Skip to content

fix: qualify Bradbury Phase 2 contracts and RPC identity - #236

Merged
dohernandez merged 5 commits into
v2-devfrom
fix/bradbury-phase-2-v2
Oct 19, 2026
Merged

dohernandez merged 5 commits into
v2-devfrom
fix/bradbury-phase-2-v2

Conversation

@jmlago

@jmlago jmlago commented Oct 19, 2026 •

Copy link
Copy Markdown
Member

Bradbury Phase 2 reuses chain ID 4221 but deploys a new contract set. This points the testnetBradbury preset at the Phase 2 contracts and the public chain RPC/explorer domains.

Changes

  • testnetBradbury: Phase 2 addresses, refreshed ConsensusMain/ConsensusData ABIs (explorer-verified implementations), RPC https://rpc.testnet-chain.genlayer.com, explorer https://scan.testnet-chain.genlayer.com. Appeals.canAppeal gains its _expectedDecisionId argument (the SDK already calls it that way via its train ABI).
  • createClient: an endpoint override now copies the chain instead of mutating the shared exported preset, so createClient({chain: testnetBradbury, endpoint}) can target another endpoint (e.g. the assigned Conduit RPC) without changing defaults for other clients.
  • RPC rate limiting: the Phase 2 public RPC answers HTTP 429 once a burst passes ~5 concurrent calls, which made getEpochInfo/getValidatorInfo fail on most runs. Reads are retried up to 3 times (honouring Retry-After); writes are never retried, so nothing is broadcast twice (fix(client): disable viem transport retries (retryCount=0) to avoid d… #110).
  • check:chains: Phase 2 is not in genlayer-networks yet, so the Bradbury entry reads a pinned copy of genlayer-consensus deployments/bradbury-phase-2.json (scripts/deployments/) and the explorer-verified implementation ABIs. Point it back at genlayer-networks once Phase 2 is published there.

Addresses, AddressManager registry entries and the genesis hash were checked against the live RPC on 2026-10-19.

Scoped out (d9ce1bc)

An earlier revision also added a network-identity guard in the transport and a check:bradbury script. They were removed to keep this PR to the chain preset:

  • The identity guard added ~15 RPC calls on first use and before every broadcast, and failed every CLI custom network built on testnet-bradbury (genlayer network add … --base testnet-bradbury), because those inherit the genesis pin and contract snapshot. The SDK already resolves AddressManager on chain from ConsensusMain.

Validation

npm run build, vitest --typecheck (206 tests), ESLint on changed files, npm run check:chains (no drift), and repeated getEpochInfo against the public RPC (5/5 succeed; 2 of 3 failed without the retry). This change does not declare a published CLI or node release ready.

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 4dd297c7-0c61-4578-ad93-328f0f75eaa9

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@jmlago

jmlago commented Oct 19, 2026

Copy link
Copy Markdown
Member Author

/run-e2e all

@ci-core-e2e-runner

Copy link
Copy Markdown
Contributor

E2E status was updated. Follow the current E2E and merge checks on this PR. Detailed diagnostics are available internally.

Keep what Phase 2 needs and follow the existing chain-preset pattern:

- testnetBradbury: Phase 2 addresses, refreshed ConsensusMain/ConsensusData
  ABIs and the new RPC/explorer URLs. ABIs keep the file's existing key order
  and narrow-ABI style; Appeals.canAppeal gains its decision-id argument.
- createClient: an endpoint override copies the chain instead of mutating the
  shared preset.
- check:chains: Bradbury reads a pinned copy of genlayer-consensus
  deployments/bradbury-phase-2.json and the explorer-verified ABIs through a
  CHAINS entry, instead of name checks in the loop.

Removed:
- genesisHash/addressManager chain fields and the identity check in the
  transport. It added ~15 RPC calls on first use and before every broadcast,
  and failed every CLI custom network based on testnet-bradbury. The SDK
  already resolves AddressManager on chain from ConsensusMain.
- the 429 retry loop in the transport. Unrelated to Phase 2 and it partly
  reverses #110; it belongs in its own PR if wanted.
- check:bradbury script, its node:test checks (not run anywhere) and the
  README section that described the removed behavior.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dohernandez

Copy link
Copy Markdown
Member

@jmlago I pushed d9ce1bc on top of your commits to keep this PR to the Bradbury Phase 2 chain preset (details in the updated description). Kept: Phase 2 addresses/ABIs/URLs, the endpoint-override copy fix, and the drift check (now a CHAINS entry over a pinned copy of genlayer-consensus deployments/bradbury-phase-2.json). Removed: the transport identity guard (≈15 extra RPC calls per first use and per broadcast, and it fails CLI custom networks based on testnet-bradbury), the 429 retry loop (separate concern, partly reverses #110), and check:bradbury. Could you take a look? If you want the retry or identity check, happy to review them as separate PRs.

@dohernandez

Copy link
Copy Markdown
Member

/run-e2e all

@ci-core-e2e-runner

Copy link
Copy Markdown
Contributor

E2E status was updated. Follow the current E2E and merge checks on this PR. Detailed diagnostics are available internally.

The Bradbury Phase 2 public RPC answers HTTP 429 once a burst passes about
five concurrent calls, so getEpochInfo and getValidatorInfo failed on most
runs. Retry reads up to three times, honouring Retry-After. Writes are never
retried, so a transaction cannot be broadcast twice (#110).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dohernandez
dohernandez merged commit b629021 into v2-dev Oct 19, 2026
10 of 11 checks passed
dohernandez added a commit to genlayerlabs/genlayer-cli that referenced this pull request Oct 19, 2026
Pin the merge commit of genlayerlabs/genlayer-js#236 on v2-dev (b629021, tree identical to its reviewed head 7ce4330), matching how earlier pins track v2-dev merge commits. Restores the lockfile integrity hash.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jmlago added a commit to genlayerlabs/genlayer-cli that referenced this pull request Oct 19, 2026
* fix: bundle Bradbury Phase 2 SDK and isolate validator configuration

* fix: validate registry configuration and keep Windows tests portable

* fix(staking): replace removed ValidatorInfo.live with hasUnclaimedRewards

genlayer-js 2.0.0-rc.1 drops ValidatorInfo.live (no alias; see its consumer-migration-v06 note). esbuild does not type-check and tests mock the SDK, so the build stayed green while validator-info printed 'live: undefined' and every primed, non-active validator showed 'inactive'. Surface the raw hasUnclaimedRewards flag instead and derive 'pending' from a self-stake deposit that is still activating.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(network): don't inherit base deployment identity in custom profiles

The Phase 2 SDK checks genesisHash and AddressManager before every request. Custom profiles cloned them from the base chain, so any profile overriding contracts or the chain ID failed every call. Like the block explorer, drop them for such profiles; an --rpc-only profile (another provider for the same deployment) keeps the check.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(staking): point the epoch-0 note at validator-info

Name the concrete command to check activation and document the satisfied-minimum branch in assertOrWarnSelfStakeMinimum.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* revert: move GENLAYER_CONFIG_DIR out of the Phase 2 PR

Unrelated to Bradbury Phase 2 qualification and not used by docs, skills, node or e2e. It also isn't fully isolated: unlocked keys are cached in the OS keychain by account name only. Recoverable from da816a8 for a separate PR.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* revert(network): drop custom-profile identity handling

genlayer-js#236 removed the transport identity guard (genesisHash/addressManager) before merging, so custom profiles have nothing to drop. Reverts e93b0e5.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(deps): pin genlayer-js to the merged Bradbury Phase 2 SDK

Pin the merge commit of genlayerlabs/genlayer-js#236 on v2-dev (b629021, tree identical to its reviewed head 7ce4330), matching how earlier pins track v2-dev merge commits. Restores the lockfile integrity hash.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Darien Hernandez <dohernandez@gmail.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants