Skip to content

Conversation

@TucksonDev
Copy link
Contributor

This PR adds a new configuration parameter dataCostEstimate that allows to pass an estimation of the data cost (i.e., the base fee of the parent chain) to be included in the rollup initialization message, as an alternative to fetch the base fee on-chain.

This allows the initialization message to be fully deterministic, since one of its components is the current on-chain base fee.

@TucksonDev TucksonDev marked this pull request as ready for review October 23, 2025 16:04
@OffchainLabs OffchainLabs deleted a comment from sherlock-ai-beta bot Oct 28, 2025
@OffchainLabs OffchainLabs deleted a comment from sherlock-ai-beta bot Oct 31, 2025
@gzeoneth gzeoneth requested review from Copilot and gzeoneth November 5, 2025 07:02
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces a new optional dataCostEstimate configuration parameter that allows specifying a parent chain base fee estimate during rollup initialization, making the initialization message deterministic by avoiding on-chain base fee queries when this parameter is provided.

Key Changes:

  • Added dataCostEstimate field to the Config struct
  • Modified rollupInitialized function to accept and use the estimate when non-zero
  • Updated all test files and configuration examples to include the new parameter

Reviewed Changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/rollup/Config.sol Added dataCostEstimate field to Config struct
src/rollup/IRollupEventInbox.sol Updated interface to include l1BaseFeeEstimate parameter
src/rollup/AbsRollupEventInbox.sol Implemented logic to use estimate when provided, otherwise fetch on-chain
src/rollup/RollupAdminLogic.sol Passed dataCostEstimate to rollup initialization
src/rollup/BOLDUpgradeAction.sol Added dataCostEstimate: 0 to config
src/mocks/MockRollupEventInbox.sol Implemented same estimate logic in mock
test/foundry/RollupEventInbox.t.sol Updated test calls to include new parameter
test/foundry/ERC20RollupEventInbox.t.sol Updated test calls to include new parameter
test/foundry/RollupCreator.t.sol Added dataCostEstimate: 0 to test configs
test/Rollup.t.sol Added dataCostEstimate: 0 to test configs
test/stakingPool/AssertionStakingPool.t.sol Added dataCostEstimate: 0 to test config
test/e2e/orbitChain.ts Added dataCostEstimate to TypeScript config
scripts/rollupCreation.ts Added dataCostEstimate to dev config
scripts/config.example.ts Added dataCostEstimate to example config
test/signatures/RollupCreator Updated function signature hash (formatting change)
test/signatures/RollupAdminLogic Updated function signature hash (formatting change)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +59 to +63
if (dataCostEstimate != 0) {
currentDataCost = dataCostEstimate;
} else {
currentDataCost = _currentDataCostToReport();
}
Copy link

Copilot AI Nov 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The condition dataCostEstimate != 0 treats zero as a signal to fetch on-chain data, but zero is also a valid base fee estimate. Consider using a different mechanism (e.g., Optional/nullable parameter or separate boolean flag) to distinguish between 'use estimate' vs 'fetch on-chain' to avoid ambiguity when the actual estimate is zero.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants