fix: MEV mitigation, invoice count safety, batch reputation, pause ch… - #614
Merged
Conversation
|
@Anthony-19 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
cargo-deny's wildcard ban (allow-wildcard-paths = true) only applies to non-publishable crates. invoice_liquidity had no publish = false, so cargo-deny treated it as a public crate and rejected the path dependency on insurance_pool. Setting publish = false is consistent with insurance_pool and fuzz, which already carry this field. Fixes: error[wildcard] in bans check
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue #MEV-1 — Mitigate MEV/front-running in resolve_fund_queue
both storage.rs and invoice.rs
if the delay has not elapsed, preventing same-block front-running
so off-chain monitors can detect MEV probing
succeed after delay, timer anchored to first join, idempotency, events)
Issue #invoice-count — Fix get_invoice_count underflow before initialization
(read_next_invoice_id defaults to 1) returns 0 instead of panicking
after first submit, N submits, batch submit count)
Issue #batch-reputation — Fix batch_submit not incrementing invoices_submitted
submit_invoices_batch loop, mirroring the single submit_invoice path
cumulative batches, two freelancers in one batch, parity with single submit,
no paid/defaulted side-effects)
Issue #pause-checks — Add missing pause guards to expire_invoice and appeal_default
expire_invoice: add is_paused check at function entry, returns ContractPaused
appeal_default: add is_paused check at function entry, returns ContractPaused
Tests: tests_pause_checks.rs (8 tests covering: pause blocks expire,
expire succeeds when unpaused, expire after unpause, pause blocks appeal,
appeal succeeds when unpaused, appeal after unpause, both blocked simultaneously)
Closes Add missing pause checks in
expire_invoiceandappeal_default#605Closes Fix
batch_submitnot incrementinginvoices_submittedfor submitters #606Closes Fix
get_invoice_countunderflow panic before contract initialization #607Closes Mitigate MEV/front-running in
resolve_fund_queue#608