-
Notifications
You must be signed in to change notification settings - Fork 856
Integrate watermark into evmrpc #2465
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
|
The latest Buf updates on your PR. Results from workflow Buf / buf (pull_request).
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #2465 +/- ##
==========================================
- Coverage 43.62% 43.57% -0.05%
==========================================
Files 1679 1695 +16
Lines 143747 145352 +1605
==========================================
+ Hits 62708 63338 +630
- Misses 75414 76311 +897
- Partials 5625 5703 +78
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
b05e87a to
2da9bbe
Compare
|
We should be able to remove sync flush receipt in this PR since we have watermark |
| if err := k.FlushTransientReceipts(ctx); err != nil { | ||
| return err | ||
| } | ||
| deadline := time.Now().Add(2 * time.Second) |
Check warning
Code scanning / CodeQL
Calling the system time Warning
| } else if err != nil && err.Error() != "not found" { | ||
| return err | ||
| } | ||
| if time.Now().After(deadline) { |
Check warning
Code scanning / CodeQL
Calling the system time Warning
codchen
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.
question: for the earliest state, is it possible for it to become stale after the request to pass the check but before the state is read? (i.e. state pruned after the check but before the actual read)
|
@codchen I think the situation you mentioned is possible. However, I think we mostly care about latest height for the watermark guarantees. |
Describe your changes and provide context
A common workflow that users do is to query the latest height and then query information about that height such as events/logs. However, since we have an option to do async writes for receipts, the events/logs may not be available yet for that height, causing the query to fail.
In general, we want all of our heights outputted by our RPC endpoints to be aligned with each other. We have introduced the concept of a watermark (sei-protocol/sei-db#116) across Tendermint block store, SS Store, and receipt store. Pulling this watermark across all 3 dbs should allow the evmrpc to output the minimum height available across these dbs for a latest height. This will ensure that all data for a given height outputted by our RPCs is available across all our endpoints.
This PR introduces a WatermarkManager that manages the heights of these DBs, which the evmrpc endpoints can use to get the latest heights that are ready.
Testing performed to validate your change
unit tests + manual testing