feat: Constrain globals on rollup contract#900
Conversation
| emit L2BlockProcessed(l2BlockNumber); | ||
| } | ||
|
|
||
| function _constrainGlobals(bytes calldata _l2Block, uint256 _version) internal view { |
There was a problem hiding this comment.
why do we pass _version as a param if it will always be the constant?
There was a problem hiding this comment.
Originally I had it in a lib, forgot to update after 😬
| constructor(IRegistry _registry) { | ||
| VERIFIER = new MockVerifier(); | ||
| REGISTRY = _registry; | ||
| VERSION = 1; |
There was a problem hiding this comment.
should this be in the constructor so it is easier to not miss updating this var when upgrading?
There was a problem hiding this comment.
Would depend on the upgrade mechanism, and since we are not sure about that yet, have just put it like this.
| throw new Error(`Public entrypoints are not allowed`); | ||
| } | ||
|
|
||
| // Is simulating it messing it up? |
| parentContract = await deployContract(ParentAbi); | ||
| childContract = await deployContract(ChildAbi); | ||
| }, 60_000); | ||
| }, 100_000); |
There was a problem hiding this comment.
Possibly as simulations now were copyign non-zero values around, but could also have been pressure on mainframe 🤷
| beforeEach(() => { | ||
| // Create instance to test | ||
| builder = new SoloBlockBuilder(builderDb, vks, simulator, prover); | ||
| builder = new SoloBlockBuilder(builderDb, vks, simulator, prover, Fr.ZERO, Fr.ZERO); |
There was a problem hiding this comment.
is there a reason for not using the constants you defined earlier: chainId, version?
0188705 to
339b4cb
Compare


Description
Fixes #827 and #831.
Checklist: