Skip to content

Commit

Permalink
Handle access list txs at espresso hardfork
Browse files Browse the repository at this point in the history
  • Loading branch information
piersy committed Sep 10, 2024
1 parent 394cf78 commit 85a6e02
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
4 changes: 4 additions & 0 deletions core/types/celo_transaction_signing_forks.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@ func (c *celoLegacy) txFuncs(tx *Transaction) *txFuncs {
// changes that were not part of Espresso. So instead we ned to handle
// DynamicFeeTxTypes here.
return dynamicFeeTxFuncs
case t == AccessListTxType:
// Similar to the dynamic fee tx type, we need to handle the access list tx type that was also enabled by the
// espresso hardfork.
return accessListTxFuncs
case t == CeloDynamicFeeTxV2Type:
return celoDynamicFeeTxV2Funcs
case t == CeloDynamicFeeTxType:
Expand Down
12 changes: 12 additions & 0 deletions core/types/celo_transaction_signing_tx_funcs.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,18 @@ var (
},
}

accessListTxFuncs = &txFuncs{
hash: func(tx *Transaction, chainID *big.Int) common.Hash {
return NewEIP2930Signer(chainID).Hash(tx)
},
signatureValues: func(tx *Transaction, sig []byte, signerChainID *big.Int) (r *big.Int, s *big.Int, v *big.Int, err error) {
return NewEIP2930Signer(signerChainID).SignatureValues(tx, sig)
},
sender: func(tx *Transaction, hashFunc func(tx *Transaction, chainID *big.Int) common.Hash, signerChainID *big.Int) (common.Address, error) {
return NewEIP2930Signer(tx.ChainId()).Sender(tx)
},
}

dynamicFeeTxFuncs = &txFuncs{
hash: func(tx *Transaction, chainID *big.Int) common.Hash {
return NewLondonSigner(chainID).Hash(tx)
Expand Down

0 comments on commit 85a6e02

Please sign in to comment.