test(#60,#61): topic-0 keccak guards + EthFlow 429/malformed-body tests#343
Merged
Conversation
Fixes #60: both twap-monitor and ethflow-watcher now assert at test time that the hardcoded topic-0 in module.toml equals keccak256 of the canonical event ABI string via alloy_sol_types::SolEvent::SIGNATURE_HASH. Fixes #61: adds two missing coverage paths in ethflow-watcher — - 429 rate-limit: verify Warn is emitted and no observed: marker is written (distinguishes from the 404 indexer-lag path) - malformed JSON body with HTTP 200: verify the strategy writes the observed: marker because it treats Ok(_) as confirmation without parsing the response body
Reads the shipped module.toml via include_str! and asserts its pinned event_signature equals the OrderPlacement / ConditionalOrderCreated SIGNATURE_HASH constant - a manifest/code drift the existing ABI-hash guard cannot catch. Ported from #164 before closing it as superseded.
3 tasks
f3bdbff to
6ac72aa
Compare
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.
What
Topic-0 keccak guard assertions + EthFlow 429 / malformed-body error-path tests for #60 / #61 — @lgahdl's original test commit (recovered from the accidentally-closed #312) rebased onto
develop, plus a stronger manifest-content topic-0 assertion ported from #164.Why
#312 was accidentally closed when its base branch
feat/m1-mock-venue(#241) was squash-merged intodev/m1and auto-deleted during the M1 train integration; GitHub pins a reopened PR to its pre-close commit, so this is a fresh PR carrying the same change (authorship preserved).This also supersedes #164 (same #60/#61 coverage). #164 was pinned to the pre-refactor
on_logs/SdkHostErrorAPI that no longer exists and would need a rewrite. Its one stronger idea — asserting the shippedmodule.tomlevent_signatureviainclude_str!(catching a manifest/code drift the ABI-hash constant check cannot) — has been ported here for both modules.Testing
cargo fmt -p ethflow-watcher -p twap-monitor -- --checkcargo test -p ethflow-watcher -p twap-monitor(green, incl. the two newmanifest_topic0_*assertions)Closes #60
Closes #61
Supersedes #312, #164