fix(sozo): default account to pre-confirmed block and make it configurable via CLI#3406
Conversation
Set the migrator account's block id to PreConfirmed so nonce lookups and fee estimation both target the block the transaction will actually land in, rather than the already-mined latest block whose gas prices may be stale. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Ohayo, sensei! Let me break down this change for you. WalkthroughThe ChangesAccount Block ID Alignment
Estimated code review effort🎯 2 (Simple) | ⏱️ ~5 minutes 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. 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 |
Adds a global --account-block-id flag that lets users override the block at which the migrator account fetches its nonce and estimates fees. Defaults to 'preconfirmed' and accepts 'latest', a block number, or a block hash via dojo_utils::parse_block_id. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
PreConfirmed is the starknet-rs default; the comment now reflects that we're just being explicit rather than overriding it. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Claude finished @kariy's task —— View job Documentation analysis complete
Summary: This PR added the Documentation updated: Added a tip block in
Location: Note: The changes were made in the |
The
SingleOwnerAccountused bysozo migratewas setting its block id toLatest(changed in 67871d66), which causes starknet-rs to perform both nonce lookups and fee estimation against the most recently mined block; the resulting gas-price estimates therefore reflect that block's prices rather than the pre-confirmed block where the transaction will actually be included, so when prices move between blocks the derivedmax_*_pricecan fall below what the next block requires and the transaction gets rejected. This change flips the default block id back toPreConfirmed(the pre-0.17.0 behavior) so fee estimation and nonce lookups both target the block the transaction will actually land in, and adds a global--account-block-idflag that lets users override the default withlatest, a block number, or a block hash viadojo_utils::parse_block_idfor cases where the previous behavior is desired.