-
Notifications
You must be signed in to change notification settings - Fork 170
Move RewardMerkleTreeV2 storage to memory #3908
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
Draft
ss-es
wants to merge
37
commits into
main
Choose a base branch
from
ss/in-memory-merkle-tree
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 19 commits
Commits
Show all changes
37 commits
Select commit
Hold shift + click to select a range
25fd3f5
store reward merkle tree v2 in memory instead of postgres
ss-es 8ac7918
Adjust genesis file
lukaszrzasik 7c93373
Use V4
lukaszrzasik bcee80c
update genesis
ss-es 871171d
Revert "update genesis"
lukaszrzasik e1748b7
add persistence and garbage collection
ss-es 84b86b7
move light client query to separate thread
ss-es f46fb20
move contract fetching into NodeState methods, switch to balances for
ss-es d524642
add migrations
ss-es a9aa145
oops
ss-es 6f60af5
add new endpoint for latest proof
ss-es 4d4ad2a
fix build
ss-es 869620f
fix build
ss-es 9e1eb3e
fix
ss-es dba8771
remove unnecessary tokio::spawn
ss-es 4b3239b
fix reward api
ss-es c6ca037
add comments
ss-es 1da547c
do not exit state update loop on failure to persist merkle proofs for
ss-es 1119736
move save out of tx again
ss-es 2e8b943
fix request/response implementation
ss-es 5c7025e
fix catchup
ss-es 7df65ad
avoid hashset allocation for missing accounts
ss-es 9ccaf59
ensure required accounts are present in tree before returning in catchup
ss-es 8636a76
remove merkle tree variant; only catchup from key/value pairs
ss-es a83017b
[breaking] change enum to struct
ss-es 7b5bce4
implement migrate_reward_merkle_tree_v2
imabdulbasit f3af1e6
clippy
imabdulbasit 10c7a90
reorder state storage loop
ss-es 6092615
load previous reward merkle tree at the start of the state storage
ss-es 182d884
check commitment against header
imabdulbasit 370c855
run `migrate_reward_merkle_tree_v2` on startup
ss-es cc41363
fix initial read from table
ss-es 6d4f304
check height before loading previous tree in state storage loop
ss-es e54ad6b
update names
ss-es 6447598
Merge branch 'main' into ss/in-memory-merkle-tree
ss-es f6c219b
Require global permit to reconstruct merkle tree (#3942)
ss-es 417a2be
Reapply "update names"
ss-es File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or 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
This file contains hidden or 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
15 changes: 15 additions & 0 deletions
15
sequencer/api/migrations/postgres/V1103__reward_merkle_tree_v2_bincode.sql
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| CREATE TABLE reward_merkle_tree_v2_bincode ( | ||
| height BIGINT PRIMARY KEY, | ||
| serialized_bytes BYTEA | ||
| ); | ||
|
|
||
| CREATE TABLE reward_merkle_tree_v2_proofs ( | ||
| height BIGINT, | ||
| account BYTEA NOT NULL, | ||
| proof BYTEA | ||
| ); | ||
|
|
||
| ALTER TABLE | ||
| reward_merkle_tree_v2_proofs | ||
| ADD | ||
| CONSTRAINT reward_merkle_tree_v2_proofs_pk PRIMARY KEY (height, account); |
11 changes: 11 additions & 0 deletions
11
sequencer/api/migrations/sqlite/V903__reward_merkle_tree_v2_bincode.sql
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| CREATE TABLE reward_merkle_tree_v2_bincode ( | ||
| height BIGINT PRIMARY KEY, | ||
| serialized_bytes BLOB | ||
| ); | ||
|
|
||
| CREATE TABLE reward_merkle_tree_v2_proofs ( | ||
| height BIGINT, | ||
| account BLOB NOT NULL, | ||
| proof BLOB, | ||
| PRIMARY KEY (height, account) | ||
| ); |
This file contains hidden or 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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.