diff --git a/go.mod b/go.mod index 6b292223539e..670c821e1e96 100644 --- a/go.mod +++ b/go.mod @@ -238,7 +238,7 @@ require ( replace ( github.com/babylonlabs-io/babylon => github.com/babylonlabs-io/babylon-private v0.9.0-rc.3.0.20240801001431-74a24c962ce2 - github.com/babylonlabs-io/finality-gadget => github.com/babylonlabs-io/finality-gadget v0.0.0-20240808170113-a35c696d61b2 + github.com/babylonlabs-io/finality-gadget => github.com/babylonlabs-io/finality-gadget v0.1.1-0.20240821072029-288e883914d5 github.com/cockroachdb/pebble => github.com/cockroachdb/pebble v0.0.0-20231018212520-f6cde3fc2fa4 github.com/ethereum/go-ethereum v1.14.7 => github.com/ethereum-optimism/op-geth v1.101407.0-rc.1.0.20240812224053-8d99ca68bb1a github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1 diff --git a/go.sum b/go.sum index 6c610d6f7f41..bf93f0b517d7 100644 --- a/go.sum +++ b/go.sum @@ -35,8 +35,8 @@ github.com/armon/go-metrics v0.0.0-20190430140413-ec5e00d3c878/go.mod h1:3AMJUQh github.com/armon/go-metrics v0.3.8/go.mod h1:4O98XIr/9W0sxpJ8UaYkvjk10Iff7SnFrb4QAOwNTFc= github.com/armon/go-metrics v0.4.1 h1:hR91U9KYmb6bLBYLQjyM+3j+rcd/UhE+G78SFnF8gJA= github.com/armon/go-metrics v0.4.1/go.mod h1:E6amYzXo6aW1tqzoZGT755KkbgrJsSdpwZ+3JqfkOG4= -github.com/babylonlabs-io/finality-gadget v0.0.0-20240808170113-a35c696d61b2 h1:ntR4P+jmATTEFqwaKOcA7TapDqIXUuerWRv5fao7eqw= -github.com/babylonlabs-io/finality-gadget v0.0.0-20240808170113-a35c696d61b2/go.mod h1:+BICJA7mUJpfYOSYds1G5w6nLO0gKVe9XwdmpIUiXmk= +github.com/babylonlabs-io/finality-gadget v0.1.1-0.20240821072029-288e883914d5 h1:Dto9JfYj1yCZPkwC50dTYxIprBBRcYu+S0RG9OrOVeI= +github.com/babylonlabs-io/finality-gadget v0.1.1-0.20240821072029-288e883914d5/go.mod h1:+BICJA7mUJpfYOSYds1G5w6nLO0gKVe9XwdmpIUiXmk= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/benbjohnson/clock v1.3.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/benbjohnson/clock v1.3.5 h1:VvXlSJBzZpA/zum6Sj74hxwYI2DIxRWuNIoXAzHZz5o= diff --git a/op-node/rollup/finality/finalizer.go b/op-node/rollup/finality/finalizer.go index 8c3bd1ebbcc8..e201b72ad047 100644 --- a/op-node/rollup/finality/finalizer.go +++ b/op-node/rollup/finality/finalizer.go @@ -340,16 +340,17 @@ func (fi *Finalizer) findLastBtcFinalizedL2Block( continue } - queryBlocks = append(queryBlocks, &fgtypes.Block{ + queryBlock := &fgtypes.Block{ BlockHeight: l2Block.Number, BlockHash: l2Block.Hash.String(), BlockTimestamp: l2Block.Time, - }) + } + queryBlocks = append(queryBlocks, queryBlock) fi.log.Debug( "added block to babylon gadget's query params", - "block_height", queryBlocks[i].BlockHeight, - "block_hash", queryBlocks[i].BlockHash, - "block_timestamp", queryBlocks[i].BlockTimestamp, + "block_height", queryBlock.BlockHeight, + "block_hash", queryBlock.BlockHash, + "block_timestamp", queryBlock.BlockTimestamp, ) } @@ -359,8 +360,6 @@ func (fi *Finalizer) findLastBtcFinalizedL2Block( } lastFinalizedBlockNumber, err := fi.babylonFinalityClient.QueryBlockRangeBabylonFinalized(queryBlocks) - fi.log.Debug("QueryBlockRangeBabylonFinalized", "lastFinalizedBlockNumber", lastFinalizedBlockNumber) - if err != nil { // on CriticalError, the chain will get stuck because // op-e2e/actions/l2_verifier.go will detect it and panic @@ -373,6 +372,7 @@ func (fi *Finalizer) findLastBtcFinalizedL2Block( } if lastFinalizedBlockNumber != nil { + fi.log.Debug("QueryBlockRangeBabylonFinalized", "lastFinalizedBlockNumber", *lastFinalizedBlockNumber) res := l2Blocks[*lastFinalizedBlockNumber] return &res } diff --git a/ops-bedrock/docker-compose.yml b/ops-bedrock/docker-compose.yml index 3af8bb7781ac..2f1e9775f878 100644 --- a/ops-bedrock/docker-compose.yml +++ b/ops-bedrock/docker-compose.yml @@ -12,6 +12,13 @@ volumes: da_data: op_log: +# This is added for Babylon integration deployment scripts +# TODO: Remove this once we have a better way to do this +# e.g. update this compose file with the bash script before the op devnet setup +# and revert it when op devnet down +networks: + artifacts_localnet: + external: true services: @@ -87,6 +94,9 @@ services: - "/entrypoint.sh" environment: GETH_MINER_RECOMMIT: 100ms + networks: + - default + - artifacts_localnet op-node: depends_on: @@ -141,6 +151,9 @@ services: - "${PWD}/test-jwt-secret.txt:/config/jwt-secret.txt" - "${PWD}/../.devnet/rollup.json:/rollup.json" - op_log:/op_log + networks: + - default + - artifacts_localnet op-proposer: depends_on: diff --git a/packages/contracts-bedrock/deploy-config/devnetL1-template.json b/packages/contracts-bedrock/deploy-config/devnetL1-template.json index 5f8e2ae7d9a4..a61ae83f939b 100644 --- a/packages/contracts-bedrock/deploy-config/devnetL1-template.json +++ b/packages/contracts-bedrock/deploy-config/devnetL1-template.json @@ -62,7 +62,7 @@ "faultGameWithdrawalDelay": 604800, "preimageOracleMinProposalSize": 10000, "preimageOracleChallengePeriod": 120, - "babylonFinalityGadgetRpc": "http://localhost:8080", + "babylonFinalityGadgetRpc": "finality-gadget:50051", "proofMaturityDelaySeconds": 12, "disputeGameFinalityDelaySeconds": 6, "respectedGameType": 254,