-
Notifications
You must be signed in to change notification settings - Fork 592
Update GlobalVariables #3824
Description
Blocked by #3937.
This have some overlaps with the updating of the header, so it might be useful to do them in series instead of in parallel.
The global variables should be extended with coinbase and fee_recipient such that the proof commits to these values.
coinbaseis theEthAddressthat is to receive block rewards on underlying.fee_recipientis theAztecAddressthat is to receive transaction fees inside the system
The
fee_recipientis just a proposed name, if you have a better name for it, fee free
The global variables touches many parts of the code-base, and need additional test in multiple areas. Note, as these extra variables are dependent on knowledge for the current values, they will only be up to date in public execution, but can be accessed historically in private execution.
The below list is likely not pointing out every place where updates are needed, but I tried to extend it as much as possible without just building the thing. Unordered.
### Tasks
- [x] Update the yellow-paper to include both L1 and L2 component
- [x] Add `coinbase` and `fee_recipient` to `GlobalVariables` in `global_variables.ts`
- [x] Add `coinbase` and `fee_recipient` to `toACVMGlobalVariables` in `serialize.ts` in the acvm
- [x] Update the `global_builder.ts` to take `coinbase` and `fee_recipient` as arguments
- [x] Extend the `SequencerConfig` to include the `coinbase` and `fee_recipient` that the sequencer intends to use. Update `sequencer.ts`. Beware that for the very first sequencer, there will not be anything deployed yet, so it would need to preemptively specify the `fee_recipient` before it is deployed.
- [x] Add `coinbase()` and `fee_recipient()` to the public context in `context.nr`. The functions just returning those values.
- [x] Update `abis.test.ts`
- [x] Update `index.test.ts` in `public` in `acir-simulator`
- [x] Update the solidity decoders (header) -> use the `integration_l1_publisher.test.ts` to generate new json traces and extend them with `coinbase` and `fee_recipient`.
- [x] Add a test function that uses the values, for testing useful to have `assert(coinbase == input)` as you can then have it fail if it is the unexpected value and it is concise. Add tests to `acir-simulator/public/index.test.ts`
- [x] Update the `PublicGlobalVariables` in `aztec-nr/aztec/src/abi.nr`
- [x] Update the `GlobalVariables` in `global_variables.nr`