Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
nebula
Commits
0308812e
Commit
0308812e
authored
Aug 18, 2023
by
clabby
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Preserve prod game type space
typo + lint
parent
9d9a79a3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
62 additions
and
24 deletions
+62
-24
helper.go
op-e2e/e2eutils/disputegame/helper.go
+2
-2
Deploy.s.sol
packages/contracts-bedrock/scripts/Deploy.s.sol
+60
-22
No files found.
op-e2e/e2eutils/disputegame/helper.go
View file @
0308812e
...
...
@@ -26,8 +26,8 @@ import (
"github.com/stretchr/testify/require"
)
const
alphabetGameType
uint8
=
0
const
cannonGameType
uint8
=
1
const
alphabetGameType
uint8
=
255
const
cannonGameType
uint8
=
0
const
alphabetGameDepth
=
4
const
lastAlphabetTraceIndex
=
1
<<
alphabetGameDepth
-
1
...
...
packages/contracts-bedrock/scripts/Deploy.s.sol
View file @
0308812e
...
...
@@ -775,31 +775,69 @@ contract Deploy is Deployer {
console.log("Absolute prestate: %s", vm.toString(mipsAbsolutePrestate));
DisputeGameFactory factory = DisputeGameFactory(mustGetAddress("DisputeGameFactoryProxy"));
for (uint8 i; i < 2; i++) {
Claim absolutePrestate =
Claim.wrap(i == 0 ? bytes32(cfg.faultGameAbsolutePrestate()) : mipsAbsolutePrestate);
IBigStepper faultVm =
IBigStepper(i == 0 ? address(new AlphabetVM(absolutePrestate)) : mustGetAddress("Mips"));
GameType gameType = GameType.wrap(i);
if (address(factory.gameImpls(gameType)) == address(0)) {
factory.setImplementation(
gameType,
new FaultDisputeGame({
_gameType: gameType,
_absolutePrestate: absolutePrestate,
_maxGameDepth: i == 0 ? 4 : cfg.faultGameMaxDepth(), // The max depth of the alphabet game is always 4
// -------------
// Mainnet games
// TODO: Remove the `onlyDevnet` modifier and conditionally deploy the mainnet games based on the chainid.
// -------------
// Set the Cannon FaultDisputeGame implementation in the factory.
_setFaultGameImplementation(
factory,
GameTypes.FAULT,
Claim.wrap(mipsAbsolutePrestate),
IBigStepper(mustGetAddress("Mips")),
cfg.faultGameMaxDepth()
);
// -------------
// Devnet games
// Devnet-specific games are created with a game type descending from the `GameType` type's max value.
// This is to preserve the game type space for mainnet games and to have those be in parity with
// their prod counter parts when deployed to a devnet.
// -------------
// Set the Alphabet FaultDisputeGame implementation in the factory.
Claim alphabetAbsolutePrestate = Claim.wrap(bytes32(cfg.faultGameAbsolutePrestate()));
_setFaultGameImplementation(
factory,
GameType.wrap(255),
alphabetAbsolutePrestate,
IBigStepper(new AlphabetVM(alphabetAbsolutePrestate)),
4 // The max game depth of the alphabet game is always 4.
);
}
/// @notice Sets the implementation for the given fault game type in the `DisputeGameFactory`.
function _setFaultGameImplementation(
DisputeGameFactory _factory,
GameType _gameType,
Claim _absolutePrestate,
IBigStepper _faultVm,
uint256 _maxGameDepth
)
internal
{
if (address(_factory.gameImpls(_gameType)) == address(0)) {
_factory.setImplementation(
_gameType,
new FaultDisputeGame({
_gameType: _gameType,
_absolutePrestate: _absolutePrestate,
_maxGameDepth: _maxGameDepth,
_gameDuration: Duration.wrap(uint64(cfg.faultGameMaxDuration())),
_vm: faultVm,
_vm:
_
faultVm,
_l2oo: L2OutputOracle(mustGetAddress("L2OutputOracleProxy")),
_blockOracle: BlockOracle(mustGetAddress("BlockOracle"))
})
);
console.log(
"DisputeGameFactoryProxy: set `FaultDisputeGame` implementation (Backend: %s | GameType: %s)",
i == 0 ? "AlphabetVM" : "MIPS",
vm.toString(i)
);
}
})
);
uint8 rawGameType = GameType.unwrap(_gameType);
console.log(
"DisputeGameFactoryProxy: set `FaultDisputeGame` implementation (Backend: %s | GameType: %s)",
rawGameType == 0 ? "Cannon" : "Alphabet",
vm.toString(rawGameType)
);
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment