-
Notifications
You must be signed in to change notification settings - Fork 22
Add Namespace Range endpoint to streamer #901
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds support for range-based namespace queries in the Espresso streamer to improve performance by fetching multiple blocks at once instead of querying block-by-block. The PR also simplifies the client configuration by migrating from multiple HotShot URLs to a single URL.
Key Changes
- Implemented
FetchNamespaceTransactionsInRangeendpoint to query transactions across a range of blocks (up to 100 blocks at a time) - Refactored from
HotShotUrls(array) toHotShotUrl(single string) throughout the codebase - Commented out hotshot listener code that is not currently in use
Reviewed changes
Copilot reviewed 13 out of 14 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| espressostreamer/espresso_streamer.go | Added range-based fetching logic with HOTSHOT_RANGE_LIMIT constant; modified fetchNextHotshotBlock to process multiple blocks |
| espressostreamer/espresso_streamer_test.go | Added FetchNamespaceTransactionsInRange mock implementation and new stream methods |
| arbnode/batch_poster.go | Changed HotShotUrls array to single HotShotUrl string; simplified client initialization |
| arbnode/espresso_caff_node.go | Changed HotShotUrls to HotShotUrl; replaced NewMultipleNodesClient with NewClient |
| system_tests/caff_node_test.go | Updated test configurations to use single HotShotUrl |
| system_tests/espresso_setup_test.go | Updated test to use single HotShotUrl |
| system_tests/espresso/chain/*.go | Added new interface methods to mock implementations |
| system_tests/hotshot_listener_test.go | Commented out entire test file |
| espresso/hotshot-listener/hotshot_listener.go | Commented out entire implementation |
| system_tests/espresso-e2e/docker-compose.yaml | Updated Espresso Docker image version |
| go.mod, go.sum | Updated espresso-network SDK dependency from v0.3.0 to v0.3.3 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
ImJeremyHe
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall it's good. Just a few comments.
| @@ -1,268 +1,268 @@ | |||
| package hotshot_listener | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did we need this? Since it becomes useless, can we just remove it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am commenting this out because we will need this code for Decentralized sequencing, dont want to delete it
| @@ -348,16 +350,43 @@ | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should also rename this function
arbnode/batch_poster.go
Outdated
| } | ||
| // If the hotshot URL is non-empty, create the Espresso client. | ||
| if hotShotUrl != "" { | ||
| hotShotClient := hotshotClient.NewClient(hotShotUrl) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't this function potentially throw an error?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no error is returned here!
| } | ||
|
|
||
| fromBlock := nextHotshotBlockNum | ||
| toBlock := latestBlockHeight |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i might need to switch onto the branch to take a closer look, but lets say latest is block 150, and next was 100. will that mean for every nitro block in the 50 hotshot block range will all be set to hot shot block 150?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no thats not how it works, it basically to fetches hotshot block is range 100 to 150. Then we can extract nitro blocks for all the hotshot blocks between hotshot block 100 and 150
|
Backport failed for Please cherry-pick the changes locally and resolve any conflicts. git fetch origin celestia-integration
git worktree add -d .worktree/backport-901-to-celestia-integration origin/celestia-integration
cd .worktree/backport-901-to-celestia-integration
git switch --create backport-901-to-celestia-integration
git cherry-pick -x 20e1206faad7056cb19d8a2626c780cafb8721bc |
|
Backport failed for Please cherry-pick the changes locally and resolve any conflicts. git fetch origin integration-v3.5.6
git worktree add -d .worktree/backport-901-to-integration-v3.5.6 origin/integration-v3.5.6
cd .worktree/backport-901-to-integration-v3.5.6
git switch --create backport-901-to-integration-v3.5.6
git cherry-pick -x 20e1206faad7056cb19d8a2626c780cafb8721bc |
|
Backport failed for Please cherry-pick the changes locally and resolve any conflicts. git fetch origin celestia-v3.5.6
git worktree add -d .worktree/backport-901-to-celestia-v3.5.6 origin/celestia-v3.5.6
cd .worktree/backport-901-to-celestia-v3.5.6
git switch --create backport-901-to-celestia-v3.5.6
git cherry-pick -x 20e1206faad7056cb19d8a2626c780cafb8721bc |
|
Backport failed for Please cherry-pick the changes locally and resolve any conflicts. git fetch origin integration-v3.8.0
git worktree add -d .worktree/backport-901-to-integration-v3.8.0 origin/integration-v3.8.0
cd .worktree/backport-901-to-integration-v3.8.0
git switch --create backport-901-to-integration-v3.8.0
git cherry-pick -x 20e1206faad7056cb19d8a2626c780cafb8721bc |
|
Backport failed for Please cherry-pick the changes locally and resolve any conflicts. git fetch origin integration-v3.9.2
git worktree add -d .worktree/backport-901-to-integration-v3.9.2 origin/integration-v3.9.2
cd .worktree/backport-901-to-integration-v3.9.2
git switch --create backport-901-to-integration-v3.9.2
git cherry-pick -x 20e1206faad7056cb19d8a2626c780cafb8721bc |
|
Backport failed for Please cherry-pick the changes locally and resolve any conflicts. git fetch origin celestia-v3.9.2
git worktree add -d .worktree/backport-901-to-celestia-v3.9.2 origin/celestia-v3.9.2
cd .worktree/backport-901-to-celestia-v3.9.2
git switch --create backport-901-to-celestia-v3.9.2
git cherry-pick -x 20e1206faad7056cb19d8a2626c780cafb8721bc |
* Add Namespace Range enpoint to streamer * fix tests * fix lint * fix comment * address bot comments * fix lint (cherry picked from commit 20e1206)
* Add Namespace Range enpoint to streamer * fix tests * fix lint * fix comment * address bot comments * fix lint (cherry picked from commit 20e1206)
* Add Namespace Range enpoint to streamer * fix tests * fix lint * fix comment * address bot comments * fix lint (cherry picked from commit 20e1206)
Description
This PR adds support for range namespace queries in streamer
Additional things