Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
palango authored Jan 20, 2025
2 parents 19a3cec + 72f15f4 commit 65d565d
Show file tree
Hide file tree
Showing 19 changed files with 454 additions and 78 deletions.
13 changes: 6 additions & 7 deletions .github/workflows/add-docker-tag.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,12 @@ jobs:
contents: 'read'
id-token: 'write'
steps:
- id: auth-gcp-master
name: Authenticate to Google Cloud
uses: google-github-actions/auth@v2
- name: Login at GCP Artifact Registry
uses: celo-org/reusable-workflows/.github/actions/[email protected]
with:
workload_identity_provider: 'projects/1094498259535/locations/global/workloadIdentityPools/gh-celo-blockchain-add-tag/providers/github-by-repos'
service_account: '[email protected]'
access_token_lifetime: '10m'
workload-id-provider: 'projects/1094498259535/locations/global/workloadIdentityPools/gh-celo-blockchain-dev/providers/github-by-repos'
service-account: 'celo-blockchain-dev@devopsre.iam.gserviceaccount.com'
docker-gcp-registries: us-west1-docker.pkg.dev

- name: Install regctl
run: |
Expand All @@ -45,4 +44,4 @@ jobs:
- name: Use regctl to copy images (add tags)
run: |
regctl image copy {{ inputs.source-image }} {{ inputs.destination-image }}
regctl image copy ${{ inputs.source-image }} ${{ inputs.destination-image }}
8 changes: 4 additions & 4 deletions .github/workflows/build-sign-commit-images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Login at GCP Artifact Registry
uses: celo-org/reusable-workflows/.github/actions/[email protected].4
uses: celo-org/reusable-workflows/.github/actions/[email protected].5
with:
workload-id-provider: 'projects/1094498259535/locations/global/workloadIdentityPools/gh-celo-blockchain-dev/providers/github-by-repos'
service-account: '[email protected]'
docker-gcp-registries: us-west1-docker.pkg.dev
- name: Build and push container
uses: celo-org/reusable-workflows/.github/actions/[email protected].4
uses: celo-org/reusable-workflows/.github/actions/[email protected].5
with:
platforms: linux/amd64,linux/arm64
registry: us-west1-docker.pkg.dev/devopsre/dev-images/geth
Expand All @@ -40,13 +40,13 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Login at GCP Artifact Registry
uses: celo-org/reusable-workflows/.github/actions/[email protected].4
uses: celo-org/reusable-workflows/.github/actions/[email protected].5
with:
workload-id-provider: 'projects/1094498259535/locations/global/workloadIdentityPools/gh-celo-blockchain-dev/providers/github-by-repos'
service-account: '[email protected]'
docker-gcp-registries: us-west1-docker.pkg.dev
- name: Build and push container
uses: celo-org/reusable-workflows/.github/actions/[email protected].4
uses: celo-org/reusable-workflows/.github/actions/[email protected].5
with:
platforms: linux/amd64,linux/arm64
registry: us-west1-docker.pkg.dev/devopsre/dev-images/geth-all
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/build-sign-release-images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
echo "MAJOR_MINOR=${semver[0]}.${semver[1]}" >> $GITHUB_OUTPUT
build-container-geth-dev:
uses: celo-org/reusable-workflows/.github/workflows/[email protected].4
uses: celo-org/reusable-workflows/.github/workflows/[email protected].5
if: startsWith(github.ref, 'refs/heads/release')
needs:
- replace-branch-name
Expand All @@ -68,7 +68,7 @@ jobs:
trivy: true

build-container-geth-all-dev:
uses: celo-org/reusable-workflows/.github/workflows/[email protected].4
uses: celo-org/reusable-workflows/.github/workflows/[email protected].5
if: startsWith(github.ref, 'refs/heads/release')
needs:
- replace-branch-name
Expand All @@ -83,7 +83,7 @@ jobs:
trivy: true

build-container-geth-devopsre:
uses: celo-org/reusable-workflows/.github/workflows/[email protected].4
uses: celo-org/reusable-workflows/.github/workflows/[email protected].5
if: startsWith(github.ref, 'refs/tags/v') && false
needs:
- replace-tag-v
Expand All @@ -98,7 +98,7 @@ jobs:
trivy: true

build-container-geth-all-devopsre:
uses: celo-org/reusable-workflows/.github/workflows/[email protected].4
uses: celo-org/reusable-workflows/.github/workflows/[email protected].5
if: startsWith(github.ref, 'refs/tags/v') && false
needs:
- replace-tag-v
Expand All @@ -113,7 +113,7 @@ jobs:
trivy: true

build-container-geth-celo-org:
uses: celo-org/reusable-workflows/.github/workflows/[email protected].4
uses: celo-org/reusable-workflows/.github/workflows/[email protected].5
if: startsWith(github.ref, 'refs/tags/v')
needs:
- replace-tag-v
Expand All @@ -128,7 +128,7 @@ jobs:
trivy: true

build-container-geth-all-celo-org:
uses: celo-org/reusable-workflows/.github/workflows/[email protected].4
uses: celo-org/reusable-workflows/.github/workflows/[email protected].5
if: startsWith(github.ref, 'refs/tags/v')
needs:
- replace-tag-v
Expand Down
2 changes: 1 addition & 1 deletion cmd/devp2p/nodesetcmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ func parseFilterLimit(args []string) (int, error) {
return limit, nil
}

// andFilter parses node filters in args and and returns a single filter that requires all
// andFilter parses node filters in args and returns a single filter that requires all
// of them to match.
func andFilter(args []string) (nodeFilter, error) {
checks, err := parseFilters(args)
Expand Down
1 change: 1 addition & 0 deletions cmd/geth/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ var (
utils.USBFlag,
// utils.SmartCardDaemonPathFlag,
utils.OverrideHForkFlag,
utils.L2MigrationBlockFlag,
utils.TxPoolLocalsFlag,
utils.TxPoolNoLocalsFlag,
utils.TxPoolJournalFlag,
Expand Down
8 changes: 8 additions & 0 deletions cmd/utils/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,11 @@ var (
Usage: "Manually specify the hfork block, overriding the bundled setting",
}

L2MigrationBlockFlag = cli.Uint64Flag{
Name: "l2migrationblock",
Usage: "Block number at which to halt the network for Celo L2 migration. This is the first block of Celo as an L2, and one after the last block of Celo as an L1. If unset or set to 0, no halt will occur.",
}

BloomFilterSizeFlag = cli.Uint64Flag{
Name: "bloomfilter.size",
Usage: "Megabytes of memory allocated to bloom-filter for pruning",
Expand Down Expand Up @@ -1723,6 +1728,9 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) {
log.Debug("Sanitizing Go's GC trigger", "percent", int(gogc))
godebug.SetGCPercent(int(gogc))

if ctx.GlobalIsSet(L2MigrationBlockFlag.Name) {
cfg.L2MigrationBlock = new(big.Int).SetUint64(ctx.GlobalUint64(L2MigrationBlockFlag.Name))
}
if ctx.GlobalIsSet(SyncModeFlag.Name) {
cfg.SyncMode = *GlobalTextMarshaler(ctx, SyncModeFlag.Name).(*downloader.SyncMode)
}
Expand Down
4 changes: 4 additions & 0 deletions consensus/istanbul/backend/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,10 @@ func (sb *Backend) verifyHeader(chain consensus.ChainHeaderReader, header *types
if header.Number == nil {
return errUnknownBlock
}
if chain.Config().IsL2Migration(header.Number) {
sb.logger.Trace("Reject block after L2 migration", "num", header.Number)
return fmt.Errorf("Block number %d is after the L2 migration.", header.Number)
}

// If the full chain isn't available (as on mobile devices), don't reject future blocks
// This is due to potential clock skew
Expand Down
2 changes: 2 additions & 0 deletions consensus/istanbul/core/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ func (c *core) Start() error {
return err
}

c.currentMu.Lock()
c.current = roundState
c.currentMu.Unlock()
c.roundChangeSetV2 = newRoundChangeSetV2(c.current.ValidatorSet())

// Reset the Round Change timer for the current round to timeout.
Expand Down
4 changes: 4 additions & 0 deletions core/forkid/forkid.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,10 @@ func gatherForks(config *params.ChainConfig) []uint64 {
if !strings.HasSuffix(field.Name, "Block") {
continue
}
// Do not include L2MigrationBlock in forkid as doing so will prevent syncing with nodes that have not set the L2MigrationBlock flag
if field.Name == "L2MigrationBlock" {
continue
}
if field.Type != reflect.TypeOf(new(big.Int)) {
continue
}
Expand Down
4 changes: 2 additions & 2 deletions e2e_test/e2e_bench_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func BenchmarkNet100EmptyBlocks(b *testing.B) {
for i := 0; i < b.N; i++ {
ac := test.AccountConfig(n, 0)
gingerbreadBlock := common.Big0
gc, ec, err := test.BuildConfig(ac, gingerbreadBlock)
gc, ec, err := test.BuildConfig(ac, gingerbreadBlock, nil)
require.NoError(b, err)
network, shutdown, err := test.NewNetwork(ac, gc, ec)
require.NoError(b, err)
Expand All @@ -45,7 +45,7 @@ func BenchmarkNet1000Txs(b *testing.B) {

ac := test.AccountConfig(n, n)
gingerbreadBlock := common.Big0
gc, ec, err := test.BuildConfig(ac, gingerbreadBlock)
gc, ec, err := test.BuildConfig(ac, gingerbreadBlock, nil)
require.NoError(b, err)
accounts := test.Accounts(ac.DeveloperAccounts(), gc.ChainConfig())
network, shutdown, err := test.NewNetwork(ac, gc, ec)
Expand Down
Loading

0 comments on commit 65d565d

Please sign in to comment.