Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make challenge manager immutable #498

Closed
wants to merge 13 commits into from
Closed

Conversation

godzillaba
Copy link
Contributor

@godzillaba godzillaba commented Dec 1, 2023

the callenge manager is still deployed behind a proxy

there is a new EdgeChallengeManagerFactory contract that replaces the challenge manager template in the rollup creator.

optimizer runs had to be lowered

@yahgwai
Copy link
Contributor

yahgwai commented Dec 14, 2023

I agree around the stakeToken != 0, lets do the check and make sure a stakeToken and amount are always set. If someone wants to deploy without a stake token they can always create a noop erc20 and use that.

// upgrade the surrounding contracts eg bridge, outbox, seq inbox, rollup event inbox
// to set of the new rollup address
bytes32 rollupSalt = keccak256(abi.encode(config));
address expectedRollupAddress =
Create2Upgradeable.computeAddress(rollupSalt, keccak256(type(RollupProxy).creationCode));
upgradeSurroundingContracts(expectedRollupAddress);

challengeManager.initialize({
// deploy the challenge manager
EdgeChallengeManager challengeManager = CHALLENGE_MANAGER_FACTORY.createChallengeManager({
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we use a factory here instead of just deploying the implementation from a template like before?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

because the expectedRollupAddress presumably wouldn't be known before deploying this action contract, and so we wouldn't be able to deploy the challengeManager implementation beforehand.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it should also deploy this behind a proxy though which it doesn't right now

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@godzillaba godzillaba marked this pull request as draft January 23, 2024 16:54
@godzillaba godzillaba marked this pull request as ready for review January 24, 2024 19:06
@godzillaba godzillaba requested a review from yahgwai January 24, 2024 19:06
Copy link

codecov bot commented Jan 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (a54ec13) 57.89% compared to head (8f5314e) 57.86%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #498      +/-   ##
==========================================
- Coverage   57.89%   57.86%   -0.03%     
==========================================
  Files          39       39              
  Lines        6926     6926              
==========================================
- Hits         4010     4008       -2     
- Misses       2910     2912       +2     
  Partials        6        6              

Copy link
Contributor

@yahgwai yahgwai left a comment

Choose a reason for hiding this comment

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

Just dropping a note that we decided to wait until other PRs have been merged - and then do this one after. It looks like it causes us to have to drop the optimizer runs, and although we estimate that this PR is still a gas improvement we havent been able to definitively confirm that.

@godzillaba godzillaba marked this pull request as draft February 15, 2024 20:00
@godzillaba godzillaba closed this Apr 24, 2024
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.

2 participants