Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(protocol): Fix bug in getProposedBlock #11679

Merged
merged 7 commits into from
Jan 10, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion packages/protocol/contracts/L1/TaikoL1.sol
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,8 @@ contract TaikoL1 is EssentialContract, IHeaderSync, TaikoEvents {
function getProposedBlock(
uint256 id
) public view returns (TaikoData.ProposedBlock memory) {
return state.getProposedBlock(getConfig().maxNumBlocks, id);
return
LibProposing.getProposedBlock(state, getConfig().maxNumBlocks, id);
}

function getSyncedHeader(
Expand Down
9 changes: 9 additions & 0 deletions packages/protocol/contracts/L1/libs/LibProposing.sol
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,15 @@ library LibProposing {
emit BlockProposed(state.nextBlockId++, meta);
}

function getProposedBlock(
TaikoData.State storage state,
uint256 maxNumBlocks,
uint256 id
) internal view returns (TaikoData.ProposedBlock storage) {
require(id > state.latestVerifiedId && id < state.nextBlockId, "L1:id");
return LibUtils.getProposedBlock(state, maxNumBlocks, id);
davidtaikocha marked this conversation as resolved.
Show resolved Hide resolved
}

function getBlockFee(
TaikoData.State storage state,
TaikoData.Config memory config
Expand Down