Repository navigation
Conversation
This branch has not been deployed
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.
Audit items M20, M21 and M22. Open against
dev.Event watcher (M21). Each block range ran in one deferred transaction that read, then called esplora and Goat (one
debug_traceTransactionper swap event), then wrote. Under WAL, a commit by anyone else in between made the first write fail with BUSY_SNAPSHOT and the whole range ran again. Once the write went through, the lock was held through the rest of the RPC calls, so engine and inbox writes waited behind them. Anyone can create a swap escrow, so the number of traces is attacker-controlled.A range now has two parts:
BEGIN IMMEDIATEtransaction with no I/O and write in the same entity order as before.The instance a BridgeIn needs comes from the BridgeInRequest of the same range or from the stored record. If that record appears between fetch and apply, the apply bails and the range is retried.
Network loop (M20). The swarm loop wrote the inbox row and the peer timestamp synchronously, with a 120 s busy timeout. Any long write lock froze gossipsub validation, heartbeats, GetGraph and publishing. Those writes now go to a writer task through a bounded queue of 64 rows and 64 MiB. The gossipsub verdict is reported after the row is written:
When the queue is full, the swarm reports Ignore at once and counts
inbox_queue_full. Peer timestamp refreshes are skipped while the writer is behind.Engine gauges (M22). A state whose row count dropped to zero was no longer reported, so its gauge kept the last value. Now every label seen before and missing from the current count is set to 0.
Review notes
history_lengthheartbeats) is still recorded, but this node no longer forwards it. Other peers and the outbox cover it.Tests: a missing instance is built from the request of the range or from its record; a BridgeIn whose instance was not built retries the range; the inbox writer records off the network loop and hands back the verdict; a full queue refuses instead of waiting; an emptied state's gauge goes back to zero. Node, engine and client tests, workspace clippy with
-D warningsand fmt pass.The test coverage and validation notes above are from the zkm PR notes. Branch scope and diff formatting were checked locally; builds and tests were not rerun during publication.