0.38.0 • Published 6 days ago

@aztec/sequencer-client v0.38.0

Weekly downloads
-
License
-
Repository
-
Last release
6 days ago

Sequencer Client

The sequencer is a module responsible for creating and publishing new rollup blocks. This involves fetching txs from the P2P pool, ordering them, executing any public functions, running them through the rollup circuits, assembling the L2 block, and posting it to the L1 rollup contract along with any contract deployment public data.

The client itself is implemented as a continuous loop. After being started, it polls the P2P pool for new txs, assembles a new block if any is found, and goes back to sleep. On every new block assembled, it modifies the world state database to reflect the txs processed, but these changes are only committed once the world state synchronizer sees the new block on L1.

Components

What components are used to build a sequencer client.

  • The block builder is responsible for assembling an L2 block out of a set of processed transactions (we say a tx has been processed if all its function calls have been executed). This involves running the txs through the base, merge, and rollup circuits, updating the world state trees, and building the L2 block object.

  • The prover generates proofs for every circuit used. For the time being, no proofs are being actually generated, so the only implementation is an empty one.

  • The publisher deals with sending L1 transactions to the rollup and contract deployment emitter contracts. It is responsible for assembling the Ethereum tx, choosing reasonable gas settings, and monitoring the tx until it gets mined. Note that the current implementation does not handle unstable network conditions (gas price spikes, reorgs, etc).

  • The public processor executes any public function calls in the transactions. Unlike private function calls, which are resolved in the client, public functions require access to the latest data trees, so they are executed by the sequencer, much like in any non-private L2.

  • The simulator is an interface to the wasm implementations of the circuits used by the sequencer.

  • The sequencer pulls txs from the P2P pool, orchestrates all the components above to assemble and publish a block, and updates the world state database.

Circuits

What circuits does the sequencer depend on.

  • The public circuit is responsible for proving the execution of Brillig (public function bytecode). At the moment, we are using a fake version that actually runs ACIR (intermediate representation for private functions) and does not emit any proofs.

  • The public kernel circuit then validates the output of the public circuit, and outputs a set of changes to the world state in the same format as the private kernel circuit, meaning we get a standard representation for all txs, regardless of whether public or private functions (or both) were run. The kernel circuits are run iteratively for every recursive call in the transaction.

  • The base rollup circuit aggregates the changes from two txs (more precisely, the outputs from their kernel circuits once all call stacks are emptied) into a single output.

  • The merge rollup circuit aggregates two outputs from base rollup circuits into a single one. This circuit is executed recursively until only two outputs are left. This setup means that an L2 block needs to contain always a power-of-two number of txs; if there are not enough, then empty txs are added.

  • The root rollup circuit consumes two outputs from base or merge rollups and outputs the data to assemble an L2 block. The L1 rollup contract then verifies the proof from this circuit, which implies that all txs included in it were correct.

Development

Start by running bootstrap.sh in the project root.

To build the package, run yarn build in the root.

To watch for changes, yarn build:dev.

To run the tests, execute yarn test.

0.38.0

6 days ago

0.37.0

11 days ago

0.36.0

13 days ago

0.35.1

27 days ago

0.35.0

27 days ago

0.33.0

1 month ago

0.34.0

1 month ago

0.32.1

1 month ago

0.32.0

2 months ago

0.31.0

2 months ago

0.30.1

2 months ago

0.30.0

2 months ago

0.29.0

2 months ago

0.28.1

2 months ago

0.28.0

2 months ago

0.27.2

2 months ago

0.27.1

2 months ago

0.27.0

2 months ago

0.26.6

2 months ago

0.26.5

2 months ago

0.26.3

2 months ago

0.26.2

2 months ago

0.26.1

2 months ago

0.24.0

3 months ago

0.23.0

3 months ago

0.22.0

3 months ago

0.21.0

3 months ago

0.20.0

4 months ago

0.19.0

4 months ago

0.18.0

4 months ago

0.17.0

4 months ago

0.16.8

5 months ago

0.16.9

5 months ago

0.16.5

5 months ago

0.16.6

5 months ago

0.16.7

5 months ago

0.16.3

5 months ago

0.16.4

5 months ago

0.16.2

5 months ago

0.16.0

6 months ago

0.16.1

6 months ago

0.15.0

6 months ago

0.15.1

6 months ago

0.14.0

6 months ago

0.14.1

6 months ago

0.14.2

6 months ago

0.11.0

7 months ago

0.11.1

7 months ago

0.13.0

7 months ago

0.13.1

6 months ago

0.12.0

7 months ago

0.10.1

7 months ago

0.10.0

7 months ago

0.9.0

7 months ago

0.8.14

7 months ago

0.8.13

7 months ago

0.8.12

7 months ago

0.8.11

7 months ago

0.8.10

7 months ago

0.8.9

7 months ago

0.8.8

7 months ago

0.8.7

7 months ago

0.8.6

7 months ago

0.7.10

8 months ago

0.7.9

8 months ago

0.7.8

8 months ago

0.7.7

8 months ago

0.7.5

8 months ago

0.7.4

8 months ago

0.7.3

8 months ago

0.7.2

8 months ago

0.7.0

8 months ago

0.6.7

8 months ago

0.6.6

8 months ago

0.6.5

8 months ago

0.6.4

8 months ago

0.6.2

8 months ago

0.1.0-alpha63

8 months ago

0.1.0-alpha62

8 months ago

0.1.0-alpha61

8 months ago

0.1.0-alpha60

8 months ago

0.1.0-alpha59

8 months ago

0.1.0-alpha57

8 months ago

0.1.0-alpha49

9 months ago

0.1.0-alpha48

9 months ago

0.1.0-alpha47

9 months ago

0.1.0-alpha46

9 months ago

0.1.0-alpha45

9 months ago

0.1.0-alpha44

9 months ago

0.1.0-alpha43

9 months ago

0.1.0-alpha42

9 months ago

0.1.0-alpha41

9 months ago

0.1.0-alpha40

9 months ago

0.1.0-alpha39

9 months ago

0.1.0-alpha23

10 months ago

0.1.0-alpha22

10 months ago

0.1.0-alpha21

10 months ago

0.1.0-alpha20

10 months ago

0.1.0-alpha17

10 months ago

0.1.0-alpha16

10 months ago

0.1.0-alpha15

10 months ago

0.1.0-alpha14

10 months ago

0.1.0-alpha13

10 months ago

0.1.0-alpha12

10 months ago

0.1.0-alpha11

10 months ago