-
Notifications
You must be signed in to change notification settings - Fork 20.9k
WIP: EIP-7907 Meter Contract Code Size And Increase Limit #32003
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
base: fusaka-devnet-2
Are you sure you want to change the base?
Conversation
Co-authored-by: lightclient <[email protected]> Co-authored-by: Qi Zhou <[email protected]>
Co-authored-by: lightclient <[email protected]> Co-authored-by: Qi Zhou <[email protected]>
core/state/access_list.go
Outdated
@@ -142,6 +164,11 @@ func (al *accessList) Equal(other *accessList) bool { | |||
return slices.EqualFunc(al.slots, other.slots, maps.Equal) | |||
} | |||
|
|||
// DeleteAddressCode removes an address code from the access list. | |||
func (al *accessList) DeleteAddressCode(address common.Address) { | |||
delete(al.addresses, address) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function is identical to DeleteAddress
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops good catch
@@ -132,8 +132,10 @@ const ( | |||
DefaultElasticityMultiplier = 2 // Bounds the maximum gas limit an EIP-1559 block may have. | |||
InitialBaseFee = 1000000000 // Initial base fee for EIP-1559 blocks. | |||
|
|||
MaxCodeSize = 24576 // Maximum bytecode to permit for a contract | |||
MaxInitCodeSize = 2 * MaxCodeSize // Maximum initcode to permit in a creation transaction and create instructions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There seems to be some use of MaxInitCodeSize yet:
--- a/cmd/evm/internal/t8ntool/transaction.go
+++ b/cmd/evm/internal/t8ntool/transaction.go
@@ -180,7 +180,7 @@ func Transaction(ctx *cli.Context) error {
r.Error = errors.New("gas * maxFeePerGas exceeds 256 bits")
}
// Check whether the init code size has been exceeded.
- if chainConfig.IsShanghai(new(big.Int), 0) && tx.To() == nil && len(tx.Data()) > params.MaxInitCodeSize {
+ if chainConfig.IsShanghai(new(big.Int), 0) && tx.To() == nil && len(tx.Data()) > params.MaxInitCodeSizeEIP3860 {
r.Error = errors.New("max initcode size exceeded")
}
results = append(results, r)
diff --git a/core/txpool/validation.go b/core/txpool/validation.go
index 720d0d3b7..29c335038 100644
--- a/core/txpool/validation.go
+++ b/core/txpool/validation.go
@@ -87,8 +87,8 @@ func ValidateTransaction(tx *types.Transaction, head *types.Header, signer types
return fmt.Errorf("%w: type %d rejected, pool not yet in Prague", core.ErrTxTypeNotSupported, tx.Type())
}
// Check whether the init code size has been exceeded
- if rules.IsShanghai && tx.To() == nil && len(tx.Data()) > params.MaxInitCodeSize {
- return fmt.Errorf("%w: code size %v, limit %v", core.ErrMaxInitCodeSizeExceeded, len(tx.Data()), params.MaxInitCodeSize)
+ if rules.IsShanghai && tx.To() == nil && len(tx.Data()) > params.MaxInitCodeSizeEIP3860 {
+ return fmt.Errorf("%w: code size %v, limit %v", core.ErrMaxInitCodeSizeExceeded, len(tx.Data()), params.MaxInitCodeSizeEIP3860)
}
// Transactions can't be negative. This may never happen using RLP decoded
// transactions but may occur for transactions created using the RPC.
WIP implementation of EIP-7907.