-
Notifications
You must be signed in to change notification settings - Fork 234
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
fix(sync): Sync latest globals within merkle tree ops #1612
Conversation
@@ -348,7 +346,7 @@ export class AztecNodeService implements AztecNode { | |||
await getTreeRoot(MerkleTreeId.BLOCKS_TREE), | |||
Fr.ZERO, | |||
await getTreeRoot(MerkleTreeId.PUBLIC_DATA_TREE), | |||
globalsHash, | |||
await this.merkleTreeDB.getLatestGlobalVariablesHash(), |
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.
hmm is there any chance this would advance such that the global variable hash is too new? Like if the system moves on after await getTreeRoot(MerkleTreeId.PUBLIC_DATA_TREE),
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 don't fully understand the code, but if we're fetching data it would be good to fetch it all at once representing one snapshot, 'latest' makes me nervous when used with other async calls
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.
These changes have unfortunately broken the p2p tests, this could be the culprit
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.
LGTM if we can get a few runs of this without issue, however some comment from you on if the latest globals match the rest of the tree data we're getting would be good
Revoking acceptance given the 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.
LGTM! Well done!
Only nit is a future comment would be nice |
Where should I place the comment and what should I highlight, ill incorporate it into a coming pr |
Would be nice to comment the promise all |
* dynamic reference to redis cluster subnet group (#1594) Co-authored-by: PhilWindle <philip.windle@gmail.com> * Created generic swapping agent for both uniswap and lido-curve bridges (#1265) * JB/Website changes (#1554) * Bruno changes * Grants changes * Update grants page, edit team page * Fix typos, change header, footer links; noir links * Fix sliders * Copy changes * Adds two RFPs * Add Michael to Careers, typos * Fix titles of roles * JB/Website changes (#1612) * Bruno changes * Grants changes * Update grants page, edit team page * Fix typos, change header, footer links; noir links * Fix sliders * Copy changes * Adds two RFPs * Add Michael to Careers, typos * Fix titles of roles * Fix lint, replace images * Pass the uint context to the return value of uint::at (#1593) * Construct return value from current context in uint::at Fixes AztecProtocol/aztec2-internal#1433 * Add uint test which asserts context inheritance * Move to yarn 3 plug 'n play and workspaces, pure ESM modules. (#1599) * Transferrables and webpack to build a worker.js until we have loader chaining... * Prod/dev conf * Update bb imports. * bb tests passing. * Integrate wasm back in bb.js. Passing tests. Reduce wasm memory footprint. * Can run halloumi and falafel. * Falafel tests pass. * Sdk tests pass. * e2e.test passes. * webpack * bb.js yarn 3.2.2 * fix mem align * fix bitwise warning on newer clang * Tweaks towards wasi 16 (more to figure out) * yarn 3.2.2 * remove encoding headers from block source client * bb.js updates * Blockchain test transpile to cjs for hardhat. * Fix blockchain. * SDK alternates proving keys. * Falafel/halloumi start_e2e scripts args. * Shared linting, formatting for bb.js and blockchain. * explorer import changes. build needs fixing. * end-to-end, falafel, halloumi linting * Hummus just a terminal. Linting. Version upgrades. * Linting. Bootstrapping. Wallet. * prettier config. * Basic working wallet. * Fix apollo server stuff in falafel... * account-migrator. explorer. * Cleanup JSON stuff. * wasabi. * Revert jest->mocha * Merge fixes. * Initial zk-money. * - Reconnect bootstrap scripts - set prettier as js default * - es-module style imports - upgrade typescript - copy wasm * zk-money builds. * Linting * Dockerfile and build stuff. * Move yarn project into own folder. * explorer build. min cci yml. * Introduce a build manifest to compute rebuild patterns. * Addition of a script for auto launching tmux and running a test. * Streamline bootstrapping. * Add bash to falafel image. * build image * Attempt to fix deploy. * Attempt to fix deploy. * Attempt to fix deploy. * Attempt to fix deploy. * Attempt to fix deploy. * Attempt to fix deploy. * Attempt to fix deploy. * Attempt to fix deploy. * Attempt to fix deploy. * Attempt to fix deploy. * Attempt to fix deploy. * Attempt to fix deploy. * Attempt to fix deploy. * Attempt to fix deploy. * Attempt to fix deploy. * When scanning for rollups, we only cache the last block number where … (#1611) * When scanning for rollups, we only cache the last block number where we actually found a rollup * Fixed bug * fix typo in zk-money app obs intial -> initial (#1633) * Adress comments about docs (#1500) * Adress comments about docs * Update schnorr.md Co-authored-by: Michael Connor <mike@aztecprotocol.com> * Move genesis data from bb.js to falafel (#1640) * moved init/genesis data from bb.js to falafel along with helper functions for reading the init data. * data files no longer need to be moved as part of bb.js webpack * obsolete comment in bb.js env * Moved some init helper functions back to bb.js. Renamed helper class in falafel. Fixed missing 'any' type in falafel env init.ts * copy init account data to dest in falafel Co-authored-by: spypsy <spypsy@users.noreply.github.com> Co-authored-by: Jonathan Bursztyn <jobur93@gmail.com> Co-authored-by: Guido Vranken <guidovranken@users.noreply.github.com> Co-authored-by: Charlie Lye <charlie@aztecprotocol.com> Co-authored-by: Charlie Lye <karl.lye@gmail.com> Co-authored-by: David Banks <47112877+dbanks12@users.noreply.github.com> Co-authored-by: Adrian Hamelink <adrian.hamelink@gmail.com> Co-authored-by: Michael Connor <mike@aztecprotocol.com>
Overview
Ci has been failing due to a race condition where world state operations were not being synchronised.
The offending value was that the world latestGlobalVariablesHash was not stored with the rest of the merkle trees, and such could not use the same serial queue to sync their update operations. This lead to the trees being out of sync with the globals value on some occasions. (I think)
This pr may be slightly contraversial as it stores non merkle tree data within the merkle_trees abstraction. However think the naming of the merkle_trees abstraction is the limiting factor. The file just stores and synchronises the world state, it just so happens that until now this state was all trees. (although this could be me bending reality to suit my current needs)
Adds a Committable type which allows us to add rollback functionality to anything