From 6ab4b6d0e8e61b6c4bd6366790f64d45ebd8490f Mon Sep 17 00:00:00 2001 From: Silas Lenihan Date: Tue, 3 Mar 2026 13:27:26 -0500 Subject: [PATCH 1/2] Solana LogTrigger: Change eventIdlJson to contractIdlJson --- go.mod | 2 +- go.sum | 4 +-- .../v2/chain-capabilities/evm/client.pb.go | 12 ++++++--- .../v2/chain-capabilities/solana/client.pb.go | 26 +++++++++---------- 4 files changed, 25 insertions(+), 19 deletions(-) diff --git a/go.mod b/go.mod index eb9c45471..b22dd31f0 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-20260226130359-963f935e0396 + github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260303182245-8434c02d5479 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 bfa8dbdd0..d733b3963 100644 --- a/go.sum +++ b/go.sum @@ -332,8 +332,8 @@ 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-20260226130359-963f935e0396 h1:03tbcwjyIEjvHba1IWOj1sfThwebm2XNzyFHSuZtlWc= -github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260226130359-963f935e0396/go.mod h1:Jqt53s27Tr0jDl8mdBXg1xhu6F8Fci8JOuq43tgHOM8= +github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260303182245-8434c02d5479 h1:+ifRmeiXFrEpEo3U8wNvQY3qnOuMhMHpddHiK4J4Qj4= +github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260303182245-8434c02d5479/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 a4327ae5c..15dba1e00 100644 --- a/pkg/capabilities/v2/chain-capabilities/evm/client.pb.go +++ b/pkg/capabilities/v2/chain-capabilities/evm/client.pb.go @@ -1791,7 +1791,7 @@ const file_capabilities_blockchain_evm_v1alpha_client_proto_rawDesc = "" + "\bTxStatus\x12\x13\n" + "\x0fTX_STATUS_FATAL\x10\x00\x12\x16\n" + "\x12TX_STATUS_REVERTED\x10\x01\x12\x15\n" + - "\x11TX_STATUS_SUCCESS\x10\x022\xcb\x11\n" + + "\x11TX_STATUS_SUCCESS\x10\x022\xa9\x12\n" + "\x06Client\x12\x80\x01\n" + "\fCallContract\x128.capabilities.blockchain.evm.v1alpha.CallContractRequest\x1a6.capabilities.blockchain.evm.v1alpha.CallContractReply\x12z\n" + "\n" + @@ -1803,8 +1803,8 @@ const file_capabilities_blockchain_evm_v1alpha_client_proto_rawDesc = "" + "\x0eHeaderByNumber\x12:.capabilities.blockchain.evm.v1alpha.HeaderByNumberRequest\x1a8.capabilities.blockchain.evm.v1alpha.HeaderByNumberReply\x12v\n" + "\n" + "LogTrigger\x12<.capabilities.blockchain.evm.v1alpha.FilterLogTriggerRequest\x1a(.capabilities.blockchain.evm.v1alpha.Log0\x01\x12}\n" + - "\vWriteReport\x127.capabilities.blockchain.evm.v1alpha.WriteReportRequest\x1a5.capabilities.blockchain.evm.v1alpha.WriteReportReply\x1a\x90\b\x82\xb5\x18\x8b\b\b\x01\x12\tevm@1.0.0\x1a\xfb\a\n" + - "\rChainSelector\x12\xe9\a\x12\xe6\a\n" + + "\vWriteReport\x127.capabilities.blockchain.evm.v1alpha.WriteReportRequest\x1a5.capabilities.blockchain.evm.v1alpha.WriteReportReply\x1a\xee\b\x82\xb5\x18\xe9\b\b\x01\x12\tevm@1.0.0\x1a\xd9\b\n" + + "\rChainSelector\x12\xc7\b\x12\xc4\b\n" + "$\n" + "\x17apechain-testnet-curtis\x10\xc1ô\xf8\x8dĒ\xb2\x89\x01\n" + "\x17\n" + @@ -1828,6 +1828,8 @@ const file_capabilities_blockchain_evm_v1alpha_client_proto_rawDesc = "" + ")\n" + "\x1dethereum-mainnet-worldchain-1\x10\x87ﺷŶ¸\x1c\n" + "%\n" + + "\x19ethereum-mainnet-xlayer-1\x10\x96\xa5\xfc\x9c\xa6\xa8\xef\xed)\n" + + "%\n" + "\x19ethereum-mainnet-zksync-1\x10\x94\xee\x97\xd9\xed\xb4\xb1\xd7\x15\n" + "%\n" + "\x18ethereum-testnet-sepolia\x10ٵ\xe4\xce\xfc\xc9\xee\xa0\xde\x01\n" + @@ -1848,8 +1850,12 @@ const file_capabilities_blockchain_evm_v1alpha_client_proto_rawDesc = "" + " \n" + "\x13ink-testnet-sepolia\x10\xe8\xf4\xa7\xa5\xf3\xe6\x96\xc0\x87\x01\n" + "\x19\n" + + "\rjovay-mainnet\x10\xb5\xc3Ě\xa1\x80ߒ\x15\n" + + "\x19\n" + "\rjovay-testnet\x10\xe4ϊ\x84\u07b2ގ\r\n" + "\x1a\n" + + "\x0epharos-mainnet\x10\xc8\xc1\x87\x9e\xf5\xef͡l\n" + + "\x1a\n" + "\x0eplasma-testnet\x10՛\xbf\xa5ô\x99\x877\n" + "\x1b\n" + "\x0fpolygon-mainnet\x10\xb1\xab\xe4\U0001a486\x9d8\n" + diff --git a/pkg/capabilities/v2/chain-capabilities/solana/client.pb.go b/pkg/capabilities/v2/chain-capabilities/solana/client.pb.go index 372b061ed..40f5f836b 100644 --- a/pkg/capabilities/v2/chain-capabilities/solana/client.pb.go +++ b/pkg/capabilities/v2/chain-capabilities/solana/client.pb.go @@ -2963,14 +2963,14 @@ func (x *SubkeyConfig) GetComparers() []*ValueComparator { } type FilterLogTriggerRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Address []byte `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` // Solana PublicKey (32 bytes) - EventName string `protobuf:"bytes,3,opt,name=event_name,json=eventName,proto3" json:"event_name,omitempty"` - EventIdlJson []byte `protobuf:"bytes,4,opt,name=event_idl_json,json=eventIdlJson,proto3" json:"event_idl_json,omitempty"` - Subkeys []*SubkeyConfig `protobuf:"bytes,5,rep,name=subkeys,proto3" json:"subkeys,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Address []byte `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` // Solana PublicKey (32 bytes) + EventName string `protobuf:"bytes,3,opt,name=event_name,json=eventName,proto3" json:"event_name,omitempty"` + ContractIdlJson []byte `protobuf:"bytes,4,opt,name=contract_idl_json,json=contractIdlJson,proto3" json:"contract_idl_json,omitempty"` + Subkeys []*SubkeyConfig `protobuf:"bytes,5,rep,name=subkeys,proto3" json:"subkeys,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *FilterLogTriggerRequest) Reset() { @@ -3024,9 +3024,9 @@ func (x *FilterLogTriggerRequest) GetEventName() string { return "" } -func (x *FilterLogTriggerRequest) GetEventIdlJson() []byte { +func (x *FilterLogTriggerRequest) GetContractIdlJson() []byte { if x != nil { - return x.EventIdlJson + return x.ContractIdlJson } return nil } @@ -3570,13 +3570,13 @@ const file_capabilities_blockchain_solana_v1alpha_client_proto_rawDesc = "" + "\boperator\x18\x02 \x01(\x0e2:.capabilities.blockchain.solana.v1alpha.ComparisonOperatorR\boperator\"y\n" + "\fSubkeyConfig\x12\x12\n" + "\x04path\x18\x01 \x03(\tR\x04path\x12U\n" + - "\tcomparers\x18\x02 \x03(\v27.capabilities.blockchain.solana.v1alpha.ValueComparatorR\tcomparers\"\xdc\x01\n" + + "\tcomparers\x18\x02 \x03(\v27.capabilities.blockchain.solana.v1alpha.ValueComparatorR\tcomparers\"\xe2\x01\n" + "\x17FilterLogTriggerRequest\x12\x12\n" + "\x04name\x18\x01 \x01(\tR\x04name\x12\x18\n" + "\aaddress\x18\x02 \x01(\fR\aaddress\x12\x1d\n" + "\n" + - "event_name\x18\x03 \x01(\tR\teventName\x12$\n" + - "\x0eevent_idl_json\x18\x04 \x01(\fR\feventIdlJson\x12N\n" + + "event_name\x18\x03 \x01(\tR\teventName\x12*\n" + + "\x11contract_idl_json\x18\x04 \x01(\fR\x0fcontractIdlJson\x12N\n" + "\asubkeys\x18\x05 \x03(\v24.capabilities.blockchain.solana.v1alpha.SubkeyConfigR\asubkeys\"\xd4\x02\n" + "\x03Log\x12\x19\n" + "\bchain_id\x18\x01 \x01(\tR\achainId\x12\x1b\n" + From 0a45615ebb7fbdd3a85d17adec3e2d939fb15b98 Mon Sep 17 00:00:00 2001 From: Silas Lenihan <32529249+silaslenihan@users.noreply.github.com> Date: Wed, 11 Mar 2026 14:12:36 -0400 Subject: [PATCH 2/2] Added CPIFilterConfig to generated code and proto helpers (#1875) * Added CPIFilterConfig to generated code and proto helpers * Added CPIFilterConfig to generated code and proto helpers --- go.mod | 2 +- go.sum | 4 +- .../v2/chain-capabilities/solana/client.pb.go | 185 ++++++++---- pkg/chains/solana/proto_helpers.go | 31 ++ pkg/chains/solana/proto_helpers_test.go | 58 ++++ pkg/chains/solana/solana.pb.go | 267 +++++++++++------- pkg/chains/solana/solana.proto | 6 + pkg/types/chains/solana/lp_types.go | 6 + 8 files changed, 399 insertions(+), 160 deletions(-) diff --git a/go.mod b/go.mod index b22dd31f0..2fc711321 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-20260303182245-8434c02d5479 + github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260311180747-73ee31ef1766 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 d733b3963..69d785d4f 100644 --- a/go.sum +++ b/go.sum @@ -332,8 +332,8 @@ 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-20260303182245-8434c02d5479 h1:+ifRmeiXFrEpEo3U8wNvQY3qnOuMhMHpddHiK4J4Qj4= -github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260303182245-8434c02d5479/go.mod h1:Jqt53s27Tr0jDl8mdBXg1xhu6F8Fci8JOuq43tgHOM8= +github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260311180747-73ee31ef1766 h1:6dCPm7XRRhYmYtoHzxbsSBrbgE5c/lk2RZMK88m/o+c= +github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260311180747-73ee31ef1766/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/solana/client.pb.go b/pkg/capabilities/v2/chain-capabilities/solana/client.pb.go index 40f5f836b..ee263e290 100644 --- a/pkg/capabilities/v2/chain-capabilities/solana/client.pb.go +++ b/pkg/capabilities/v2/chain-capabilities/solana/client.pb.go @@ -2962,6 +2962,58 @@ func (x *SubkeyConfig) GetComparers() []*ValueComparator { return nil } +type CPIFilterConfig struct { + state protoimpl.MessageState `protogen:"open.v1"` + DestAddress []byte `protobuf:"bytes,1,opt,name=dest_address,json=destAddress,proto3" json:"dest_address,omitempty"` + MethodName []byte `protobuf:"bytes,2,opt,name=method_name,json=methodName,proto3" json:"method_name,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CPIFilterConfig) Reset() { + *x = CPIFilterConfig{} + mi := &file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[44] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CPIFilterConfig) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CPIFilterConfig) ProtoMessage() {} + +func (x *CPIFilterConfig) ProtoReflect() protoreflect.Message { + mi := &file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[44] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CPIFilterConfig.ProtoReflect.Descriptor instead. +func (*CPIFilterConfig) Descriptor() ([]byte, []int) { + return file_capabilities_blockchain_solana_v1alpha_client_proto_rawDescGZIP(), []int{44} +} + +func (x *CPIFilterConfig) GetDestAddress() []byte { + if x != nil { + return x.DestAddress + } + return nil +} + +func (x *CPIFilterConfig) GetMethodName() []byte { + if x != nil { + return x.MethodName + } + return nil +} + type FilterLogTriggerRequest struct { state protoimpl.MessageState `protogen:"open.v1"` Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` @@ -2969,13 +3021,14 @@ type FilterLogTriggerRequest struct { EventName string `protobuf:"bytes,3,opt,name=event_name,json=eventName,proto3" json:"event_name,omitempty"` ContractIdlJson []byte `protobuf:"bytes,4,opt,name=contract_idl_json,json=contractIdlJson,proto3" json:"contract_idl_json,omitempty"` Subkeys []*SubkeyConfig `protobuf:"bytes,5,rep,name=subkeys,proto3" json:"subkeys,omitempty"` + CpiFilterConfig *CPIFilterConfig `protobuf:"bytes,6,opt,name=cpi_filter_config,json=cpiFilterConfig,proto3,oneof" json:"cpi_filter_config,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *FilterLogTriggerRequest) Reset() { *x = FilterLogTriggerRequest{} - mi := &file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[44] + mi := &file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[45] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2987,7 +3040,7 @@ func (x *FilterLogTriggerRequest) String() string { func (*FilterLogTriggerRequest) ProtoMessage() {} func (x *FilterLogTriggerRequest) ProtoReflect() protoreflect.Message { - mi := &file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[44] + mi := &file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[45] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3000,7 +3053,7 @@ func (x *FilterLogTriggerRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use FilterLogTriggerRequest.ProtoReflect.Descriptor instead. func (*FilterLogTriggerRequest) Descriptor() ([]byte, []int) { - return file_capabilities_blockchain_solana_v1alpha_client_proto_rawDescGZIP(), []int{44} + return file_capabilities_blockchain_solana_v1alpha_client_proto_rawDescGZIP(), []int{45} } func (x *FilterLogTriggerRequest) GetName() string { @@ -3038,6 +3091,13 @@ func (x *FilterLogTriggerRequest) GetSubkeys() []*SubkeyConfig { return nil } +func (x *FilterLogTriggerRequest) GetCpiFilterConfig() *CPIFilterConfig { + if x != nil { + return x.CpiFilterConfig + } + return nil +} + type Log struct { state protoimpl.MessageState `protogen:"open.v1"` ChainId string `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` // Chain identifier @@ -3057,7 +3117,7 @@ type Log struct { func (x *Log) Reset() { *x = Log{} - mi := &file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[45] + mi := &file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[46] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3069,7 +3129,7 @@ func (x *Log) String() string { func (*Log) ProtoMessage() {} func (x *Log) ProtoReflect() protoreflect.Message { - mi := &file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[45] + mi := &file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[46] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3082,7 +3142,7 @@ func (x *Log) ProtoReflect() protoreflect.Message { // Deprecated: Use Log.ProtoReflect.Descriptor instead. func (*Log) Descriptor() ([]byte, []int) { - return file_capabilities_blockchain_solana_v1alpha_client_proto_rawDescGZIP(), []int{45} + return file_capabilities_blockchain_solana_v1alpha_client_proto_rawDescGZIP(), []int{46} } func (x *Log) GetChainId() string { @@ -3173,7 +3233,7 @@ type AccountMeta struct { func (x *AccountMeta) Reset() { *x = AccountMeta{} - mi := &file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[46] + mi := &file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[47] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3185,7 +3245,7 @@ func (x *AccountMeta) String() string { func (*AccountMeta) ProtoMessage() {} func (x *AccountMeta) ProtoReflect() protoreflect.Message { - mi := &file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[46] + mi := &file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[47] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3198,7 +3258,7 @@ func (x *AccountMeta) ProtoReflect() protoreflect.Message { // Deprecated: Use AccountMeta.ProtoReflect.Descriptor instead. func (*AccountMeta) Descriptor() ([]byte, []int) { - return file_capabilities_blockchain_solana_v1alpha_client_proto_rawDescGZIP(), []int{46} + return file_capabilities_blockchain_solana_v1alpha_client_proto_rawDescGZIP(), []int{47} } func (x *AccountMeta) GetPublicKey() []byte { @@ -3227,7 +3287,7 @@ type WriteReportRequest struct { func (x *WriteReportRequest) Reset() { *x = WriteReportRequest{} - mi := &file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[47] + mi := &file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[48] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3239,7 +3299,7 @@ func (x *WriteReportRequest) String() string { func (*WriteReportRequest) ProtoMessage() {} func (x *WriteReportRequest) ProtoReflect() protoreflect.Message { - mi := &file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[47] + mi := &file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[48] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3252,7 +3312,7 @@ func (x *WriteReportRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use WriteReportRequest.ProtoReflect.Descriptor instead. func (*WriteReportRequest) Descriptor() ([]byte, []int) { - return file_capabilities_blockchain_solana_v1alpha_client_proto_rawDescGZIP(), []int{47} + return file_capabilities_blockchain_solana_v1alpha_client_proto_rawDescGZIP(), []int{48} } func (x *WriteReportRequest) GetRemainingAccounts() []*AccountMeta { @@ -3296,7 +3356,7 @@ type WriteReportReply struct { func (x *WriteReportReply) Reset() { *x = WriteReportReply{} - mi := &file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[48] + mi := &file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[49] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3308,7 +3368,7 @@ func (x *WriteReportReply) String() string { func (*WriteReportReply) ProtoMessage() {} func (x *WriteReportReply) ProtoReflect() protoreflect.Message { - mi := &file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[48] + mi := &file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[49] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3321,7 +3381,7 @@ func (x *WriteReportReply) ProtoReflect() protoreflect.Message { // Deprecated: Use WriteReportReply.ProtoReflect.Descriptor instead. func (*WriteReportReply) Descriptor() ([]byte, []int) { - return file_capabilities_blockchain_solana_v1alpha_client_proto_rawDescGZIP(), []int{48} + return file_capabilities_blockchain_solana_v1alpha_client_proto_rawDescGZIP(), []int{49} } func (x *WriteReportReply) GetTxStatus() TxStatus { @@ -3570,14 +3630,20 @@ const file_capabilities_blockchain_solana_v1alpha_client_proto_rawDesc = "" + "\boperator\x18\x02 \x01(\x0e2:.capabilities.blockchain.solana.v1alpha.ComparisonOperatorR\boperator\"y\n" + "\fSubkeyConfig\x12\x12\n" + "\x04path\x18\x01 \x03(\tR\x04path\x12U\n" + - "\tcomparers\x18\x02 \x03(\v27.capabilities.blockchain.solana.v1alpha.ValueComparatorR\tcomparers\"\xe2\x01\n" + + "\tcomparers\x18\x02 \x03(\v27.capabilities.blockchain.solana.v1alpha.ValueComparatorR\tcomparers\"U\n" + + "\x0fCPIFilterConfig\x12!\n" + + "\fdest_address\x18\x01 \x01(\fR\vdestAddress\x12\x1f\n" + + "\vmethod_name\x18\x02 \x01(\fR\n" + + "methodName\"\xe2\x02\n" + "\x17FilterLogTriggerRequest\x12\x12\n" + "\x04name\x18\x01 \x01(\tR\x04name\x12\x18\n" + "\aaddress\x18\x02 \x01(\fR\aaddress\x12\x1d\n" + "\n" + "event_name\x18\x03 \x01(\tR\teventName\x12*\n" + "\x11contract_idl_json\x18\x04 \x01(\fR\x0fcontractIdlJson\x12N\n" + - "\asubkeys\x18\x05 \x03(\v24.capabilities.blockchain.solana.v1alpha.SubkeyConfigR\asubkeys\"\xd4\x02\n" + + "\asubkeys\x18\x05 \x03(\v24.capabilities.blockchain.solana.v1alpha.SubkeyConfigR\asubkeys\x12h\n" + + "\x11cpi_filter_config\x18\x06 \x01(\v27.capabilities.blockchain.solana.v1alpha.CPIFilterConfigH\x00R\x0fcpiFilterConfig\x88\x01\x01B\x14\n" + + "\x12_cpi_filter_config\"\xd4\x02\n" + "\x03Log\x12\x19\n" + "\bchain_id\x18\x01 \x01(\tR\achainId\x12\x1b\n" + "\tlog_index\x18\x02 \x01(\x03R\blogIndex\x12\x1d\n" + @@ -3679,7 +3745,7 @@ func file_capabilities_blockchain_solana_v1alpha_client_proto_rawDescGZIP() []by } var file_capabilities_blockchain_solana_v1alpha_client_proto_enumTypes = make([]protoimpl.EnumInfo, 6) -var file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes = make([]protoimpl.MessageInfo, 49) +var file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes = make([]protoimpl.MessageInfo, 50) var file_capabilities_blockchain_solana_v1alpha_client_proto_goTypes = []any{ (EncodingType)(0), // 0: capabilities.blockchain.solana.v1alpha.EncodingType (CommitmentType)(0), // 1: capabilities.blockchain.solana.v1alpha.CommitmentType @@ -3731,17 +3797,18 @@ var file_capabilities_blockchain_solana_v1alpha_client_proto_goTypes = []any{ (*SimulateTransactionAccountsOpts)(nil), // 47: capabilities.blockchain.solana.v1alpha.SimulateTransactionAccountsOpts (*ValueComparator)(nil), // 48: capabilities.blockchain.solana.v1alpha.ValueComparator (*SubkeyConfig)(nil), // 49: capabilities.blockchain.solana.v1alpha.SubkeyConfig - (*FilterLogTriggerRequest)(nil), // 50: capabilities.blockchain.solana.v1alpha.FilterLogTriggerRequest - (*Log)(nil), // 51: capabilities.blockchain.solana.v1alpha.Log - (*AccountMeta)(nil), // 52: capabilities.blockchain.solana.v1alpha.AccountMeta - (*WriteReportRequest)(nil), // 53: capabilities.blockchain.solana.v1alpha.WriteReportRequest - (*WriteReportReply)(nil), // 54: capabilities.blockchain.solana.v1alpha.WriteReportReply - (*pb.BigInt)(nil), // 55: values.v1.BigInt - (*sdk.ReportResponse)(nil), // 56: sdk.v1alpha.ReportResponse + (*CPIFilterConfig)(nil), // 50: capabilities.blockchain.solana.v1alpha.CPIFilterConfig + (*FilterLogTriggerRequest)(nil), // 51: capabilities.blockchain.solana.v1alpha.FilterLogTriggerRequest + (*Log)(nil), // 52: capabilities.blockchain.solana.v1alpha.Log + (*AccountMeta)(nil), // 53: capabilities.blockchain.solana.v1alpha.AccountMeta + (*WriteReportRequest)(nil), // 54: capabilities.blockchain.solana.v1alpha.WriteReportRequest + (*WriteReportReply)(nil), // 55: capabilities.blockchain.solana.v1alpha.WriteReportReply + (*pb.BigInt)(nil), // 56: values.v1.BigInt + (*sdk.ReportResponse)(nil), // 57: sdk.v1alpha.ReportResponse } var file_capabilities_blockchain_solana_v1alpha_client_proto_depIdxs = []int32{ 8, // 0: capabilities.blockchain.solana.v1alpha.Account.data:type_name -> capabilities.blockchain.solana.v1alpha.DataBytesOrJSON - 55, // 1: capabilities.blockchain.solana.v1alpha.Account.rent_epoch:type_name -> values.v1.BigInt + 56, // 1: capabilities.blockchain.solana.v1alpha.Account.rent_epoch:type_name -> values.v1.BigInt 0, // 2: capabilities.blockchain.solana.v1alpha.DataBytesOrJSON.encoding:type_name -> capabilities.blockchain.solana.v1alpha.EncodingType 0, // 3: capabilities.blockchain.solana.v1alpha.GetAccountInfoOpts.encoding:type_name -> capabilities.blockchain.solana.v1alpha.EncodingType 1, // 4: capabilities.blockchain.solana.v1alpha.GetAccountInfoOpts.commitment:type_name -> capabilities.blockchain.solana.v1alpha.CommitmentType @@ -3786,36 +3853,37 @@ var file_capabilities_blockchain_solana_v1alpha_client_proto_depIdxs = []int32{ 4, // 43: capabilities.blockchain.solana.v1alpha.ValueComparator.operator:type_name -> capabilities.blockchain.solana.v1alpha.ComparisonOperator 48, // 44: capabilities.blockchain.solana.v1alpha.SubkeyConfig.comparers:type_name -> capabilities.blockchain.solana.v1alpha.ValueComparator 49, // 45: capabilities.blockchain.solana.v1alpha.FilterLogTriggerRequest.subkeys:type_name -> capabilities.blockchain.solana.v1alpha.SubkeyConfig - 52, // 46: capabilities.blockchain.solana.v1alpha.WriteReportRequest.remaining_accounts:type_name -> capabilities.blockchain.solana.v1alpha.AccountMeta - 7, // 47: capabilities.blockchain.solana.v1alpha.WriteReportRequest.compute_config:type_name -> capabilities.blockchain.solana.v1alpha.ComputeConfig - 56, // 48: capabilities.blockchain.solana.v1alpha.WriteReportRequest.report:type_name -> sdk.v1alpha.ReportResponse - 3, // 49: capabilities.blockchain.solana.v1alpha.WriteReportReply.tx_status:type_name -> capabilities.blockchain.solana.v1alpha.TxStatus - 5, // 50: capabilities.blockchain.solana.v1alpha.WriteReportReply.receiver_contract_execution_status:type_name -> capabilities.blockchain.solana.v1alpha.ReceiverContractExecutionStatus - 12, // 51: capabilities.blockchain.solana.v1alpha.Client.GetAccountInfoWithOpts:input_type -> capabilities.blockchain.solana.v1alpha.GetAccountInfoWithOptsRequest - 14, // 52: capabilities.blockchain.solana.v1alpha.Client.GetBalance:input_type -> capabilities.blockchain.solana.v1alpha.GetBalanceRequest - 17, // 53: capabilities.blockchain.solana.v1alpha.Client.GetBlock:input_type -> capabilities.blockchain.solana.v1alpha.GetBlockRequest - 19, // 54: capabilities.blockchain.solana.v1alpha.Client.GetFeeForMessage:input_type -> capabilities.blockchain.solana.v1alpha.GetFeeForMessageRequest - 23, // 55: capabilities.blockchain.solana.v1alpha.Client.GetMultipleAccountsWithOpts:input_type -> capabilities.blockchain.solana.v1alpha.GetMultipleAccountsWithOptsRequest - 25, // 56: capabilities.blockchain.solana.v1alpha.Client.GetSignatureStatuses:input_type -> capabilities.blockchain.solana.v1alpha.GetSignatureStatusesRequest - 28, // 57: capabilities.blockchain.solana.v1alpha.Client.GetSlotHeight:input_type -> capabilities.blockchain.solana.v1alpha.GetSlotHeightRequest - 42, // 58: capabilities.blockchain.solana.v1alpha.Client.GetTransaction:input_type -> capabilities.blockchain.solana.v1alpha.GetTransactionRequest - 50, // 59: capabilities.blockchain.solana.v1alpha.Client.LogTrigger:input_type -> capabilities.blockchain.solana.v1alpha.FilterLogTriggerRequest - 53, // 60: capabilities.blockchain.solana.v1alpha.Client.WriteReport:input_type -> capabilities.blockchain.solana.v1alpha.WriteReportRequest - 11, // 61: capabilities.blockchain.solana.v1alpha.Client.GetAccountInfoWithOpts:output_type -> capabilities.blockchain.solana.v1alpha.GetAccountInfoWithOptsReply - 13, // 62: capabilities.blockchain.solana.v1alpha.Client.GetBalance:output_type -> capabilities.blockchain.solana.v1alpha.GetBalanceReply - 16, // 63: capabilities.blockchain.solana.v1alpha.Client.GetBlock:output_type -> capabilities.blockchain.solana.v1alpha.GetBlockReply - 18, // 64: capabilities.blockchain.solana.v1alpha.Client.GetFeeForMessage:output_type -> capabilities.blockchain.solana.v1alpha.GetFeeForMessageReply - 22, // 65: capabilities.blockchain.solana.v1alpha.Client.GetMultipleAccountsWithOpts:output_type -> capabilities.blockchain.solana.v1alpha.GetMultipleAccountsWithOptsReply - 24, // 66: capabilities.blockchain.solana.v1alpha.Client.GetSignatureStatuses:output_type -> capabilities.blockchain.solana.v1alpha.GetSignatureStatusesReply - 27, // 67: capabilities.blockchain.solana.v1alpha.Client.GetSlotHeight:output_type -> capabilities.blockchain.solana.v1alpha.GetSlotHeightReply - 41, // 68: capabilities.blockchain.solana.v1alpha.Client.GetTransaction:output_type -> capabilities.blockchain.solana.v1alpha.GetTransactionReply - 51, // 69: capabilities.blockchain.solana.v1alpha.Client.LogTrigger:output_type -> capabilities.blockchain.solana.v1alpha.Log - 54, // 70: capabilities.blockchain.solana.v1alpha.Client.WriteReport:output_type -> capabilities.blockchain.solana.v1alpha.WriteReportReply - 61, // [61:71] is the sub-list for method output_type - 51, // [51:61] is the sub-list for method input_type - 51, // [51:51] is the sub-list for extension type_name - 51, // [51:51] is the sub-list for extension extendee - 0, // [0:51] is the sub-list for field type_name + 50, // 46: capabilities.blockchain.solana.v1alpha.FilterLogTriggerRequest.cpi_filter_config:type_name -> capabilities.blockchain.solana.v1alpha.CPIFilterConfig + 53, // 47: capabilities.blockchain.solana.v1alpha.WriteReportRequest.remaining_accounts:type_name -> capabilities.blockchain.solana.v1alpha.AccountMeta + 7, // 48: capabilities.blockchain.solana.v1alpha.WriteReportRequest.compute_config:type_name -> capabilities.blockchain.solana.v1alpha.ComputeConfig + 57, // 49: capabilities.blockchain.solana.v1alpha.WriteReportRequest.report:type_name -> sdk.v1alpha.ReportResponse + 3, // 50: capabilities.blockchain.solana.v1alpha.WriteReportReply.tx_status:type_name -> capabilities.blockchain.solana.v1alpha.TxStatus + 5, // 51: capabilities.blockchain.solana.v1alpha.WriteReportReply.receiver_contract_execution_status:type_name -> capabilities.blockchain.solana.v1alpha.ReceiverContractExecutionStatus + 12, // 52: capabilities.blockchain.solana.v1alpha.Client.GetAccountInfoWithOpts:input_type -> capabilities.blockchain.solana.v1alpha.GetAccountInfoWithOptsRequest + 14, // 53: capabilities.blockchain.solana.v1alpha.Client.GetBalance:input_type -> capabilities.blockchain.solana.v1alpha.GetBalanceRequest + 17, // 54: capabilities.blockchain.solana.v1alpha.Client.GetBlock:input_type -> capabilities.blockchain.solana.v1alpha.GetBlockRequest + 19, // 55: capabilities.blockchain.solana.v1alpha.Client.GetFeeForMessage:input_type -> capabilities.blockchain.solana.v1alpha.GetFeeForMessageRequest + 23, // 56: capabilities.blockchain.solana.v1alpha.Client.GetMultipleAccountsWithOpts:input_type -> capabilities.blockchain.solana.v1alpha.GetMultipleAccountsWithOptsRequest + 25, // 57: capabilities.blockchain.solana.v1alpha.Client.GetSignatureStatuses:input_type -> capabilities.blockchain.solana.v1alpha.GetSignatureStatusesRequest + 28, // 58: capabilities.blockchain.solana.v1alpha.Client.GetSlotHeight:input_type -> capabilities.blockchain.solana.v1alpha.GetSlotHeightRequest + 42, // 59: capabilities.blockchain.solana.v1alpha.Client.GetTransaction:input_type -> capabilities.blockchain.solana.v1alpha.GetTransactionRequest + 51, // 60: capabilities.blockchain.solana.v1alpha.Client.LogTrigger:input_type -> capabilities.blockchain.solana.v1alpha.FilterLogTriggerRequest + 54, // 61: capabilities.blockchain.solana.v1alpha.Client.WriteReport:input_type -> capabilities.blockchain.solana.v1alpha.WriteReportRequest + 11, // 62: capabilities.blockchain.solana.v1alpha.Client.GetAccountInfoWithOpts:output_type -> capabilities.blockchain.solana.v1alpha.GetAccountInfoWithOptsReply + 13, // 63: capabilities.blockchain.solana.v1alpha.Client.GetBalance:output_type -> capabilities.blockchain.solana.v1alpha.GetBalanceReply + 16, // 64: capabilities.blockchain.solana.v1alpha.Client.GetBlock:output_type -> capabilities.blockchain.solana.v1alpha.GetBlockReply + 18, // 65: capabilities.blockchain.solana.v1alpha.Client.GetFeeForMessage:output_type -> capabilities.blockchain.solana.v1alpha.GetFeeForMessageReply + 22, // 66: capabilities.blockchain.solana.v1alpha.Client.GetMultipleAccountsWithOpts:output_type -> capabilities.blockchain.solana.v1alpha.GetMultipleAccountsWithOptsReply + 24, // 67: capabilities.blockchain.solana.v1alpha.Client.GetSignatureStatuses:output_type -> capabilities.blockchain.solana.v1alpha.GetSignatureStatusesReply + 27, // 68: capabilities.blockchain.solana.v1alpha.Client.GetSlotHeight:output_type -> capabilities.blockchain.solana.v1alpha.GetSlotHeightReply + 41, // 69: capabilities.blockchain.solana.v1alpha.Client.GetTransaction:output_type -> capabilities.blockchain.solana.v1alpha.GetTransactionReply + 52, // 70: capabilities.blockchain.solana.v1alpha.Client.LogTrigger:output_type -> capabilities.blockchain.solana.v1alpha.Log + 55, // 71: capabilities.blockchain.solana.v1alpha.Client.WriteReport:output_type -> capabilities.blockchain.solana.v1alpha.WriteReportReply + 62, // [62:72] is the sub-list for method output_type + 52, // [52:62] is the sub-list for method input_type + 52, // [52:52] is the sub-list for extension type_name + 52, // [52:52] is the sub-list for extension extendee + 0, // [0:52] is the sub-list for field type_name } func init() { file_capabilities_blockchain_solana_v1alpha_client_proto_init() } @@ -3839,15 +3907,16 @@ func file_capabilities_blockchain_solana_v1alpha_client_proto_init() { } file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[35].OneofWrappers = []any{} file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[45].OneofWrappers = []any{} - file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[47].OneofWrappers = []any{} + file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[46].OneofWrappers = []any{} file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[48].OneofWrappers = []any{} + file_capabilities_blockchain_solana_v1alpha_client_proto_msgTypes[49].OneofWrappers = []any{} type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_capabilities_blockchain_solana_v1alpha_client_proto_rawDesc), len(file_capabilities_blockchain_solana_v1alpha_client_proto_rawDesc)), NumEnums: 6, - NumMessages: 49, + NumMessages: 50, NumExtensions: 0, NumServices: 1, }, diff --git a/pkg/chains/solana/proto_helpers.go b/pkg/chains/solana/proto_helpers.go index b3acdf5ed..dc35f338f 100644 --- a/pkg/chains/solana/proto_helpers.go +++ b/pkg/chains/solana/proto_helpers.go @@ -1541,6 +1541,11 @@ func ConvertLPFilterQueryFromProto(p *LPFilterQuery) (*typesolana.LPFilterQuery, } } + cpiFilterConfig, err := ConvertCPIFilterConfigToProto(p.CpiFilterConfig) + if err != nil { + return nil, fmt.Errorf("convert cpi filter config err: %w", err) + } + return &typesolana.LPFilterQuery{ Name: p.Name, Address: addr, @@ -1552,6 +1557,21 @@ func ConvertLPFilterQueryFromProto(p *LPFilterQuery) (*typesolana.LPFilterQuery, Retention: time.Duration(p.Retention), MaxLogsKept: p.MaxLogsKept, IncludeReverted: p.IncludeReverted, + CPIFilterConfig: cpiFilterConfig, + }, nil +} + +func ConvertCPIFilterConfigToProto(c *CPIFilterConfig) (*typesolana.CPIFilterConfig, error) { + if c == nil { + return nil, nil + } + addr, err := ConvertPublicKeyFromProto(c.DestAddress) + if err != nil { + return nil, fmt.Errorf("convert address err: %w", err) + } + return &typesolana.CPIFilterConfig{ + DestAddress: addr, + MethodName: string(c.MethodName), }, nil } @@ -1597,6 +1617,17 @@ func ConvertLPFilterQueryToProto(f *typesolana.LPFilterQuery) *LPFilterQuery { Retention: int64(f.Retention), MaxLogsKept: f.MaxLogsKept, IncludeReverted: f.IncludeReverted, + CpiFilterConfig: convertCPIFilterConfigGoToProto(f.CPIFilterConfig), + } +} + +func convertCPIFilterConfigGoToProto(c *typesolana.CPIFilterConfig) *CPIFilterConfig { + if c == nil { + return nil + } + return &CPIFilterConfig{ + DestAddress: c.DestAddress[:], + MethodName: []byte(c.MethodName), } } diff --git a/pkg/chains/solana/proto_helpers_test.go b/pkg/chains/solana/proto_helpers_test.go index 30d7d4acb..e2c49d0e7 100644 --- a/pkg/chains/solana/proto_helpers_test.go +++ b/pkg/chains/solana/proto_helpers_test.go @@ -401,3 +401,61 @@ func TestErrorJoinBehavior_PublicKeys(t *testing.T) { // Ensure errors.Is behaves reasonably (not super strict here) require.True(t, errors.Is(err, err)) } + +func TestConvertCPIFilterConfigToProto(t *testing.T) { + t.Run("nil input returns nil", func(t *testing.T) { + got, err := conv.ConvertCPIFilterConfigToProto(nil) + require.NoError(t, err) + require.Nil(t, got) + }) + + t.Run("valid config converts successfully", func(t *testing.T) { + addr := mkBytes(typesolana.PublicKeyLength, 0xAB) + methodName := []byte("someMethod") + in := &conv.CPIFilterConfig{ + DestAddress: addr, + MethodName: methodName, + } + got, err := conv.ConvertCPIFilterConfigToProto(in) + require.NoError(t, err) + require.NotNil(t, got) + require.Equal(t, addr, got.DestAddress[:]) + require.Equal(t, "someMethod", got.MethodName) + }) + + t.Run("nil address returns error", func(t *testing.T) { + in := &conv.CPIFilterConfig{ + DestAddress: nil, + MethodName: []byte("method"), + } + got, err := conv.ConvertCPIFilterConfigToProto(in) + require.Error(t, err) + require.Nil(t, got) + require.Contains(t, err.Error(), "convert address err") + require.Contains(t, err.Error(), "address can't be nil") + }) + + t.Run("invalid address length returns error", func(t *testing.T) { + in := &conv.CPIFilterConfig{ + DestAddress: mkBytes(typesolana.PublicKeyLength-1, 0x01), + MethodName: []byte("method"), + } + got, err := conv.ConvertCPIFilterConfigToProto(in) + require.Error(t, err) + require.Nil(t, got) + require.Contains(t, err.Error(), "convert address err") + require.Contains(t, err.Error(), "invalid public key") + }) + + t.Run("empty method name is allowed", func(t *testing.T) { + addr := mkBytes(typesolana.PublicKeyLength, 0x11) + in := &conv.CPIFilterConfig{ + DestAddress: addr, + MethodName: nil, + } + got, err := conv.ConvertCPIFilterConfigToProto(in) + require.NoError(t, err) + require.NotNil(t, got) + require.Equal(t, "", got.MethodName) + }) +} diff --git a/pkg/chains/solana/solana.pb.go b/pkg/chains/solana/solana.pb.go index 654b3c91e..86a4362d8 100644 --- a/pkg/chains/solana/solana.pb.go +++ b/pkg/chains/solana/solana.pb.go @@ -3384,6 +3384,58 @@ func (x *Subkeys) GetSubkeys() []string { return nil } +type CPIFilterConfig struct { + state protoimpl.MessageState `protogen:"open.v1"` + DestAddress []byte `protobuf:"bytes,1,opt,name=dest_address,json=destAddress,proto3" json:"dest_address,omitempty"` + MethodName []byte `protobuf:"bytes,2,opt,name=method_name,json=methodName,proto3" json:"method_name,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CPIFilterConfig) Reset() { + *x = CPIFilterConfig{} + mi := &file_solana_proto_msgTypes[52] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CPIFilterConfig) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CPIFilterConfig) ProtoMessage() {} + +func (x *CPIFilterConfig) ProtoReflect() protoreflect.Message { + mi := &file_solana_proto_msgTypes[52] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CPIFilterConfig.ProtoReflect.Descriptor instead. +func (*CPIFilterConfig) Descriptor() ([]byte, []int) { + return file_solana_proto_rawDescGZIP(), []int{52} +} + +func (x *CPIFilterConfig) GetDestAddress() []byte { + if x != nil { + return x.DestAddress + } + return nil +} + +func (x *CPIFilterConfig) GetMethodName() []byte { + if x != nil { + return x.MethodName + } + return nil +} + // Log-poller filter config (Solana flavor). type LPFilterQuery struct { state protoimpl.MessageState `protogen:"open.v1"` @@ -3393,19 +3445,20 @@ type LPFilterQuery struct { EventSig []byte `protobuf:"bytes,4,opt,name=event_sig,json=eventSig,proto3" json:"event_sig,omitempty"` // 8-byte event discriminator StartingBlock int64 `protobuf:"varint,5,opt,name=starting_block,json=startingBlock,proto3" json:"starting_block,omitempty"` // start slot // Deprecated: Marked as deprecated in solana.proto. - EventIdlJson []byte `protobuf:"bytes,6,opt,name=event_idl_json,json=eventIdlJson,proto3" json:"event_idl_json,omitempty"` // event IDL JSON bytes - SubkeyPaths []*Subkeys `protobuf:"bytes,7,rep,name=subkey_paths,json=subkeyPaths,proto3" json:"subkey_paths,omitempty"` // subkey selectors - Retention int64 `protobuf:"varint,8,opt,name=retention,proto3" json:"retention,omitempty"` // seconds to keep logs - MaxLogsKept int64 `protobuf:"varint,9,opt,name=max_logs_kept,json=maxLogsKept,proto3" json:"max_logs_kept,omitempty"` // 0 = unlimited - IncludeReverted bool `protobuf:"varint,10,opt,name=include_reverted,json=includeReverted,proto3" json:"include_reverted,omitempty"` // include rolled-back - ContractIdlJson []byte `protobuf:"bytes,11,opt,name=contract_idl_json,json=contractIdlJson,proto3" json:"contract_idl_json,omitempty"` // contract IDL JSON bytes + EventIdlJson []byte `protobuf:"bytes,6,opt,name=event_idl_json,json=eventIdlJson,proto3" json:"event_idl_json,omitempty"` // event IDL JSON bytes + SubkeyPaths []*Subkeys `protobuf:"bytes,7,rep,name=subkey_paths,json=subkeyPaths,proto3" json:"subkey_paths,omitempty"` // subkey selectors + Retention int64 `protobuf:"varint,8,opt,name=retention,proto3" json:"retention,omitempty"` // seconds to keep logs + MaxLogsKept int64 `protobuf:"varint,9,opt,name=max_logs_kept,json=maxLogsKept,proto3" json:"max_logs_kept,omitempty"` // 0 = unlimited + IncludeReverted bool `protobuf:"varint,10,opt,name=include_reverted,json=includeReverted,proto3" json:"include_reverted,omitempty"` // include rolled-back + ContractIdlJson []byte `protobuf:"bytes,11,opt,name=contract_idl_json,json=contractIdlJson,proto3" json:"contract_idl_json,omitempty"` // contract IDL JSON bytes + CpiFilterConfig *CPIFilterConfig `protobuf:"bytes,12,opt,name=cpi_filter_config,json=cpiFilterConfig,proto3,oneof" json:"cpi_filter_config,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *LPFilterQuery) Reset() { *x = LPFilterQuery{} - mi := &file_solana_proto_msgTypes[52] + mi := &file_solana_proto_msgTypes[53] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3417,7 +3470,7 @@ func (x *LPFilterQuery) String() string { func (*LPFilterQuery) ProtoMessage() {} func (x *LPFilterQuery) ProtoReflect() protoreflect.Message { - mi := &file_solana_proto_msgTypes[52] + mi := &file_solana_proto_msgTypes[53] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3430,7 +3483,7 @@ func (x *LPFilterQuery) ProtoReflect() protoreflect.Message { // Deprecated: Use LPFilterQuery.ProtoReflect.Descriptor instead. func (*LPFilterQuery) Descriptor() ([]byte, []int) { - return file_solana_proto_rawDescGZIP(), []int{52} + return file_solana_proto_rawDescGZIP(), []int{53} } func (x *LPFilterQuery) GetName() string { @@ -3511,6 +3564,13 @@ func (x *LPFilterQuery) GetContractIdlJson() []byte { return nil } +func (x *LPFilterQuery) GetCpiFilterConfig() *CPIFilterConfig { + if x != nil { + return x.CpiFilterConfig + } + return nil +} + // Canonical log shape for tracked events. type Log struct { state protoimpl.MessageState `protogen:"open.v1"` @@ -3531,7 +3591,7 @@ type Log struct { func (x *Log) Reset() { *x = Log{} - mi := &file_solana_proto_msgTypes[53] + mi := &file_solana_proto_msgTypes[54] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3543,7 +3603,7 @@ func (x *Log) String() string { func (*Log) ProtoMessage() {} func (x *Log) ProtoReflect() protoreflect.Message { - mi := &file_solana_proto_msgTypes[53] + mi := &file_solana_proto_msgTypes[54] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3556,7 +3616,7 @@ func (x *Log) ProtoReflect() protoreflect.Message { // Deprecated: Use Log.ProtoReflect.Descriptor instead. func (*Log) Descriptor() ([]byte, []int) { - return file_solana_proto_rawDescGZIP(), []int{53} + return file_solana_proto_rawDescGZIP(), []int{54} } func (x *Log) GetChainId() string { @@ -3647,7 +3707,7 @@ type QueryTrackedLogsRequest struct { func (x *QueryTrackedLogsRequest) Reset() { *x = QueryTrackedLogsRequest{} - mi := &file_solana_proto_msgTypes[54] + mi := &file_solana_proto_msgTypes[55] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3659,7 +3719,7 @@ func (x *QueryTrackedLogsRequest) String() string { func (*QueryTrackedLogsRequest) ProtoMessage() {} func (x *QueryTrackedLogsRequest) ProtoReflect() protoreflect.Message { - mi := &file_solana_proto_msgTypes[54] + mi := &file_solana_proto_msgTypes[55] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3672,7 +3732,7 @@ func (x *QueryTrackedLogsRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use QueryTrackedLogsRequest.ProtoReflect.Descriptor instead. func (*QueryTrackedLogsRequest) Descriptor() ([]byte, []int) { - return file_solana_proto_rawDescGZIP(), []int{54} + return file_solana_proto_rawDescGZIP(), []int{55} } func (x *QueryTrackedLogsRequest) GetFilterQuery() []*Expression { @@ -3698,7 +3758,7 @@ type QueryTrackedLogsReply struct { func (x *QueryTrackedLogsReply) Reset() { *x = QueryTrackedLogsReply{} - mi := &file_solana_proto_msgTypes[55] + mi := &file_solana_proto_msgTypes[56] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3710,7 +3770,7 @@ func (x *QueryTrackedLogsReply) String() string { func (*QueryTrackedLogsReply) ProtoMessage() {} func (x *QueryTrackedLogsReply) ProtoReflect() protoreflect.Message { - mi := &file_solana_proto_msgTypes[55] + mi := &file_solana_proto_msgTypes[56] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3723,7 +3783,7 @@ func (x *QueryTrackedLogsReply) ProtoReflect() protoreflect.Message { // Deprecated: Use QueryTrackedLogsReply.ProtoReflect.Descriptor instead. func (*QueryTrackedLogsReply) Descriptor() ([]byte, []int) { - return file_solana_proto_rawDescGZIP(), []int{55} + return file_solana_proto_rawDescGZIP(), []int{56} } func (x *QueryTrackedLogsReply) GetLogs() []*Log { @@ -3743,7 +3803,7 @@ type RegisterLogTrackingRequest struct { func (x *RegisterLogTrackingRequest) Reset() { *x = RegisterLogTrackingRequest{} - mi := &file_solana_proto_msgTypes[56] + mi := &file_solana_proto_msgTypes[57] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3755,7 +3815,7 @@ func (x *RegisterLogTrackingRequest) String() string { func (*RegisterLogTrackingRequest) ProtoMessage() {} func (x *RegisterLogTrackingRequest) ProtoReflect() protoreflect.Message { - mi := &file_solana_proto_msgTypes[56] + mi := &file_solana_proto_msgTypes[57] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3768,7 +3828,7 @@ func (x *RegisterLogTrackingRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use RegisterLogTrackingRequest.ProtoReflect.Descriptor instead. func (*RegisterLogTrackingRequest) Descriptor() ([]byte, []int) { - return file_solana_proto_rawDescGZIP(), []int{56} + return file_solana_proto_rawDescGZIP(), []int{57} } func (x *RegisterLogTrackingRequest) GetFilter() *LPFilterQuery { @@ -3786,7 +3846,7 @@ type RegisterLogTrackingReply struct { func (x *RegisterLogTrackingReply) Reset() { *x = RegisterLogTrackingReply{} - mi := &file_solana_proto_msgTypes[57] + mi := &file_solana_proto_msgTypes[58] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3798,7 +3858,7 @@ func (x *RegisterLogTrackingReply) String() string { func (*RegisterLogTrackingReply) ProtoMessage() {} func (x *RegisterLogTrackingReply) ProtoReflect() protoreflect.Message { - mi := &file_solana_proto_msgTypes[57] + mi := &file_solana_proto_msgTypes[58] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3811,7 +3871,7 @@ func (x *RegisterLogTrackingReply) ProtoReflect() protoreflect.Message { // Deprecated: Use RegisterLogTrackingReply.ProtoReflect.Descriptor instead. func (*RegisterLogTrackingReply) Descriptor() ([]byte, []int) { - return file_solana_proto_rawDescGZIP(), []int{57} + return file_solana_proto_rawDescGZIP(), []int{58} } // Unregister a filter by name/id. @@ -3824,7 +3884,7 @@ type UnregisterLogTrackingRequest struct { func (x *UnregisterLogTrackingRequest) Reset() { *x = UnregisterLogTrackingRequest{} - mi := &file_solana_proto_msgTypes[58] + mi := &file_solana_proto_msgTypes[59] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3836,7 +3896,7 @@ func (x *UnregisterLogTrackingRequest) String() string { func (*UnregisterLogTrackingRequest) ProtoMessage() {} func (x *UnregisterLogTrackingRequest) ProtoReflect() protoreflect.Message { - mi := &file_solana_proto_msgTypes[58] + mi := &file_solana_proto_msgTypes[59] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3849,7 +3909,7 @@ func (x *UnregisterLogTrackingRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use UnregisterLogTrackingRequest.ProtoReflect.Descriptor instead. func (*UnregisterLogTrackingRequest) Descriptor() ([]byte, []int) { - return file_solana_proto_rawDescGZIP(), []int{58} + return file_solana_proto_rawDescGZIP(), []int{59} } func (x *UnregisterLogTrackingRequest) GetFilterName() string { @@ -3867,7 +3927,7 @@ type UnregisterLogTrackingReply struct { func (x *UnregisterLogTrackingReply) Reset() { *x = UnregisterLogTrackingReply{} - mi := &file_solana_proto_msgTypes[59] + mi := &file_solana_proto_msgTypes[60] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3879,7 +3939,7 @@ func (x *UnregisterLogTrackingReply) String() string { func (*UnregisterLogTrackingReply) ProtoMessage() {} func (x *UnregisterLogTrackingReply) ProtoReflect() protoreflect.Message { - mi := &file_solana_proto_msgTypes[59] + mi := &file_solana_proto_msgTypes[60] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3892,7 +3952,7 @@ func (x *UnregisterLogTrackingReply) ProtoReflect() protoreflect.Message { // Deprecated: Use UnregisterLogTrackingReply.ProtoReflect.Descriptor instead. func (*UnregisterLogTrackingReply) Descriptor() ([]byte, []int) { - return file_solana_proto_rawDescGZIP(), []int{59} + return file_solana_proto_rawDescGZIP(), []int{60} } // latest block processed by lp @@ -3905,7 +3965,7 @@ type GetLatestLPBlockReply struct { func (x *GetLatestLPBlockReply) Reset() { *x = GetLatestLPBlockReply{} - mi := &file_solana_proto_msgTypes[60] + mi := &file_solana_proto_msgTypes[61] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3917,7 +3977,7 @@ func (x *GetLatestLPBlockReply) String() string { func (*GetLatestLPBlockReply) ProtoMessage() {} func (x *GetLatestLPBlockReply) ProtoReflect() protoreflect.Message { - mi := &file_solana_proto_msgTypes[60] + mi := &file_solana_proto_msgTypes[61] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3930,7 +3990,7 @@ func (x *GetLatestLPBlockReply) ProtoReflect() protoreflect.Message { // Deprecated: Use GetLatestLPBlockReply.ProtoReflect.Descriptor instead. func (*GetLatestLPBlockReply) Descriptor() ([]byte, []int) { - return file_solana_proto_rawDescGZIP(), []int{60} + return file_solana_proto_rawDescGZIP(), []int{61} } func (x *GetLatestLPBlockReply) GetSlot() uint64 { @@ -3950,7 +4010,7 @@ type GetFiltersNamesReply struct { func (x *GetFiltersNamesReply) Reset() { *x = GetFiltersNamesReply{} - mi := &file_solana_proto_msgTypes[61] + mi := &file_solana_proto_msgTypes[62] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3962,7 +4022,7 @@ func (x *GetFiltersNamesReply) String() string { func (*GetFiltersNamesReply) ProtoMessage() {} func (x *GetFiltersNamesReply) ProtoReflect() protoreflect.Message { - mi := &file_solana_proto_msgTypes[61] + mi := &file_solana_proto_msgTypes[62] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3975,7 +4035,7 @@ func (x *GetFiltersNamesReply) ProtoReflect() protoreflect.Message { // Deprecated: Use GetFiltersNamesReply.ProtoReflect.Descriptor instead. func (*GetFiltersNamesReply) Descriptor() ([]byte, []int) { - return file_solana_proto_rawDescGZIP(), []int{61} + return file_solana_proto_rawDescGZIP(), []int{62} } func (x *GetFiltersNamesReply) GetItems() []string { @@ -4228,7 +4288,11 @@ const file_solana_proto_rawDesc = "" + "\x06values\x18\x01 \x03(\fR\x06values\x12\x1a\n" + "\boperator\x18\x02 \x01(\x03R\boperator\"#\n" + "\aSubkeys\x12\x18\n" + - "\asubkeys\x18\x01 \x03(\tR\asubkeys\"\x9c\x03\n" + + "\asubkeys\x18\x01 \x03(\tR\asubkeys\"U\n" + + "\x0fCPIFilterConfig\x12!\n" + + "\fdest_address\x18\x01 \x01(\fR\vdestAddress\x12\x1f\n" + + "\vmethod_name\x18\x02 \x01(\fR\n" + + "methodName\"\x81\x04\n" + "\rLPFilterQuery\x12\x12\n" + "\x04name\x18\x01 \x01(\tR\x04name\x12\x18\n" + "\aaddress\x18\x02 \x01(\fR\aaddress\x12\x1d\n" + @@ -4242,7 +4306,9 @@ const file_solana_proto_rawDesc = "" + "\rmax_logs_kept\x18\t \x01(\x03R\vmaxLogsKept\x12)\n" + "\x10include_reverted\x18\n" + " \x01(\bR\x0fincludeReverted\x12*\n" + - "\x11contract_idl_json\x18\v \x01(\fR\x0fcontractIdlJson\"\xc5\x02\n" + + "\x11contract_idl_json\x18\v \x01(\fR\x0fcontractIdlJson\x12M\n" + + "\x11cpi_filter_config\x18\f \x01(\v2\x1c.loop.solana.CPIFilterConfigH\x00R\x0fcpiFilterConfig\x88\x01\x01B\x14\n" + + "\x12_cpi_filter_config\"\xc5\x02\n" + "\x03Log\x12\x19\n" + "\bchain_id\x18\x01 \x01(\tR\achainId\x12\x1b\n" + "\tlog_index\x18\x02 \x01(\x03R\blogIndex\x12\x1d\n" + @@ -4328,7 +4394,7 @@ func file_solana_proto_rawDescGZIP() []byte { } var file_solana_proto_enumTypes = make([]protoimpl.EnumInfo, 4) -var file_solana_proto_msgTypes = make([]protoimpl.MessageInfo, 62) +var file_solana_proto_msgTypes = make([]protoimpl.MessageInfo, 63) var file_solana_proto_goTypes = []any{ (EncodingType)(0), // 0: loop.solana.EncodingType (CommitmentType)(0), // 1: loop.solana.CommitmentType @@ -4386,26 +4452,27 @@ var file_solana_proto_goTypes = []any{ (*Primitive)(nil), // 53: loop.solana.Primitive (*HashedValueComparator)(nil), // 54: loop.solana.HashedValueComparator (*Subkeys)(nil), // 55: loop.solana.Subkeys - (*LPFilterQuery)(nil), // 56: loop.solana.LPFilterQuery - (*Log)(nil), // 57: loop.solana.Log - (*QueryTrackedLogsRequest)(nil), // 58: loop.solana.QueryTrackedLogsRequest - (*QueryTrackedLogsReply)(nil), // 59: loop.solana.QueryTrackedLogsReply - (*RegisterLogTrackingRequest)(nil), // 60: loop.solana.RegisterLogTrackingRequest - (*RegisterLogTrackingReply)(nil), // 61: loop.solana.RegisterLogTrackingReply - (*UnregisterLogTrackingRequest)(nil), // 62: loop.solana.UnregisterLogTrackingRequest - (*UnregisterLogTrackingReply)(nil), // 63: loop.solana.UnregisterLogTrackingReply - (*GetLatestLPBlockReply)(nil), // 64: loop.solana.GetLatestLPBlockReply - (*GetFiltersNamesReply)(nil), // 65: loop.solana.GetFiltersNamesReply - (*pb.BigInt)(nil), // 66: values.v1.BigInt - (chain_common.ComparisonOperator)(0), // 67: loop.chain.common.ComparisonOperator - (chain_common.BooleanOperator)(0), // 68: loop.chain.common.BooleanOperator - (*chain_common.Primitive)(nil), // 69: loop.chain.common.Primitive - (*chain_common.LimitAndSort)(nil), // 70: loop.chain.common.LimitAndSort - (*emptypb.Empty)(nil), // 71: google.protobuf.Empty + (*CPIFilterConfig)(nil), // 56: loop.solana.CPIFilterConfig + (*LPFilterQuery)(nil), // 57: loop.solana.LPFilterQuery + (*Log)(nil), // 58: loop.solana.Log + (*QueryTrackedLogsRequest)(nil), // 59: loop.solana.QueryTrackedLogsRequest + (*QueryTrackedLogsReply)(nil), // 60: loop.solana.QueryTrackedLogsReply + (*RegisterLogTrackingRequest)(nil), // 61: loop.solana.RegisterLogTrackingRequest + (*RegisterLogTrackingReply)(nil), // 62: loop.solana.RegisterLogTrackingReply + (*UnregisterLogTrackingRequest)(nil), // 63: loop.solana.UnregisterLogTrackingRequest + (*UnregisterLogTrackingReply)(nil), // 64: loop.solana.UnregisterLogTrackingReply + (*GetLatestLPBlockReply)(nil), // 65: loop.solana.GetLatestLPBlockReply + (*GetFiltersNamesReply)(nil), // 66: loop.solana.GetFiltersNamesReply + (*pb.BigInt)(nil), // 67: values.v1.BigInt + (chain_common.ComparisonOperator)(0), // 68: loop.chain.common.ComparisonOperator + (chain_common.BooleanOperator)(0), // 69: loop.chain.common.BooleanOperator + (*chain_common.Primitive)(nil), // 70: loop.chain.common.Primitive + (*chain_common.LimitAndSort)(nil), // 71: loop.chain.common.LimitAndSort + (*emptypb.Empty)(nil), // 72: google.protobuf.Empty } var file_solana_proto_depIdxs = []int32{ 6, // 0: loop.solana.Account.data:type_name -> loop.solana.DataBytesOrJSON - 66, // 1: loop.solana.Account.rent_epoch:type_name -> values.v1.BigInt + 67, // 1: loop.solana.Account.rent_epoch:type_name -> values.v1.BigInt 0, // 2: loop.solana.DataBytesOrJSON.encoding:type_name -> loop.solana.EncodingType 0, // 3: loop.solana.GetAccountInfoOpts.encoding:type_name -> loop.solana.EncodingType 1, // 4: loop.solana.GetAccountInfoOpts.commitment:type_name -> loop.solana.CommitmentType @@ -4450,54 +4517,55 @@ var file_solana_proto_depIdxs = []int32{ 3, // 43: loop.solana.SubmitTransactionReply.status:type_name -> loop.solana.TxStatus 5, // 44: loop.solana.SubmitTransactionRequest.cfg:type_name -> loop.solana.ComputeConfig 54, // 45: loop.solana.EventSig.hashed_value_comparers:type_name -> loop.solana.HashedValueComparator - 67, // 46: loop.solana.IndexedValueComparator.operator:type_name -> loop.chain.common.ComparisonOperator + 68, // 46: loop.solana.IndexedValueComparator.operator:type_name -> loop.chain.common.ComparisonOperator 49, // 47: loop.solana.EventBySubkey.value_comparers:type_name -> loop.solana.IndexedValueComparator 53, // 48: loop.solana.Expression.primitive:type_name -> loop.solana.Primitive 52, // 49: loop.solana.Expression.boolean_expression:type_name -> loop.solana.BooleanExpression - 68, // 50: loop.solana.BooleanExpression.boolean_operator:type_name -> loop.chain.common.BooleanOperator + 69, // 50: loop.solana.BooleanExpression.boolean_operator:type_name -> loop.chain.common.BooleanOperator 51, // 51: loop.solana.BooleanExpression.expression:type_name -> loop.solana.Expression - 69, // 52: loop.solana.Primitive.general_primitive:type_name -> loop.chain.common.Primitive + 70, // 52: loop.solana.Primitive.general_primitive:type_name -> loop.chain.common.Primitive 50, // 53: loop.solana.Primitive.event_by_subkey:type_name -> loop.solana.EventBySubkey 55, // 54: loop.solana.LPFilterQuery.subkey_paths:type_name -> loop.solana.Subkeys - 51, // 55: loop.solana.QueryTrackedLogsRequest.filterQuery:type_name -> loop.solana.Expression - 70, // 56: loop.solana.QueryTrackedLogsRequest.limit_and_sort:type_name -> loop.chain.common.LimitAndSort - 57, // 57: loop.solana.QueryTrackedLogsReply.logs:type_name -> loop.solana.Log - 56, // 58: loop.solana.RegisterLogTrackingRequest.filter:type_name -> loop.solana.LPFilterQuery - 10, // 59: loop.solana.Solana.GetAccountInfoWithOpts:input_type -> loop.solana.GetAccountInfoWithOptsRequest - 12, // 60: loop.solana.Solana.GetBalance:input_type -> loop.solana.GetBalanceRequest - 15, // 61: loop.solana.Solana.GetBlock:input_type -> loop.solana.GetBlockRequest - 17, // 62: loop.solana.Solana.GetFeeForMessage:input_type -> loop.solana.GetFeeForMessageRequest - 21, // 63: loop.solana.Solana.GetMultipleAccountsWithOpts:input_type -> loop.solana.GetMultipleAccountsWithOptsRequest - 23, // 64: loop.solana.Solana.GetSignatureStatuses:input_type -> loop.solana.GetSignatureStatusesRequest - 26, // 65: loop.solana.Solana.GetSlotHeight:input_type -> loop.solana.GetSlotHeightRequest - 40, // 66: loop.solana.Solana.GetTransaction:input_type -> loop.solana.GetTransactionRequest - 58, // 67: loop.solana.Solana.QueryTrackedLogs:input_type -> loop.solana.QueryTrackedLogsRequest - 60, // 68: loop.solana.Solana.RegisterLogTracking:input_type -> loop.solana.RegisterLogTrackingRequest - 44, // 69: loop.solana.Solana.SimulateTX:input_type -> loop.solana.SimulateTXRequest - 47, // 70: loop.solana.Solana.SubmitTransaction:input_type -> loop.solana.SubmitTransactionRequest - 62, // 71: loop.solana.Solana.UnregisterLogTracking:input_type -> loop.solana.UnregisterLogTrackingRequest - 71, // 72: loop.solana.Solana.GetLatestLPBlock:input_type -> google.protobuf.Empty - 71, // 73: loop.solana.Solana.GetFiltersNames:input_type -> google.protobuf.Empty - 9, // 74: loop.solana.Solana.GetAccountInfoWithOpts:output_type -> loop.solana.GetAccountInfoWithOptsReply - 11, // 75: loop.solana.Solana.GetBalance:output_type -> loop.solana.GetBalanceReply - 14, // 76: loop.solana.Solana.GetBlock:output_type -> loop.solana.GetBlockReply - 16, // 77: loop.solana.Solana.GetFeeForMessage:output_type -> loop.solana.GetFeeForMessageReply - 20, // 78: loop.solana.Solana.GetMultipleAccountsWithOpts:output_type -> loop.solana.GetMultipleAccountsWithOptsReply - 22, // 79: loop.solana.Solana.GetSignatureStatuses:output_type -> loop.solana.GetSignatureStatusesReply - 25, // 80: loop.solana.Solana.GetSlotHeight:output_type -> loop.solana.GetSlotHeightReply - 39, // 81: loop.solana.Solana.GetTransaction:output_type -> loop.solana.GetTransactionReply - 59, // 82: loop.solana.Solana.QueryTrackedLogs:output_type -> loop.solana.QueryTrackedLogsReply - 61, // 83: loop.solana.Solana.RegisterLogTracking:output_type -> loop.solana.RegisterLogTrackingReply - 43, // 84: loop.solana.Solana.SimulateTX:output_type -> loop.solana.SimulateTXReply - 46, // 85: loop.solana.Solana.SubmitTransaction:output_type -> loop.solana.SubmitTransactionReply - 63, // 86: loop.solana.Solana.UnregisterLogTracking:output_type -> loop.solana.UnregisterLogTrackingReply - 64, // 87: loop.solana.Solana.GetLatestLPBlock:output_type -> loop.solana.GetLatestLPBlockReply - 65, // 88: loop.solana.Solana.GetFiltersNames:output_type -> loop.solana.GetFiltersNamesReply - 74, // [74:89] is the sub-list for method output_type - 59, // [59:74] is the sub-list for method input_type - 59, // [59:59] is the sub-list for extension type_name - 59, // [59:59] is the sub-list for extension extendee - 0, // [0:59] is the sub-list for field type_name + 56, // 55: loop.solana.LPFilterQuery.cpi_filter_config:type_name -> loop.solana.CPIFilterConfig + 51, // 56: loop.solana.QueryTrackedLogsRequest.filterQuery:type_name -> loop.solana.Expression + 71, // 57: loop.solana.QueryTrackedLogsRequest.limit_and_sort:type_name -> loop.chain.common.LimitAndSort + 58, // 58: loop.solana.QueryTrackedLogsReply.logs:type_name -> loop.solana.Log + 57, // 59: loop.solana.RegisterLogTrackingRequest.filter:type_name -> loop.solana.LPFilterQuery + 10, // 60: loop.solana.Solana.GetAccountInfoWithOpts:input_type -> loop.solana.GetAccountInfoWithOptsRequest + 12, // 61: loop.solana.Solana.GetBalance:input_type -> loop.solana.GetBalanceRequest + 15, // 62: loop.solana.Solana.GetBlock:input_type -> loop.solana.GetBlockRequest + 17, // 63: loop.solana.Solana.GetFeeForMessage:input_type -> loop.solana.GetFeeForMessageRequest + 21, // 64: loop.solana.Solana.GetMultipleAccountsWithOpts:input_type -> loop.solana.GetMultipleAccountsWithOptsRequest + 23, // 65: loop.solana.Solana.GetSignatureStatuses:input_type -> loop.solana.GetSignatureStatusesRequest + 26, // 66: loop.solana.Solana.GetSlotHeight:input_type -> loop.solana.GetSlotHeightRequest + 40, // 67: loop.solana.Solana.GetTransaction:input_type -> loop.solana.GetTransactionRequest + 59, // 68: loop.solana.Solana.QueryTrackedLogs:input_type -> loop.solana.QueryTrackedLogsRequest + 61, // 69: loop.solana.Solana.RegisterLogTracking:input_type -> loop.solana.RegisterLogTrackingRequest + 44, // 70: loop.solana.Solana.SimulateTX:input_type -> loop.solana.SimulateTXRequest + 47, // 71: loop.solana.Solana.SubmitTransaction:input_type -> loop.solana.SubmitTransactionRequest + 63, // 72: loop.solana.Solana.UnregisterLogTracking:input_type -> loop.solana.UnregisterLogTrackingRequest + 72, // 73: loop.solana.Solana.GetLatestLPBlock:input_type -> google.protobuf.Empty + 72, // 74: loop.solana.Solana.GetFiltersNames:input_type -> google.protobuf.Empty + 9, // 75: loop.solana.Solana.GetAccountInfoWithOpts:output_type -> loop.solana.GetAccountInfoWithOptsReply + 11, // 76: loop.solana.Solana.GetBalance:output_type -> loop.solana.GetBalanceReply + 14, // 77: loop.solana.Solana.GetBlock:output_type -> loop.solana.GetBlockReply + 16, // 78: loop.solana.Solana.GetFeeForMessage:output_type -> loop.solana.GetFeeForMessageReply + 20, // 79: loop.solana.Solana.GetMultipleAccountsWithOpts:output_type -> loop.solana.GetMultipleAccountsWithOptsReply + 22, // 80: loop.solana.Solana.GetSignatureStatuses:output_type -> loop.solana.GetSignatureStatusesReply + 25, // 81: loop.solana.Solana.GetSlotHeight:output_type -> loop.solana.GetSlotHeightReply + 39, // 82: loop.solana.Solana.GetTransaction:output_type -> loop.solana.GetTransactionReply + 60, // 83: loop.solana.Solana.QueryTrackedLogs:output_type -> loop.solana.QueryTrackedLogsReply + 62, // 84: loop.solana.Solana.RegisterLogTracking:output_type -> loop.solana.RegisterLogTrackingReply + 43, // 85: loop.solana.Solana.SimulateTX:output_type -> loop.solana.SimulateTXReply + 46, // 86: loop.solana.Solana.SubmitTransaction:output_type -> loop.solana.SubmitTransactionReply + 64, // 87: loop.solana.Solana.UnregisterLogTracking:output_type -> loop.solana.UnregisterLogTrackingReply + 65, // 88: loop.solana.Solana.GetLatestLPBlock:output_type -> loop.solana.GetLatestLPBlockReply + 66, // 89: loop.solana.Solana.GetFiltersNames:output_type -> loop.solana.GetFiltersNamesReply + 75, // [75:90] is the sub-list for method output_type + 60, // [60:75] is the sub-list for method input_type + 60, // [60:60] is the sub-list for extension type_name + 60, // [60:60] is the sub-list for extension extendee + 0, // [0:60] is the sub-list for field type_name } func init() { file_solana_proto_init() } @@ -4530,13 +4598,14 @@ func file_solana_proto_init() { (*Primitive_EventSig)(nil), (*Primitive_EventBySubkey)(nil), } + file_solana_proto_msgTypes[53].OneofWrappers = []any{} type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_solana_proto_rawDesc), len(file_solana_proto_rawDesc)), NumEnums: 4, - NumMessages: 62, + NumMessages: 63, NumExtensions: 0, NumServices: 1, }, diff --git a/pkg/chains/solana/solana.proto b/pkg/chains/solana/solana.proto index f777780a0..c629a81da 100644 --- a/pkg/chains/solana/solana.proto +++ b/pkg/chains/solana/solana.proto @@ -407,6 +407,11 @@ message Subkeys { repeated string subkeys = 1; // e.g., ["events","0","fields","owner"] } +message CPIFilterConfig { + bytes dest_address = 1; + bytes method_name = 2; +} + // Log-poller filter config (Solana flavor). message LPFilterQuery { string name = 1; // filter name/id @@ -420,6 +425,7 @@ message LPFilterQuery { int64 max_logs_kept = 9; // 0 = unlimited bool include_reverted = 10; // include rolled-back bytes contract_idl_json = 11; // contract IDL JSON bytes + optional CPIFilterConfig cpi_filter_config = 12; } // Canonical log shape for tracked events. diff --git a/pkg/types/chains/solana/lp_types.go b/pkg/types/chains/solana/lp_types.go index 3e65fbd8c..165a8752b 100644 --- a/pkg/types/chains/solana/lp_types.go +++ b/pkg/types/chains/solana/lp_types.go @@ -27,6 +27,7 @@ type LPFilterQuery struct { Retention time.Duration MaxLogsKept int64 IncludeReverted bool + CPIFilterConfig *CPIFilterConfig } // matches lp-parsed solana logs @@ -47,3 +48,8 @@ type Log struct { type LPBlock struct { Slot uint64 } + +type CPIFilterConfig struct { + DestAddress PublicKey + MethodName string +}