Skip to content

chore(relayer): remove intermediary hop logic#21448

Merged
MatusKysel merged 1 commit intomainfrom
chore/relayer-remove-hop-logic
Mar 9, 2026
Merged

chore(relayer): remove intermediary hop logic#21448
MatusKysel merged 1 commit intomainfrom
chore/relayer-remove-hop-logic

Conversation

@MatusKysel
Copy link
Contributor

No description provided.

@claude
Copy link

claude bot commented Mar 9, 2026

Claude finished @MatusKysel's task in 1m 54s —— View job


PR Review: chore(relayer): remove intermediary hop logic

  • Gather context and read changed files
  • Review code changes
  • Post findings

Summary: Clean simplification removing the multi-hop intermediary chain logic (L2A → L1 → L2B style routing). The removal is complete and consistent across all layers — CLI flags, config, processor, and proof generation.

Issues Found

1. cacheOption is silently ignored (pre-existing, but more visible now)

packages/relayer/pkg/proof/encoded_signal_proof.go:57

encodedSignalProof, err := encoding.EncodeHopProofs([]encoding.HopProof{{
    ...
    CacheOption:  encoding.CACHE_NOTHING,  // always 0, ignores p.cacheOption
    ...
}})

Prover stores cacheOption int (set from cfg.CacheOption, defaulting to 3 = CACHE_BOTH per the CLI flag), but it's never applied. This was a pre-existing bug in the old hop code too, but now the code is simpler and easier to fix — just use uint8(p.cacheOption) here.

Fix this →


Minor Observations

2. Trivial wrapper in EncodedSignalProof

packages/relayer/pkg/proof/encoded_signal_proof.go:24-29

func (p *Prover) EncodedSignalProof(ctx context.Context, params SignalProofParams) ([]byte, error) {
    return p.abiEncodeSignalProof(ctx, params)
}

The public function is a single-line passthrough to a private function. With the hop abstraction gone, there's no reason to keep both — just make abiEncodeSignalProof the public function or inline the private one. Minor, not blocking.

3. Stale naming in encoding layer

encoding.EncodeHopProofs and encoding.HopProof types still use "hop" terminology despite this PR removing all hop semantics. Arguably a follow-up cleanup, but it's confusing — we're now passing a single-element slice to a "hops" encoder. Not introduced by this PR, but worth a note.


What's Good

  • The latestBlockID == 0 fallback correctly uses event.Raw.BlockNumber directly now (previously used blockNum which could have been mutated through hop chain traversal).
  • Removing 293 lines is always nice. The simplified generateEncodedSignalProof is much easier to follow.
  • Config validation for matching hop array lengths is gone since there's nothing to validate.
  • Tests updated appropriately to use the new SignalProofParams API.

The cacheOption issue is worth fixing before merging since the CLI flag default of CACHE_BOTH (3) implies caching behavior that currently does nothing. The rest is cosmetic.

@codecov
Copy link

codecov bot commented Mar 9, 2026

Codecov Report

❌ Patch coverage is 55.00000% with 18 lines in your changes missing coverage. Please review.
✅ Project coverage is 26.15%. Comparing base (94730f4) to head (2cf73de).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
packages/relayer/processor/process_message.go 23.52% 10 Missing and 3 partials ⚠️
packages/relayer/pkg/proof/encoded_signal_proof.go 78.26% 3 Missing and 2 partials ⚠️
Additional details and impacted files
Files with missing lines Coverage Δ
packages/relayer/processor/config.go 61.17% <ø> (+2.17%) ⬆️
packages/relayer/processor/processor.go 0.00% <ø> (ø)
packages/relayer/pkg/proof/encoded_signal_proof.go 75.60% <78.26%> (-3.99%) ⬇️
packages/relayer/processor/process_message.go 36.84% <23.52%> (+3.85%) ⬆️

... and 1 file with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 94730f4...2cf73de. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@MatusKysel MatusKysel enabled auto-merge March 9, 2026 10:54
@MatusKysel MatusKysel force-pushed the chore/relayer-remove-hop-logic branch from ac01e7d to 2cf73de Compare March 9, 2026 10:58
@MatusKysel MatusKysel added this pull request to the merge queue Mar 9, 2026
Merged via the queue into main with commit 981eba3 Mar 9, 2026
6 checks passed
@MatusKysel MatusKysel deleted the chore/relayer-remove-hop-logic branch March 9, 2026 15:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants