fix: use parent timestamps for activation boundaries#3697
Conversation
Amp-Thread-ID: https://ampcode.com/threads/T-019ef05c-a0ce-71fc-bde0-19cf2e7a0ef3 Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-019ef05c-a0ce-71fc-bde0-19cf2e7a0ef3 Co-authored-by: Amp <amp@ampcode.com>
| self.rollup.log_upgrade_activation( | ||
| envelope.execution_payload.block_number(), | ||
| envelope.execution_payload.timestamp(), | ||
| None, |
There was a problem hiding this comment.
The follower path passes None for parent_timestamp, falling back to the estimated is_first_X_block which is the heuristic this PR is trying to move away from. The EngineProcessor has access to the current unsafe head via self.engine.state().sync_state — its timestamp is the parent of the payload being inserted. Consider passing Some(unsafe_head_timestamp) here so the follower path also benefits from the accurate parent-aware check.
This is the same pattern used in the sequencer build path (build.rs:202-205), where Some(unsafe_head.block_info.timestamp) is correctly passed.
Amp-Thread-ID: https://ampcode.com/threads/T-019ef05c-a0ce-71fc-bde0-19cf2e7a0ef3 Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-019ef05c-a0ce-71fc-bde0-19cf2e7a0ef3 Co-authored-by: Amp <amp@ampcode.com>
| if cfg.is_first_jovian_block(self.timestamp, self.timestamp.saturating_sub(cfg.block_time)) | ||
| && !self.transactions.is_empty() |
There was a problem hiding this comment.
check_batch receives l2_safe_head whose block_info.timestamp is the actual parent timestamp, yet this line still reconstructs the parent via self.timestamp.saturating_sub(cfg.block_time) — the exact heuristic this PR is eliminating elsewhere.
Consider using the real parent timestamp:
| if cfg.is_first_jovian_block(self.timestamp, self.timestamp.saturating_sub(cfg.block_time)) | |
| && !self.transactions.is_empty() | |
| if cfg.is_first_jovian_block(self.timestamp, l2_safe_head.block_info.timestamp) |
Amp-Thread-ID: https://ampcode.com/threads/T-019ef05c-a0ce-71fc-bde0-19cf2e7a0ef3 Co-authored-by: Amp <amp@ampcode.com>
🔄 base-std fork tests: running...
|
Review SummaryThe core change — adding an explicit Findings (from prior inline comments, confirmed on re-review)1.
2. The follower path calls What looks good
|
Uses actual parent timestamps for first-block upgrade checks in the sequencing and protocol paths so activation boundaries no longer rely on reconstructing a parent with child_timestamp - block_time. It also renames the timestamp-to-block helper to make its lower-bound semantics explicit when multiple blocks can share the same second.