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.
Bug 1
Closes #2723
The relayer panic is caused by an overflow, bc of dividing by ~
6.540888459481895e-211
. On my local, the effective rate of indexing starts at0.61
.But then both the
blocks_processed
and thetip_progression
are consistently zero, which makes thenew_rate
be zero (hyperlane-monorepo/rust/hyperlane-base/src/contract_sync/eta_calculator.rs
Line 41 in eea423a
0.00038
.The reason for blocks_processed and tip_progression consistently being zero after the first log is that
eta_calculator.calculate(from, tip)
is always called with the same from and tip although it expects to get the latest values.The fix
the tip wasn't being set after the sequence_and_tip query here:
hyperlane-monorepo/rust/hyperlane-base/src/contract_sync/cursor.rs
Line 565 in eea423a
And then the to and from are calculated based on it:
hyperlane-monorepo/rust/hyperlane-base/src/contract_sync/cursor.rs
Line 550 in eea423a
So even though the sync_state internal variables were kept up-to-date, the min(...) would cause the issue.
The first PR commit fixes this.
Bug 2
There was another bug in the eta calculator, caused by it only using
next_block
to approximate synced state, which doesn't apply to sequence indexing. The way the eta calculator is called had to be changed to use abstract measures of sync progression (which could be blocks or sequences).The second PR commit fixes this, afaict.