feat(op-acceptor): add --shard-index/--shard-total for parallel gateless sharding#566
Open
smartcontracts wants to merge 1 commit intomainfrom
Open
feat(op-acceptor): add --shard-index/--shard-total for parallel gateless sharding#566smartcontracts wants to merge 1 commit intomainfrom
smartcontracts wants to merge 1 commit intomainfrom
Conversation
…ess test execution Adds round-robin sharding to gateless mode so CI can split test packages across N workers without maintaining manual gate lists. After test package discovery, packages are sorted alphabetically for determinism, then filtered by `index % total == shardIndex`. New packages are automatically picked up; removed packages disappear — no manual curation needed. Flags: --shard-index Zero-based shard index (default: -1, disabled) --shard-total Total number of shards (default: 0, disabled) Env vars: OP_ACCEPTOR_SHARD_INDEX, OP_ACCEPTOR_SHARD_TOTAL Validation: - Both must be set together - Index must be in [0, total) - Only works in gateless mode (errors with --gate) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #566 +/- ##
==========================================
- Coverage 57.82% 57.79% -0.03%
==========================================
Files 96 96
Lines 14477 14508 +31
==========================================
+ Hits 8371 8385 +14
- Misses 5591 5608 +17
Partials 515 515
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Contributor
|
We have a very similar PR as WIP here: #553 And the discussion which lead to it here: Did you happen to see/consider any of this beforehand? I am wondering if we can streamline our efforts. |
smartcontracts
added a commit
to ethereum-optimism/optimism
that referenced
this pull request
Mar 9, 2026
Emulates the naive sharding approach from ethereum-optimism/infra#566: all 46 acceptance test packages sorted alphabetically and distributed round-robin (i % 8) across 8 shards. Same packages, same CI structure, just different assignment — compare wall-clock time against #19423's curated shards to measure the cost of naive vs domain-aware splitting. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
smartcontracts
added a commit
to ethereum-optimism/optimism
that referenced
this pull request
Mar 9, 2026
Replaces curated ci-shard gates with an exact emulation of the naive sharding from ethereum-optimism/infra#566: 1. Discover all 68 test packages on disk (loadGatelessValidators) 2. sort.Strings (Go lexicographic) 3. i % 8 == shardIndex (round-robin) 4. --exclude-gates flake-shake (post-shard, removes 4 packages) Result: 64 packages across 8 shards (7-9 per shard). This includes fault-proof tests, external-network tests, and everything else that the curated shards in #19423 intentionally excluded. The naive approach has no awareness of test weight or prerequisites. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
--shard-indexand--shard-totalflags to op-acceptor for round-robin test package sharding in gateless modeindex % total == shardIndexMotivation
The Optimism monorepo's
memory-allCI job runs ~40 acceptance test packages in a single worker, which is the critical path bottleneck. With this change, CI can parallelize into N shards:op-acceptor \ --testdir ./op-acceptance-tests/... \ --shard-index $SHARD --shard-total 8 \ --exclude-gates flake-shake \ --allow-skips --timeout 120m \ --orchestrator sysgoThis eliminates the need for manually maintained
ci-shard-*gates inacceptance-tests.yamland orphan detection scripts.Changes
flags/flags.go--shard-index(default -1) and--shard-total(default 0) flags with env varsconfig.go[0, total), gateless-onlynat.goregistry/registry.goi % total == indexfilter inloadGatelessValidators()registry/registry_test.goTest plan
TestShardFiltering_Basic— 8 packages / 4 shards = 2 eachTestShardFiltering_Coverage— union of all shards == full package setTestShardFiltering_Deterministic— same shard twice = same resultTestShardFiltering_NoOverlap— no package in multiple shardsTestShardFiltering_MoreShardsThanPackages— empty shards handledTestShardFiltering_SinglePackage— 1 package / 2 shardsTestShardFiltering_Disabled— default values = no shardinggo vetclean on all changed packages🤖 Generated with Claude Code