Skip to content
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

Feature/exittree #27

Merged
merged 45 commits into from
Aug 13, 2024
Merged

Feature/exittree #27

merged 45 commits into from
Aug 13, 2024

Conversation

arnaubennassar
Copy link
Contributor

@arnaubennassar arnaubennassar commented Jul 30, 2024

  • promoted localbridgesync to bridgesync since now it will sync both L1 & L2 bridges
  • Separated the tree from the bridge processor, as now this tree will be reused by many syncers. Although the file appears to be new on the Files changed the logic is pretty much the same, just separated the tree
  • Made the DB keys big endian as little endian had problems when sorting
  • On the L1 Info tree sync:
    • Added verify batch events to the l1 info tree downloader, as those are needed to build the rollup exit tree
    • Modified the E2E test to use verify batches event (had to create a custom contract for that). Also added a stress test. The stress test has the capability of simulating reorgs, but this is disabled as the test is failing wen enabled, and this was outside the scope of the PR
    • The l1 info tree processor has replaced the l1infotree implementation for the new generic tree implementation
    • It also has added an instance of rollup exit tree
    • And simplified a lot the schema by removing the index and root tables
  • On the evm downloader:
    • check that hash matches when querying block header from a log
    • filter logs, but not in the query since it can be problematic on some rpc providers
  • added ctx on the Reorg and ProcessBlock functions for the processors
  • Build a generic tree processor. This tree has two operational modes: append only and updatable. Note that both modes are tested through the l1infotreesync/e2e_test.go. Note that the AppendOnlyTree was used previously in the localbridgesync

@arnaubennassar arnaubennassar self-assigned this Jul 30, 2024
@arnaubennassar arnaubennassar marked this pull request as draft August 1, 2024 12:27
@arnaubennassar arnaubennassar marked this pull request as ready for review August 2, 2024 10:25
@arnaubennassar arnaubennassar requested review from goran-ethernal and removed request for vcastellm August 5, 2024 16:53
Copy link
Collaborator

@goran-ethernal goran-ethernal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leaving some comments. Haven't finished reviewing appendable and updateable tree.

bridgesync/bridgesync.go Outdated Show resolved Hide resolved
bridgesync/processor.go Outdated Show resolved Hide resolved
bridgesync/processor.go Outdated Show resolved Hide resolved
bridgesync/processor.go Outdated Show resolved Hide resolved
bridgesync/processor.go Outdated Show resolved Hide resolved
bridgesync/processor.go Outdated Show resolved Hide resolved
bridgesync/processor.go Outdated Show resolved Hide resolved
l1infotreesync/downloader.go Outdated Show resolved Hide resolved
sync/evmdownloader.go Outdated Show resolved Hide resolved
sync/evmdownloader.go Outdated Show resolved Hide resolved
tree/testvectors/types.go Outdated Show resolved Hide resolved
bridgesync/bridgesync.go Outdated Show resolved Hide resolved
bridgesync/bridgesync.go Outdated Show resolved Hide resolved
l1infotreesync/downloader.go Outdated Show resolved Hide resolved
tree/testvectors/types.go Outdated Show resolved Hide resolved
tree/tree_test.go Outdated Show resolved Hide resolved
tree/tree.go Outdated Show resolved Hide resolved
sync/evmdownloader.go Outdated Show resolved Hide resolved
sync/evmdownloader.go Outdated Show resolved Hide resolved
l1infotreesync/processor.go Outdated Show resolved Hide resolved
Copy link
Collaborator

@goran-ethernal goran-ethernal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but we have a UT failing. Might be good to check what is going on.

Copy link

sonarcloud bot commented Aug 13, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 80%)
14.0% Duplication on New Code (required ≤ 3%)

See analysis details on SonarCloud

@arnaubennassar arnaubennassar merged commit 0f98a37 into develop Aug 13, 2024
4 of 7 checks passed
@arnaubennassar arnaubennassar deleted the feature/exittree branch August 13, 2024 09:05
Stefan-Ethernal added a commit that referenced this pull request Sep 17, 2024
* implementation completed, missing tests

* WIP

* WIP

* WIP

* sync refactor

* decouple sync processors from EVM

* Add CLI for aggOracle

* WIP

* wip

* WIP

* start reorg detector

* fix docker

* pass test with docker

* add TODO

* go mod tidy

* Implement base addLeaf

* pass test vectors

* fix UT

* Add PR review suggestions from Stefan-Ethernal

* fix UTs

* Add PR review suggestions from Stefan-Ethernal

* fix datacommittee_test deploying proxy contract

* fix UTs

* WIP

* WIP

* abstract tree

* Fix UTs

* Add PR review suggestions from joanestebanr

* Fix evmdownloader problems

* refactor tree add and rollback to be atomic

* simplify l1infotree

* implementation done, test WIP

* pass E2E test

* remove outdated coment

* make test shorter

* Add coments

* Apply requests from Stefan-Ethernal and goran-ethernal

* increase sleep to pass UT

* reduce test iterations

---------

Co-authored-by: Stefan Negovanović <[email protected]>
Co-authored-by: joanestebanr <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants