Rewrite the chain layer around account kinds, with EVM accounts (steps 16 and 17) #24
All Vouch review confidence checks passed
Residual risk 0.21 = Change Risk (0.52) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.52 · 650 lines diff across 8 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.388
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #24"
general
weight: 0.35
b3hr4d
This PR now holds steps 16 and 17 of
docs/plan-v0.md: #25 (EVM accounts) and #26 (the receive, account, members, settings and notifications pages) were merged into this branch, and it is merged withmain's recovery controller (#27). The chain code is rewritten rather than adapted.Before: an owner added an ICP account, an ICRC account per token and a Bitcoin account by hand, and an ICP account and an ICRC account with the same index were two entries for one subaccount. A transfer whose outcome the wallet could not tell waited for someone to press execute again, and a Bitcoin transaction the network dropped kept its outputs reserved for good. Nothing in the wallet could hold or send ETH.
After: every wallet starts with one Internet Computer account, one Bitcoin account and one EVM account (decision 0008).
- It retries a ledger call it could not tell every 10 minutes with the same
created_at_time.- It watches a Bitcoin transaction until it has 6 confirmations. While the transaction's inputs are unspent, it sends it again after 1 hour, then 2, and so on up to once a day.
- It watches an EVM transaction until a finalized block uses its nonce.
How (step 16, accounts and settling):
accounts.rsgives each account a kind.assets.rskeeps the tracked list:- ICP is always tracked.
- ICRC-1 ledgers are added with
track_assetonce they answer as one.- Bitcoin needs no tracking.
balanceandTransfername an asset, or take the account's default.icp_account_idshows the ICP ledger's account identifier for exchanges.initandpost_upgrade. The Bitcoin account is made by the timer once the subnet gives the wallet its key, with a growing wait between tries. None of them is in the audit log.sending.rsholds execution and settling. Watched Bitcoin transactions settle from one read of the account's outputs.- When an account holds more outputs than the wallet reads, a transaction's own change output in the list still shows the block that holds it.
- In that case the balance comes from the Bitcoin canister's total, less what each transaction not seen confirmed spends, plus its change.
storage::migrategives old accounts their kind.- An ICP account and an ICRC account with the same index become one account under the oldest id. The newer id leads to it and is no longer listed.
- The ICRC-1 ledgers they held become tracked.
- Transfers name their asset and their new account.
- Anything still unknown is queued for settling.
scripts/try-local.sh --upgradeupgrades the wallet it installed last to the checkout, in place, with the regtest network.How (step 17, EVM accounts):
wallet / evm / n), written with its EIP-55 checksum. Keccak comes fromtiny-keccak, approved in the thread.- Fees. They come from
eth_feeHistory: the higher median base fee and the lower median tip of the providers that answered. Ethereum and Sepolia tip at least 1 gwei. The fee cap is twice the base fee plus the tip, at most 50,000 gwei a gas.- Gas. It comes from
eth_estimateGas. A plain transfer uses exactly 21,000, and anything else gets half again as much. On Base and Optimism the transfer also budgets twice the L1 data and operator fee that the chain's fee oracle names.- A proposer's fixed fee. It caps all of that. A cap below the base fee plus the least tip is refused before signing. The action stays ready and holds no nonce.
- Count and balance. They are read last. The whole most the transfer may pay counts against the balance and the daily limit.
- A transaction no provider can have seen is built again by the next execution.
- If one of the account's transactions settles while a nonce is being read, the execution stops and is run again.
- A send that may have reached a provider is kept, and is only ever sent again as it is.
- The wallet looks at it less often each time: 10 minutes, doubling up to a day.
- It settles by its receipt once a finalized block used its nonce, and records what it really paid.
- A missing receipt means the wallet looks again later, never that the transaction failed.
INSTALL_CYCLESis now 350B. A 5.5 MB release installed with 330.4B cycles to spend and was refused with 329.9B. The UI, README and mainnet-gate figures say 0.35T.tests/evm_rpc_mockstands in for the EVM RPC canister and uses the deployed canister's Candid types.- It verifies signed transactions, keeps a pool, mines, finalizes, reverts, hides receipts and fails calls on demand.
- CI builds it.
- It uses
serde_json(=1.0.154), a test-only dependency that does not ship in the wallet.Docs. Only
docs/design.md, the README and the mainnet-gate figures change, where the rewrite made them false.Merged with main (#27). The Recovery card sits on the Settings page beside the rules, since #26 moved members and the policy there. The controller's tests use account kinds.
recovery-toolshows the wallet's install argument as(variant { Upgrade = null })now thatUpgradetakes the Bitcoin network, and the example indocs/recovery.mdwas regenerated. #26's QR encoder decision becomes 0010, sincemaintook 0009.Checks on the merged head:
vectors.pymatches.- the previous release upgrading with ICP and ICRC accounts at the same index;
- a Bitcoin send resent after an hour;
- a dropped Bitcoin transaction resent again and again;
- a ledger transfer the wallet finds out about by itself;
- EVM transfers that run, revert, wait for a finalized block, outlive a hidden receipt, and stop on a fee cap that is too low.
mainof the day was upgraded in place withtry-local.sh --upgrade, and its accounts, balances and open transfers read right.Known limits in v1:
To upgrade your local try-local wallet in place, pull this branch and run:
🤖 Generated with Claude Code
https://claude.ai/code/session_013Vgh2De8Zarye1iDyGSRbe