Commit b94df1d0 authored by mergify[bot]'s avatar mergify[bot] Committed by GitHub

Merge branch 'develop' into felipe/ufm-kmstool

parents 57186ac7 5eb852bb
...@@ -49,7 +49,8 @@ jobs: ...@@ -49,7 +49,8 @@ jobs:
id: changesets id: changesets
with: with:
createGithubReleases: false createGithubReleases: false
publish: pnpm release publish: pnpm release:publish
version: pnpm release:version
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
......
This diff is collapsed.
...@@ -31,6 +31,7 @@ func setupFaultDisputeGame() (common.Address, *bind.TransactOpts, *backends.Simu ...@@ -31,6 +31,7 @@ func setupFaultDisputeGame() (common.Address, *bind.TransactOpts, *backends.Simu
backend, backend,
[32]byte{0x01}, [32]byte{0x01},
big.NewInt(15), big.NewInt(15),
uint64(604800), // 7 days
common.Address{0xdd}, common.Address{0xdd},
) )
if err != nil { if err != nil {
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
"prepare": "husky install", "prepare": "husky install",
"release": "npx nx run-many --target=build --skip-nx-cache && pnpm changeset publish", "release": "npx nx run-many --target=build --skip-nx-cache && pnpm changeset publish",
"release:check": "changeset status --verbose --since=origin/main", "release:check": "changeset status --verbose --since=origin/main",
"release:publish": "npx nx run-many --target=build && pnpm install && pnpm build && changeset publish", "release:publish": "pnpm install --frozen-lockfile && npx nx run-many --target=build && pnpm build && changeset publish",
"release:version": "changeset version && pnpm install --lockfile-only", "release:version": "changeset version && pnpm install --lockfile-only",
"install:foundry": "curl -L https://foundry.paradigm.xyz | bash && pnpm update:foundry", "install:foundry": "curl -L https://foundry.paradigm.xyz | bash && pnpm update:foundry",
"update:foundry": "foundryup -C $(cat .foundryrc)" "update:foundry": "foundryup -C $(cat .foundryrc)"
......
...@@ -83,37 +83,36 @@ FaucetTest:test_nonAdmin_drip_fails() (gas: 262520) ...@@ -83,37 +83,36 @@ FaucetTest:test_nonAdmin_drip_fails() (gas: 262520)
FaucetTest:test_receive_succeeds() (gas: 17401) FaucetTest:test_receive_succeeds() (gas: 17401)
FaucetTest:test_withdraw_nonAdmin_reverts() (gas: 13145) FaucetTest:test_withdraw_nonAdmin_reverts() (gas: 13145)
FaucetTest:test_withdraw_succeeds() (gas: 78359) FaucetTest:test_withdraw_succeeds() (gas: 78359)
FaultDisputeGame_ResolvesCorrectly_Chaos:test_resolvesCorrectly_succeeds() (gas: 111450391) FaultDisputeGame_ResolvesCorrectly_CorrectRoot1:test_resolvesCorrectly_succeeds() (gas: 498839)
FaultDisputeGame_ResolvesCorrectly_CorrectRoot1:test_resolvesCorrectly_succeeds() (gas: 498867) FaultDisputeGame_ResolvesCorrectly_CorrectRoot2:test_resolvesCorrectly_succeeds() (gas: 505685)
FaultDisputeGame_ResolvesCorrectly_CorrectRoot2:test_resolvesCorrectly_succeeds() (gas: 505669) FaultDisputeGame_ResolvesCorrectly_CorrectRoot3:test_resolvesCorrectly_succeeds() (gas: 502382)
FaultDisputeGame_ResolvesCorrectly_CorrectRoot3:test_resolvesCorrectly_succeeds() (gas: 502410) FaultDisputeGame_ResolvesCorrectly_CorrectRoot4:test_resolvesCorrectly_succeeds() (gas: 505561)
FaultDisputeGame_ResolvesCorrectly_CorrectRoot4:test_resolvesCorrectly_succeeds() (gas: 505545) FaultDisputeGame_ResolvesCorrectly_CorrectRoot5:test_resolvesCorrectly_succeeds() (gas: 504878)
FaultDisputeGame_ResolvesCorrectly_CorrectRoot5:test_resolvesCorrectly_succeeds() (gas: 504906) FaultDisputeGame_ResolvesCorrectly_IncorrectRoot1:test_resolvesCorrectly_succeeds() (gas: 497604)
FaultDisputeGame_ResolvesCorrectly_IncorrectRoot1:test_resolvesCorrectly_succeeds() (gas: 497632) FaultDisputeGame_ResolvesCorrectly_IncorrectRoot2:test_resolvesCorrectly_succeeds() (gas: 504450)
FaultDisputeGame_ResolvesCorrectly_IncorrectRoot2:test_resolvesCorrectly_succeeds() (gas: 504434) FaultDisputeGame_ResolvesCorrectly_IncorrectRoot3:test_resolvesCorrectly_succeeds() (gas: 501147)
FaultDisputeGame_ResolvesCorrectly_IncorrectRoot3:test_resolvesCorrectly_succeeds() (gas: 501175) FaultDisputeGame_ResolvesCorrectly_IncorrectRoot4:test_resolvesCorrectly_succeeds() (gas: 502326)
FaultDisputeGame_ResolvesCorrectly_IncorrectRoot4:test_resolvesCorrectly_succeeds() (gas: 502310) FaultDisputeGame_ResolvesCorrectly_IncorrectRoot5:test_resolvesCorrectly_succeeds() (gas: 501643)
FaultDisputeGame_ResolvesCorrectly_IncorrectRoot5:test_resolvesCorrectly_succeeds() (gas: 501671) FaultDisputeGame_Test:test_extraData_succeeds() (gas: 17404)
FaultDisputeGame_Test:test_extraData_succeeds() (gas: 17426)
FaultDisputeGame_Test:test_gameData_succeeds() (gas: 17917) FaultDisputeGame_Test:test_gameData_succeeds() (gas: 17917)
FaultDisputeGame_Test:test_gameStart_succeeds() (gas: 10315) FaultDisputeGame_Test:test_gameStart_succeeds() (gas: 10315)
FaultDisputeGame_Test:test_gameType_succeeds() (gas: 8282) FaultDisputeGame_Test:test_gameType_succeeds() (gas: 8260)
FaultDisputeGame_Test:test_initialRootClaimData_succeeds() (gas: 17669) FaultDisputeGame_Test:test_initialRootClaimData_succeeds() (gas: 17669)
FaultDisputeGame_Test:test_move_clockCorrectness_succeeds() (gas: 415981) FaultDisputeGame_Test:test_move_clockCorrectness_succeeds() (gas: 416029)
FaultDisputeGame_Test:test_move_clockTimeExceeded_reverts() (gas: 26387) FaultDisputeGame_Test:test_move_clockTimeExceeded_reverts() (gas: 26399)
FaultDisputeGame_Test:test_move_defendRoot_reverts() (gas: 13360) FaultDisputeGame_Test:test_move_defendRoot_reverts() (gas: 13360)
FaultDisputeGame_Test:test_move_duplicateClaim_reverts() (gas: 103230) FaultDisputeGame_Test:test_move_duplicateClaim_reverts() (gas: 103254)
FaultDisputeGame_Test:test_move_gameDepthExceeded_reverts() (gas: 408100) FaultDisputeGame_Test:test_move_gameDepthExceeded_reverts() (gas: 408148)
FaultDisputeGame_Test:test_move_gameNotInProgress_reverts() (gas: 10968) FaultDisputeGame_Test:test_move_gameNotInProgress_reverts() (gas: 10968)
FaultDisputeGame_Test:test_move_nonExistentParent_reverts() (gas: 24655) FaultDisputeGame_Test:test_move_nonExistentParent_reverts() (gas: 24655)
FaultDisputeGame_Test:test_move_simpleAttack_succeeds() (gas: 107344) FaultDisputeGame_Test:test_move_simpleAttack_succeeds() (gas: 107356)
FaultDisputeGame_Test:test_resolve_challengeContested_succeeds() (gas: 224784) FaultDisputeGame_Test:test_resolve_challengeContested_succeeds() (gas: 224820)
FaultDisputeGame_Test:test_resolve_notInProgress_reverts() (gas: 9657) FaultDisputeGame_Test:test_resolve_notInProgress_reverts() (gas: 9657)
FaultDisputeGame_Test:test_resolve_rootContested_succeeds() (gas: 109749) FaultDisputeGame_Test:test_resolve_rootContested_succeeds() (gas: 109773)
FaultDisputeGame_Test:test_resolve_rootUncontestedClockNotExpired_succeeds() (gas: 21422) FaultDisputeGame_Test:test_resolve_rootUncontestedClockNotExpired_succeeds() (gas: 21434)
FaultDisputeGame_Test:test_resolve_rootUncontested_succeeds() (gas: 27251) FaultDisputeGame_Test:test_resolve_rootUncontested_succeeds() (gas: 27263)
FaultDisputeGame_Test:test_resolve_teamDeathmatch_succeeds() (gas: 395442) FaultDisputeGame_Test:test_resolve_teamDeathmatch_succeeds() (gas: 395502)
FaultDisputeGame_Test:test_rootClaim_succeeds() (gas: 8181) FaultDisputeGame_Test:test_rootClaim_succeeds() (gas: 8225)
FeeVault_Test:test_constructor_succeeds() (gas: 18185) FeeVault_Test:test_constructor_succeeds() (gas: 18185)
GasBenchMark_L1CrossDomainMessenger:test_sendMessage_benchmark_0() (gas: 352113) GasBenchMark_L1CrossDomainMessenger:test_sendMessage_benchmark_0() (gas: 352113)
GasBenchMark_L1CrossDomainMessenger:test_sendMessage_benchmark_1() (gas: 2950320) GasBenchMark_L1CrossDomainMessenger:test_sendMessage_benchmark_1() (gas: 2950320)
......
...@@ -30,12 +30,12 @@ contract FaultDisputeGame is IFaultDisputeGame, Clone, Semver { ...@@ -30,12 +30,12 @@ contract FaultDisputeGame is IFaultDisputeGame, Clone, Semver {
/// @notice The max depth of the game. /// @notice The max depth of the game.
uint256 public immutable MAX_GAME_DEPTH; uint256 public immutable MAX_GAME_DEPTH;
/// @notice The duration of the game.
Duration public immutable GAME_DURATION;
/// @notice A hypervisor that performs single instruction steps on a fault proof program trace. /// @notice A hypervisor that performs single instruction steps on a fault proof program trace.
IBigStepper public immutable VM; IBigStepper public immutable VM;
/// @notice The duration of the game.
Duration internal constant GAME_DURATION = Duration.wrap(7 days);
/// @notice The root claim's position is always at gindex 1. /// @notice The root claim's position is always at gindex 1.
Position internal constant ROOT_POSITION = Position.wrap(1); Position internal constant ROOT_POSITION = Position.wrap(1);
...@@ -58,10 +58,12 @@ contract FaultDisputeGame is IFaultDisputeGame, Clone, Semver { ...@@ -58,10 +58,12 @@ contract FaultDisputeGame is IFaultDisputeGame, Clone, Semver {
constructor( constructor(
Claim _absolutePrestate, Claim _absolutePrestate,
uint256 _maxGameDepth, uint256 _maxGameDepth,
Duration _gameDuration,
IBigStepper _vm IBigStepper _vm
) Semver(0, 0, 3) { ) Semver(0, 0, 3) {
ABSOLUTE_PRESTATE = _absolutePrestate; ABSOLUTE_PRESTATE = _absolutePrestate;
MAX_GAME_DEPTH = _maxGameDepth; MAX_GAME_DEPTH = _maxGameDepth;
GAME_DURATION = _gameDuration;
VM = _vm; VM = _vm;
} }
......
...@@ -29,7 +29,12 @@ contract FaultDisputeGame_Init is DisputeGameFactory_Init { ...@@ -29,7 +29,12 @@ contract FaultDisputeGame_Init is DisputeGameFactory_Init {
function init(Claim rootClaim, Claim absolutePrestate) public { function init(Claim rootClaim, Claim absolutePrestate) public {
super.setUp(); super.setUp();
// Deploy an implementation of the fault game // Deploy an implementation of the fault game
gameImpl = new FaultDisputeGame(absolutePrestate, 4, new AlphabetVM(absolutePrestate)); gameImpl = new FaultDisputeGame(
absolutePrestate,
4,
Duration.wrap(7 days),
new AlphabetVM(absolutePrestate)
);
// Register the game implementation with the factory. // Register the game implementation with the factory.
factory.setImplementation(GAME_TYPE, gameImpl); factory.setImplementation(GAME_TYPE, gameImpl);
// Create a new game. // Create a new game.
......
...@@ -45,5 +45,6 @@ ...@@ -45,5 +45,6 @@
"l1StartingBlockTag": "earliest", "l1StartingBlockTag": "earliest",
"l2GenesisRegolithTimeOffset": "0x0", "l2GenesisRegolithTimeOffset": "0x0",
"faultGameAbsolutePrestate": 140, "faultGameAbsolutePrestate": 140,
"faultGameMaxDepth": 4 "faultGameMaxDepth": 4,
} "faultGameMaxDuration": 604800
\ No newline at end of file }
...@@ -697,6 +697,7 @@ contract Deploy is Deployer { ...@@ -697,6 +697,7 @@ contract Deploy is Deployer {
factory.setImplementation(GameTypes.FAULT, new FaultDisputeGame({ factory.setImplementation(GameTypes.FAULT, new FaultDisputeGame({
_absolutePrestate: absolutePrestate, _absolutePrestate: absolutePrestate,
_maxGameDepth: cfg.faultGameMaxDepth(), _maxGameDepth: cfg.faultGameMaxDepth(),
_gameDuration: Duration.wrap(uint64(cfg.faultGameMaxDuration())),
_vm: faultVm _vm: faultVm
})); }));
console.log("DisputeGameFactory: set `FaultDisputeGame` implementation"); console.log("DisputeGameFactory: set `FaultDisputeGame` implementation");
......
...@@ -47,6 +47,7 @@ contract DeployConfig is Script { ...@@ -47,6 +47,7 @@ contract DeployConfig is Script {
uint256 public l2GenesisRegolithTimeOffset; uint256 public l2GenesisRegolithTimeOffset;
uint256 public faultGameAbsolutePrestate; uint256 public faultGameAbsolutePrestate;
uint256 public faultGameMaxDepth; uint256 public faultGameMaxDepth;
uint256 public faultGameMaxDuration;
constructor(string memory _path) { constructor(string memory _path) {
console.log("DeployConfig: reading file %s", _path); console.log("DeployConfig: reading file %s", _path);
...@@ -88,6 +89,7 @@ contract DeployConfig is Script { ...@@ -88,6 +89,7 @@ contract DeployConfig is Script {
if (block.chainid == 900) { if (block.chainid == 900) {
faultGameAbsolutePrestate = stdJson.readUint(_json, "$.faultGameAbsolutePrestate"); faultGameAbsolutePrestate = stdJson.readUint(_json, "$.faultGameAbsolutePrestate");
faultGameMaxDepth = stdJson.readUint(_json, "$.faultGameMaxDepth"); faultGameMaxDepth = stdJson.readUint(_json, "$.faultGameMaxDepth");
faultGameMaxDuration = stdJson.readUint(_json, "$.faultGameMaxDuration");
} }
} }
......
...@@ -23,7 +23,7 @@ importers: ...@@ -23,7 +23,7 @@ importers:
version: 0.4.8 version: 0.4.8
'@nrwl/nx-cloud': '@nrwl/nx-cloud':
specifier: latest specifier: latest
version: 16.0.5 version: 16.1.0
'@types/chai': '@types/chai':
specifier: ^4.2.18 specifier: ^4.2.18
version: 4.2.21 version: 4.2.21
...@@ -2493,10 +2493,10 @@ packages: ...@@ -2493,10 +2493,10 @@ packages:
tslib: 2.6.0 tslib: 2.6.0
dev: true dev: true
/@nrwl/nx-cloud@16.0.5: /@nrwl/nx-cloud@16.1.0:
resolution: {integrity: sha512-1p82ym8WE9ziejwgPslstn19iV/VkHfHfKr/5YOnfCHQS+NxUf92ogcYhHXtqWLblVZ9Zs4W4pkSXK4e04wCmQ==} resolution: {integrity: sha512-OFjbSqdCuZq9KRYU/mOlIN8SYLZREsLlZYqYpObZqXJ5meUgBDJbUSwRweUSUvt73fgRixLEau2jPysiLHKxSQ==}
dependencies: dependencies:
nx-cloud: 16.0.5 nx-cloud: 16.1.0
transitivePeerDependencies: transitivePeerDependencies:
- debug - debug
dev: true dev: true
...@@ -12534,11 +12534,11 @@ packages: ...@@ -12534,11 +12534,11 @@ packages:
bn.js: 4.11.6 bn.js: 4.11.6
strip-hex-prefix: 1.0.0 strip-hex-prefix: 1.0.0
/nx-cloud@16.0.5: /nx-cloud@16.1.0:
resolution: {integrity: sha512-13P7r0aKikjBtmdZrNorwXzVPeVIV4MLEwqGY+DEG6doLBtI5KqEQk/d5B5l2dCF2BEi/LXEmLYCmf9gwbOJ+Q==} resolution: {integrity: sha512-2K5OuJ4MEDrn2solje2X+a3UxSCdfR5PIscCRQbBANyvJfl3hGJSTxz0n5xeJJX4cKcQlfAxDQFRH6DHNdTGPQ==}
hasBin: true hasBin: true
dependencies: dependencies:
'@nrwl/nx-cloud': 16.0.5 '@nrwl/nx-cloud': 16.1.0
axios: 1.1.3 axios: 1.1.3
chalk: 4.1.2 chalk: 4.1.2
dotenv: 10.0.0 dotenv: 10.0.0
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment