Skip to content

Conversation

@m30m
Copy link
Contributor

@m30m m30m commented Apr 23, 2025

Summary

Improve revelations api for arbitrum based chains

Rationale

Current revelations api doesn't work well where block.number on-chain is different from what rpc returns. In arbitrum based chains, one points to the L1 block and the other to the L2 block.

How has this been tested?

  • Current tests cover my changes
  • Added new tests
  • Manually tested the code

@m30m m30m requested a review from a team as a code owner April 23, 2025 22:09
@vercel
Copy link

vercel bot commented Apr 23, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
entropy-debugger ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 25, 2025 5:09pm
insights ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 25, 2025 5:09pm
4 Skipped Deployments
Name Status Preview Comments Updated (UTC)
api-reference ⬜️ Ignored (Inspect) Visit Preview Apr 25, 2025 5:09pm
component-library ⬜️ Ignored (Inspect) Visit Preview Apr 25, 2025 5:09pm
proposals ⬜️ Ignored (Inspect) Visit Preview Apr 25, 2025 5:09pm
staking ⬜️ Ignored (Inspect) Visit Preview Apr 25, 2025 5:09pm

Copy link
Contributor

@jayantk jayantk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this introduces a fairly awkward API -- see inline comment for a suggestion on a better way

#[utoipa::path(
get,
path = "/v1/chains/{chain_id}/revelations/{sequence}",
path = "/v1/chains/{chain_id}/revelations/{block_number}/{sequence}",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a very awkward API for someone to call -- how would they know to get the block number also?

I think a better solution is to implement the cache of events for the explorer, and then use that to do the lookup from sequence number to block number.

@m30m m30m changed the title Use the block number of event instead of request data for revelation api fix(entropy): Use the block number of event instead of request data for revelation api Apr 25, 2025
@m30m m30m merged commit 449b4c2 into main Apr 25, 2025
11 checks passed
@m30m m30m deleted the block-based-revelation branch April 25, 2025 17:13
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