Uh oh!
There was an error while loading. Please reload this page.
fix(balances): wallet-only view when consensus infra is not deployed - #391
Conversation
After #389 stopped the staking scan from crashing balances on studio, the next consensus-dependent read surfaced: the vesting-factory lookup resolves through ConsensusMain → AddressManager, and on a network without that infrastructure deployed (studio, or a custom profile on a bare RPC) it decodes garbage — `genlayer balances` died with 'Position 32 is out of bounds ... name()' (e2e 090 scenario 2 on the studio stack). Custom networks inherit the base chain's ConsensusMain address even without a --consensus-main override, so a studio profile carries a non-null (localnet) address that simply isn't deployed on the studio RPC — a static check can't tell them apart. Probe eth_getCode(consensusMain) once up front: if empty, the consensus infra isn't deployed, so skip the whole consensus-dependent section (vesting + staking) and render the wallet balance only, with a clear note. Handles the entire missing-infra class in one capability check rather than one revert at a time. dev-env (real deployed address) is unaffected. Verified against a live studio stack: e2e 090 (both scenarios) green. 772/772 unit tests pass.
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
MuncleUscles
commented
Jul 10, 2026
/run-e2e |
Uh oh!
There was an error while loading. Please reload this page.
What
Follow-up to #389. That PR stopped the staking scan from crashing
genlayer balanceson studio; this fixes the next consensus-dependent read that then surfaced — the vesting-factory lookup (ConsensusMain → AddressManager). On a network without consensus infrastructure deployed (studio, or a custom profile on a bare RPC) that read decodes garbage and the command died with:(e2e
090_cli_network_and_balancesscenario 2, studio stack.)Fix — one capability probe for the whole class
Custom networks inherit the base chain's ConsensusMain address even without
--consensus-main, so a studio profile carries a non-null (localnet) address that simply isn't deployed on the studio RPC — a static check can't distinguish them. Probeeth_getCode(consensusMain)once up front: if empty (0x), consensus infra isn't deployed → skip the whole consensus-dependent section (vesting and staking) and render the wallet balance only, with a clear note. One check covers the entire missing-infra class instead of one revert at a time. dev-env (real deployed address) is unaffected.Verification
(a'')no-consensus degradation + reframed(a')).genlayer balancesexits 0 with wallet-only output; cucumber090both scenarios green on the studio target.Depends-On: genlayerlabs/genlayer-consensus#1179