From e6be776ca4ec5b4fe45e1d034d6e9b97855cd938 Mon Sep 17 00:00:00 2001 From: ilija Date: Wed, 1 Apr 2026 22:20:30 +0200 Subject: [PATCH 1/2] Add gas to evm service callmsg --- go.mod | 2 +- go.sum | 6 ++++-- .../v2/chain-capabilities/evm/client.pb.go | 13 +++++++++++-- .../v2/chain-capabilities/evm/proto_helpers.go | 2 ++ pkg/types/chains/evm/evm.go | 1 + 5 files changed, 19 insertions(+), 5 deletions(-) diff --git a/go.mod b/go.mod index addfd096ae..c4aae579cb 100644 --- a/go.mod +++ b/go.mod @@ -41,7 +41,7 @@ require ( github.com/smartcontractkit/chain-selectors v1.0.89 github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10 github.com/smartcontractkit/chainlink-protos/billing/go v0.0.0-20251024234028-0988426d98f4 - github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260326111235-8c09d1a4491f + github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260401201627-3792bc50e91d github.com/smartcontractkit/chainlink-protos/linking-service/go v0.0.0-20251002192024-d2ad9222409b github.com/smartcontractkit/chainlink-protos/node-platform v0.0.0-20260205130626-db2a2aab956b github.com/smartcontractkit/chainlink-protos/storage-service v0.3.0 diff --git a/go.sum b/go.sum index b90e6b6184..79fb37d574 100644 --- a/go.sum +++ b/go.sum @@ -332,8 +332,10 @@ github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10 h1:FJAFgXS9 github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10/go.mod h1:oiDa54M0FwxevWwyAX773lwdWvFYYlYHHQV1LQ5HpWY= github.com/smartcontractkit/chainlink-protos/billing/go v0.0.0-20251024234028-0988426d98f4 h1:GCzrxDWn3b7jFfEA+WiYRi8CKoegsayiDoJBCjYkneE= github.com/smartcontractkit/chainlink-protos/billing/go v0.0.0-20251024234028-0988426d98f4/go.mod h1:HHGeDUpAsPa0pmOx7wrByCitjQ0mbUxf0R9v+g67uCA= -github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260326111235-8c09d1a4491f h1:8p3vE987AHM3Of1JvnNJXNE/AtWtfNvJhk3TeeAG3Qw= -github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260326111235-8c09d1a4491f/go.mod h1:Jqt53s27Tr0jDl8mdBXg1xhu6F8Fci8JOuq43tgHOM8= +github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260401200329-e11d286a58a5 h1:lhkdq5y/70cw6ipqcNzrpPOB20lsZPnklaGgXKsxv7s= +github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260401200329-e11d286a58a5/go.mod h1:Jqt53s27Tr0jDl8mdBXg1xhu6F8Fci8JOuq43tgHOM8= +github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260401201627-3792bc50e91d h1:8cE7qXsUHiimU78Z+0/vSHsMZqT9+yRrYOSqAIDGGRU= +github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260401201627-3792bc50e91d/go.mod h1:Jqt53s27Tr0jDl8mdBXg1xhu6F8Fci8JOuq43tgHOM8= github.com/smartcontractkit/chainlink-protos/linking-service/go v0.0.0-20251002192024-d2ad9222409b h1:QuI6SmQFK/zyUlVWEf0GMkiUYBPY4lssn26nKSd/bOM= github.com/smartcontractkit/chainlink-protos/linking-service/go v0.0.0-20251002192024-d2ad9222409b/go.mod h1:qSTSwX3cBP3FKQwQacdjArqv0g6QnukjV4XuzO6UyoY= github.com/smartcontractkit/chainlink-protos/node-platform v0.0.0-20260205130626-db2a2aab956b h1:36knUpKHHAZ86K4FGWXtx8i/EQftGdk2bqCoEu/Cha8= diff --git a/pkg/capabilities/v2/chain-capabilities/evm/client.pb.go b/pkg/capabilities/v2/chain-capabilities/evm/client.pb.go index 02536f4c92..073d363f51 100644 --- a/pkg/capabilities/v2/chain-capabilities/evm/client.pb.go +++ b/pkg/capabilities/v2/chain-capabilities/evm/client.pb.go @@ -591,6 +591,7 @@ type CallMsg struct { From []byte `protobuf:"bytes,1,opt,name=from,proto3" json:"from,omitempty"` // sender address in evm address [20]byte fix-sized array format To []byte `protobuf:"bytes,2,opt,name=to,proto3" json:"to,omitempty"` // contract address in evm address [20]byte fix-sized array format Data []byte `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` // solidity-spec abi encoded bytes + Gas uint64 `protobuf:"varint,4,opt,name=gas,proto3" json:"gas,omitempty"` // gas limit, 0 is unbounded unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -646,6 +647,13 @@ func (x *CallMsg) GetData() []byte { return nil } +func (x *CallMsg) GetGas() uint64 { + if x != nil { + return x.Gas + } + return 0 +} + // represents evm-style filter query type FilterQuery struct { state protoimpl.MessageState `protogen:"open.v1"` @@ -1700,11 +1708,12 @@ const file_capabilities_blockchain_evm_v1alpha_client_proto_rawDesc = "" + "\btx_index\x18\b \x01(\rR\atxIndex\x12\x14\n" + "\x05index\x18\t \x01(\rR\x05index\x12\x18\n" + "\aremoved\x18\n" + - " \x01(\bR\aremoved\"A\n" + + " \x01(\bR\aremoved\"S\n" + "\aCallMsg\x12\x12\n" + "\x04from\x18\x01 \x01(\fR\x04from\x12\x0e\n" + "\x02to\x18\x02 \x01(\fR\x02to\x12\x12\n" + - "\x04data\x18\x03 \x01(\fR\x04data\"\xef\x01\n" + + "\x04data\x18\x03 \x01(\fR\x04data\x12\x10\n" + + "\x03gas\x18\x04 \x01(\x04R\x03gas\"\xef\x01\n" + "\vFilterQuery\x12\x1d\n" + "\n" + "block_hash\x18\x01 \x01(\fR\tblockHash\x120\n" + diff --git a/pkg/capabilities/v2/chain-capabilities/evm/proto_helpers.go b/pkg/capabilities/v2/chain-capabilities/evm/proto_helpers.go index 5d095b8808..ca2199173d 100644 --- a/pkg/capabilities/v2/chain-capabilities/evm/proto_helpers.go +++ b/pkg/capabilities/v2/chain-capabilities/evm/proto_helpers.go @@ -157,6 +157,7 @@ func ConvertCallMsgToProto(msg *evmtypes.CallMsg) (*CallMsg, error) { From: msg.From[:], To: msg.To[:], Data: msg.Data, + Gas: msg.Gas, }, nil } @@ -173,6 +174,7 @@ func ConvertCallMsgFromProto(protoMsg *CallMsg) (*evmtypes.CallMsg, error) { callMsg := &evmtypes.CallMsg{ Data: protoMsg.GetData(), To: toAddress, + Gas: protoMsg.Gas, } // fromAddress is optional diff --git a/pkg/types/chains/evm/evm.go b/pkg/types/chains/evm/evm.go index a16291c664..3a34c8c23c 100644 --- a/pkg/types/chains/evm/evm.go +++ b/pkg/types/chains/evm/evm.go @@ -84,6 +84,7 @@ type CallMsg struct { To Address From Address // from field is needed if contract read depends on msg.sender Data ABIPayload + Gas uint64 // max gas allowed for the call (0 means no limit) } // matches evm-style transaction From 8e7d95ec0534a4d6ab0d95b0756cb5ccee872e7d Mon Sep 17 00:00:00 2001 From: ilija Date: Wed, 1 Apr 2026 23:02:26 +0200 Subject: [PATCH 2/2] Add gas to CallMsg proto helpers --- go.sum | 2 -- pkg/chains/evm/evm.pb.go | 13 +++++++++++-- pkg/chains/evm/evm.proto | 1 + pkg/chains/evm/proto_helpers.go | 2 ++ 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/go.sum b/go.sum index 79fb37d574..a213ba1bd3 100644 --- a/go.sum +++ b/go.sum @@ -332,8 +332,6 @@ github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10 h1:FJAFgXS9 github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10/go.mod h1:oiDa54M0FwxevWwyAX773lwdWvFYYlYHHQV1LQ5HpWY= github.com/smartcontractkit/chainlink-protos/billing/go v0.0.0-20251024234028-0988426d98f4 h1:GCzrxDWn3b7jFfEA+WiYRi8CKoegsayiDoJBCjYkneE= github.com/smartcontractkit/chainlink-protos/billing/go v0.0.0-20251024234028-0988426d98f4/go.mod h1:HHGeDUpAsPa0pmOx7wrByCitjQ0mbUxf0R9v+g67uCA= -github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260401200329-e11d286a58a5 h1:lhkdq5y/70cw6ipqcNzrpPOB20lsZPnklaGgXKsxv7s= -github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260401200329-e11d286a58a5/go.mod h1:Jqt53s27Tr0jDl8mdBXg1xhu6F8Fci8JOuq43tgHOM8= github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260401201627-3792bc50e91d h1:8cE7qXsUHiimU78Z+0/vSHsMZqT9+yRrYOSqAIDGGRU= github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260401201627-3792bc50e91d/go.mod h1:Jqt53s27Tr0jDl8mdBXg1xhu6F8Fci8JOuq43tgHOM8= github.com/smartcontractkit/chainlink-protos/linking-service/go v0.0.0-20251002192024-d2ad9222409b h1:QuI6SmQFK/zyUlVWEf0GMkiUYBPY4lssn26nKSd/bOM= diff --git a/pkg/chains/evm/evm.pb.go b/pkg/chains/evm/evm.pb.go index efd72d09bd..5684d05f00 100644 --- a/pkg/chains/evm/evm.pb.go +++ b/pkg/chains/evm/evm.pb.go @@ -139,6 +139,7 @@ type CallMsg struct { From []byte `protobuf:"bytes,1,opt,name=from,proto3" json:"from,omitempty"` // sender address in evm address [20]byte fix-sized array format To []byte `protobuf:"bytes,2,opt,name=to,proto3" json:"to,omitempty"` // contract address in evm address [20]byte fix-sized array format Data []byte `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` // solidity-spec abi encoded bytes + Gas uint64 `protobuf:"varint,4,opt,name=gas,proto3" json:"gas,omitempty"` // gas limit, 0 is unbounded unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -194,6 +195,13 @@ func (x *CallMsg) GetData() []byte { return nil } +func (x *CallMsg) GetGas() uint64 { + if x != nil { + return x.Gas + } + return 0 +} + type Topics struct { state protoimpl.MessageState `protogen:"open.v1"` Topic [][]byte `protobuf:"bytes,1,rep,name=topic,proto3" json:"topic,omitempty"` // in [32]byte fix-sized array format @@ -2999,11 +3007,12 @@ var File_evm_proto protoreflect.FileDescriptor const file_evm_proto_rawDesc = "" + "\n" + - "\tevm.proto\x12\bloop.evm\x1a\x1bgoogle/protobuf/empty.proto\x1a\x1dloop/chain-common/query.proto\x1a\x16values/v1/values.proto\"A\n" + + "\tevm.proto\x12\bloop.evm\x1a\x1bgoogle/protobuf/empty.proto\x1a\x1dloop/chain-common/query.proto\x1a\x16values/v1/values.proto\"S\n" + "\aCallMsg\x12\x12\n" + "\x04from\x18\x01 \x01(\fR\x04from\x12\x0e\n" + "\x02to\x18\x02 \x01(\fR\x02to\x12\x12\n" + - "\x04data\x18\x03 \x01(\fR\x04data\"\x1e\n" + + "\x04data\x18\x03 \x01(\fR\x04data\x12\x10\n" + + "\x03gas\x18\x04 \x01(\x04R\x03gas\"\x1e\n" + "\x06Topics\x12\x14\n" + "\x05topic\x18\x01 \x03(\fR\x05topic\"\xa0\x02\n" + "\x03Log\x12\x18\n" + diff --git a/pkg/chains/evm/evm.proto b/pkg/chains/evm/evm.proto index 370d4c88a4..a690883243 100644 --- a/pkg/chains/evm/evm.proto +++ b/pkg/chains/evm/evm.proto @@ -32,6 +32,7 @@ message CallMsg { bytes from = 1; // sender address in evm address [20]byte fix-sized array format bytes to = 2; // contract address in evm address [20]byte fix-sized array format bytes data = 3; // solidity-spec abi encoded bytes + uint64 gas = 4; // gas limit, 0 is unbounded } message Topics { diff --git a/pkg/chains/evm/proto_helpers.go b/pkg/chains/evm/proto_helpers.go index c587b1ca55..0ed1ae65bd 100644 --- a/pkg/chains/evm/proto_helpers.go +++ b/pkg/chains/evm/proto_helpers.go @@ -244,6 +244,7 @@ func ConvertCallMsgToProto(msg *evmtypes.CallMsg) (*CallMsg, error) { From: msg.From[:], To: msg.To[:], Data: msg.Data, + Gas: msg.Gas, }, nil } @@ -260,6 +261,7 @@ func ConvertCallMsgFromProto(protoMsg *CallMsg) (*evmtypes.CallMsg, error) { callMsg := &evmtypes.CallMsg{ Data: protoMsg.GetData(), To: toAddress, + Gas: protoMsg.Gas, } // fromAddress is optional