refactor(cli): migrate releasecelo, validator, validatorgroup to viem [8/8]#773
Closed
pahor167 wants to merge 4 commits into
Closed
refactor(cli): migrate releasecelo, validator, validatorgroup to viem [8/8]#773pahor167 wants to merge 4 commits into
pahor167 wants to merge 4 commits into
Conversation
β¦s to viem Replace web3-based transaction patterns with viem equivalents across releasecelo/, validator/, and validatorgroup/ CLI commands and their tests.
|
Contributor
size-limit report π¦
|
Codecov Reportβ
All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## pahor/viem-D4-cli-commands-2 #773 +/- ##
===============================================================
Coverage ? 66.69%
===============================================================
Files ? 167
Lines ? 8200
Branches ? 1369
===============================================================
Hits ? 5469
Misses ? 2660
Partials ? 71
π New features to boost your workflow:
|
added 3 commits
April 1, 2026 12:04
β¦shot - SimpleHttpProvider.request: add replacer to JSON.stringify that converts bigint to hex string, fixing "Do not know how to serialize a BigInt" when viem passes bigint blockNumber params via the provider - election/activate.test.ts: update inline snapshots to reflect correct sequential tx log order (finishNextEpoch txHash arrives before activate starts)
- Remove extra trailing txHash entry from two activate --wait snapshots (displayViemTx only emits one txHash per call, not two) - Increase reorders member beforeEach/test timeouts from 30s to 60s - Add 60s timeout to epoch block information tests (viem adds pre-flight gas estimation making each write ~50% more RPC calls than web3)
5 tasks
pahor167
added a commit
that referenced
this pull request
Jun 15, 2026
β¦es (#780) ## Summary Combined branch containing the full web3 β viem migration (the union of the stacked PRs #766β#773) plus 24 commits of review fixes from a deep multi-agent audit of the cumulative diff (~350 files). ### Migration (from the original stack) - `@celo/connect`, `@celo/utils`: web3 replaced with viem-native primitives (#766) - `@celo/contractkit`: viem-native contract interaction across all wrappers (#767) - `@celo/explorer`, `@celo/governance`, wallets, dev-utils (#768) - `@celo/celocli`: all command groups migrated (#769β#773) ### Review fixes on top (highlights, 38 findings fixed) Funds/correctness critical: - wallet-base: tx quantities above 2^53 were silently truncated when hex-encoding (`1 CELO + 1 wei` signed as exactly 1 CELO); now BigInt-backed with a regression test - connect: `defaultFeeCurrency` was silently ignored for every `contract.write`; dynamic chain now carries the Celo serializers/formatters so CIP-64 serializes correctly - contractkit: IPC provider hung forever (parsed only on socket `end`); ws:// / wss:// node URLs fell through to the HTTP provider; HTTP error statuses resolved `undefined` - contractkit: `setAccount` without proof-of-possession always threw (`'0x0'` as bytes32); `Attestations.getPendingWithdrawals` parameter order restored to match the contract - cli: `releasecelo:admin-revoke` lost the `{from: voteSigner}` override β revokes reverted with an authorized vote signer - connect: fee-math radix bug inflated `maxFeePerGas` for string inputs High: - tuple-blind ABI signatures produced wrong selectors/topic hashes (ABI enrichment, `methodIds`, log-explorer event matching) - `BaseWrapper.getPastEvents` swallowed RPC errors as "no events"; unknown event names now throw (web3 parity) - Election historical `blockNumber` queries were silently ignored (voter rewards at past epochs) - governance CLI commands no longer displayed on-chain event confirmations (ProposalExecuted / HotfixExecuted / HotfixApproved / Deposit) β restored, including the silently-dropped test snapshots - `isValidChecksumAddress` accepted all-lowercase addresses; sourcify proxy implementation address checksummed again - BigInt-safe JSON-RPC serialization in production providers Plus test-semantics restorations (weakened assertions, mocked-method-under-test), test-infra robustness (receipt waits, strict `evm_revert`), changeset corrections (contractkit correctly marked major with full breaking-change list), and documentation of behavior changes. Full audit trail (62 findings: 38 fixed, 12 refuted with evidence, the rest classified pre-existing/wontfix) lives in `.omc/ralph/pr-review-progress.md` on the working machine; findings are also traceable through the individual commit messages. ## Test plan - [x] Full workspace build green (all 23 packages) - [x] Full test suite: all packages green locally except known env-flaky timeouts under full parallel load (actions/keystores) and a pre-existing `election:activate --wait` snapshot-order flake that reproduces on the unmodified stack HEAD - [x] Anvil-backed suites green: contractkit 258/258, celocli 337 passed - [x] Live smoke tests: IPC provider against `anvil --ipc`, WebSocket provider against `wss://forno.celo.org/ws` - [ ] CI green on this PR --------- Co-authored-by: Pavel Hornak <pavel.hornak@clabs.co> Co-authored-by: Paul Lange <palango@gmx.de>
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.
Stack
Changes
Replace web3-based transaction patterns with viem equivalents across
releasecelo/,validator/, andvalidatorgroup/CLI commands and their tests.This is the final PR in the stack β CI must pass here before merging any of the chain.
PR-Codex overview
This PR focuses on refactoring the codebase to replace instances of
displaySendTxwithdisplayViemTx, updating the transaction handling mechanism to use a new client. It also modifies test cases to use a provider instead of Web3, enhancing compatibility with a new connection method.Detailed summary
displaySendTxwithdisplayViemTxin various command files.publicClient.providerinstead ofweb3.newKitFromWeb3tonewKitFromProviderin tests.