Skip to content

test(#60,#61): topic-0 keccak guards + EthFlow 429/malformed-body tests#343

Merged
mfw78 merged 2 commits into
developfrom
feat/60-61-topic0-ethflow-tests
Jul 15, 2026
Merged

test(#60,#61): topic-0 keccak guards + EthFlow 429/malformed-body tests#343
mfw78 merged 2 commits into
developfrom
feat/60-61-topic0-ethflow-tests

Conversation

@mfw78

@mfw78 mfw78 commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

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 into dev/m1 and 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 / SdkHostError API that no longer exists and would need a rewrite. Its one stronger idea — asserting the shipped module.toml event_signature via include_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 -- --check
  • cargo test -p ethflow-watcher -p twap-monitor (green, incl. the two new manifest_topic0_* assertions)

Closes #60
Closes #61
Supersedes #312, #164

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
@mfw78 mfw78 added the base: develop Open PR targets develop — merge FIRST, before the dev/m1 integration PRs. label Jul 15, 2026
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.
@mfw78 mfw78 force-pushed the feat/60-61-topic0-ethflow-tests branch from f3bdbff to 6ac72aa Compare July 15, 2026 09:51
@mfw78 mfw78 merged commit b5f6af9 into develop Jul 15, 2026
5 checks passed
@mfw78 mfw78 deleted the feat/60-61-topic0-ethflow-tests branch July 15, 2026 09:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

base: develop Open PR targets develop — merge FIRST, before the dev/m1 integration PRs.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

EthFlow verification error-path tests incomplete chain: assert subscription topic-0 equals keccak256(event sig)

2 participants