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

Merge branch 'develop' into clabby/e2e/actions-ci

parents 43f92b9d db23be2f
......@@ -109,11 +109,11 @@ jobs:
registry:
description: Docker registry
type: string
default: "us-central1-docker.pkg.dev"
default: "us-docker.pkg.dev"
repo:
description: Docker repo
type: string
default: "bedrock-goerli-development/images"
default: "oplabs-tools-artifacts/images"
machine:
image: ubuntu-2204:2022.07.1
resource_class: xlarge
......@@ -157,11 +157,11 @@ jobs:
registry:
description: Docker registry
type: string
default: "us-central1-docker.pkg.dev"
default: "us-docker.pkg.dev"
repo:
description: Docker repo
type: string
default: "bedrock-goerli-development/images"
default: "oplabs-tools-artifacts/images"
machine:
image: ubuntu-2204:2022.07.1
resource_class: xlarge
......@@ -194,11 +194,11 @@ jobs:
registry:
description: Docker registry
type: string
default: "us-central1-docker.pkg.dev"
default: "us-docker.pkg.dev"
repo:
description: Docker repo
type: string
default: "bedrock-goerli-development/images"
default: "oplabs-tools-artifacts/images"
docker:
- image: cimg/python:3.7
resource_class: small
......@@ -991,7 +991,7 @@ workflows:
docker_name: op-node
docker_tags: <<pipeline.git.revision>>,<<pipeline.git.branch>>
context:
- gcr
- oplabs-gcr
requires:
- op-node-docker-build
- docker-build:
......@@ -1005,7 +1005,7 @@ workflows:
docker_name: op-batcher
docker_tags: <<pipeline.git.revision>>,<<pipeline.git.branch>>
context:
- gcr
- oplabs-gcr
requires:
- op-batcher-docker-build
- docker-build:
......@@ -1019,7 +1019,7 @@ workflows:
docker_name: op-proposer
docker_tags: <<pipeline.git.revision>>,<<pipeline.git.branch>>
context:
- gcr
- oplabs-gcr
requires:
- op-proposer-docker-build
- docker-build:
......@@ -1033,7 +1033,7 @@ workflows:
docker_name: op-heartbeat
docker_tags: <<pipeline.git.revision>>,<<pipeline.git.branch>>
context:
- gcr
- oplabs-gcr
requires:
- op-heartbeat-docker-build
- hive-test:
......@@ -1064,6 +1064,11 @@ workflows:
jobs:
- docker-build:
name: op-node-docker-build
filters:
tags:
only: /^op-[a-z0-9\-]*\/v.*/
branches:
ignore: /.*/
docker_file: op-node/Dockerfile
docker_name: op-node
docker_tags: <<pipeline.git.revision>>,<<pipeline.git.branch>>
......@@ -1073,11 +1078,16 @@ workflows:
docker_name: op-node
docker_tags: <<pipeline.git.revision>>,<<pipeline.git.branch>>
context:
- gcr
- oplabs-gcr
requires:
- op-node-docker-build
- docker-build:
name: op-batcher-docker-build
filters:
tags:
only: /^op-[a-z0-9\-]*\/v.*/
branches:
ignore: /.*/
docker_file: op-batcher/Dockerfile
docker_name: op-batcher
docker_tags: <<pipeline.git.revision>>,<<pipeline.git.branch>>
......@@ -1087,11 +1097,16 @@ workflows:
docker_name: op-batcher
docker_tags: <<pipeline.git.revision>>,<<pipeline.git.branch>>
context:
- gcr
- oplabs-gcr
requires:
- op-batcher-docker-build
- docker-build:
name: op-proposer-docker-build
filters:
tags:
only: /^op-[a-z0-9\-]*\/v.*/
branches:
ignore: /.*/
docker_file: op-proposer/Dockerfile
docker_name: op-proposer
docker_tags: <<pipeline.git.revision>>,<<pipeline.git.branch>>
......@@ -1101,11 +1116,16 @@ workflows:
docker_name: op-proposer
docker_tags: <<pipeline.git.revision>>,<<pipeline.git.branch>>
context:
- gcr
- oplabs-gcr
requires:
- op-proposer-docker-build
- docker-build:
name: op-migrate-docker-build
filters:
tags:
only: /^op-[a-z0-9\-]*\/v.*/
branches:
ignore: /.*/
docker_file: op-chain-ops/Dockerfile
docker_name: op-migrate
docker_tags: <<pipeline.git.revision>>,<<pipeline.git.branch>>
......@@ -1115,7 +1135,7 @@ workflows:
docker_name: op-migrate
docker_tags: <<pipeline.git.revision>>,<<pipeline.git.branch>>
context:
- gcr
- oplabs-gcr
requires:
- op-migrate-docker-build
- docker-tag-op-stack-release:
......@@ -1130,4 +1150,4 @@ workflows:
- op-proposer-docker-publish
- op-batcher-docker-publish
context:
- gcr-release
- oplabs-gcr-release
......@@ -51,8 +51,8 @@ func PostCheckMigratedDB(ldb ethdb.Database, migrationData migration.MigrationDa
header := rawdb.ReadHeader(ldb, hash, *num)
log.Info("Read header from database", "number", *num)
if !bytes.Equal(header.Extra, bedrockTransitionBlockExtraData) {
return fmt.Errorf("expected extra data to be %x, but got %x", bedrockTransitionBlockExtraData, header.Extra)
if !bytes.Equal(header.Extra, BedrockTransitionBlockExtraData) {
return fmt.Errorf("expected extra data to be %x, but got %x", BedrockTransitionBlockExtraData, header.Extra)
}
prevHeader := rawdb.ReadHeader(ldb, header.ParentHash, *num-1)
......
......@@ -20,8 +20,11 @@ import (
)
var (
abiTrue = common.Hash{31: 0x01}
bedrockTransitionBlockExtraData = []byte("BEDROCK")
abiTrue = common.Hash{31: 0x01}
// BedrockTransitionBlockExtraData represents the extradata
// set in the very first bedrock block. This value must be
// less than 32 bytes long or it will create an invalid block.
BedrockTransitionBlockExtraData = []byte("BEDROCK")
)
type MigrationResult struct {
......@@ -42,7 +45,7 @@ func MigrateDB(ldb ethdb.Database, config *DeployConfig, l1Block *types.Block, m
header := rawdb.ReadHeader(ldb, hash, *num)
log.Info("Read header from database", "number", *num)
if bytes.Equal(header.Extra, bedrockTransitionBlockExtraData) {
if bytes.Equal(header.Extra, BedrockTransitionBlockExtraData) {
log.Info("Detected migration already happened", "root", header.Root, "blockhash", header.Hash())
return &MigrationResult{
......@@ -143,6 +146,11 @@ func MigrateDB(ldb ethdb.Database, config *DeployConfig, l1Block *types.Block, m
// Set the amount of gas used so that EIP 1559 starts off stable
gasUsed := (uint64)(config.L2GenesisBlockGasLimit) * config.EIP1559Elasticity
// Ensure that the extradata is valid
if size := len(BedrockTransitionBlockExtraData); size > 32 {
return nil, fmt.Errorf("transition block extradata too long: %d", size)
}
// Create the bedrock transition block
bedrockHeader := &types.Header{
ParentHash: header.Hash(),
......@@ -157,7 +165,7 @@ func MigrateDB(ldb ethdb.Database, config *DeployConfig, l1Block *types.Block, m
GasLimit: (uint64)(config.L2GenesisBlockGasLimit),
GasUsed: gasUsed,
Time: uint64(config.L2OutputOracleStartingTimestamp),
Extra: bedrockTransitionBlockExtraData,
Extra: BedrockTransitionBlockExtraData,
MixDigest: common.Hash{},
Nonce: types.BlockNonce{},
BaseFee: big.NewInt(params.InitialBaseFee),
......
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