Skip to content

chore(protocol, taiko-client): general typos fix #19272

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

Merged
merged 1 commit into from
Apr 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
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
24 changes: 12 additions & 12 deletions packages/protocol/audit/code4rena-2024-03-taiko-final-report.md
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ POC for example 1. Paste the below code into the `TaikoL1LibProvingWithTiers.t`
assertLt(bobBalanceAfter, bobBalanceBefore);

console2.log("Bob Loss:", bobBalanceBefore - bobBalanceAfter);
console2.log("Bob Loss without couting livenessbond:", bobBalanceBefore - bobBalanceAfter - 1e18); // Liveness bond is 1 ETH in tests
console2.log("Bob Loss without counting livenessbond:", bobBalanceBefore - bobBalanceAfter - 1e18); // Liveness bond is 1 ETH in tests
}

```
Expand Down Expand Up @@ -669,7 +669,7 @@ Notice how the meta data is passed to this function. Part of the function of the
Notice how if the payment is in ERC20 tokens, the payee will be the variable \_meta.coinbase, and like we showed earlier, this can be set to any arbitrary address by the proposer. This can lead to a scenario as such:

1. proposer A approves the assignmentHook contract to spend a portion of their tokens, the allowance is set higher than the actual fee they will be paying.
2. proposer A proposes a block, and a fee is charged and payed to the assigned prover, but there remains allowance that the assignment hook contract can still use.
2. proposer A proposes a block, and a fee is charged and paid to the assigned prover, but there remains allowance that the assignment hook contract can still use.
3. proposer B proposes a block and sets params.coinbase as the address of proposer A.
4. proposer A address will be the payee of the fee for the assigned prover for the block proposed by proposer B.

Expand Down Expand Up @@ -1175,7 +1175,7 @@ The `bridge_watchdog` role can forge arbitrary messages and drain the bridge of

### Proof of Concept

`bridge_watchdog` can call `suspendMessasges()` to suspend and un-suspend a message
`bridge_watchdog` can call `suspendMessages()` to suspend and un-suspend a message

<https://github.com/code-423n4/2024-03-taiko/blob/f58384f44dbf4c6535264a472322322705133b11/packages/protocol/contracts/bridge/Bridge.sol#L82-L95>

Expand Down Expand Up @@ -1324,7 +1324,7 @@ _Note: For full discussion, see [here](https://github.com/code-423n4/2024-03-tai

---

## [[M-06] First block proposer check in the `LibProposing._isProposerPermitted` function is errorneous](https://github.com/code-423n4/2024-03-taiko-findings/issues/274)
## [[M-06] First block proposer check in the `LibProposing._isProposerPermitted` function is erroneous](https://github.com/code-423n4/2024-03-taiko-findings/issues/274)

_Submitted by [Shield](https://github.com/code-423n4/2024-03-taiko-findings/issues/274), also found by [monrel](https://github.com/code-423n4/2024-03-taiko-findings/issues/382) and [blockdev](https://github.com/code-423n4/2024-03-taiko-findings/issues/9)_

Expand Down Expand Up @@ -1651,7 +1651,7 @@ TaikoData.Block memory blk = TaikoData.Block({
})
```

This also generates issues for independent provers, as they may not utilize the proposed block's data to attempt to prove it and utilize the correct parentMetaHash, which will make the LibProving:proveBlock call revert with an L1_BLOCK_MISTATCH error:
This also generates issues for independent provers, as they may not utilize the proposed block's data to attempt to prove it and utilize the correct parentMetaHash, which will make the LibProving:proveBlock call revert with an L1_BLOCK_MISMATCH error:

```solidity
function proveBlock
Expand Down Expand Up @@ -1827,7 +1827,7 @@ Consider using VRF like solutions to make `_rand` truly random.

> Not the proving but the liveness (proposing) would take longer as provers would deny to grant signatures to prove blocks - which's evaluation i happening during `proposeBlock`.
>
> But at least +2 years post mainnet taiko foundation is commited to `proposeBlock` every X time intervals (even if not breaking even) to keep the liveness and get over this.
> But at least +2 years post mainnet taiko foundation is committed to `proposeBlock` every X time intervals (even if not breaking even) to keep the liveness and get over this.
>
> And as stated, by the time hopefully this minTier() will vanish in that time - hopefully even in months after launch (not years) when ZK is cheap enough. So for now we would say it is a known issue, we are aware of.

Expand Down Expand Up @@ -1952,7 +1952,7 @@ Also refer my other recommendation under the report titled: _"Incorrect calculat

> This is a valid bug report, fixing in https://github.com/taikoxyz/taiko-mono/pull/16612
>
> TimelockTokenPool.sol will not have a similar fix as the risk is very managable. Blob caching/sharing is disabled, so no fix for it as well.
> TimelockTokenPool.sol will not have a similar fix as the risk is very manageable. Blob caching/sharing is disabled, so no fix for it as well.

---

Expand Down Expand Up @@ -2246,7 +2246,7 @@ _The following wardens also submitted reports: [Shield](https://github.com/code-

[Link](https://github.com/code-423n4/2024-03-taiko/blob/f58384f44dbf4c6535264a472322322705133b11/packages/protocol/contracts/L1/TaikoToken.sol#L25)

ContextUpgradeable is not initialized in TaikoToken.sol contract. This contract is used in ERC20PermitUpgradeable which is used in ERC20VotesUpgradeable. But neither contract initializes this Context contract when the contracts themselves are intialized.
ContextUpgradeable is not initialized in TaikoToken.sol contract. This contract is used in ERC20PermitUpgradeable which is used in ERC20VotesUpgradeable. But neither contract initializes this Context contract when the contracts themselves are initialized.

In TaikoToken.sol [here](https://github.com/code-423n4/2024-03-taiko/blob/f58384f44dbf4c6535264a472322322705133b11/packages/protocol/contracts/L1/TaikoToken.sol#L25), we can see that the below \_\_Context_init() function is not called.

Expand Down Expand Up @@ -2615,12 +2615,12 @@ File: MerkleTrie.sol

## [N-04] Typo in comment in Bytes.sol

Use rather instead of rathern.
Use rather instead of rather.

```solidity
File: Bytes.sol
93: /// @notice Slices a byte array with a given starting index up to the end of the original byte
94: /// array. Returns a new array rathern than a pointer to the original.
94: /// array. Returns a new array rather than a pointer to the original.
```

## [N-05] Incorrect comment regarding gasLimit in processMessage()
Expand Down Expand Up @@ -2726,7 +2726,7 @@ File: TaikoToken.sol

## [N-12] Guardian proof that is never fully approved by minGuardians is never deleted

A guardian proof hashs is only deleted if it has been approved by min number of guardians in the approval bits. In case it is not, the approval for the hash remains and is not deleted.
A guardian proof hash is only deleted if it has been approved by min number of guardians in the approval bits. In case it is not, the approval for the hash remains and is not deleted.

```solidity
File: GuardianProver.sol
Expand Down Expand Up @@ -12959,7 +12959,7 @@ Overall, I'm excited to see where the Taiko project will go, and I'm confident t
| Preparation of report | 10 |
| Total time spent | 70 |

## 13. Refrences
## 13. References

- https://github.com/code-423n4/2024-03-taiko
- https://docs.taiko.xyz/start-here/getting-started
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ contract PEMCertChainLib is IPEMCertChainLib {
// The Validity sequence is located 4 elements below the first element of the tbsCertificate
// sequence

// The subject commanName value is contained in the Subject sequence
// The subject commonName value is contained in the Subject sequence
// which is 5 elements below the first element of the tbsCertificate sequence

// The PublicKey is located in the second element of subjectPublicKeyInfo sequence
Expand Down
8 changes: 4 additions & 4 deletions packages/taiko-client/bindings/encoding/input.go
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ var (
TaikoWrapperABI *abi.ABI
ForcedInclusionStoreABI *abi.ABI
TaikoAnchorABI *abi.ABI
ResloverBaseABI *abi.ABI
ResolverBaseABI *abi.ABI
ComposeVerifierABI *abi.ABI
ForkRouterPacayaABI *abi.ABI
TaikoTokenPacayaABI *abi.ABI
Expand Down Expand Up @@ -441,8 +441,8 @@ func init() {
log.Crit("Get TaikoAnchor ABI error", "error", err)
}

if ResloverBaseABI, err = pacayaBindings.ResolverBaseMetaData.GetAbi(); err != nil {
log.Crit("Get ResloverBase ABI error", "error", err)
if ResolverBaseABI, err = pacayaBindings.ResolverBaseMetaData.GetAbi(); err != nil {
log.Crit("Get ResolverBase ABI error", "error", err)
}

if ComposeVerifierABI, err = pacayaBindings.ComposeVerifierMetaData.GetAbi(); err != nil {
Expand Down Expand Up @@ -477,7 +477,7 @@ func init() {
TaikoWrapperABI.Errors,
ForcedInclusionStoreABI.Errors,
TaikoAnchorABI.Errors,
ResloverBaseABI.Errors,
ResolverBaseABI.Errors,
ComposeVerifierABI.Errors,
ForkRouterPacayaABI.Errors,
TaikoTokenPacayaABI.Errors,
Expand Down
6 changes: 3 additions & 3 deletions packages/taiko-client/bindings/metadata/metadata_ontake.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,17 @@ func (m *TaikoDataBlockMetadataOntake) GetAnchorBlockHash() common.Hash {
return m.AnchorBlockHash
}

// Ontake implemnts TaikoProposalMetaData interface.
// Ontake implements TaikoProposalMetaData interface.
func (m *TaikoDataBlockMetadataOntake) Ontake() TaikoBlockMetaDataOntake {
return m
}

// Pacaya implemnts TaikoProposalMetaData interface.
// Pacaya implements TaikoProposalMetaData interface.
func (m *TaikoDataBlockMetadataOntake) Pacaya() TaikoBatchMetaDataPacaya {
return nil
}

// IsPacaya implemnts TaikoProposalMetaData interface.
// IsPacaya implements TaikoProposalMetaData interface.
func (m *TaikoDataBlockMetadataOntake) IsPacaya() bool {
return false
}
Expand Down
6 changes: 3 additions & 3 deletions packages/taiko-client/bindings/metadata/metadata_pacaya.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,17 @@ func NewTaikoDataBlockMetadataPacaya(e *pacayaBindings.TaikoInboxClientBatchProp
}
}

// Ontake implemnts TaikoProposalMetaData interface.
// Ontake implements TaikoProposalMetaData interface.
func (m *TaikoDataBlockMetadataPacaya) Ontake() TaikoBlockMetaDataOntake {
return nil
}

// Pacaya implemnts TaikoProposalMetaData interface.
// Pacaya implements TaikoProposalMetaData interface.
func (m *TaikoDataBlockMetadataPacaya) Pacaya() TaikoBatchMetaDataPacaya {
return m
}

// IsPacaya implemnts TaikoProposalMetaData interface.
// IsPacaya implements TaikoProposalMetaData interface.
func (m *TaikoDataBlockMetadataPacaya) IsPacaya() bool {
return true
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ func (s *BlobSyncerTestSuite) initProposer() {
}, nil, nil))

s.p = prop
s.p.RegisterTxMgrSelctorToBlobServer(s.BlobServer)
s.p.RegisterTxMgrSelectorToBlobServer(s.BlobServer)
}

func TestBlobSyncerTestSuite(t *testing.T) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ func (s *ChainSyncerTestSuite) SetupTest() {
}, nil, nil))

s.p = prop
s.p.RegisterTxMgrSelctorToBlobServer(s.BlobServer)
s.p.RegisterTxMgrSelectorToBlobServer(s.BlobServer)
}

func (s *ChainSyncerTestSuite) TestGetInnerSyncers() {
Expand Down
4 changes: 2 additions & 2 deletions packages/taiko-client/driver/driver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1052,7 +1052,7 @@ func (s *DriverTestSuite) InitProposer() {
},
}, nil, nil))
s.p = p
s.p.RegisterTxMgrSelctorToBlobServer(s.BlobServer)
s.p.RegisterTxMgrSelectorToBlobServer(s.BlobServer)
}

func (s *DriverTestSuite) TearDownTestTearDown() {
Expand Down Expand Up @@ -1090,7 +1090,7 @@ func (s *DriverTestSuite) insertPreconfBlock(
signedTx, err := types.SignTx(tx, types.LatestSignerForChainID(s.RPCClient.L2.ChainID), s.TestAddrPrivKey)
s.Nil(err)

// If the transaction is underpriced, we just ingore it.
// If the transaction is underpriced, we just ignore it.
err = s.RPCClient.L2.SendTransaction(context.Background(), signedTx)
if err != nil {
s.Equal("replacement transaction underpriced", err.Error())
Expand Down
4 changes: 2 additions & 2 deletions packages/taiko-client/driver/preconf_blocks/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ type BuildPreconfBlockResponseBody struct {
}

// BuildPreconfBlock handles a preconfirmation block creation request,
// if the preconfirmation block creation body in request are valid, it will insert the correspoinding the
// if the preconfirmation block creation body in request are valid, it will insert the corresponding
// preconfirmation block to the backend L2 execution engine and return a success response.
//
// @Summary Insert a preconfirmation block to the L2 execution engine.
// @Description Insert a preconfirmation block to the L2 execution engine, if the preconfirmation block creation
// @Description body in request are valid, it will insert the correspoinding the
// @Description body in request are valid, it will insert the corresponding
// @Description preconfirmation block to the backend L2 execution engine and return a success response.
// @Param body body BuildPreconfBlockRequestBody true "preconf block creation request body"
// @Accept json
Expand Down
2 changes: 1 addition & 1 deletion packages/taiko-client/driver/preconf_blocks/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ type PreconfBlockAPIServer struct {
lookaheadMutex sync.Mutex
}

// New creates a new preconf blcok server instance, and starts the server.
// New creates a new preconf block server instance, and starts the server.
func New(
cors string,
jwtSecret []byte,
Expand Down
2 changes: 1 addition & 1 deletion packages/taiko-client/internal/testutils/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ func (s *ClientTestSuite) ProposeAndInsertValidBlock(
s.Nil(err)
err = s.RPCClient.L2.SendTransaction(context.Background(), signedTx)
if err != nil {
// If the transaction is underpriced, we just ingore it.
// If the transaction is underpriced, we just ignore it.
s.Equal("replacement transaction underpriced", err.Error())
}
s.Nil(proposer.ProposeOp(context.Background()))
Expand Down
2 changes: 1 addition & 1 deletion packages/taiko-client/internal/testutils/interfaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ type Proposer interface {
utils.SubcommandApplication
ProposeOp(ctx context.Context) error
ProposeTxLists(ctx context.Context, txLists []types.Transactions, l2Head uint64, parentMetaHash common.Hash) error
RegisterTxMgrSelctorToBlobServer(blobServer *MemoryBlobServer)
RegisterTxMgrSelectorToBlobServer(blobServer *MemoryBlobServer)
}
4 changes: 2 additions & 2 deletions packages/taiko-client/proposer/proposer.go
Original file line number Diff line number Diff line change
Expand Up @@ -542,9 +542,9 @@ func (p *Proposer) Name() string {
return "proposer"
}

// RegisterTxMgrSelctorToBlobServer registers the tx manager selector to the given blob server,
// RegisterTxMgrSelectorToBlobServer registers the tx manager selector to the given blob server,
// should only be used for testing.
func (p *Proposer) RegisterTxMgrSelctorToBlobServer(blobServer *testutils.MemoryBlobServer) {
func (p *Proposer) RegisterTxMgrSelectorToBlobServer(blobServer *testutils.MemoryBlobServer) {
p.txmgrSelector = utils.NewTxMgrSelector(
testutils.NewMemoryBlobTxMgr(p.rpc, p.txmgrSelector.TxMgr(), blobServer),
testutils.NewMemoryBlobTxMgr(p.rpc, p.txmgrSelector.PrivateTxMgr(), blobServer),
Expand Down
2 changes: 1 addition & 1 deletion packages/taiko-client/proposer/proposer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ func (s *ProposerTestSuite) SetupTest() {
}, nil, nil))

s.p = p
s.p.RegisterTxMgrSelctorToBlobServer(s.BlobServer)
s.p.RegisterTxMgrSelectorToBlobServer(s.BlobServer)
s.cancel = cancel
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
type TransactionBuilderTestSuite struct {
testutils.ClientTestSuite
calldataTxBuilder *CalldataTransactionBuilder
blobTxBuiler *BlobTransactionBuilder
blobTxBuilder *BlobTransactionBuilder
txsToPropose []types.Transactions
}

Expand All @@ -43,7 +43,7 @@ func (s *TransactionBuilderTestSuite) SetupTest() {
chainConfig,
false,
)
s.blobTxBuiler = NewBlobTransactionBuilder(
s.blobTxBuilder = NewBlobTransactionBuilder(
s.RPCClient,
l1ProposerPrivKey,
common.HexToAddress(os.Getenv("TAIKO_INBOX")),
Expand Down
10 changes: 5 additions & 5 deletions packages/taiko-client/prover/event_handler/block_proposed.go
Original file line number Diff line number Diff line change
Expand Up @@ -378,27 +378,27 @@ type NewBlockProposedGuardianEventHandlerOps struct {
GuardianProverHeartbeater guardianProverHeartbeater.BlockSenderHeartbeater
}

// BlockProposedGuaridanEventHandler is responsible for handling the BlockProposed event as a guardian prover.
type BlockProposedGuaridanEventHandler struct {
// BlockProposedGuardianEventHandler is responsible for handling the BlockProposed event as a guardian prover.
type BlockProposedGuardianEventHandler struct {
*BlockProposedEventHandler
GuardianProverHeartbeater guardianProverHeartbeater.BlockSenderHeartbeater
}

// NewBlockProposedEventGuardianHandler creates a new BlockProposedEventHandler instance.
func NewBlockProposedEventGuardianHandler(
opts *NewBlockProposedGuardianEventHandlerOps,
) *BlockProposedGuaridanEventHandler {
) *BlockProposedGuardianEventHandler {
blockProposedEventHandler := NewBlockProposedEventHandler(opts.NewBlockProposedEventHandlerOps)
blockProposedEventHandler.isGuardian = true

return &BlockProposedGuaridanEventHandler{
return &BlockProposedGuardianEventHandler{
BlockProposedEventHandler: blockProposedEventHandler,
GuardianProverHeartbeater: opts.GuardianProverHeartbeater,
}
}

// Handle implements the BlockProposedHandler interface.
func (h *BlockProposedGuaridanEventHandler) Handle(
func (h *BlockProposedGuardianEventHandler) Handle(
ctx context.Context,
meta metadata.TaikoProposalMetaData,
end eventIterator.EndBlockProposedEventIterFunc,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ func (s *ProofSubmitterTestSuite) SetupTest() {
}, txMgr, txMgr))

s.proposer = prop
s.proposer.RegisterTxMgrSelctorToBlobServer(s.BlobServer)
s.proposer.RegisterTxMgrSelectorToBlobServer(s.BlobServer)
}

func (s *ProofSubmitterTestSuite) TestGetRandomBumpedSubmissionDelay() {
Expand Down
2 changes: 1 addition & 1 deletion packages/taiko-client/prover/prover_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ func (s *ProverTestSuite) SetupTest() {
}, s.txmgr, s.txmgr))

s.proposer = prop
s.proposer.RegisterTxMgrSelctorToBlobServer(s.BlobServer)
s.proposer.RegisterTxMgrSelectorToBlobServer(s.BlobServer)
}

func (s *ProverTestSuite) TestName() {
Expand Down
Loading