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
0a002e1e
Commit
0a002e1e
authored
Jun 24, 2023
by
clabby
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
devnet: Set the implementation of the `FaultDisputeGame` in the DGF upon initialization
parent
15660862
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
48 additions
and
3 deletions
+48
-3
docker-compose.yml
ops-bedrock/docker-compose.yml
+1
-0
devnetL1.json
packages/contracts-bedrock/deploy-config/devnetL1.json
+4
-2
Deploy.s.sol
packages/contracts-bedrock/scripts/Deploy.s.sol
+37
-1
DeployConfig.s.sol
packages/contracts-bedrock/scripts/DeployConfig.s.sol
+4
-0
deploy-config.ts
packages/contracts-bedrock/src/deploy-config.ts
+2
-0
No files found.
ops-bedrock/docker-compose.yml
View file @
0a002e1e
...
@@ -17,6 +17,7 @@ services:
...
@@ -17,6 +17,7 @@ services:
dockerfile
:
Dockerfile.l1
dockerfile
:
Dockerfile.l1
ports
:
ports
:
-
"
8545:8545"
-
"
8545:8545"
-
"
8546:8546"
-
"
7060:6060"
-
"
7060:6060"
volumes
:
volumes
:
-
"
l1_data:/db"
-
"
l1_data:/db"
...
...
packages/contracts-bedrock/deploy-config/devnetL1.json
View file @
0a002e1e
...
@@ -43,5 +43,7 @@
...
@@ -43,5 +43,7 @@
"eip1559Elasticity"
:
2
,
"eip1559Elasticity"
:
2
,
"l1GenesisBlockTimestamp"
:
"0x64935846"
,
"l1GenesisBlockTimestamp"
:
"0x64935846"
,
"l1StartingBlockTag"
:
"earliest"
,
"l1StartingBlockTag"
:
"earliest"
,
"l2GenesisRegolithTimeOffset"
:
"0x0"
"l2GenesisRegolithTimeOffset"
:
"0x0"
,
}
"faultGameAbsolutePrestate"
:
15
,
\ No newline at end of file
"faultGameMaxDepth"
:
4
}
packages/contracts-bedrock/scripts/Deploy.s.sol
View file @
0a002e1e
...
@@ -23,9 +23,14 @@ import { SystemConfig } from "../contracts/L1/SystemConfig.sol";
...
@@ -23,9 +23,14 @@ import { SystemConfig } from "../contracts/L1/SystemConfig.sol";
import { ResourceMetering } from "../contracts/L1/ResourceMetering.sol";
import { ResourceMetering } from "../contracts/L1/ResourceMetering.sol";
import { Constants } from "../contracts/libraries/Constants.sol";
import { Constants } from "../contracts/libraries/Constants.sol";
import { DisputeGameFactory } from "../contracts/dispute/DisputeGameFactory.sol";
import { DisputeGameFactory } from "../contracts/dispute/DisputeGameFactory.sol";
import { FaultDisputeGame } from "../contracts/dispute/FaultDisputeGame.sol";
import { L1ERC721Bridge } from "../contracts/L1/L1ERC721Bridge.sol";
import { L1ERC721Bridge } from "../contracts/L1/L1ERC721Bridge.sol";
import { Predeploys } from "../contracts/libraries/Predeploys.sol";
import { Predeploys } from "../contracts/libraries/Predeploys.sol";
import { IBigStepper } from "../contracts/dispute/interfaces/IBigStepper.sol";
import { AlphabetVM } from "../contracts/test/FaultDisputeGame.t.sol";
import "../contracts/libraries/DisputeTypes.sol";
/// @title Deploy
/// @title Deploy
/// @notice Script used to deploy a bedrock system. The entire system is deployed within the `run` function.
/// @notice Script used to deploy a bedrock system. The entire system is deployed within the `run` function.
/// To add a new contract to the system, add a public function that deploys that individual contract.
/// To add a new contract to the system, add a public function that deploys that individual contract.
...
@@ -86,7 +91,10 @@ contract Deploy is Deployer {
...
@@ -86,7 +91,10 @@ contract Deploy is Deployer {
initializeL2OutputOracle();
initializeL2OutputOracle();
initializeOptimismPortal();
initializeOptimismPortal();
setFaultGameImplementation();
transferProxyAdminOwnership();
transferProxyAdminOwnership();
transferDisputeGameFactoryOwnership();
}
}
/// @notice Modifier that wraps a function in broadcasting.
/// @notice Modifier that wraps a function in broadcasting.
...
@@ -444,7 +452,7 @@ contract Deploy is Deployer {
...
@@ -444,7 +452,7 @@ contract Deploy is Deployer {
_implementation: disputeGameFactory,
_implementation: disputeGameFactory,
_data: abi.encodeCall(
_data: abi.encodeCall(
DisputeGameFactory.initialize,
DisputeGameFactory.initialize,
(
cfg.finalSystemOwner()
)
(
msg.sender
)
)
)
});
});
...
@@ -665,5 +673,33 @@ contract Deploy is Deployer {
...
@@ -665,5 +673,33 @@ contract Deploy is Deployer {
console.log("ProxyAdmin ownership transferred to: %s", finalSystemOwner);
console.log("ProxyAdmin ownership transferred to: %s", finalSystemOwner);
}
}
}
}
/// @notice Transfer ownership of the DisputeGameFactory contract to the final system owner
function transferDisputeGameFactoryOwnership() broadcast() public {
if (block.chainid == 900) {
DisputeGameFactory disputeGameFactory = DisputeGameFactory(mustGetAddress("DisputeGameFactoryProxy"));
address owner = disputeGameFactory.owner();
address finalSystemOwner = cfg.finalSystemOwner();
if (owner != finalSystemOwner) {
disputeGameFactory.transferOwnership(finalSystemOwner);
console.log("DisputeGameFactory ownership transferred to: %s", finalSystemOwner);
}
}
}
/// @notice Sets the implementation for the `FAULT` game type in the `DisputeGameFactory`
function setFaultGameImplementation() broadcast() public {
if (block.chainid == 900) {
DisputeGameFactory factory = DisputeGameFactory(mustGetAddress("DisputeGameFactoryProxy"));
Claim absolutePrestate = Claim.wrap(bytes32(cfg.faultGameAbsolutePrestate()));
IBigStepper faultVm = IBigStepper(new AlphabetVM(absolutePrestate));
factory.setImplementation(GameTypes.FAULT, new FaultDisputeGame({
_absolutePrestate: absolutePrestate,
_maxGameDepth: cfg.faultGameMaxDepth(),
_vm: faultVm
}));
console.log("DisputeGameFactory: set `FaultDisputeGame` implementation");
}
}
}
}
packages/contracts-bedrock/scripts/DeployConfig.s.sol
View file @
0a002e1e
...
@@ -45,6 +45,8 @@ contract DeployConfig is Script {
...
@@ -45,6 +45,8 @@ contract DeployConfig is Script {
uint256 public eip1559Denominator;
uint256 public eip1559Denominator;
uint256 public eip1559Elasticity;
uint256 public eip1559Elasticity;
uint256 public l2GenesisRegolithTimeOffset;
uint256 public l2GenesisRegolithTimeOffset;
uint256 public faultGameAbsolutePrestate;
uint256 public faultGameMaxDepth;
constructor(string memory _path) {
constructor(string memory _path) {
console.log("DeployConfig: reading file %s", _path);
console.log("DeployConfig: reading file %s", _path);
...
@@ -82,6 +84,8 @@ contract DeployConfig is Script {
...
@@ -82,6 +84,8 @@ contract DeployConfig is Script {
eip1559Denominator = stdJson.readUint(_json, "$.eip1559Denominator");
eip1559Denominator = stdJson.readUint(_json, "$.eip1559Denominator");
eip1559Elasticity = stdJson.readUint(_json, "$.eip1559Elasticity");
eip1559Elasticity = stdJson.readUint(_json, "$.eip1559Elasticity");
l2GenesisRegolithTimeOffset = stdJson.readUint(_json, "$.l2GenesisRegolithTimeOffset");
l2GenesisRegolithTimeOffset = stdJson.readUint(_json, "$.l2GenesisRegolithTimeOffset");
faultGameAbsolutePrestate = stdJson.readUint(_json, "$.faultGameAbsolutePrestate");
faultGameMaxDepth = stdJson.readUint(_json, "$.faultGameMaxDepth");
}
}
function l1StartingBlockTag() public returns (bytes32) {
function l1StartingBlockTag() public returns (bytes32) {
...
...
packages/contracts-bedrock/src/deploy-config.ts
View file @
0a002e1e
...
@@ -201,6 +201,8 @@ interface OptionalL1DeployConfig {
...
@@ -201,6 +201,8 @@ interface OptionalL1DeployConfig {
l1GenesisBlockGasUsed
:
string
l1GenesisBlockGasUsed
:
string
l1GenesisBlockParentHash
:
string
l1GenesisBlockParentHash
:
string
l1GenesisBlockBaseFeePerGas
:
string
l1GenesisBlockBaseFeePerGas
:
string
faultGameAbsolutePrestate
:
number
faultGameMaxDepth
:
number
}
}
/**
/**
...
...
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