feat: ensures zero fee address is correctly set (#54)

This commit is contained in:
Kartik Chopra 2024-11-26 21:33:12 -05:00 committed by GitHub
parent 467254587d
commit 7cb1fc132d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 42 additions and 75 deletions

View file

@ -177,6 +177,14 @@ func makeFullNode(ctx *cli.Context) (*node.Node, ethapi.Backend) {
v := ctx.Uint64(utils.OverrideVerkle.Name)
cfg.Eth.OverrideVerkle = &v
}
if ctx.IsSet(utils.ZeroFeeAddressesFlag.Name) {
for _, addr := range ctx.StringSlice(utils.ZeroFeeAddressesFlag.Name) {
cfg.Eth.ZeroFeeAddresses = append(
cfg.Eth.ZeroFeeAddresses,
common.HexToAddress(strings.TrimSpace(addr)),
)
}
}
backend, eth := utils.RegisterEthService(stack, &cfg.Eth)
// Create gauge with geth system and build information

View file

@ -2124,7 +2124,6 @@ func MakeChain(ctx *cli.Context, stack *node.Node, readonly bool) (*core.BlockCh
if ctx.IsSet(CacheFlag.Name) || ctx.IsSet(CacheGCFlag.Name) {
cache.TrieDirtyLimit = ctx.Int(CacheFlag.Name) * ctx.Int(CacheGCFlag.Name) / 100
}
vmcfg := vm.Config{EnablePreimageRecording: ctx.Bool(VMEnableDebugFlag.Name)}
if ctx.IsSet(ZeroFeeAddressesFlag.Name) {
for _, addr := range ctx.StringSlice(ZeroFeeAddressesFlag.Name) {

View file

@ -192,6 +192,7 @@ func New(stack *node.Node, config *ethconfig.Config) (*Ethereum, error) {
var (
vmConfig = vm.Config{
EnablePreimageRecording: config.EnablePreimageRecording,
ZeroFeeAddresses: config.ZeroFeeAddresses,
}
cacheConfig = &core.CacheConfig{
TrieCleanLimit: config.TrieCleanCache,

View file

@ -159,6 +159,9 @@ type Config struct {
// OverrideVerkle (TODO: remove after the fork)
OverrideVerkle *uint64 `toml:",omitempty"`
// ZeroFeeAddresses is a list of addresses that are exempt from the zero fee policy.
ZeroFeeAddresses []common.Address `toml:",omitempty"`
}
// CreateConsensusEngine creates a consensus engine for the given chain config.

View file

@ -1,6 +1,7 @@
{
"config": {
"chainId": 17864,
"chainId": 13923,
"terminalTotalDifficulty": 500,
"homesteadBlock": 0,
"eip150Block": 0,
"eip155Block": 0,
@ -9,66 +10,23 @@
"constantinopleBlock": 0,
"petersburgBlock": 0,
"istanbulBlock": 0,
"muirGlacierBlock": 0,
"berlinBlock": 0,
"londonBlock": 0,
"shanghaiTime": 0,
"cancunTime": 0,
"arrowGlacierBlock": 0,
"grayGlacierBlock": 0,
"clique": {
"period": 200,
"epoch": 30000
}
"pragueTime": 0
},
"nonce": "0x0",
"timestamp": "0x18E0A4E0D22",
"extraData": "0x0000000000000000000000000000000000000000000000000000000000000000d9cd8E5DE6d55f796D980B818D350C0746C25b970000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"gasLimit": "0x1c9c380",
"difficulty": "0x1",
"mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"coinbase": "0x0000000000000000000000000000000000000000",
"alloc": {
"0xBe3dEF3973584FdcC1326634aF188f0d9772D57D": {
"balance": "10000000000000000000000000000"
},
"0xd9cd8E5DE6d55f796D980B818D350C0746C25b97": {
"balance": "10000000000000000000000000000"
},
"0x788EBABe5c3dD422Ef92Ca6714A69e2eabcE1Ee4": {
"balance": "10000000000000000000000000000"
},
"0xf6ba5bca9b489de3a4ac3a57823d5d97d608feb9": {
"balance": "10000000000000000000000000000"
},
"0x0DCaa27B9E4Db92F820189345792f8eC5Ef148F6": {
"balance": "10000000000000000000000000000"
},
"0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266": {
"balance": "10000000000000000000000000000"
},
"0x3fab184622dc19b6109349b94811493bf2a45362": {
"balance": "10000000000000000000000000000"
},
"0xBcA333b67fb805aB18B4Eb7aa5a0B09aB25E5ce2": {
"balance": "10000000000000000000000000000"
},
"0xB9286CB4782E43A202BfD426AbB72c8cb34f886c": {
"balance": "10000000000000000000000000000"
},
"0x04F713A0b687c84D4F66aCd1423712Af6F852B78": {
"balance": "10000000000000000000000000000"
},
"0x82b941824b43F33e417be1E92273A3020a0D760c": {
"balance": "10000000000000000000000000000"
},
"0x57508f0B0f3426758F1f3D63ad4935a7c9383620": {
"balance": "10000000000000000000000000000"
},
"0xa51f13769d1466e0b5483cb719e89add8d615052": {
"balance": "10000000000000000000000000000"
},
"0x9a5a8ebd13951c8500c728c1982317a503b3e8ce": {
"balance": "10000000000000000000000000000"
}
}
"0xc3bc246D6B0094C8B7D054f911F2bE3b07cE8A63": {
"balance": "999999999999911111"
}
},
"coinbase": "0x0000000000000000000000000000000000000000",
"difficulty": "0x0",
"extraData": "",
"gasLimit": "0x2fefd8",
"nonce": "0x0000000000000042",
"mixhash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"timestamp": "0x00"
}

2
go.mod
View file

@ -2,8 +2,6 @@ module github.com/ethereum/go-ethereum
go 1.22.0
toolchain go1.23.1
require (
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.2.0
github.com/Microsoft/go-winio v0.6.1