juno icon indicating copy to clipboard operation
juno copied to clipboard

Separate L1 and L2 during sync

Open joshklop opened this issue 2 years ago • 0 comments

Fixes #309

Description

Right now there is tight coupling in the sync process (mostly centered around the enormous Synchronizer struct).

This PR "modularizes" the sync process by making the changes described below.

Changes:

  • Cleanly separate the L1 and L2 sync into two different "sync services." These are named L1SyncService and L2SyncService, respectively.
  • Take advantage of geth's amazing bindgen tool to generate golang bindings to the Starknet contracts. This gives us type safety and fantastic support for iterating over logs.
  • Related to the last point: we can now seamlessly create unit and integration tests for the sync process using a SimulatedBackend.
  • Remove the option to sync the state from the feeder gateway. This feature increases our API surface and is outside the scope of a StarkNet full node.

Types of changes

  • Breaking change: we remove the option to sync state from the feeder gateway.
  • Documentation Update: TODO
  • Refactoring
  • Build related changes: slight edit to the Makefile to generate the starknet contract ABI bindings

Testing

Requires testing Yes

Did you write tests? TODO

Documentation

If this requires a documentation update, did you add one? TODO

joshklop avatar Aug 11 '22 00:08 joshklop