Skip to content

Commit

Permalink
Potential fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanIliev545 committed Aug 28, 2024
1 parent 5b1622f commit 0bb83ad
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 8 deletions.
26 changes: 26 additions & 0 deletions contracts/config/networks.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
}
}
11 changes: 6 additions & 5 deletions contracts/deployment_scripts/testing/003_simple_withdrawal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down Expand Up @@ -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)
Expand Down
3 changes: 1 addition & 2 deletions contracts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -31,6 +30,6 @@
},
"peerDependencies": {
"@nomicfoundation/hardhat-verify" : "2.0.8",
"@nomicfoundation/hardhat-ethers":"3.0.6"
"@nomicfoundation/hardhat-ethers":"3.0.5"
}
}
8 changes: 7 additions & 1 deletion go/host/l1/statemachine.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Check failure on line 127 in go/host/l1/statemachine.go

View workflow job for this annotation

GitHub Actions / lint

`cannonical` is a misspelling of `canonical` (misspell)
// 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)
Expand Down Expand Up @@ -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
}

Expand Down

0 comments on commit 0bb83ad

Please sign in to comment.