feat(exit-certificate): F05 - use same targetBlock between multiples runs#1627
Conversation
…n Step 0 - Change `cfg.TargetBlock` type from `string` to `aggkittypes.BlockNumberFinality`, supporting finality keywords (latest/finalized/safe/pending), decimal/hex block numbers, and offset notation (e.g. "LatestBlock/-10"). - Resolve the concrete block number at the start of `RunStep0` via `BlockNumberFinality.BlockNumber()` using a minimal `ethClientAdapter`; result stored in `Step0Result.TargetBlock` (new field) and persisted as `step-0-l2_target_block.json`. - Remove `ResolvedTargetBlock` from `Config`; pass the resolved `uint64` as an explicit parameter to `RunStepA`, `RunStepB`, and `RunStepG`. - Single-step runners (`runSingleA/B/G`) load the block from `step-0-l2_target_block.json` via `loadTargetBlock`. - Rename intermediate file `step-0-result.json` → `step-0-l2_target_block.json`. - Update README with target-block resolution table and updated Step 0 outputs. - Add output-directory cleanup hint at end of kurtosis configuration script. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Claude finished @joanestebanr's task in 1m 53s —— View job PR Review Complete ✅Reviewed PR #1627: feat(exit-certificate): resolve targetBlock via BlockNumberFinality in Step 0 🚀 What's NewThis PR refactors target block handling in the exit certificate tool by replacing the string-based 🐛 Bug FixesNone. 📋 Config Updates// Before
"targetBlock": "12345678"
// After — still works, plus new forms:
"targetBlock": "latest" // or "finalized", "safe", "pending"
"targetBlock": "LatestBlock/-10" // latest minus 10 blocks
"targetBlock": "12345678" // decimal (unchanged)
"targetBlock": "0xBCDE34" // hex (unchanged)
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1d0983418b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if err != nil { | ||
| return aggkittypes.LatestBlock |
There was a problem hiding this comment.
Reject invalid targetBlock instead of defaulting to latest
parseTargetBlock silently falls back to LatestBlock whenever NewBlockNumberFinality returns an error, so typos or malformed values (for example "FinalizedBock" or "0xZZ") are accepted and the run proceeds against a different block than configured. This can produce incorrect LBT/balance/certificate outputs without any user-visible configuration error, which is a regression from the previous behavior that rejected invalid block values.
Useful? React with 👍 / 👎.
🔄 Changes Summary
cfg.TargetBlocktype fromstringtoaggkittypes.BlockNumberFinality, enabling finality keywords (latest,finalized,safe,pending), decimal/hex block numbers, and offset notation (e.g.LatestBlock/-10).Step0Result.TargetBlock uint64— the concrete resolved block number is now part of the Step 0 output and persisted tostep-0-l2_target_block.json.ResolvedTargetBlockfromConfig; the resolved block number is passed as an explicittargetBlock uint64parameter toRunStepA,RunStepB, andRunStepG.runSingleA/B/G) load the block fromstep-0-l2_target_block.jsonvia a newloadTargetBlockhelper.step-0-result.json→step-0-l2_target_block.json.targetBlockinparameters.jsonnow accepts finality keywords and offset notation in addition to decimal/hex block numbers. The default (empty string) resolves tolatest. Existing decimal/hex values continue to work.step-0-result.jsonrenamed tostep-0-l2_target_block.json; any tooling reading the old filename must be updated.📋 Config Updates
✅ Testing
targetBlock: "latest"and verifystep-0-l2_target_block.jsonis written with a valid block number; subsequent single-step runs for A, B, and G should pick it up automatically.🐞 Issues
🔗 Related PRs
feat/exit_certificate_f01_token_sclocked