diff --git a/contracts/config/networks.json b/contracts/config/networks.json index 8a604af9fd..8d233b64a4 100644 --- a/contracts/config/networks.json +++ b/contracts/config/networks.json @@ -88,5 +88,31 @@ "6e384a07a01263518a09a5424c7b6bbfc3604ba7d93f47e3a455cbdd7f9f0682", "4bfe14725e685901c062ccd4e220c61cf9c189897b6c78bd18d7f51291b2b8f8" ] + }, + "localTestnetGeth": { + "url": "http://127.0.0.1:8025", + "deploy": [ + "deployment_scripts/core" + ], + "accounts": [ + "f52e5418e349dccdda29b6ac8b0abe6576bb7713886aa85abea6181ba731f9bb", + "4bfe14725e685901c062ccd4e220c61cf9c189897b6c78bd18d7f51291b2b8f1" + ] + }, + "localTestnetTen": { + "chainId": 443, + "url": "http://127.0.0.1:3000/v1/", + "useGateway": true, + "companionNetworks" : { + "layer1" : "localTestnetGeth" + }, + "deploy": [ + "deployment_scripts/testing" + ], + "accounts": [ + "8dfb8083da6275ae3e4f41e3e8a8c19d028d32c9247e24530933782f2a05035b", + "6e384a07a01263518a09a5424c7b6bbfc3604ba7d93f47e3a455cbdd7f9f0682", + "4bfe14725e685901c062ccd4e220c61cf9c189897b6c78bd18d7f51291b2b8f8" + ] } } \ No newline at end of file diff --git a/contracts/deployment_scripts/testing/003_simple_withdrawal.ts b/contracts/deployment_scripts/testing/003_simple_withdrawal.ts index 01b3024d71..f24b3ad564 100644 --- a/contracts/deployment_scripts/testing/003_simple_withdrawal.ts +++ b/contracts/deployment_scripts/testing/003_simple_withdrawal.ts @@ -49,6 +49,7 @@ async function waitForRootPublished(management, msg, proof, root, provider: Ethe } await sleep(1_000) } + console.log(`Estimation took ${Date.now() - startTime} ms`) return gas_estimate } @@ -96,17 +97,17 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { } - // const networkConfig : any = await hre.network.provider.request({method: 'net_config'}); - const mgmtContractAddress = "0x946600AF6893Ee818CC7CC2dEC4D0A0bF91C9817"// networkConfig.ManagementContractAddress; - const messageBusAddress = "0x68e95924f22Be35386A8aE0240f8885967d452D6" //networkConfig.MessageBusAddress; + const networkConfig : any = await hre.network.provider.request({method: 'net_config'}); + const mgmtContractAddress = /*"0x946600AF6893Ee818CC7CC2dEC4D0A0bF91C9817"*/ networkConfig.ManagementContractAddress; + const messageBusAddress = /*"0x68e95924f22Be35386A8aE0240f8885967d452D6"*/ networkConfig.MessageBusAddress; - /* const l1Accounts = await hre.companionNetworks.layer1.getNamedAccounts() + const l1Accounts = await hre.companionNetworks.layer1.getNamedAccounts() const fundTx = await hre.companionNetworks.layer1.deployments.rawTx({ from: l1Accounts.deployer, to: messageBusAddress, value: "1000", }) - console.log(`Message bus funding status = ${fundTx.status}`)*/ + console.log(`Message bus funding status = ${fundTx.status}`) var managementContract = await hre.ethers.getContractAt("ManagementContract", mgmtContractAddress); const estimation = await waitForRootPublished(managementContract, msg, proof, tree.root, hre.companionNetworks.layer1.provider) diff --git a/contracts/package.json b/contracts/package.json index 40aa221b90..11faaa9eeb 100644 --- a/contracts/package.json +++ b/contracts/package.json @@ -10,7 +10,6 @@ "author": "", "license": "ISC", "devDependencies": { - "@nomicfoundation/hardhat-ethers": "^3.0.6", "@nomicfoundation/hardhat-toolbox": "^4.0.0", "@openzeppelin/hardhat-upgrades": "^3.0.0", "@solidstate/hardhat-bytecode-exporter": "^1.1.1", @@ -31,6 +30,6 @@ }, "peerDependencies": { "@nomicfoundation/hardhat-verify" : "2.0.8", - "@nomicfoundation/hardhat-ethers":"3.0.6" + "@nomicfoundation/hardhat-ethers":"3.0.5" } } \ No newline at end of file diff --git a/go/host/l1/statemachine.go b/go/host/l1/statemachine.go index 2de3c54da7..db76f31b85 100644 --- a/go/host/l1/statemachine.go +++ b/go/host/l1/statemachine.go @@ -121,8 +121,13 @@ func (c *crossChainStateMachine) PublishNextBundle() error { } bundle, err := c.enclaveClient.ExportCrossChainData(context.Background(), begin.Uint64(), end.Uint64()) - if err != nil { + if err != nil && !errors.Is(err, errutil.ErrCrossChainBundleNoBatches) { return err + } else if err != nil && errors.Is(err, errutil.ErrCrossChainBundleNoBatches) { + // If there are no cannonical batches for this rollup, move to the next rollup. + // In case a fork happens it will be revisited under different forkID produced from the management contract. + c.currentRollup++ + return nil } alreadyPublished, err := c.IsBundleAlreadyPublished(bundle) @@ -178,6 +183,7 @@ func (c *crossChainStateMachine) Synchronize() error { Number: c.latestRollup.Number + 1, } + c.logger.Info("Synchronized rollup state machine", "latestRollup", c.latestRollup.Number, "forkUID", c.latestRollup.ForkUID.String()) return nil }