Skip to content

feat: Constrain globals on rollup contract#900

Merged
LHerskind merged 5 commits into
masterfrom
lh/constrain-chainid-version
Jun 23, 2023
Merged

feat: Constrain globals on rollup contract#900
LHerskind merged 5 commits into
masterfrom
lh/constrain-chainid-version

Conversation

@LHerskind

Copy link
Copy Markdown
Contributor

Description

Fixes #827 and #831.

Checklist:

  • I have reviewed my diff in github, line by line.
  • Every change is related to the PR description.
  • I have linked this pull request to the issue(s) that it resolves.
  • There are no unexpected formatting changes, superfluous debug logs, or commented-out code.
  • The branch has been merged or rebased against the head of its merge target.
  • I'm happy for the PR to be merged at the reviewer's next convenience.

@ludamad ludamad left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

lgtm

@LHerskind LHerskind linked an issue Jun 23, 2023 that may be closed by this pull request
@LHerskind LHerskind marked this pull request as ready for review June 23, 2023 11:14
@LHerskind LHerskind requested a review from rahul-kothari June 23, 2023 11:14
Comment thread l1-contracts/src/core/Rollup.sol Outdated
emit L2BlockProcessed(l2BlockNumber);
}

function _constrainGlobals(bytes calldata _l2Block, uint256 _version) internal view {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

why do we pass _version as a param if it will always be the constant?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Originally I had it in a lib, forgot to update after 😬

constructor(IRegistry _registry) {
VERIFIER = new MockVerifier();
REGISTRY = _registry;
VERSION = 1;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

should this be in the constructor so it is easier to not miss updating this var when upgrading?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Would depend on the upgrade mechanism, and since we are not sure about that yet, have just put it like this.

Comment thread yarn-project/aztec-rpc/src/account_impl/ecdsa_account_contract.ts
throw new Error(`Public entrypoints are not allowed`);
}

// Is simulating it messing it up?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

is this stale or?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Season 7 Oops GIF by Workaholics

parentContract = await deployContract(ParentAbi);
childContract = await deployContract(ChildAbi);
}, 60_000);
}, 100_000);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

damn why

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

is there a reason for not using the constants you defined earlier: chainId, version?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Simple.
Pop Tv Idiot GIF by Big Brother After Dark

@LHerskind LHerskind force-pushed the lh/constrain-chainid-version branch from 0188705 to 339b4cb Compare June 23, 2023 13:14
@LHerskind LHerskind merged commit bcbf54b into master Jun 23, 2023
@LHerskind LHerskind deleted the lh/constrain-chainid-version branch June 23, 2023 14:20
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.

feat: Constrain version on L1 contract feat: Constrain chainid on L1 contract

3 participants