-
Notifications
You must be signed in to change notification settings - Fork 174
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
refactor(katana): replace cursor-based api with by block basis for simplicity #1986
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 tasks
kariy
changed the title
replace cursor with by block basis
refactor(katana): replace cursor-based api with
May 20, 2024
kariy
changed the title
refactor(katana): replace cursor-based api with
refactor(katana): replace cursor-based api with by block basis for simplicity
May 20, 2024
This was referenced May 20, 2024
kariy
commented
May 20, 2024
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1986 +/- ##
==========================================
+ Coverage 69.73% 69.84% +0.10%
==========================================
Files 314 314
Lines 35654 35726 +72
==========================================
+ Hits 24864 24953 +89
+ Misses 10790 10773 -17 ☔ View full report in Codecov by Sentry. |
glihm
reviewed
May 21, 2024
kariy
added a commit
that referenced
this pull request
May 23, 2024
# Description basically refactor the tx traces fetching logic to using the new API introduced in #1986. ref: #1986 (comment) to simplify the process of extracting the l1 -> l2 messages bcs currently we have to compute the message hash in order to find the corresponding tx as seen here: https://github.com/dojoengine/dojo/blob/855da3112c87faea87646db5a406ac77b4daf149/crates/saya/core/src/prover/program_input.rs#L54-L74 these changes (including #1986) make the process more straightforward as we can just filter based on the tx hash which is more straightforward. ## Related issue <!-- Please link related issues: Fixes #<issue_number> More info: https://docs.github.com/en/free-pro-team@latest/github/managing-your-work-on-github/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword --> ## Tests <!-- Please refer to the CONTRIBUTING.md file to know more about the testing process. Ensure you've tested at least the package you're modifying if running all the tests consumes too much memory on your system. --> - [ ] Yes - [x] No, because they aren't needed - [ ] No, because I need help ## Added to documentation? <!-- If the changes are small, code comments are enough, otherwise, the documentation is needed. It may be a README.md file added to your module/package, a DojoBook PR or both. --> - [ ] README.md - [ ] [Dojo Book](https://github.com/dojoengine/book) - [x] No documentation needed ## Checklist - [x] I've formatted my code (`scripts/prettier.sh`, `scripts/rust_fmt.sh`, `scripts/cairo_fmt.sh`) - [x] I've linted my code (`scripts/clippy.sh`, `scripts/docs.sh`) - [x] I've commented my code - [ ] I've requested a review after addressing the comments
10 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
currently, the
saya_getTransactionsExecutions
API is based on a cursor to determine how the traces are being fetched.dojo/crates/saya/provider/src/rpc/mod.rs
Lines 160 to 175 in 855da31
one issue it currently has it that the api params does not put any constraint on whether the returned traces are guarantee to only be from a specific block. however, the implementation seems to indicate otherwise.
anyway, this pr basically want to remove the complexity of the pagination logic (which we dont even need!) and to replace it with a basic
get Xs from block Y
api instead.so we can simplify the endpoint itself to just return the traces per block instead of based on a cursor. the cursor is only adding more complexity to the api itself.
Related issue
Tests
Added to documentation?
Checklist
scripts/prettier.sh
,scripts/rust_fmt.sh
,scripts/cairo_fmt.sh
)scripts/clippy.sh
,scripts/docs.sh
)