Skip to content

Commit

Permalink
Fix: updates for integration deployment scripts (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
lesterli authored Aug 21, 2024
1 parent 48cc6f2 commit ff9df0a
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 11 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down
14 changes: 7 additions & 7 deletions op-node/rollup/finality/finalizer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
}

Expand All @@ -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
Expand All @@ -373,6 +372,7 @@ func (fi *Finalizer) findLastBtcFinalizedL2Block(
}

if lastFinalizedBlockNumber != nil {
fi.log.Debug("QueryBlockRangeBabylonFinalized", "lastFinalizedBlockNumber", *lastFinalizedBlockNumber)
res := l2Blocks[*lastFinalizedBlockNumber]
return &res
}
Expand Down
13 changes: 13 additions & 0 deletions ops-bedrock/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down Expand Up @@ -87,6 +94,9 @@ services:
- "/entrypoint.sh"
environment:
GETH_MINER_RECOMMIT: 100ms
networks:
- default
- artifacts_localnet

op-node:
depends_on:
Expand Down Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"faultGameWithdrawalDelay": 604800,
"preimageOracleMinProposalSize": 10000,
"preimageOracleChallengePeriod": 120,
"babylonFinalityGadgetRpc": "http://localhost:8080",
"babylonFinalityGadgetRpc": "finality-gadget:50051",
"proofMaturityDelaySeconds": 12,
"disputeGameFinalityDelaySeconds": 6,
"respectedGameType": 254,
Expand Down

0 comments on commit ff9df0a

Please sign in to comment.