diff --git a/proto/ethermint/evm/v1/evm.proto b/proto/ethermint/evm/v1/evm.proto index 875619ffec..0529edaa94 100644 --- a/proto/ethermint/evm/v1/evm.proto +++ b/proto/ethermint/evm/v1/evm.proto @@ -24,6 +24,9 @@ message Params { // allow_unprotected_txs defines if replay-protected (i.e non EIP155 // signed) transactions can be executed on the state machine. bool allow_unprotected_txs = 7; + // enabled_precompiles contains list of hex-encoded evm addresses of enabled precompiled contracts. + // Precompile must be registered before it can be enabled. + repeated string enabled_precompiles = 8; } // ChainConfig defines the Ethereum ChainConfig parameters using *sdk.Int values diff --git a/x/evm/keeper/params_test.go b/x/evm/keeper/params_test.go index 38fc687f10..b082ca7b1c 100644 --- a/x/evm/keeper/params_test.go +++ b/x/evm/keeper/params_test.go @@ -101,6 +101,46 @@ func (suite *KeeperTestSuite) TestParams() { }, true, }, + { + "success - EnabledPrecompiles param is set to empty slice and will be retrieved as nil", + func() interface{} { + params.EnabledPrecompiles = []string{} + suite.app.EvmKeeper.SetParams(suite.ctx, params) + var typedNil []string = nil // NOTE: despite we set EnabledPrecompiles as []string{}, it will be retrieved as nil + return typedNil + }, + func() interface{} { + evmParams := suite.app.EvmKeeper.GetParams(suite.ctx) + return evmParams.GetEnabledPrecompiles() + }, + true, + }, + { + "success - EnabledPrecompiles param is set to nil and can be retrieved correctly", + func() interface{} { + params.EnabledPrecompiles = nil + suite.app.EvmKeeper.SetParams(suite.ctx, params) + return params.EnabledPrecompiles + }, + func() interface{} { + evmParams := suite.app.EvmKeeper.GetParams(suite.ctx) + return evmParams.GetEnabledPrecompiles() + }, + true, + }, + { + "success - EnabledPrecompiles param is set to []string{\"0x100\", \"0x101\"} and can be retrieved correctly", + func() interface{} { + params.EnabledPrecompiles = []string{"0x100", "0x101"} + suite.app.EvmKeeper.SetParams(suite.ctx, params) + return params.EnabledPrecompiles + }, + func() interface{} { + evmParams := suite.app.EvmKeeper.GetParams(suite.ctx) + return evmParams.GetEnabledPrecompiles() + }, + true, + }, } for _, tc := range testCases { suite.Run(tc.name, func() { diff --git a/x/evm/types/evm.pb.go b/x/evm/types/evm.pb.go index 1849162a56..ee4b4be350 100644 --- a/x/evm/types/evm.pb.go +++ b/x/evm/types/evm.pb.go @@ -42,6 +42,9 @@ type Params struct { // allow_unprotected_txs defines if replay-protected (i.e non EIP155 // signed) transactions can be executed on the state machine. AllowUnprotectedTxs bool `protobuf:"varint,7,opt,name=allow_unprotected_txs,json=allowUnprotectedTxs,proto3" json:"allow_unprotected_txs,omitempty"` + // enabled_precompiles contains list of hex-encoded evm addresses of enabled precompiled contracts. + // Precompile must be registered before it can be enabled. + EnabledPrecompiles []string `protobuf:"bytes,8,rep,name=enabled_precompiles,json=enabledPrecompiles,proto3" json:"enabled_precompiles,omitempty"` } func (m *Params) Reset() { *m = Params{} } @@ -126,6 +129,13 @@ func (m *Params) GetAllowUnprotectedTxs() bool { return false } +func (m *Params) GetEnabledPrecompiles() []string { + if m != nil { + return m.EnabledPrecompiles + } + return nil +} + // ChainConfig defines the Ethereum ChainConfig parameters using *sdk.Int values // instead of *big.Int. type ChainConfig struct { @@ -882,121 +892,122 @@ func init() { func init() { proto.RegisterFile("ethermint/evm/v1/evm.proto", fileDescriptor_d21ecc92c8c8583e) } var fileDescriptor_d21ecc92c8c8583e = []byte{ - // 1810 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x58, 0x4d, 0x6f, 0x1b, 0xb9, - 0x19, 0x8e, 0xad, 0xb1, 0x3d, 0xa2, 0x64, 0x69, 0x4c, 0x29, 0x5e, 0x25, 0x41, 0x3d, 0xee, 0x14, - 0x2d, 0x5c, 0x60, 0x63, 0xaf, 0xbd, 0x30, 0x12, 0x6c, 0xd0, 0x0f, 0xcb, 0xf1, 0xee, 0xda, 0x4d, + // 1838 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 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, 0x7d, 0x4d, 0x73, 0x9b, 0x78, 0x4f, 0xd6, 0x56, 0xb5, 0x92, - 0x03, 0x4a, 0x8c, 0x08, 0xb5, 0x68, 0x55, 0x24, 0x87, 0xf0, 0x31, 0xb0, 0x19, 0xe9, 0x13, 0x26, - 0x48, 0xa8, 0x16, 0xc7, 0x46, 0x63, 0x19, 0x3e, 0x02, 0x76, 0x84, 0xb9, 0x9f, 0x73, 0x12, 0xea, - 0x95, 0x40, 0x2b, 0x11, 0xe6, 0x6f, 0x39, 0x09, 0x3f, 0xb3, 0xfe, 0xfc, 0xb5, 0xfb, 0xc0, 0xc3, - 0xa0, 0x72, 0x10, 0x04, 0x84, 0xf3, 0xf3, 0xbc, 0x97, 0x90, 0xff, 0xd1, 0x61, 0x7b, 0xa0, 0xca, - 0x05, 0x65, 0x38, 0x22, 0xfe, 0x05, 0x19, 0x9a, 0x3e, 0xd3, 0x5d, 0x63, 0xf4, 0xbf, 0x22, 0x43, - 0x8e, 0xa6, 0x05, 0x43, 0xf1, 0xb5, 0x05, 0x2a, 0xe7, 0x0c, 0x07, 0xc4, 0xdc, 0xf0, 0x65, 0xaf, - 0x4a, 0x91, 0x19, 0x0a, 0x23, 0x49, 0x6e, 0x11, 0xa7, 0x84, 0xe6, 0xc2, 0xec, 0xa7, 0x91, 0x28, - 0x23, 0x18, 0x21, 0x03, 0x12, 0xa8, 0x32, 0x5a, 0xc8, 0x48, 0x70, 0x1f, 0xac, 0x86, 0x31, 0x57, - 0xaf, 0x33, 0x2e, 0x70, 0x70, 0xa1, 0xd3, 0x6f, 0x3b, 0x57, 0x85, 0x5b, 0x35, 0x86, 0x37, 0x52, - 0x8f, 0x66, 0x24, 0xf8, 0x02, 0xd4, 0x27, 0x61, 0x6a, 0xb6, 0xaa, 0x36, 0x76, 0x1b, 0x5e, 0x15, - 0x6e, 0x6d, 0xec, 0xaa, 0x2c, 0x68, 0x4e, 0x96, 0x2b, 0x1d, 0x92, 0x4e, 0x1e, 0xa9, 0x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x6c, 0x31, 0xf0, 0xe3, 0x2c, 0x24, 0x03, 0xd5, + 0xbc, 0xad, 0x76, 0xf3, 0xaa, 0x70, 0x9d, 0x29, 0xf7, 0x63, 0x69, 0x43, 0x2b, 0x62, 0xa0, 0x06, + 0xf0, 0x63, 0x00, 0xf4, 0x92, 0x14, 0x83, 0x6e, 0xbd, 0xab, 0x57, 0x85, 0x5b, 0x56, 0x5a, 0x85, + 0x3d, 0x19, 0x42, 0x0f, 0x2c, 0x69, 0x6c, 0x5b, 0x61, 0x57, 0xaf, 0x0a, 0xd7, 0x4e, 0x68, 0xa4, + 0x31, 0xb5, 0x49, 0xa6, 0x8a, 0x91, 0x94, 0xf6, 0x49, 0xa8, 0xba, 0x9b, 0x8d, 0x46, 0xa2, 0xf7, + 0x97, 0x45, 0x60, 0x9f, 0x0f, 0x10, 0xe1, 0x79, 0x22, 0xe0, 0xe7, 0xc0, 0x09, 0x68, 0x26, 0x18, + 0x0e, 0x84, 0x3f, 0x93, 0xda, 0xf6, 0x93, 0x49, 0xa7, 0x99, 0xf7, 0xf0, 0x50, 0x7d, 0xa4, 0x3a, + 0x30, 0xf9, 0x6f, 0x82, 0xa5, 0x4e, 0x42, 0x69, 0xaa, 0x2a, 0xa1, 0x8a, 0xb4, 0x00, 0x91, 0xca, + 0x9a, 0xda, 0xe5, 0x92, 0x7a, 0x09, 0xfc, 0xf0, 0xe6, 0x2e, 0xcf, 0x95, 0x4a, 0x7b, 0xdd, 0xbc, + 0x06, 0x6a, 0x9a, 0xdb, 0xcc, 0xf7, 0x64, 0x6e, 0x55, 0x29, 0x39, 0xa0, 0xc4, 0x88, 0x50, 0x9b, + 0x56, 0x45, 0x72, 0x08, 0x1f, 0x03, 0x9b, 0x91, 0x3e, 0x61, 0x82, 0x84, 0x6a, 0x73, 0x6c, 0x34, + 0x96, 0xe1, 0x23, 0x60, 0x47, 0x98, 0xfb, 0x39, 0x27, 0xa1, 0xde, 0x09, 0xb4, 0x12, 0x61, 0xfe, + 0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x5c, 0x45, 0x03, + 0x28, 0x3c, 0xef, 0x1d, 0x68, 0xdc, 0xe2, 0x29, 0xbf, 0xdf, 0x2a, 0x24, 0xd3, 0x38, 0xe4, 0x18, + 0xfe, 0x02, 0x2c, 0x61, 0x21, 0xd8, 0xa8, 0x73, 0xdc, 0x21, 0x00, 0x3d, 0xcf, 0x7b, 0x01, 0xd6, + 0x6e, 0x78, 0xdc, 0xca, 0x04, 0x81, 0x25, 0xa3, 0x33, 0x09, 0x55, 0xe3, 0xf6, 0x2f, 0xbf, 0xb9, + 0xdc, 0x58, 0xf8, 0xf6, 0x72, 0x63, 0xe1, 0xdf, 0x97, 0x1b, 0x0b, 0x7f, 0xfd, 0xb0, 0xf1, 0xe0, + 0xdb, 0x0f, 0x1b, 0x0f, 0xfe, 0xf9, 0x61, 0xe3, 0xc1, 0xef, 0xa6, 0x5b, 0x39, 0xe9, 0xcb, 0x4e, + 0x3e, 0xf9, 0x2b, 0x69, 0xa0, 0xfe, 0x4c, 0x52, 0xa9, 0xea, 0x2c, 0xab, 0x3f, 0x89, 0x3e, 0xfd, + 0x6f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xe0, 0x37, 0x66, 0x64, 0x6a, 0x12, 0x00, 0x00, } func (m *Params) Marshal() (dAtA []byte, err error) { @@ -1019,6 +1030,15 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.EnabledPrecompiles) > 0 { + for iNdEx := len(m.EnabledPrecompiles) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.EnabledPrecompiles[iNdEx]) + copy(dAtA[i:], m.EnabledPrecompiles[iNdEx]) + i = encodeVarintEvm(dAtA, i, uint64(len(m.EnabledPrecompiles[iNdEx]))) + i-- + dAtA[i] = 0x42 + } + } if m.AllowUnprotectedTxs { i-- if m.AllowUnprotectedTxs { @@ -1939,6 +1959,12 @@ func (m *Params) Size() (n int) { if m.AllowUnprotectedTxs { n += 2 } + if len(m.EnabledPrecompiles) > 0 { + for _, s := range m.EnabledPrecompiles { + l = len(s) + n += 1 + l + sovEvm(uint64(l)) + } + } return n } @@ -2534,6 +2560,38 @@ func (m *Params) Unmarshal(dAtA []byte) error { } } m.AllowUnprotectedTxs = bool(v != 0) + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field EnabledPrecompiles", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvm + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvm + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvm + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.EnabledPrecompiles = append(m.EnabledPrecompiles, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipEvm(dAtA[iNdEx:]) diff --git a/x/evm/types/params.go b/x/evm/types/params.go index b95870128b..c931075d7a 100644 --- a/x/evm/types/params.go +++ b/x/evm/types/params.go @@ -19,6 +19,7 @@ import ( "fmt" "math/big" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/params" sdk "github.com/cosmos/cosmos-sdk/types" @@ -105,7 +106,15 @@ func (p Params) Validate() error { return err } - return validateEIP712AllowedMsgs(p.EIP712AllowedMsgs) + if err := validateEIP712AllowedMsgs(p.EIP712AllowedMsgs); err != nil { + return err + } + + if err := validateEnabledPrecompiles(p.EnabledPrecompiles); err != nil { + return err + } + + return nil } // EIP712AllowedMsgFromMsgType returns the EIP712AllowedMsg for a given message type url. @@ -186,6 +195,16 @@ func validateEIP712AllowedMsgs(i interface{}) error { return nil } +func validateEnabledPrecompiles(enabledPrecompiles []string) error { + for _, addr := range enabledPrecompiles { + if !common.IsHexAddress(addr) { + return fmt.Errorf("invalid hex address: %v in enabled precompiles list", addr) + } + } + + return nil +} + // IsLondon returns if london hardfork is enabled. func IsLondon(ethConfig *params.ChainConfig, height int64) bool { return ethConfig.IsLondon(big.NewInt(height)) diff --git a/x/evm/types/params_test.go b/x/evm/types/params_test.go index eefb1773ed..b9947c4634 100644 --- a/x/evm/types/params_test.go +++ b/x/evm/types/params_test.go @@ -8,43 +8,78 @@ import ( "github.com/stretchr/testify/require" ) +const ( + validEthAddress = "0xc0ffee254729296a45a3885639AC7E10F9d54979" + invalidEthAddress = "0xc0ffee254729296a45a3885639AC7E10F9d5497" +) + func TestParamsValidate(t *testing.T) { extraEips := []int64{2929, 1884, 1344} testCases := []struct { - name string - params Params - expError bool + name string + getParams func() Params + expError bool }{ - {"default", DefaultParams(), false}, { - "valid", - NewParams("ara", false, true, true, DefaultChainConfig(), extraEips, []EIP712AllowedMsg{}), - false, + name: "default", + getParams: DefaultParams, + expError: false, }, { - "empty", - Params{}, - true, + name: "valid", + getParams: func() Params { + return NewParams("ara", false, true, true, DefaultChainConfig(), extraEips, []EIP712AllowedMsg{}) + }, + expError: false, }, { - "invalid evm denom", - Params{ - EvmDenom: "@!#!@$!@5^32", + name: "empty", + getParams: func() Params { + return Params{} }, - true, + expError: true, }, { - "invalid eip", - Params{ - EvmDenom: "stake", - ExtraEIPs: []int64{1}, + name: "invalid evm denom", + getParams: func() Params { + return Params{ + EvmDenom: "@!#!@$!@5^32", + } }, - true, + expError: true, + }, + { + name: "invalid eip", + getParams: func() Params { + return Params{ + EvmDenom: "stake", + ExtraEIPs: []int64{1}, + } + }, + expError: true, + }, + { + name: "valid enabled precompiles", + getParams: func() Params { + params := DefaultParams() + params.EnabledPrecompiles = []string{validEthAddress} + return params + }, + expError: false, + }, + { + name: "invalid enabled precompiles", + getParams: func() Params { + params := DefaultParams() + params.EnabledPrecompiles = []string{invalidEthAddress} + return params + }, + expError: true, }, } for _, tc := range testCases { - err := tc.params.Validate() + err := tc.getParams().Validate() if tc.expError { require.Error(t, err, tc.name) @@ -69,6 +104,13 @@ func TestParamsValidatePriv(t *testing.T) { require.NoError(t, validateBool(true)) require.Error(t, validateEIPs("")) require.NoError(t, validateEIPs([]int64{1884})) + + require.Error(t, validateEnabledPrecompiles([]string{""})) + require.Error(t, validateEnabledPrecompiles([]string{invalidEthAddress})) + require.Error(t, validateEnabledPrecompiles([]string{validEthAddress, invalidEthAddress})) + require.NoError(t, validateEnabledPrecompiles(nil)) + require.NoError(t, validateEnabledPrecompiles([]string{})) + require.NoError(t, validateEnabledPrecompiles([]string{validEthAddress})) } func TestValidateChainConfig(t *testing.T) {