From 982e32c41758a3e858205f5dfc717aecf523f8ba Mon Sep 17 00:00:00 2001 From: Vinh Date: Fri, 31 Jan 2025 19:42:47 -0800 Subject: [PATCH] add comment for ABI on contract read/write --- protobuf/avs.pb.go | 8 ++++++-- protobuf/avs.proto | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/protobuf/avs.pb.go b/protobuf/avs.pb.go index d08367ba..b1d6f93e 100644 --- a/protobuf/avs.pb.go +++ b/protobuf/avs.pb.go @@ -760,7 +760,9 @@ type ContractWriteNode struct { ContractAddress string `protobuf:"bytes,1,opt,name=contract_address,json=contractAddress,proto3" json:"contract_address,omitempty"` CallData string `protobuf:"bytes,2,opt,name=call_data,json=callData,proto3" json:"call_data,omitempty"` - // abi is necessary to decode the return + // The ABI is only required to decode the return value of a method call. + // If we don’t need the result and only want the transaction hash (which is usually sufficient), + // then we don’t need to provide the ABI. ContractAbi string `protobuf:"bytes,3,opt,name=contract_abi,json=contractAbi,proto3" json:"contract_abi,omitempty"` Method string `protobuf:"bytes,4,opt,name=method,proto3" json:"method,omitempty"` } @@ -832,7 +834,9 @@ type ContractReadNode struct { ContractAddress string `protobuf:"bytes,1,opt,name=contract_address,json=contractAddress,proto3" json:"contract_address,omitempty"` CallData string `protobuf:"bytes,2,opt,name=call_data,json=callData,proto3" json:"call_data,omitempty"` - // abi and method name is necessary to decode the return + // The ABI and method name are required to decode the return value and pass it to the next step. + // Currently, we need to provide the contract ABI as a JSON string. + // We don’t need to include the full ABI—just enough to decode the method call. ContractAbi string `protobuf:"bytes,3,opt,name=contract_abi,json=contractAbi,proto3" json:"contract_abi,omitempty"` Method string `protobuf:"bytes,4,opt,name=method,proto3" json:"method,omitempty"` } diff --git a/protobuf/avs.proto b/protobuf/avs.proto index 752dbd93..460b76a1 100644 --- a/protobuf/avs.proto +++ b/protobuf/avs.proto @@ -124,7 +124,9 @@ message ContractWriteNode { string contract_address = 1; string call_data = 2; - // abi is necessary to decode the return + // The ABI is only required to decode the return value of a method call. + // If we don’t need the result and only want the transaction hash (which is usually sufficient), + // then we don’t need to provide the ABI. string contract_abi = 3; string method = 4; } @@ -133,7 +135,9 @@ message ContractReadNode { string contract_address = 1; string call_data = 2; - // abi and method name is necessary to decode the return + // The ABI and method name are required to decode the return value and pass it to the next step. + // Currently, we need to provide the contract ABI as a JSON string. + // We don’t need to include the full ABI—just enough to decode the method call. string contract_abi = 3; string method = 4; }