Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into brecht-review
Browse files Browse the repository at this point in the history
# Conflicts:
#	packages/protocol/contracts/L1/libs/LibProposing.sol
  • Loading branch information
Brechtpd committed Feb 12, 2024
2 parents 817114e + e3fde54 commit 7984c2d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
1 change: 1 addition & 0 deletions packages/protocol/contracts/L1/TaikoData.sol
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ library TaikoData {

struct BlockParams {
address assignedProver;
address coinbase;
bytes32 extraData;
bytes32 blobHash;
uint24 txListByteOffset;
Expand Down
14 changes: 6 additions & 8 deletions packages/protocol/contracts/L1/libs/LibProposing.sol
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ library LibProposing {
revert L1_INVALID_PROVER();
}

if (params.coinbase == address(0)) {
params.coinbase = msg.sender;
}

// Taiko, as a Based Rollup, enables permissionless block proposals.
// However, if the "proposer" address is set to a non-zero value, we
// ensure that only that specific address has the authority to propose
Expand All @@ -104,7 +108,7 @@ library LibProposing {

// Each transaction must handle a specific quantity of L1-to-L2
// Ether deposits.
depositsProcessed = LibDepositing.processDeposits(state, config, msg.sender);
depositsProcessed = LibDepositing.processDeposits(state, config, params.coinbase);

// Initialize metadata to compute a metaHash, which forms a part of
// the block data to be stored on-chain for future integrity checks.
Expand All @@ -117,13 +121,7 @@ library LibProposing {
blobHash: 0, // to be initialized below
extraData: params.extraData,
depositsHash: keccak256(abi.encode(depositsProcessed)),
// TODO(Brecht): A bit limiting this is required to be the same address as
// msg.sender
// And fees will be collected on L2 so if a smart contract is used as the proposer
// it requires
// the same contract to be deployed on L2 at the same address owned by the same
// entity.
coinbase: msg.sender,
coinbase: params.coinbase,
id: b.numBlocks,
gasLimit: config.blockMaxGasLimit,
timestamp: uint64(block.timestamp),
Expand Down
2 changes: 1 addition & 1 deletion packages/protocol/test/L1/TaikoL1TestBase.sol
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ abstract contract TaikoL1TestBase is TaikoTest {

vm.prank(proposer, proposer);
(meta, depositsProcessed) = L1.proposeBlock{ value: msgValue }(
abi.encode(TaikoData.BlockParams(prover, 0, 0, 0, 0, false, 0, hookcalls)),
abi.encode(TaikoData.BlockParams(prover, address(0), 0, 0, 0, 0, false, 0, hookcalls)),
new bytes(txListSize)
);
}
Expand Down

0 comments on commit 7984c2d

Please sign in to comment.