From 82e99fcfa25768784d7cee4551a4ff4ed3ee7fd4 Mon Sep 17 00:00:00 2001 From: Bolek Kulbabinski <1416262+bolekk@users.noreply.github.com> Date: Fri, 31 May 2024 15:34:49 -0700 Subject: [PATCH 1/4] [KS-241] Update metadata passed to Forwarder and Receiver --- .changeset/twenty-zoos-do.md | 5 + contracts/.changeset/rich-crabs-smoke.md | 5 + .../v0.8/keystone/KeystoneFeedsConsumer.sol | 100 +++++++++++++++--- .../src/v0.8/keystone/KeystoneForwarder.sol | 92 +++++++++------- .../v0.8/keystone/interfaces/IReceiver.sol | 2 +- core/capabilities/targets/write_target.go | 11 +- .../keystone/generated/forwarder/forwarder.go | 41 +++---- ...rapper-dependency-versions-do-not-edit.txt | 2 +- core/scripts/go.mod | 2 +- core/scripts/go.sum | 4 +- core/services/relay/evm/cap_encoder.go | 62 +++++++---- core/services/relay/evm/cap_encoder_test.go | 51 ++++----- core/services/relay/evm/write_target_test.go | 4 + core/services/workflows/engine.go | 2 +- go.mod | 2 +- go.sum | 4 +- integration-tests/go.mod | 2 +- integration-tests/go.sum | 4 +- integration-tests/load/go.mod | 2 +- integration-tests/load/go.sum | 4 +- 20 files changed, 263 insertions(+), 138 deletions(-) create mode 100644 .changeset/twenty-zoos-do.md create mode 100644 contracts/.changeset/rich-crabs-smoke.md diff --git a/.changeset/twenty-zoos-do.md b/.changeset/twenty-zoos-do.md new file mode 100644 index 00000000000..e8d999c4c7d --- /dev/null +++ b/.changeset/twenty-zoos-do.md @@ -0,0 +1,5 @@ +--- +"chainlink": patch +--- + +#internal Update metadata passed to Forwarder and Receiver diff --git a/contracts/.changeset/rich-crabs-smoke.md b/contracts/.changeset/rich-crabs-smoke.md new file mode 100644 index 00000000000..fc33cf7d4e0 --- /dev/null +++ b/contracts/.changeset/rich-crabs-smoke.md @@ -0,0 +1,5 @@ +--- +'@chainlink/contracts': patch +--- + +#internal Keystone Forwarder and Feeds Consumer diff --git a/contracts/src/v0.8/keystone/KeystoneFeedsConsumer.sol b/contracts/src/v0.8/keystone/KeystoneFeedsConsumer.sol index 36058d2b11a..1044c70d492 100644 --- a/contracts/src/v0.8/keystone/KeystoneFeedsConsumer.sol +++ b/contracts/src/v0.8/keystone/KeystoneFeedsConsumer.sol @@ -2,27 +2,101 @@ pragma solidity ^0.8.19; import {IReceiver} from "./interfaces/IReceiver.sol"; +import {ConfirmedOwner} from "../shared/access/ConfirmedOwner.sol"; -contract KeystoneFeedsConsumer is IReceiver { - event MessageReceived(bytes32 indexed workflowId, address indexed workflowOwner, uint256 nReports); - event FeedReceived(bytes32 indexed feedId, uint256 price, uint64 timestamp); +contract KeystoneFeedsConsumer is IReceiver, ConfirmedOwner { + event FeedReceived(bytes32 indexed feedId, int192 price, uint32 timestamp); - constructor() {} + error UnauthorizedSender(address sender); + error UnauthorizedWorkflowOwner(address workflowOwner); + error UnauthorizedWorkflowName(bytes10 workflowName); - struct FeedReport { - bytes32 FeedID; - uint256 Price; - uint64 Timestamp; + constructor() ConfirmedOwner(msg.sender) {} + + struct ReceivedFeedReport { + bytes32 FeedId; + int192 Price; + uint32 Timestamp; + } + + struct StoredFeedReport { + int192 Price; + uint32 Timestamp; + } + + mapping(bytes32 feedId => StoredFeedReport feedReport) internal s_feedReports; + address[] internal s_allowedSendersList; + mapping(address => bool) internal s_allowedSenders; + address[] internal s_allowedWorkflowOwnersList; + mapping(address => bool) internal s_allowedWorkflowOwners; + bytes10[] internal s_allowedWorkflowNamesList; + mapping(bytes10 => bool) internal s_allowedWorkflowNames; + + function setConfig( + address[] calldata _allowedSendersList, + address[] calldata _allowedWorkflowOwnersList, + bytes10[] calldata _allowedWorkflowNamesList + ) external onlyOwner { + for (uint32 i = 0; i < s_allowedSendersList.length; i++) { + s_allowedSenders[s_allowedSendersList[i]] = false; + } + for (uint32 i = 0; i < _allowedSendersList.length; i++) { + s_allowedSenders[_allowedSendersList[i]] = true; + } + s_allowedSendersList = _allowedSendersList; + for (uint32 i = 0; i < s_allowedWorkflowOwnersList.length; i++) { + s_allowedWorkflowOwners[s_allowedWorkflowOwnersList[i]] = false; + } + for (uint32 i = 0; i < _allowedWorkflowOwnersList.length; i++) { + s_allowedWorkflowOwners[_allowedWorkflowOwnersList[i]] = true; + } + s_allowedWorkflowOwnersList = _allowedWorkflowOwnersList; + for (uint32 i = 0; i < s_allowedWorkflowNamesList.length; i++) { + s_allowedWorkflowNames[s_allowedWorkflowNamesList[i]] = false; + } + for (uint32 i = 0; i < _allowedWorkflowNamesList.length; i++) { + s_allowedWorkflowNames[_allowedWorkflowNamesList[i]] = true; + } + s_allowedWorkflowNamesList = _allowedWorkflowNamesList; } - function onReport(bytes32 workflowId, address workflowOwner, bytes calldata rawReport) external { - // TODO: validate sender and workflowOwner + function onReport(bytes calldata metadata, bytes calldata rawReport) external { + if (s_allowedSenders[msg.sender] == false) { + revert UnauthorizedSender(msg.sender); + } + + (bytes10 workflowName, address workflowOwner) = _getInfo(metadata); + if (s_allowedWorkflowNames[workflowName] == false) { + revert UnauthorizedWorkflowName(workflowName); + } + if (s_allowedWorkflowOwners[workflowOwner] == false) { + revert UnauthorizedWorkflowOwner(workflowOwner); + } - FeedReport[] memory feeds = abi.decode(rawReport, (FeedReport[])); + ReceivedFeedReport[] memory feeds = abi.decode(rawReport, (ReceivedFeedReport[])); for (uint32 i = 0; i < feeds.length; i++) { - emit FeedReceived(feeds[i].FeedID, feeds[i].Price, feeds[i].Timestamp); + s_feedReports[feeds[i].FeedId] = StoredFeedReport(feeds[i].Price, feeds[i].Timestamp); + emit FeedReceived(feeds[i].FeedId, feeds[i].Price, feeds[i].Timestamp); } + } + + // solhint-disable-next-line chainlink-solidity/explicit-returns + function _getInfo(bytes memory metadata) internal pure returns (bytes10 workflowName, address workflowOwner) { + // (first 32 bytes contain length of the byte array) + // workflow_cid // offset 32, size 32 + // workflow_name // offset 64, size 10 + // workflow_owner // offset 74, size 20 + // report_name // offset 94, size 2 + assembly { + // shift right by 22 bytes to get the actual value + workflowName := shr(mul(22, 8), mload(add(metadata, 64))) + // shift right by 12 bytes to get the actual value + workflowOwner := shr(mul(12, 8), mload(add(metadata, 74))) + } + } - emit MessageReceived(workflowId, workflowOwner, feeds.length); + function getPrice(bytes32 feedId) external view returns (int192, uint32) { + StoredFeedReport memory report = s_feedReports[feedId]; + return (report.Price, report.Timestamp); } } diff --git a/contracts/src/v0.8/keystone/KeystoneForwarder.sol b/contracts/src/v0.8/keystone/KeystoneForwarder.sol index 3bdfd10fe8a..8eefe29dde5 100644 --- a/contracts/src/v0.8/keystone/KeystoneForwarder.sol +++ b/contracts/src/v0.8/keystone/KeystoneForwarder.sol @@ -17,6 +17,9 @@ contract KeystoneForwarder is IForwarder, ConfirmedOwner, TypeAndVersionInterfac /// REPORT_METADATA_LENGTH, which is the minimum length of a report. error InvalidReport(); + /// @notice This error is returned when the metadata version is not supported. + error InvalidVersion(uint8 version); + /// @notice This error is thrown whenever trying to set a config with a fault /// tolerance of 0. error FaultToleranceMustBePositive(); @@ -58,9 +61,9 @@ contract KeystoneForwarder is IForwarder, ConfirmedOwner, TypeAndVersionInterfac /// @param signature The signature that was invalid error InvalidSignature(bytes signature); - /// @notice This error is thrown whenever a report has already been processed. - /// @param reportId The ID of the report that was already processed - error ReportAlreadyProcessed(bytes32 reportId); + /// @notice This error is thrown whenever a message has already been processed. + /// @param messageId The ID of the message that was already processed + error AlreadyProcessed(bytes32 messageId); bool internal s_reentrancyGuard; // guard against reentrancy @@ -83,22 +86,15 @@ contract KeystoneForwarder is IForwarder, ConfirmedOwner, TypeAndVersionInterfac /// @notice Emitted when a report is processed /// @param receiver The address of the receiver contract - /// @param workflowOwner The address of the workflow owner /// @param workflowExecutionId The ID of the workflow execution /// @param result The result of the attempted delivery. True if successful. - event ReportProcessed( - address indexed receiver, - address indexed workflowOwner, - bytes32 indexed workflowExecutionId, - bool result - ); + event ReportProcessed(address indexed receiver, bytes32 indexed workflowExecutionId, bool result); constructor() ConfirmedOwner(msg.sender) {} uint256 internal constant MAX_ORACLES = 31; - // 32 bytes for workflowId, 4 bytes for donId, 32 bytes for - // workflowExecutionId, 20 bytes for workflowOwner - uint256 internal constant REPORT_METADATA_LENGTH = 88; + uint256 internal constant METADATA_LENGTH = 109; + uint256 internal constant FORWARDER_METADATA_LENGTH = 45; uint256 internal constant SIGNATURE_LENGTH = 65; function setConfig(uint32 donId, uint8 f, address[] calldata signers) external onlyOwner { @@ -133,17 +129,19 @@ contract KeystoneForwarder is IForwarder, ConfirmedOwner, TypeAndVersionInterfac bytes calldata reportContext, bytes[] calldata signatures ) external nonReentrant { - if (rawReport.length < REPORT_METADATA_LENGTH) { + if (rawReport.length < METADATA_LENGTH) { revert InvalidReport(); } - (bytes32 workflowId, uint32 donId, bytes32 workflowExecutionId, address workflowOwner) = _getMetadata(rawReport); + (bytes32 workflowExecutionId, uint32 donId /* uint32 donConfigVersion */, , bytes2 reportId) = _getMetadata( + rawReport + ); // f can never be 0, so this means the config doesn't actually exist if (s_configs[donId].f == 0) revert InvalidDonId(donId); - bytes32 reportId = _reportId(receiverAddress, workflowExecutionId); - if (s_reports[reportId].transmitter != address(0)) revert ReportAlreadyProcessed(reportId); + bytes32 combinedId = _combinedId(receiverAddress, workflowExecutionId, reportId); + if (s_reports[combinedId].transmitter != address(0)) revert AlreadyProcessed(combinedId); if (s_configs[donId].f + 1 != signatures.length) revert InvalidSignatureCount(s_configs[donId].f + 1, signatures.length); @@ -169,28 +167,37 @@ contract KeystoneForwarder is IForwarder, ConfirmedOwner, TypeAndVersionInterfac } bool success; - try IReceiver(receiverAddress).onReport(workflowId, workflowOwner, rawReport[REPORT_METADATA_LENGTH:]) { + try + IReceiver(receiverAddress).onReport( + rawReport[FORWARDER_METADATA_LENGTH:METADATA_LENGTH], + rawReport[METADATA_LENGTH:] + ) + { success = true; } catch { // Do nothing, success is already false } - s_reports[reportId] = DeliveryStatus(msg.sender, success); - - emit ReportProcessed(receiverAddress, workflowOwner, workflowExecutionId, success); + s_reports[combinedId] = DeliveryStatus(msg.sender, success); + emit ReportProcessed(receiverAddress, workflowExecutionId, success); } - function _reportId(address receiver, bytes32 workflowExecutionId) internal pure returns (bytes32) { + function _combinedId(address receiver, bytes32 workflowExecutionId, bytes2 reportId) internal pure returns (bytes32) { // TODO: gas savings: could we just use a bytes key and avoid another keccak256 call - return keccak256(bytes.concat(bytes20(uint160(receiver)), workflowExecutionId)); + return keccak256(bytes.concat(bytes20(uint160(receiver)), workflowExecutionId, reportId)); } // get transmitter of a given report or 0x0 if it wasn't transmitted yet - function getTransmitter(address receiver, bytes32 workflowExecutionId) external view returns (address) { - bytes32 reportId = _reportId(receiver, workflowExecutionId); - return s_reports[reportId].transmitter; + function getTransmitter( + address receiver, + bytes32 workflowExecutionId, + bytes2 reportId + ) external view returns (address) { + bytes32 combinedId = _combinedId(receiver, workflowExecutionId, reportId); + return s_reports[combinedId].transmitter; } + // solhint-disable-next-line chainlink-solidity/explicit-returns function _splitSignature(bytes memory sig) internal pure returns (bytes32 r, bytes32 s, uint8 v) { if (sig.length != SIGNATURE_LENGTH) revert InvalidSignature(sig); @@ -213,20 +220,31 @@ contract KeystoneForwarder is IForwarder, ConfirmedOwner, TypeAndVersionInterfac } } + // solhint-disable-next-line chainlink-solidity/explicit-returns function _getMetadata( bytes memory rawReport - ) internal pure returns (bytes32 workflowId, uint32 donId, bytes32 workflowExecutionId, address workflowOwner) { + ) internal pure returns (bytes32 workflowExecutionId, uint32 donId, uint32 donConfigVersion, bytes2 reportId) { + // (first 32 bytes contain length of the report) + // version // offset 32, size 1 + // workflow_execution_id // offset 33, size 32 + // timestamp // offset 65, size 4 + // don_id // offset 69, size 4 + // don_config_version, // offset 73, size 4 + // workflow_cid // offset 77, size 32 + // workflow_name // offset 109, size 10 + // workflow_owner // offset 119, size 20 + // report_name // offset 139, size 2 + if (uint8(rawReport[32]) != 1) { + revert InvalidVersion(uint8(rawReport[32])); + } assembly { - // skip first 32 bytes, contains length of the report - // first 32 bytes is the workflowId - workflowId := mload(add(rawReport, 32)) - // next 4 bytes is donId. We shift right by 28 bytes to get the actual value - donId := shr(mul(28, 8), mload(add(rawReport, 64))) - // next 32 bytes is the workflowExecutionId - workflowExecutionId := mload(add(rawReport, 68)) - // next 20 bytes is the workflowOwner. We shift right by 12 bytes to get - // the actual value - workflowOwner := shr(mul(12, 8), mload(add(rawReport, 100))) + workflowExecutionId := mload(add(rawReport, 33)) + // shift right by 28 bytes to get the actual value + donId := shr(mul(28, 8), mload(add(rawReport, 69))) + // shift right by 28 bytes to get the actual value + donConfigVersion := shr(mul(28, 8), mload(add(rawReport, 73))) + // shift right by 30 bytes to get the actual value + reportId := shr(mul(30, 8), mload(add(rawReport, 139))) } } diff --git a/contracts/src/v0.8/keystone/interfaces/IReceiver.sol b/contracts/src/v0.8/keystone/interfaces/IReceiver.sol index 96a68ec97f2..f58c2da7ae1 100644 --- a/contracts/src/v0.8/keystone/interfaces/IReceiver.sol +++ b/contracts/src/v0.8/keystone/interfaces/IReceiver.sol @@ -3,5 +3,5 @@ pragma solidity ^0.8.19; /// @title IReceiver - receives keystone reports interface IReceiver { - function onReport(bytes32 workflowId, address workflowOwner, bytes calldata report) external; + function onReport(bytes calldata metadata, bytes calldata report) external; } diff --git a/core/capabilities/targets/write_target.go b/core/capabilities/targets/write_target.go index be5c779bf05..9eea8451fd9 100644 --- a/core/capabilities/targets/write_target.go +++ b/core/capabilities/targets/write_target.go @@ -10,6 +10,7 @@ import ( "github.com/google/uuid" "github.com/smartcontractkit/chainlink-common/pkg/capabilities" + "github.com/smartcontractkit/chainlink-common/pkg/capabilities/consensus/ocr3/types" commontypes "github.com/smartcontractkit/chainlink-common/pkg/types" "github.com/smartcontractkit/chainlink-common/pkg/values" "github.com/smartcontractkit/chainlink/v2/core/logger" @@ -19,6 +20,7 @@ var ( _ capabilities.ActionCapability = &WriteTarget{} ) +// required field of target's config in the workflow spec const signedReportField = "signed_report" type WriteTarget struct { @@ -84,11 +86,7 @@ func (cap *WriteTarget) Execute(ctx context.Context, request capabilities.Capabi return nil, fmt.Errorf("missing required field %s", signedReportField) } - var inputs struct { - Report []byte - Context []byte - Signatures [][]byte - } + inputs := types.SignedReport{} if err = signedReport.UnwrapTo(&inputs); err != nil { return nil, err } @@ -110,9 +108,11 @@ func (cap *WriteTarget) Execute(ctx context.Context, request capabilities.Capabi queryInputs := struct { Receiver string WorkflowExecutionID []byte + ReportId []byte }{ Receiver: reqConfig.Address, WorkflowExecutionID: rawExecutionID, + ReportId: inputs.ID, } var transmitter common.Address if err = cap.cr.GetLatestValue(ctx, "forwarder", "getTransmitter", queryInputs, &transmitter); err != nil { @@ -149,6 +149,7 @@ func (cap *WriteTarget) Execute(ctx context.Context, request capabilities.Capabi if req.Signatures == nil { req.Signatures = make([][]byte, 0) } + cap.lggr.Debugw("Transaction raw report", "report", hex.EncodeToString(req.RawReport)) meta := commontypes.TxMeta{WorkflowExecutionID: &request.Metadata.WorkflowExecutionID} value := big.NewInt(0) diff --git a/core/gethwrappers/keystone/generated/forwarder/forwarder.go b/core/gethwrappers/keystone/generated/forwarder/forwarder.go index 951ef047364..5479e4265a2 100644 --- a/core/gethwrappers/keystone/generated/forwarder/forwarder.go +++ b/core/gethwrappers/keystone/generated/forwarder/forwarder.go @@ -31,8 +31,8 @@ var ( ) var KeystoneForwarderMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"signer\",\"type\":\"address\"}],\"name\":\"DuplicateSigner\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"numSigners\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxSigners\",\"type\":\"uint256\"}],\"name\":\"ExcessSigners\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FaultToleranceMustBePositive\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"numSigners\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"minSigners\",\"type\":\"uint256\"}],\"name\":\"InsufficientSigners\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"donId\",\"type\":\"uint32\"}],\"name\":\"InvalidDonId\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidReport\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"name\":\"InvalidSignature\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expected\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"received\",\"type\":\"uint256\"}],\"name\":\"InvalidSignatureCount\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"signer\",\"type\":\"address\"}],\"name\":\"InvalidSigner\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ReentrantCall\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"reportId\",\"type\":\"bytes32\"}],\"name\":\"ReportAlreadyProcessed\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"workflowOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"workflowExecutionId\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"result\",\"type\":\"bool\"}],\"name\":\"ReportProcessed\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"workflowExecutionId\",\"type\":\"bytes32\"}],\"name\":\"getTransmitter\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"receiverAddress\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"rawReport\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"reportContext\",\"type\":\"bytes\"},{\"internalType\":\"bytes[]\",\"name\":\"signatures\",\"type\":\"bytes[]\"}],\"name\":\"report\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"donId\",\"type\":\"uint32\"},{\"internalType\":\"uint8\",\"name\":\"f\",\"type\":\"uint8\"},{\"internalType\":\"address[]\",\"name\":\"signers\",\"type\":\"address[]\"}],\"name\":\"setConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"typeAndVersion\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"pure\",\"type\":\"function\"}]", - Bin: "0x608060405234801561001057600080fd5b5033806000816100675760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615610097576100978161009f565b505050610148565b336001600160a01b038216036100f75760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640161005e565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b61152c806101576000396000f3fe608060405234801561001057600080fd5b506004361061007d5760003560e01c8063390d0b151161005b578063390d0b15146100f257806379ba50971461012a5780638da5cb5b14610132578063f2fde38b1461015057600080fd5b80631128956514610082578063134a46f014610097578063181f5a77146100aa575b600080fd5b610095610090366004611128565b610163565b005b6100956100a53660046111d3565b6108b5565b604080518082018252601781527f4b657973746f6e65466f7277617264657220312e302e30000000000000000000602082015290516100e991906112ab565b60405180910390f35b6101056101003660046112c5565b610c16565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016100e9565b610095610ca7565b60005473ffffffffffffffffffffffffffffffffffffffff16610105565b61009561015e3660046112ef565b610da4565b60015474010000000000000000000000000000000000000000900460ff16156101b8576040517f37ed32e800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600180547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff16740100000000000000000000000000000000000000001790556058851015610232576040517fb55ac75400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000806000806102778a8a8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610db892505050565b63ffffffff8316600090815260026020526040812054949850929650909450925060ff90911690036102e2576040517fea1b312900000000000000000000000000000000000000000000000000000000815263ffffffff841660048201526024015b60405180910390fd5b604080517fffffffffffffffffffffffffffffffffffffffff00000000000000000000000060608e901b1660208083019190915260348083018690528351808403909101815260549092018352815191810191909120600081815260039092529190205473ffffffffffffffffffffffffffffffffffffffff1615610396576040517f1aac3d29000000000000000000000000000000000000000000000000000000008152600481018290526024016102d9565b63ffffffff841660009081526002602052604090205486906103bc9060ff166001611339565b60ff16146104275763ffffffff84166000908152600260205260409020546103e89060ff166001611339565b6040517fd6022e8e00000000000000000000000000000000000000000000000000000000815260ff9091166004820152602481018790526044016102d9565b60008b8b604051610439929190611352565b604051908190038120610452918c908c90602001611362565b604051602081830303815290604052805190602001209050610472610fb5565b6000805b898110156106e05760008060006104e48e8e868181106104985761049861137c565b90506020028101906104aa91906113ab565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610ddd92505050565b9194509250905060006001886104fb84601b611339565b6040805160008152602081018083529390935260ff90911690820152606081018690526080810185905260a0016020604051602081039080840390855afa15801561054a573d6000803e3d6000fd5b5050604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015163ffffffff8f1660009081526002602081815284832073ffffffffffffffffffffffffffffffffffffffff851684529091019052918220549850925060ff881690039050610605576040517fbf18af4300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff821660048201526024016102d9565b610610600187611410565b955060008760ff8816601f81106106295761062961137c565b602002015173ffffffffffffffffffffffffffffffffffffffff1614610693576040517fe021c4f200000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff821660048201526024016102d9565b80878760ff16601f81106106a9576106a961137c565b73ffffffffffffffffffffffffffffffffffffffff9092166020929092020152506106d992508391506114299050565b9050610476565b5050505060008c73ffffffffffffffffffffffffffffffffffffffff1663ff5a027087858f8f605890809261071793929190611461565b6040518563ffffffff1660e01b8152600401610736949392919061148b565b600060405180830381600087803b15801561075057600080fd5b505af1925050508015610761575060015b1561076a575060015b60405180604001604052803373ffffffffffffffffffffffffffffffffffffffff1681526020018215158152506003600084815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060208201518160000160146101000a81548160ff021916908315150217905550905050838373ffffffffffffffffffffffffffffffffffffffff168e73ffffffffffffffffffffffffffffffffffffffff167fdae8e752043eb5fc7e4a6eced57ceaf159548b630125ece9ffc41cfc952c208184604051610876911515815260200190565b60405180910390a45050600180547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1690555050505050505050505050565b6108bd610e3d565b8260ff166000036108fa576040517f0743bae600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b601f81111561093f576040517f61750f4000000000000000000000000000000000000000000000000000000000815260048101829052601f60248201526044016102d9565b61094a8360036114fc565b60ff1681116109a8578061095f8460036114fc565b61096a906001611339565b6040517f9dd9e6d8000000000000000000000000000000000000000000000000000000008152600481019290925260ff1660248201526044016102d9565b60005b63ffffffff8516600090815260026020526040902060010154811015610a495763ffffffff851660009081526002602052604081206001018054839081106109f5576109f561137c565b600091825260208083209091015463ffffffff891683526002808352604080852073ffffffffffffffffffffffffffffffffffffffff9093168552910190915281205550610a4281611429565b90506109ab565b5063ffffffff84166000908152600260205260409020610a6d906001018383610fd4565b5060005b81811015610bcb576000838383818110610a8d57610a8d61137c565b9050602002016020810190610aa291906112ef565b63ffffffff8716600090815260026020818152604080842073ffffffffffffffffffffffffffffffffffffffff86168552909201905290205490915015610b2d576040517fe021c4f200000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff821660048201526024016102d9565b610b38826001611339565b63ffffffff8716600090815260026020818152604080842073ffffffffffffffffffffffffffffffffffffffff909616808552868401835290842060ff959095169094559081526001938401805494850181558252902090910180547fffffffffffffffffffffffff0000000000000000000000000000000000000000169091179055610bc481611429565b9050610a71565b50505063ffffffff91909116600090815260026020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660ff909216919091179055565b600080610c7884846040517fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606084901b1660208201526034810182905260009060540160405160208183030381529060405280519060200120905092915050565b60009081526003602052604090205473ffffffffffffffffffffffffffffffffffffffff169150505b92915050565b60015473ffffffffffffffffffffffffffffffffffffffff163314610d28576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e65720000000000000000000060448201526064016102d9565b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b610dac610e3d565b610db581610ec0565b50565b602081015160408201516044830151606490930151919360e09190911c929160601c90565b60008060006041845114610e1f57836040517f2adfdc300000000000000000000000000000000000000000000000000000000081526004016102d991906112ab565b50505060208101516040820151606090920151909260009190911a90565b60005473ffffffffffffffffffffffffffffffffffffffff163314610ebe576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e65720000000000000000000060448201526064016102d9565b565b3373ffffffffffffffffffffffffffffffffffffffff821603610f3f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c6600000000000000000060448201526064016102d9565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b604051806103e00160405280601f906020820280368337509192915050565b82805482825590600052602060002090810192821561104c579160200282015b8281111561104c5781547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff843516178255602090920191600190910190610ff4565b5061105892915061105c565b5090565b5b80821115611058576000815560010161105d565b803573ffffffffffffffffffffffffffffffffffffffff8116811461109557600080fd5b919050565b60008083601f8401126110ac57600080fd5b50813567ffffffffffffffff8111156110c457600080fd5b6020830191508360208285010111156110dc57600080fd5b9250929050565b60008083601f8401126110f557600080fd5b50813567ffffffffffffffff81111561110d57600080fd5b6020830191508360208260051b85010111156110dc57600080fd5b60008060008060008060006080888a03121561114357600080fd5b61114c88611071565b9650602088013567ffffffffffffffff8082111561116957600080fd5b6111758b838c0161109a565b909850965060408a013591508082111561118e57600080fd5b61119a8b838c0161109a565b909650945060608a01359150808211156111b357600080fd5b506111c08a828b016110e3565b989b979a50959850939692959293505050565b600080600080606085870312156111e957600080fd5b843563ffffffff811681146111fd57600080fd5b9350602085013560ff8116811461121357600080fd5b9250604085013567ffffffffffffffff81111561122f57600080fd5b61123b878288016110e3565b95989497509550505050565b6000815180845260005b8181101561126d57602081850181015186830182015201611251565b5060006020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b6020815260006112be6020830184611247565b9392505050565b600080604083850312156112d857600080fd5b6112e183611071565b946020939093013593505050565b60006020828403121561130157600080fd5b6112be82611071565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60ff8181168382160190811115610ca157610ca161130a565b8183823760009101908152919050565b838152818360208301376000910160200190815292915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe18436030181126113e057600080fd5b83018035915067ffffffffffffffff8211156113fb57600080fd5b6020019150368190038213156110dc57600080fd5b60ff8281168282160390811115610ca157610ca161130a565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361145a5761145a61130a565b5060010190565b6000808585111561147157600080fd5b8386111561147e57600080fd5b5050820193919092039150565b84815273ffffffffffffffffffffffffffffffffffffffff8416602082015260606040820152816060820152818360808301376000818301608090810191909152601f9092017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01601019392505050565b60ff81811683821602908116908181146115185761151861130a565b509291505056fea164736f6c6343000813000a", + ABI: "[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"messageId\",\"type\":\"bytes32\"}],\"name\":\"AlreadyProcessed\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"signer\",\"type\":\"address\"}],\"name\":\"DuplicateSigner\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"numSigners\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxSigners\",\"type\":\"uint256\"}],\"name\":\"ExcessSigners\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FaultToleranceMustBePositive\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"numSigners\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"minSigners\",\"type\":\"uint256\"}],\"name\":\"InsufficientSigners\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"donId\",\"type\":\"uint32\"}],\"name\":\"InvalidDonId\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidReport\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"name\":\"InvalidSignature\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expected\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"received\",\"type\":\"uint256\"}],\"name\":\"InvalidSignatureCount\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"signer\",\"type\":\"address\"}],\"name\":\"InvalidSigner\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"InvalidVersion\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ReentrantCall\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"workflowExecutionId\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"result\",\"type\":\"bool\"}],\"name\":\"ReportProcessed\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"workflowExecutionId\",\"type\":\"bytes32\"},{\"internalType\":\"bytes2\",\"name\":\"reportId\",\"type\":\"bytes2\"}],\"name\":\"getTransmitter\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"receiverAddress\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"rawReport\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"reportContext\",\"type\":\"bytes\"},{\"internalType\":\"bytes[]\",\"name\":\"signatures\",\"type\":\"bytes[]\"}],\"name\":\"report\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"donId\",\"type\":\"uint32\"},{\"internalType\":\"uint8\",\"name\":\"f\",\"type\":\"uint8\"},{\"internalType\":\"address[]\",\"name\":\"signers\",\"type\":\"address[]\"}],\"name\":\"setConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"typeAndVersion\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"pure\",\"type\":\"function\"}]", + Bin: "0x608060405234801561001057600080fd5b5033806000816100675760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615610097576100978161009f565b505050610148565b336001600160a01b038216036100f75760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640161005e565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b6115f3806101576000396000f3fe608060405234801561001057600080fd5b506004361061007d5760003560e01c806379ba50971161005b57806379ba5097146100f25780638864b864146100fa5780638da5cb5b146101d3578063f2fde38b146101f157600080fd5b80631128956514610082578063134a46f014610097578063181f5a77146100aa575b600080fd5b6100956100903660046111a4565b610204565b005b6100956100a536600461124f565b610942565b604080518082018252601781527f4b657973746f6e65466f7277617264657220312e302e30000000000000000000602082015290516100e99190611327565b60405180910390f35b610095610ca3565b6101ae610108366004611341565b6040805160609490941b7fffffffffffffffffffffffffffffffffffffffff0000000000000000000000001660208086019190915260348501939093527fffff000000000000000000000000000000000000000000000000000000000000919091166054840152805160368185030181526056909301815282519282019290922060009081526003909152205473ffffffffffffffffffffffffffffffffffffffff1690565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016100e9565b60005473ffffffffffffffffffffffffffffffffffffffff166101ae565b6100956101ff3660046113a6565b610da0565b60015474010000000000000000000000000000000000000000900460ff1615610259576040517f37ed32e800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600180547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1674010000000000000000000000000000000000000000179055606d8510156102d3576040517fb55ac75400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000806000806103188a8a8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610db492505050565b63ffffffff8316600090815260026020526040812054949850929650909450925060ff9091169003610383576040517fea1b312900000000000000000000000000000000000000000000000000000000815263ffffffff841660048201526024015b60405180910390fd5b604080517fffffffffffffffffffffffffffffffffffffffff00000000000000000000000060608e901b16602080830191909152603482018790527fffff000000000000000000000000000000000000000000000000000000000000841660548301528251808303603601815260569092018352815191810191909120600081815260039092529190205473ffffffffffffffffffffffffffffffffffffffff161561045e576040517f1a20d3e60000000000000000000000000000000000000000000000000000000081526004810182905260240161037a565b63ffffffff841660009081526002602052604090205486906104849060ff1660016113f0565b60ff16146104ef5763ffffffff84166000908152600260205260409020546104b09060ff1660016113f0565b6040517fd6022e8e00000000000000000000000000000000000000000000000000000000815260ff90911660048201526024810187905260440161037a565b60008b8b60405161050192919061140f565b60405190819003812061051a918c908c9060200161141f565b60405160208183030381529060405280519060200120905061053a611031565b6000805b898110156107a85760008060006105ac8e8e8681811061056057610560611439565b90506020028101906105729190611468565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610e5992505050565b9194509250905060006001886105c384601b6113f0565b6040805160008152602081018083529390935260ff90911690820152606081018690526080810185905260a0016020604051602081039080840390855afa158015610612573d6000803e3d6000fd5b5050604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015163ffffffff8f1660009081526002602081815284832073ffffffffffffffffffffffffffffffffffffffff851684529091019052918220549850925060ff8816900390506106cd576040517fbf18af4300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8216600482015260240161037a565b6106d86001876114cd565b955060008760ff8816601f81106106f1576106f1611439565b602002015173ffffffffffffffffffffffffffffffffffffffff161461075b576040517fe021c4f200000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8216600482015260240161037a565b80878760ff16601f811061077157610771611439565b73ffffffffffffffffffffffffffffffffffffffff9092166020929092020152506107a192508391506114e69050565b905061053e565b5050505060008c73ffffffffffffffffffffffffffffffffffffffff1663805f21328d8d602d90606d926107de9392919061151e565b8f8f606d9080926107f19392919061151e565b6040518563ffffffff1660e01b81526004016108109493929190611591565b600060405180830381600087803b15801561082a57600080fd5b505af192505050801561083b575060015b15610844575060015b604080518082018252338152821515602080830191825260008681526003909152839020915182549151151574010000000000000000000000000000000000000000027fffffffffffffffffffffff00000000000000000000000000000000000000000090921673ffffffffffffffffffffffffffffffffffffffff9182161791909117909155905187918f16907fbe015fd2fd7c1a00158e111095c794ae7030eb413d2a0990e5b78d3114df1d499061090390851515815260200190565b60405180910390a35050600180547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1690555050505050505050505050565b61094a610eb9565b8260ff16600003610987576040517f0743bae600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b601f8111156109cc576040517f61750f4000000000000000000000000000000000000000000000000000000000815260048101829052601f602482015260440161037a565b6109d78360036115c3565b60ff168111610a3557806109ec8460036115c3565b6109f79060016113f0565b6040517f9dd9e6d8000000000000000000000000000000000000000000000000000000008152600481019290925260ff16602482015260440161037a565b60005b63ffffffff8516600090815260026020526040902060010154811015610ad65763ffffffff85166000908152600260205260408120600101805483908110610a8257610a82611439565b600091825260208083209091015463ffffffff891683526002808352604080852073ffffffffffffffffffffffffffffffffffffffff9093168552910190915281205550610acf816114e6565b9050610a38565b5063ffffffff84166000908152600260205260409020610afa906001018383611050565b5060005b81811015610c58576000838383818110610b1a57610b1a611439565b9050602002016020810190610b2f91906113a6565b63ffffffff8716600090815260026020818152604080842073ffffffffffffffffffffffffffffffffffffffff86168552909201905290205490915015610bba576040517fe021c4f200000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8216600482015260240161037a565b610bc58260016113f0565b63ffffffff8716600090815260026020818152604080842073ffffffffffffffffffffffffffffffffffffffff909616808552868401835290842060ff959095169094559081526001938401805494850181558252902090910180547fffffffffffffffffffffffff0000000000000000000000000000000000000000169091179055610c51816114e6565b9050610afe565b50505063ffffffff91909116600090815260026020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660ff909216919091179055565b60015473ffffffffffffffffffffffffffffffffffffffff163314610d24576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e657200000000000000000000604482015260640161037a565b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b610da8610eb9565b610db181610f3c565b50565b60008060008084602081518110610dcd57610dcd611439565b60209101015160f81c600114610e2e5784602081518110610df057610df0611439565b01602001516040517f7207be2000000000000000000000000000000000000000000000000000000000815260f89190911c600482015260240161037a565b50505050602181015160458201516049830151608b90930151919360e091821c9390911c9160f01c90565b60008060006041845114610e9b57836040517f2adfdc3000000000000000000000000000000000000000000000000000000000815260040161037a9190611327565b50505060208101516040820151606090920151909260009190911a90565b60005473ffffffffffffffffffffffffffffffffffffffff163314610f3a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e657200000000000000000000604482015260640161037a565b565b3373ffffffffffffffffffffffffffffffffffffffff821603610fbb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640161037a565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b604051806103e00160405280601f906020820280368337509192915050565b8280548282559060005260206000209081019282156110c8579160200282015b828111156110c85781547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff843516178255602090920191600190910190611070565b506110d49291506110d8565b5090565b5b808211156110d457600081556001016110d9565b803573ffffffffffffffffffffffffffffffffffffffff8116811461111157600080fd5b919050565b60008083601f84011261112857600080fd5b50813567ffffffffffffffff81111561114057600080fd5b60208301915083602082850101111561115857600080fd5b9250929050565b60008083601f84011261117157600080fd5b50813567ffffffffffffffff81111561118957600080fd5b6020830191508360208260051b850101111561115857600080fd5b60008060008060008060006080888a0312156111bf57600080fd5b6111c8886110ed565b9650602088013567ffffffffffffffff808211156111e557600080fd5b6111f18b838c01611116565b909850965060408a013591508082111561120a57600080fd5b6112168b838c01611116565b909650945060608a013591508082111561122f57600080fd5b5061123c8a828b0161115f565b989b979a50959850939692959293505050565b6000806000806060858703121561126557600080fd5b843563ffffffff8116811461127957600080fd5b9350602085013560ff8116811461128f57600080fd5b9250604085013567ffffffffffffffff8111156112ab57600080fd5b6112b78782880161115f565b95989497509550505050565b6000815180845260005b818110156112e9576020818501810151868301820152016112cd565b5060006020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b60208152600061133a60208301846112c3565b9392505050565b60008060006060848603121561135657600080fd5b61135f846110ed565b92506020840135915060408401357fffff0000000000000000000000000000000000000000000000000000000000008116811461139b57600080fd5b809150509250925092565b6000602082840312156113b857600080fd5b61133a826110ed565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60ff8181168382160190811115611409576114096113c1565b92915050565b8183823760009101908152919050565b838152818360208301376000910160200190815292915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe184360301811261149d57600080fd5b83018035915067ffffffffffffffff8211156114b857600080fd5b60200191503681900382131561115857600080fd5b60ff8281168282160390811115611409576114096113c1565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203611517576115176113c1565b5060010190565b6000808585111561152e57600080fd5b8386111561153b57600080fd5b5050820193919092039150565b8183528181602085013750600060208284010152600060207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116840101905092915050565b6040815260006115a5604083018688611548565b82810360208401526115b8818587611548565b979650505050505050565b60ff81811683821602908116908181146115df576115df6113c1565b509291505056fea164736f6c6343000813000a", } var KeystoneForwarderABI = KeystoneForwarderMetaData.ABI @@ -171,9 +171,9 @@ func (_KeystoneForwarder *KeystoneForwarderTransactorRaw) Transact(opts *bind.Tr return _KeystoneForwarder.Contract.contract.Transact(opts, method, params...) } -func (_KeystoneForwarder *KeystoneForwarderCaller) GetTransmitter(opts *bind.CallOpts, receiver common.Address, workflowExecutionId [32]byte) (common.Address, error) { +func (_KeystoneForwarder *KeystoneForwarderCaller) GetTransmitter(opts *bind.CallOpts, receiver common.Address, workflowExecutionId [32]byte, reportId [2]byte) (common.Address, error) { var out []interface{} - err := _KeystoneForwarder.contract.Call(opts, &out, "getTransmitter", receiver, workflowExecutionId) + err := _KeystoneForwarder.contract.Call(opts, &out, "getTransmitter", receiver, workflowExecutionId, reportId) if err != nil { return *new(common.Address), err @@ -185,12 +185,12 @@ func (_KeystoneForwarder *KeystoneForwarderCaller) GetTransmitter(opts *bind.Cal } -func (_KeystoneForwarder *KeystoneForwarderSession) GetTransmitter(receiver common.Address, workflowExecutionId [32]byte) (common.Address, error) { - return _KeystoneForwarder.Contract.GetTransmitter(&_KeystoneForwarder.CallOpts, receiver, workflowExecutionId) +func (_KeystoneForwarder *KeystoneForwarderSession) GetTransmitter(receiver common.Address, workflowExecutionId [32]byte, reportId [2]byte) (common.Address, error) { + return _KeystoneForwarder.Contract.GetTransmitter(&_KeystoneForwarder.CallOpts, receiver, workflowExecutionId, reportId) } -func (_KeystoneForwarder *KeystoneForwarderCallerSession) GetTransmitter(receiver common.Address, workflowExecutionId [32]byte) (common.Address, error) { - return _KeystoneForwarder.Contract.GetTransmitter(&_KeystoneForwarder.CallOpts, receiver, workflowExecutionId) +func (_KeystoneForwarder *KeystoneForwarderCallerSession) GetTransmitter(receiver common.Address, workflowExecutionId [32]byte, reportId [2]byte) (common.Address, error) { + return _KeystoneForwarder.Contract.GetTransmitter(&_KeystoneForwarder.CallOpts, receiver, workflowExecutionId, reportId) } func (_KeystoneForwarder *KeystoneForwarderCaller) Owner(opts *bind.CallOpts) (common.Address, error) { @@ -619,50 +619,41 @@ func (it *KeystoneForwarderReportProcessedIterator) Close() error { type KeystoneForwarderReportProcessed struct { Receiver common.Address - WorkflowOwner common.Address WorkflowExecutionId [32]byte Result bool Raw types.Log } -func (_KeystoneForwarder *KeystoneForwarderFilterer) FilterReportProcessed(opts *bind.FilterOpts, receiver []common.Address, workflowOwner []common.Address, workflowExecutionId [][32]byte) (*KeystoneForwarderReportProcessedIterator, error) { +func (_KeystoneForwarder *KeystoneForwarderFilterer) FilterReportProcessed(opts *bind.FilterOpts, receiver []common.Address, workflowExecutionId [][32]byte) (*KeystoneForwarderReportProcessedIterator, error) { var receiverRule []interface{} for _, receiverItem := range receiver { receiverRule = append(receiverRule, receiverItem) } - var workflowOwnerRule []interface{} - for _, workflowOwnerItem := range workflowOwner { - workflowOwnerRule = append(workflowOwnerRule, workflowOwnerItem) - } var workflowExecutionIdRule []interface{} for _, workflowExecutionIdItem := range workflowExecutionId { workflowExecutionIdRule = append(workflowExecutionIdRule, workflowExecutionIdItem) } - logs, sub, err := _KeystoneForwarder.contract.FilterLogs(opts, "ReportProcessed", receiverRule, workflowOwnerRule, workflowExecutionIdRule) + logs, sub, err := _KeystoneForwarder.contract.FilterLogs(opts, "ReportProcessed", receiverRule, workflowExecutionIdRule) if err != nil { return nil, err } return &KeystoneForwarderReportProcessedIterator{contract: _KeystoneForwarder.contract, event: "ReportProcessed", logs: logs, sub: sub}, nil } -func (_KeystoneForwarder *KeystoneForwarderFilterer) WatchReportProcessed(opts *bind.WatchOpts, sink chan<- *KeystoneForwarderReportProcessed, receiver []common.Address, workflowOwner []common.Address, workflowExecutionId [][32]byte) (event.Subscription, error) { +func (_KeystoneForwarder *KeystoneForwarderFilterer) WatchReportProcessed(opts *bind.WatchOpts, sink chan<- *KeystoneForwarderReportProcessed, receiver []common.Address, workflowExecutionId [][32]byte) (event.Subscription, error) { var receiverRule []interface{} for _, receiverItem := range receiver { receiverRule = append(receiverRule, receiverItem) } - var workflowOwnerRule []interface{} - for _, workflowOwnerItem := range workflowOwner { - workflowOwnerRule = append(workflowOwnerRule, workflowOwnerItem) - } var workflowExecutionIdRule []interface{} for _, workflowExecutionIdItem := range workflowExecutionId { workflowExecutionIdRule = append(workflowExecutionIdRule, workflowExecutionIdItem) } - logs, sub, err := _KeystoneForwarder.contract.WatchLogs(opts, "ReportProcessed", receiverRule, workflowOwnerRule, workflowExecutionIdRule) + logs, sub, err := _KeystoneForwarder.contract.WatchLogs(opts, "ReportProcessed", receiverRule, workflowExecutionIdRule) if err != nil { return nil, err } @@ -726,7 +717,7 @@ func (KeystoneForwarderOwnershipTransferred) Topic() common.Hash { } func (KeystoneForwarderReportProcessed) Topic() common.Hash { - return common.HexToHash("0xdae8e752043eb5fc7e4a6eced57ceaf159548b630125ece9ffc41cfc952c2081") + return common.HexToHash("0xbe015fd2fd7c1a00158e111095c794ae7030eb413d2a0990e5b78d3114df1d49") } func (_KeystoneForwarder *KeystoneForwarder) Address() common.Address { @@ -734,7 +725,7 @@ func (_KeystoneForwarder *KeystoneForwarder) Address() common.Address { } type KeystoneForwarderInterface interface { - GetTransmitter(opts *bind.CallOpts, receiver common.Address, workflowExecutionId [32]byte) (common.Address, error) + GetTransmitter(opts *bind.CallOpts, receiver common.Address, workflowExecutionId [32]byte, reportId [2]byte) (common.Address, error) Owner(opts *bind.CallOpts) (common.Address, error) @@ -760,9 +751,9 @@ type KeystoneForwarderInterface interface { ParseOwnershipTransferred(log types.Log) (*KeystoneForwarderOwnershipTransferred, error) - FilterReportProcessed(opts *bind.FilterOpts, receiver []common.Address, workflowOwner []common.Address, workflowExecutionId [][32]byte) (*KeystoneForwarderReportProcessedIterator, error) + FilterReportProcessed(opts *bind.FilterOpts, receiver []common.Address, workflowExecutionId [][32]byte) (*KeystoneForwarderReportProcessedIterator, error) - WatchReportProcessed(opts *bind.WatchOpts, sink chan<- *KeystoneForwarderReportProcessed, receiver []common.Address, workflowOwner []common.Address, workflowExecutionId [][32]byte) (event.Subscription, error) + WatchReportProcessed(opts *bind.WatchOpts, sink chan<- *KeystoneForwarderReportProcessed, receiver []common.Address, workflowExecutionId [][32]byte) (event.Subscription, error) ParseReportProcessed(log types.Log) (*KeystoneForwarderReportProcessed, error) diff --git a/core/gethwrappers/keystone/generation/generated-wrapper-dependency-versions-do-not-edit.txt b/core/gethwrappers/keystone/generation/generated-wrapper-dependency-versions-do-not-edit.txt index bedaa8320eb..21de8cb7d79 100644 --- a/core/gethwrappers/keystone/generation/generated-wrapper-dependency-versions-do-not-edit.txt +++ b/core/gethwrappers/keystone/generation/generated-wrapper-dependency-versions-do-not-edit.txt @@ -1,4 +1,4 @@ GETH_VERSION: 1.13.8 -forwarder: ../../../contracts/solc/v0.8.19/KeystoneForwarder/KeystoneForwarder.abi ../../../contracts/solc/v0.8.19/KeystoneForwarder/KeystoneForwarder.bin 7de386c8c4f6cc82ee5d57c35725c522bc3ee0276356b3dce19e1735e70f17b2 +forwarder: ../../../contracts/solc/v0.8.19/KeystoneForwarder/KeystoneForwarder.abi ../../../contracts/solc/v0.8.19/KeystoneForwarder/KeystoneForwarder.bin 06d5f16f927bfc29653824ca4b113628d1620ed95b371e5abb827c142e561b49 keystone_capability_registry: ../../../contracts/solc/v0.8.19/CapabilityRegistry/CapabilityRegistry.abi ../../../contracts/solc/v0.8.19/CapabilityRegistry/CapabilityRegistry.bin 0a79d0eba13fd4a4b83d7618bb181c21c42222f3cc6c5a90a09302f685555033 ocr3_capability: ../../../contracts/solc/v0.8.19/OCR3Capability/OCR3Capability.abi ../../../contracts/solc/v0.8.19/OCR3Capability/OCR3Capability.bin 9dcbdf55bd5729ba266148da3f17733eb592c871c2108ccca546618628fd9ad2 diff --git a/core/scripts/go.mod b/core/scripts/go.mod index 69ddfb58278..c32e2a9f128 100644 --- a/core/scripts/go.mod +++ b/core/scripts/go.mod @@ -21,7 +21,7 @@ require ( github.com/prometheus/client_golang v1.17.0 github.com/shopspring/decimal v1.3.1 github.com/smartcontractkit/chainlink-automation v1.0.3 - github.com/smartcontractkit/chainlink-common v0.1.7-0.20240603100528-9e4ad2c80034 + github.com/smartcontractkit/chainlink-common v0.1.7-0.20240605021851-ddaad4797fe1 github.com/smartcontractkit/chainlink-vrf v0.0.0-20240222010609-cd67d123c772 github.com/smartcontractkit/chainlink/v2 v2.0.0-00010101000000-000000000000 github.com/smartcontractkit/libocr v0.0.0-20240419185742-fd3cab206b2c diff --git a/core/scripts/go.sum b/core/scripts/go.sum index 9745a09531e..06ad66caeaf 100644 --- a/core/scripts/go.sum +++ b/core/scripts/go.sum @@ -1185,8 +1185,8 @@ github.com/smartcontractkit/chain-selectors v1.0.10 h1:t9kJeE6B6G+hKD0GYR4kGJSCq github.com/smartcontractkit/chain-selectors v1.0.10/go.mod h1:d4Hi+E1zqjy9HqMkjBE5q1vcG9VGgxf5VxiRHfzi2kE= github.com/smartcontractkit/chainlink-automation v1.0.3 h1:h/ijT0NiyV06VxYVgcNfsE3+8OEzT3Q0Z9au0z1BPWs= github.com/smartcontractkit/chainlink-automation v1.0.3/go.mod h1:RjboV0Qd7YP+To+OrzHGXaxUxoSONveCoAK2TQ1INLU= -github.com/smartcontractkit/chainlink-common v0.1.7-0.20240603100528-9e4ad2c80034 h1:y2AKnwEybyhr7LEvBRn0RoLBABuckvB6S9gQJMEDrgU= -github.com/smartcontractkit/chainlink-common v0.1.7-0.20240603100528-9e4ad2c80034/go.mod h1:DUZccDEW98n+J1mhdWGO7wr/Njad9p9Fzks839JN7Rs= +github.com/smartcontractkit/chainlink-common v0.1.7-0.20240605021851-ddaad4797fe1 h1:3Rl4N7u9RRYmXY96ZLoaHVGONXZ8lL4Kc027dFjD46g= +github.com/smartcontractkit/chainlink-common v0.1.7-0.20240605021851-ddaad4797fe1/go.mod h1:DUZccDEW98n+J1mhdWGO7wr/Njad9p9Fzks839JN7Rs= github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20240524214833-c362c2ebbd2d h1:5tgMC5Gi2UAOKZ+m28W8ubjLeR0pQCAcrz6eQ0rW510= github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20240524214833-c362c2ebbd2d/go.mod h1:0UNuO3nDt9MFsZPaHJBEUolxVkN0iC69j1ccDp95e8k= github.com/smartcontractkit/chainlink-data-streams v0.0.0-20240220203239-09be0ea34540 h1:xFSv8561jsLtF6gYZr/zW2z5qUUAkcFkApin2mnbYTo= diff --git a/core/services/relay/evm/cap_encoder.go b/core/services/relay/evm/cap_encoder.go index e9e9c8d54d8..55cb34a90ac 100644 --- a/core/services/relay/evm/cap_encoder.go +++ b/core/services/relay/evm/cap_encoder.go @@ -2,6 +2,7 @@ package evm import ( "context" + "encoding/binary" "encoding/hex" "encoding/json" "fmt" @@ -16,7 +17,6 @@ import ( const ( abiConfigFieldName = "abi" encoderName = "user" - idLen = 32 ) type capEncoder struct { @@ -84,41 +84,65 @@ func (c *capEncoder) Encode(ctx context.Context, input values.Map) ([]byte, erro } func prependMetadataFields(meta consensustypes.Metadata, userPayload []byte) ([]byte, error) { - // TODO: use all 7 fields from Metadata struct - result := []byte{} - workflowID, err := decodeID(meta.WorkflowID, idLen) - if err != nil { + var err error + var result []byte + + // 1. Version (1 byte) + if meta.Version > 255 { + return nil, fmt.Errorf("version must be between 0 and 255") + } + result = append(result, byte(meta.Version)) + + // 2. Execution ID (32 bytes) + if result, err = decodeAndAppend(meta.ExecutionID, 32, result, "ExecutionID"); err != nil { return nil, err } - result = append(result, workflowID...) - donID, err := decodeID(meta.DONID, 4) - if err != nil { + // 3. Timestamp (4 bytes) + tsBytes := make([]byte, 4) + binary.BigEndian.PutUint32(tsBytes, meta.Timestamp) + result = append(result, tsBytes...) + + // 4. DON ID (4 bytes) + if result, err = decodeAndAppend(meta.DONID, 4, result, "DONID"); err != nil { return nil, err } - result = append(result, donID...) - executionID, err := decodeID(meta.ExecutionID, idLen) - if err != nil { + // 5. DON config version (4 bytes) + cfgVersionBytes := make([]byte, 4) + binary.BigEndian.PutUint32(cfgVersionBytes, meta.DONConfigVersion) + result = append(result, cfgVersionBytes...) + + // 5. Workflow ID / spec hash (32 bytes) + if result, err = decodeAndAppend(meta.WorkflowID, 32, result, "WorkflowID"); err != nil { return nil, err } - result = append(result, executionID...) - workflowOwner, err := decodeID(meta.WorkflowOwner, 20) - if err != nil { + // 6. Workflow Name (10 bytes) + if result, err = decodeAndAppend(meta.WorkflowName, 10, result, "WorkflowName"); err != nil { return nil, err } - result = append(result, workflowOwner...) + + // 7. Workflow Owner (20 bytes) + if result, err = decodeAndAppend(meta.WorkflowOwner, 20, result, "WorkflowOwner"); err != nil { + return nil, err + } + + // 8. Report ID (2 bytes) + if result, err = decodeAndAppend(meta.ReportID, 2, result, "ReportID"); err != nil { + return nil, err + } + return append(result, userPayload...), nil } -func decodeID(id string, expectedLen int) ([]byte, error) { +func decodeAndAppend(id string, expectedLen int, prevResult []byte, logName string) ([]byte, error) { b, err := hex.DecodeString(id) if err != nil { - return nil, err + return nil, fmt.Errorf("failed to hex-decode %s (%s): %w", logName, id, err) } if len(b) != expectedLen { - return nil, fmt.Errorf("incorrect length for id %s, expected %d bytes, got %d", id, expectedLen, len(b)) + return nil, fmt.Errorf("incorrect length for id %s (%s), expected %d bytes, got %d", logName, id, expectedLen, len(b)) } - return b, nil + return append(prevResult, b...), nil } diff --git a/core/services/relay/evm/cap_encoder_test.go b/core/services/relay/evm/cap_encoder_test.go index 7c441491064..b56d3828c42 100644 --- a/core/services/relay/evm/cap_encoder_test.go +++ b/core/services/relay/evm/cap_encoder_test.go @@ -18,10 +18,16 @@ var ( reportA = []byte{0x01, 0x02, 0x03} reportB = []byte{0xaa, 0xbb, 0xcc, 0xdd} - workflowID = "15c631d295ef5e32deb99a10ee6804bc4af1385568f9b3363f6552ac6dbb2cef" - donID = "00010203" - executionID = "8d4e66421db647dd916d3ec28d56188c8d7dae5f808e03d03339ed2562f13bb0" - workflowOwnerID = "0000000000000000000000000000000000000000" + workflowID = "15c631d295ef5e32deb99a10ee6804bc4af1385568f9b3363f6552ac6dbb2cef" + workflowName = "aabbccddeeaabbccddee" + donID = "00010203" + executionID = "8d4e66421db647dd916d3ec28d56188c8d7dae5f808e03d03339ed2562f13bb0" + workflowOwnerID = "0000000000000000000000000000000000000000" + reportID = "9988" + timestampInt = uint32(1234567890) + timestampHex = "499602d2" + configVersionInt = uint32(1) + configVersionHex = "00000001" invalidID = "not_valid" wrongLength = "8d4e66" @@ -48,10 +54,7 @@ func TestEVMEncoder_SingleField(t *testing.T) { expected := // start of the outer tuple - workflowID + - donID + - executionID + - workflowOwnerID + + getHexMetadata() + // start of the inner tuple (user_fields) "0000000000000000000000000000000000000000000000000000000000000020" + // offset of Full_reports array "0000000000000000000000000000000000000000000000000000000000000002" + // length of Full_reports array @@ -87,10 +90,7 @@ func TestEVMEncoder_TwoFields(t *testing.T) { expected := // start of the outer tuple - workflowID + - donID + - executionID + - workflowOwnerID + + getHexMetadata() + // start of the inner tuple (user_fields) "0000000000000000000000000000000000000000000000000000000000000040" + // offset of Prices array "00000000000000000000000000000000000000000000000000000000000000a0" + // offset of Timestamps array @@ -128,10 +128,7 @@ func TestEVMEncoder_Tuple(t *testing.T) { expected := // start of the outer tuple - workflowID + - donID + - executionID + - workflowOwnerID + + getHexMetadata() + // start of the inner tuple (user_fields) "0000000000000000000000000000000000000000000000000000000000000020" + // offset of Elem tuple "0000000000000000000000000000000000000000000000000000000000000040" + // offset of Prices array @@ -176,10 +173,7 @@ func TestEVMEncoder_ListOfTuples(t *testing.T) { expected := // start of the outer tuple - workflowID + - donID + - executionID + - workflowOwnerID + + getHexMetadata() + // start of the inner tuple (user_fields) "0000000000000000000000000000000000000000000000000000000000000020" + // offset of Elem list "0000000000000000000000000000000000000000000000000000000000000002" + // length of Elem list @@ -222,11 +216,20 @@ func TestEVMEncoder_InvalidIDs(t *testing.T) { assert.ErrorContains(t, err, "incorrect length for id") } +func getHexMetadata() string { + return "01" + executionID + timestampHex + donID + configVersionHex + workflowID + workflowName + workflowOwnerID + reportID +} + func getMetadata(cid string) consensustypes.Metadata { return consensustypes.Metadata{ - WorkflowID: cid, - DONID: donID, - ExecutionID: executionID, - WorkflowOwner: workflowOwnerID, + Version: 1, + ExecutionID: executionID, + Timestamp: timestampInt, + DONID: donID, + DONConfigVersion: configVersionInt, + WorkflowID: cid, + WorkflowName: workflowName, + WorkflowOwner: workflowOwnerID, + ReportID: reportID, } } diff --git a/core/services/relay/evm/write_target_test.go b/core/services/relay/evm/write_target_test.go index 76060dce990..4abbf16cd3b 100644 --- a/core/services/relay/evm/write_target_test.go +++ b/core/services/relay/evm/write_target_test.go @@ -99,6 +99,8 @@ func TestEvmWrite(t *testing.T) { "signed_report": map[string]any{ "report": []byte{1, 2, 3}, "signatures": [][]byte{}, + "context": []byte{4, 5}, + "id": []byte{9, 9}, }, }) require.NoError(t, err) @@ -193,6 +195,8 @@ func TestEvmWrite(t *testing.T) { "signed_report": map[string]any{ "report": []byte{1, 2, 3}, "signatures": [][]byte{}, + "context": []byte{4, 5}, + "id": []byte{9, 9}, }, }) require.NoError(t, err) diff --git a/core/services/workflows/engine.go b/core/services/workflows/engine.go index 2672ea3fb6f..9fb2a6beacd 100644 --- a/core/services/workflows/engine.go +++ b/core/services/workflows/engine.go @@ -794,7 +794,7 @@ func NewEngine(cfg Config) (engine *Engine, err error) { workflow.id = cfg.WorkflowID workflow.owner = cfg.WorkflowOwner - workflow.name = cfg.WorkflowName + workflow.name = hex.EncodeToString([]byte(cfg.WorkflowName)) // Instantiate semaphore to put a limit on the number of workers newWorkerCh := make(chan struct{}, cfg.MaxWorkerLimit) diff --git a/go.mod b/go.mod index f9f8cc6000e..309ecf16f01 100644 --- a/go.mod +++ b/go.mod @@ -72,7 +72,7 @@ require ( github.com/shopspring/decimal v1.3.1 github.com/smartcontractkit/chain-selectors v1.0.10 github.com/smartcontractkit/chainlink-automation v1.0.3 - github.com/smartcontractkit/chainlink-common v0.1.7-0.20240603100528-9e4ad2c80034 + github.com/smartcontractkit/chainlink-common v0.1.7-0.20240605021851-ddaad4797fe1 github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20240524214833-c362c2ebbd2d github.com/smartcontractkit/chainlink-data-streams v0.0.0-20240220203239-09be0ea34540 github.com/smartcontractkit/chainlink-feeds v0.0.0-20240522213638-159fb2d99917 diff --git a/go.sum b/go.sum index 05c8c9ffe3c..f1b2762c452 100644 --- a/go.sum +++ b/go.sum @@ -1171,8 +1171,8 @@ github.com/smartcontractkit/chain-selectors v1.0.10 h1:t9kJeE6B6G+hKD0GYR4kGJSCq github.com/smartcontractkit/chain-selectors v1.0.10/go.mod h1:d4Hi+E1zqjy9HqMkjBE5q1vcG9VGgxf5VxiRHfzi2kE= github.com/smartcontractkit/chainlink-automation v1.0.3 h1:h/ijT0NiyV06VxYVgcNfsE3+8OEzT3Q0Z9au0z1BPWs= github.com/smartcontractkit/chainlink-automation v1.0.3/go.mod h1:RjboV0Qd7YP+To+OrzHGXaxUxoSONveCoAK2TQ1INLU= -github.com/smartcontractkit/chainlink-common v0.1.7-0.20240603100528-9e4ad2c80034 h1:y2AKnwEybyhr7LEvBRn0RoLBABuckvB6S9gQJMEDrgU= -github.com/smartcontractkit/chainlink-common v0.1.7-0.20240603100528-9e4ad2c80034/go.mod h1:DUZccDEW98n+J1mhdWGO7wr/Njad9p9Fzks839JN7Rs= +github.com/smartcontractkit/chainlink-common v0.1.7-0.20240605021851-ddaad4797fe1 h1:3Rl4N7u9RRYmXY96ZLoaHVGONXZ8lL4Kc027dFjD46g= +github.com/smartcontractkit/chainlink-common v0.1.7-0.20240605021851-ddaad4797fe1/go.mod h1:DUZccDEW98n+J1mhdWGO7wr/Njad9p9Fzks839JN7Rs= github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20240524214833-c362c2ebbd2d h1:5tgMC5Gi2UAOKZ+m28W8ubjLeR0pQCAcrz6eQ0rW510= github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20240524214833-c362c2ebbd2d/go.mod h1:0UNuO3nDt9MFsZPaHJBEUolxVkN0iC69j1ccDp95e8k= github.com/smartcontractkit/chainlink-data-streams v0.0.0-20240220203239-09be0ea34540 h1:xFSv8561jsLtF6gYZr/zW2z5qUUAkcFkApin2mnbYTo= diff --git a/integration-tests/go.mod b/integration-tests/go.mod index 76fb1264b5a..968c6f04d02 100644 --- a/integration-tests/go.mod +++ b/integration-tests/go.mod @@ -27,7 +27,7 @@ require ( github.com/shopspring/decimal v1.3.1 github.com/slack-go/slack v0.12.2 github.com/smartcontractkit/chainlink-automation v1.0.3 - github.com/smartcontractkit/chainlink-common v0.1.7-0.20240603100528-9e4ad2c80034 + github.com/smartcontractkit/chainlink-common v0.1.7-0.20240605021851-ddaad4797fe1 github.com/smartcontractkit/chainlink-testing-framework v1.28.17 github.com/smartcontractkit/chainlink-vrf v0.0.0-20231120191722-fef03814f868 github.com/smartcontractkit/chainlink/v2 v2.0.0-00010101000000-000000000000 diff --git a/integration-tests/go.sum b/integration-tests/go.sum index 53462f9be60..e3a5c0a8e80 100644 --- a/integration-tests/go.sum +++ b/integration-tests/go.sum @@ -1512,8 +1512,8 @@ github.com/smartcontractkit/chain-selectors v1.0.10 h1:t9kJeE6B6G+hKD0GYR4kGJSCq github.com/smartcontractkit/chain-selectors v1.0.10/go.mod h1:d4Hi+E1zqjy9HqMkjBE5q1vcG9VGgxf5VxiRHfzi2kE= github.com/smartcontractkit/chainlink-automation v1.0.3 h1:h/ijT0NiyV06VxYVgcNfsE3+8OEzT3Q0Z9au0z1BPWs= github.com/smartcontractkit/chainlink-automation v1.0.3/go.mod h1:RjboV0Qd7YP+To+OrzHGXaxUxoSONveCoAK2TQ1INLU= -github.com/smartcontractkit/chainlink-common v0.1.7-0.20240603100528-9e4ad2c80034 h1:y2AKnwEybyhr7LEvBRn0RoLBABuckvB6S9gQJMEDrgU= -github.com/smartcontractkit/chainlink-common v0.1.7-0.20240603100528-9e4ad2c80034/go.mod h1:DUZccDEW98n+J1mhdWGO7wr/Njad9p9Fzks839JN7Rs= +github.com/smartcontractkit/chainlink-common v0.1.7-0.20240605021851-ddaad4797fe1 h1:3Rl4N7u9RRYmXY96ZLoaHVGONXZ8lL4Kc027dFjD46g= +github.com/smartcontractkit/chainlink-common v0.1.7-0.20240605021851-ddaad4797fe1/go.mod h1:DUZccDEW98n+J1mhdWGO7wr/Njad9p9Fzks839JN7Rs= github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20240524214833-c362c2ebbd2d h1:5tgMC5Gi2UAOKZ+m28W8ubjLeR0pQCAcrz6eQ0rW510= github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20240524214833-c362c2ebbd2d/go.mod h1:0UNuO3nDt9MFsZPaHJBEUolxVkN0iC69j1ccDp95e8k= github.com/smartcontractkit/chainlink-data-streams v0.0.0-20240220203239-09be0ea34540 h1:xFSv8561jsLtF6gYZr/zW2z5qUUAkcFkApin2mnbYTo= diff --git a/integration-tests/load/go.mod b/integration-tests/load/go.mod index 0163e4acd04..f12267228f3 100644 --- a/integration-tests/load/go.mod +++ b/integration-tests/load/go.mod @@ -16,7 +16,7 @@ require ( github.com/rs/zerolog v1.30.0 github.com/slack-go/slack v0.12.2 github.com/smartcontractkit/chainlink-automation v1.0.3 - github.com/smartcontractkit/chainlink-common v0.1.7-0.20240603100528-9e4ad2c80034 + github.com/smartcontractkit/chainlink-common v0.1.7-0.20240605021851-ddaad4797fe1 github.com/smartcontractkit/chainlink-testing-framework v1.28.17 github.com/smartcontractkit/chainlink/integration-tests v0.0.0-20240214231432-4ad5eb95178c github.com/smartcontractkit/chainlink/v2 v2.9.0-beta0.0.20240216210048-da02459ddad8 diff --git a/integration-tests/load/go.sum b/integration-tests/load/go.sum index 1fe677a4843..4dc25c5b838 100644 --- a/integration-tests/load/go.sum +++ b/integration-tests/load/go.sum @@ -1502,8 +1502,8 @@ github.com/smartcontractkit/chain-selectors v1.0.10 h1:t9kJeE6B6G+hKD0GYR4kGJSCq github.com/smartcontractkit/chain-selectors v1.0.10/go.mod h1:d4Hi+E1zqjy9HqMkjBE5q1vcG9VGgxf5VxiRHfzi2kE= github.com/smartcontractkit/chainlink-automation v1.0.3 h1:h/ijT0NiyV06VxYVgcNfsE3+8OEzT3Q0Z9au0z1BPWs= github.com/smartcontractkit/chainlink-automation v1.0.3/go.mod h1:RjboV0Qd7YP+To+OrzHGXaxUxoSONveCoAK2TQ1INLU= -github.com/smartcontractkit/chainlink-common v0.1.7-0.20240603100528-9e4ad2c80034 h1:y2AKnwEybyhr7LEvBRn0RoLBABuckvB6S9gQJMEDrgU= -github.com/smartcontractkit/chainlink-common v0.1.7-0.20240603100528-9e4ad2c80034/go.mod h1:DUZccDEW98n+J1mhdWGO7wr/Njad9p9Fzks839JN7Rs= +github.com/smartcontractkit/chainlink-common v0.1.7-0.20240605021851-ddaad4797fe1 h1:3Rl4N7u9RRYmXY96ZLoaHVGONXZ8lL4Kc027dFjD46g= +github.com/smartcontractkit/chainlink-common v0.1.7-0.20240605021851-ddaad4797fe1/go.mod h1:DUZccDEW98n+J1mhdWGO7wr/Njad9p9Fzks839JN7Rs= github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20240524214833-c362c2ebbd2d h1:5tgMC5Gi2UAOKZ+m28W8ubjLeR0pQCAcrz6eQ0rW510= github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20240524214833-c362c2ebbd2d/go.mod h1:0UNuO3nDt9MFsZPaHJBEUolxVkN0iC69j1ccDp95e8k= github.com/smartcontractkit/chainlink-data-streams v0.0.0-20240220203239-09be0ea34540 h1:xFSv8561jsLtF6gYZr/zW2z5qUUAkcFkApin2mnbYTo= From 8ed322447dc18f89c71b0b4ad1ab091d23175dce Mon Sep 17 00:00:00 2001 From: "app-token-issuer-infra-releng[bot]" <120227048+app-token-issuer-infra-releng[bot]@users.noreply.github.com> Date: Wed, 5 Jun 2024 02:36:46 +0000 Subject: [PATCH 2/4] Update gethwrappers --- core/gethwrappers/keystone/generated/forwarder/forwarder.go | 2 +- .../generated-wrapper-dependency-versions-do-not-edit.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/gethwrappers/keystone/generated/forwarder/forwarder.go b/core/gethwrappers/keystone/generated/forwarder/forwarder.go index 5479e4265a2..d0e235909e8 100644 --- a/core/gethwrappers/keystone/generated/forwarder/forwarder.go +++ b/core/gethwrappers/keystone/generated/forwarder/forwarder.go @@ -32,7 +32,7 @@ var ( var KeystoneForwarderMetaData = &bind.MetaData{ ABI: "[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"messageId\",\"type\":\"bytes32\"}],\"name\":\"AlreadyProcessed\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"signer\",\"type\":\"address\"}],\"name\":\"DuplicateSigner\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"numSigners\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxSigners\",\"type\":\"uint256\"}],\"name\":\"ExcessSigners\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FaultToleranceMustBePositive\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"numSigners\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"minSigners\",\"type\":\"uint256\"}],\"name\":\"InsufficientSigners\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"donId\",\"type\":\"uint32\"}],\"name\":\"InvalidDonId\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidReport\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"name\":\"InvalidSignature\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expected\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"received\",\"type\":\"uint256\"}],\"name\":\"InvalidSignatureCount\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"signer\",\"type\":\"address\"}],\"name\":\"InvalidSigner\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"InvalidVersion\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ReentrantCall\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"workflowExecutionId\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"result\",\"type\":\"bool\"}],\"name\":\"ReportProcessed\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"workflowExecutionId\",\"type\":\"bytes32\"},{\"internalType\":\"bytes2\",\"name\":\"reportId\",\"type\":\"bytes2\"}],\"name\":\"getTransmitter\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"receiverAddress\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"rawReport\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"reportContext\",\"type\":\"bytes\"},{\"internalType\":\"bytes[]\",\"name\":\"signatures\",\"type\":\"bytes[]\"}],\"name\":\"report\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"donId\",\"type\":\"uint32\"},{\"internalType\":\"uint8\",\"name\":\"f\",\"type\":\"uint8\"},{\"internalType\":\"address[]\",\"name\":\"signers\",\"type\":\"address[]\"}],\"name\":\"setConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"typeAndVersion\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"pure\",\"type\":\"function\"}]", - Bin: "0x608060405234801561001057600080fd5b5033806000816100675760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615610097576100978161009f565b505050610148565b336001600160a01b038216036100f75760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640161005e565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b6115f3806101576000396000f3fe608060405234801561001057600080fd5b506004361061007d5760003560e01c806379ba50971161005b57806379ba5097146100f25780638864b864146100fa5780638da5cb5b146101d3578063f2fde38b146101f157600080fd5b80631128956514610082578063134a46f014610097578063181f5a77146100aa575b600080fd5b6100956100903660046111a4565b610204565b005b6100956100a536600461124f565b610942565b604080518082018252601781527f4b657973746f6e65466f7277617264657220312e302e30000000000000000000602082015290516100e99190611327565b60405180910390f35b610095610ca3565b6101ae610108366004611341565b6040805160609490941b7fffffffffffffffffffffffffffffffffffffffff0000000000000000000000001660208086019190915260348501939093527fffff000000000000000000000000000000000000000000000000000000000000919091166054840152805160368185030181526056909301815282519282019290922060009081526003909152205473ffffffffffffffffffffffffffffffffffffffff1690565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016100e9565b60005473ffffffffffffffffffffffffffffffffffffffff166101ae565b6100956101ff3660046113a6565b610da0565b60015474010000000000000000000000000000000000000000900460ff1615610259576040517f37ed32e800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600180547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1674010000000000000000000000000000000000000000179055606d8510156102d3576040517fb55ac75400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000806000806103188a8a8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610db492505050565b63ffffffff8316600090815260026020526040812054949850929650909450925060ff9091169003610383576040517fea1b312900000000000000000000000000000000000000000000000000000000815263ffffffff841660048201526024015b60405180910390fd5b604080517fffffffffffffffffffffffffffffffffffffffff00000000000000000000000060608e901b16602080830191909152603482018790527fffff000000000000000000000000000000000000000000000000000000000000841660548301528251808303603601815260569092018352815191810191909120600081815260039092529190205473ffffffffffffffffffffffffffffffffffffffff161561045e576040517f1a20d3e60000000000000000000000000000000000000000000000000000000081526004810182905260240161037a565b63ffffffff841660009081526002602052604090205486906104849060ff1660016113f0565b60ff16146104ef5763ffffffff84166000908152600260205260409020546104b09060ff1660016113f0565b6040517fd6022e8e00000000000000000000000000000000000000000000000000000000815260ff90911660048201526024810187905260440161037a565b60008b8b60405161050192919061140f565b60405190819003812061051a918c908c9060200161141f565b60405160208183030381529060405280519060200120905061053a611031565b6000805b898110156107a85760008060006105ac8e8e8681811061056057610560611439565b90506020028101906105729190611468565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610e5992505050565b9194509250905060006001886105c384601b6113f0565b6040805160008152602081018083529390935260ff90911690820152606081018690526080810185905260a0016020604051602081039080840390855afa158015610612573d6000803e3d6000fd5b5050604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015163ffffffff8f1660009081526002602081815284832073ffffffffffffffffffffffffffffffffffffffff851684529091019052918220549850925060ff8816900390506106cd576040517fbf18af4300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8216600482015260240161037a565b6106d86001876114cd565b955060008760ff8816601f81106106f1576106f1611439565b602002015173ffffffffffffffffffffffffffffffffffffffff161461075b576040517fe021c4f200000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8216600482015260240161037a565b80878760ff16601f811061077157610771611439565b73ffffffffffffffffffffffffffffffffffffffff9092166020929092020152506107a192508391506114e69050565b905061053e565b5050505060008c73ffffffffffffffffffffffffffffffffffffffff1663805f21328d8d602d90606d926107de9392919061151e565b8f8f606d9080926107f19392919061151e565b6040518563ffffffff1660e01b81526004016108109493929190611591565b600060405180830381600087803b15801561082a57600080fd5b505af192505050801561083b575060015b15610844575060015b604080518082018252338152821515602080830191825260008681526003909152839020915182549151151574010000000000000000000000000000000000000000027fffffffffffffffffffffff00000000000000000000000000000000000000000090921673ffffffffffffffffffffffffffffffffffffffff9182161791909117909155905187918f16907fbe015fd2fd7c1a00158e111095c794ae7030eb413d2a0990e5b78d3114df1d499061090390851515815260200190565b60405180910390a35050600180547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1690555050505050505050505050565b61094a610eb9565b8260ff16600003610987576040517f0743bae600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b601f8111156109cc576040517f61750f4000000000000000000000000000000000000000000000000000000000815260048101829052601f602482015260440161037a565b6109d78360036115c3565b60ff168111610a3557806109ec8460036115c3565b6109f79060016113f0565b6040517f9dd9e6d8000000000000000000000000000000000000000000000000000000008152600481019290925260ff16602482015260440161037a565b60005b63ffffffff8516600090815260026020526040902060010154811015610ad65763ffffffff85166000908152600260205260408120600101805483908110610a8257610a82611439565b600091825260208083209091015463ffffffff891683526002808352604080852073ffffffffffffffffffffffffffffffffffffffff9093168552910190915281205550610acf816114e6565b9050610a38565b5063ffffffff84166000908152600260205260409020610afa906001018383611050565b5060005b81811015610c58576000838383818110610b1a57610b1a611439565b9050602002016020810190610b2f91906113a6565b63ffffffff8716600090815260026020818152604080842073ffffffffffffffffffffffffffffffffffffffff86168552909201905290205490915015610bba576040517fe021c4f200000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8216600482015260240161037a565b610bc58260016113f0565b63ffffffff8716600090815260026020818152604080842073ffffffffffffffffffffffffffffffffffffffff909616808552868401835290842060ff959095169094559081526001938401805494850181558252902090910180547fffffffffffffffffffffffff0000000000000000000000000000000000000000169091179055610c51816114e6565b9050610afe565b50505063ffffffff91909116600090815260026020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660ff909216919091179055565b60015473ffffffffffffffffffffffffffffffffffffffff163314610d24576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e657200000000000000000000604482015260640161037a565b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b610da8610eb9565b610db181610f3c565b50565b60008060008084602081518110610dcd57610dcd611439565b60209101015160f81c600114610e2e5784602081518110610df057610df0611439565b01602001516040517f7207be2000000000000000000000000000000000000000000000000000000000815260f89190911c600482015260240161037a565b50505050602181015160458201516049830151608b90930151919360e091821c9390911c9160f01c90565b60008060006041845114610e9b57836040517f2adfdc3000000000000000000000000000000000000000000000000000000000815260040161037a9190611327565b50505060208101516040820151606090920151909260009190911a90565b60005473ffffffffffffffffffffffffffffffffffffffff163314610f3a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e657200000000000000000000604482015260640161037a565b565b3373ffffffffffffffffffffffffffffffffffffffff821603610fbb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640161037a565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b604051806103e00160405280601f906020820280368337509192915050565b8280548282559060005260206000209081019282156110c8579160200282015b828111156110c85781547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff843516178255602090920191600190910190611070565b506110d49291506110d8565b5090565b5b808211156110d457600081556001016110d9565b803573ffffffffffffffffffffffffffffffffffffffff8116811461111157600080fd5b919050565b60008083601f84011261112857600080fd5b50813567ffffffffffffffff81111561114057600080fd5b60208301915083602082850101111561115857600080fd5b9250929050565b60008083601f84011261117157600080fd5b50813567ffffffffffffffff81111561118957600080fd5b6020830191508360208260051b850101111561115857600080fd5b60008060008060008060006080888a0312156111bf57600080fd5b6111c8886110ed565b9650602088013567ffffffffffffffff808211156111e557600080fd5b6111f18b838c01611116565b909850965060408a013591508082111561120a57600080fd5b6112168b838c01611116565b909650945060608a013591508082111561122f57600080fd5b5061123c8a828b0161115f565b989b979a50959850939692959293505050565b6000806000806060858703121561126557600080fd5b843563ffffffff8116811461127957600080fd5b9350602085013560ff8116811461128f57600080fd5b9250604085013567ffffffffffffffff8111156112ab57600080fd5b6112b78782880161115f565b95989497509550505050565b6000815180845260005b818110156112e9576020818501810151868301820152016112cd565b5060006020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b60208152600061133a60208301846112c3565b9392505050565b60008060006060848603121561135657600080fd5b61135f846110ed565b92506020840135915060408401357fffff0000000000000000000000000000000000000000000000000000000000008116811461139b57600080fd5b809150509250925092565b6000602082840312156113b857600080fd5b61133a826110ed565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60ff8181168382160190811115611409576114096113c1565b92915050565b8183823760009101908152919050565b838152818360208301376000910160200190815292915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe184360301811261149d57600080fd5b83018035915067ffffffffffffffff8211156114b857600080fd5b60200191503681900382131561115857600080fd5b60ff8281168282160390811115611409576114096113c1565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203611517576115176113c1565b5060010190565b6000808585111561152e57600080fd5b8386111561153b57600080fd5b5050820193919092039150565b8183528181602085013750600060208284010152600060207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116840101905092915050565b6040815260006115a5604083018688611548565b82810360208401526115b8818587611548565b979650505050505050565b60ff81811683821602908116908181146115df576115df6113c1565b509291505056fea164736f6c6343000813000a", + Bin: "0x608060405234801561001057600080fd5b5033806000816100675760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615610097576100978161009f565b505050610148565b336001600160a01b038216036100f75760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640161005e565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b6115ef806101576000396000f3fe608060405234801561001057600080fd5b506004361061007d5760003560e01c806379ba50971161005b57806379ba5097146100f25780638864b864146100fa5780638da5cb5b146101d3578063f2fde38b146101f157600080fd5b80631128956514610082578063134a46f014610097578063181f5a77146100aa575b600080fd5b6100956100903660046111a0565b610204565b005b6100956100a536600461124b565b61093e565b604080518082018252601781527f4b657973746f6e65466f7277617264657220312e302e30000000000000000000602082015290516100e99190611323565b60405180910390f35b610095610c9f565b6101ae61010836600461133d565b6040805160609490941b7fffffffffffffffffffffffffffffffffffffffff0000000000000000000000001660208086019190915260348501939093527fffff000000000000000000000000000000000000000000000000000000000000919091166054840152805160368185030181526056909301815282519282019290922060009081526003909152205473ffffffffffffffffffffffffffffffffffffffff1690565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016100e9565b60005473ffffffffffffffffffffffffffffffffffffffff166101ae565b6100956101ff3660046113a2565b610d9c565b60015474010000000000000000000000000000000000000000900460ff1615610259576040517f37ed32e800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600180547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1674010000000000000000000000000000000000000000179055606d8510156102d3576040517fb55ac75400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600080600061031789898080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610db092505050565b63ffffffff831660009081526002602052604081205494975092955093505060ff9091169003610380576040517fea1b312900000000000000000000000000000000000000000000000000000000815263ffffffff831660048201526024015b60405180910390fd5b604080517fffffffffffffffffffffffffffffffffffffffff00000000000000000000000060608d901b16602080830191909152603482018690527fffff000000000000000000000000000000000000000000000000000000000000841660548301528251808303603601815260569092018352815191810191909120600081815260039092529190205473ffffffffffffffffffffffffffffffffffffffff161561045b576040517f1a20d3e600000000000000000000000000000000000000000000000000000000815260048101829052602401610377565b63ffffffff831660009081526002602052604090205485906104819060ff1660016113ec565b60ff16146104ec5763ffffffff83166000908152600260205260409020546104ad9060ff1660016113ec565b6040517fd6022e8e00000000000000000000000000000000000000000000000000000000815260ff909116600482015260248101869052604401610377565b60008a8a6040516104fe92919061140b565b604051908190038120610517918b908b9060200161141b565b60405160208183030381529060405280519060200120905061053761102d565b6000805b888110156107a55760008060006105a98d8d8681811061055d5761055d611435565b905060200281019061056f9190611464565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610e5592505050565b9194509250905060006001886105c084601b6113ec565b6040805160008152602081018083529390935260ff90911690820152606081018690526080810185905260a0016020604051602081039080840390855afa15801561060f573d6000803e3d6000fd5b5050604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015163ffffffff8e1660009081526002602081815284832073ffffffffffffffffffffffffffffffffffffffff851684529091019052918220549850925060ff8816900390506106ca576040517fbf18af4300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff82166004820152602401610377565b6106d56001876114c9565b955060008760ff8816601f81106106ee576106ee611435565b602002015173ffffffffffffffffffffffffffffffffffffffff1614610758576040517fe021c4f200000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff82166004820152602401610377565b80878760ff16601f811061076e5761076e611435565b73ffffffffffffffffffffffffffffffffffffffff90921660209290920201525061079e92508391506114e29050565b905061053b565b5050505060008b73ffffffffffffffffffffffffffffffffffffffff1663805f21328c8c602d90606d926107db9392919061151a565b8e8e606d9080926107ee9392919061151a565b6040518563ffffffff1660e01b815260040161080d949392919061158d565b600060405180830381600087803b15801561082757600080fd5b505af1925050508015610838575060015b15610841575060015b604080518082018252338152821515602080830191825260008681526003909152839020915182549151151574010000000000000000000000000000000000000000027fffffffffffffffffffffff00000000000000000000000000000000000000000090921673ffffffffffffffffffffffffffffffffffffffff9182161791909117909155905186918e16907fbe015fd2fd7c1a00158e111095c794ae7030eb413d2a0990e5b78d3114df1d499061090090851515815260200190565b60405180910390a35050600180547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff16905550505050505050505050565b610946610eb5565b8260ff16600003610983576040517f0743bae600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b601f8111156109c8576040517f61750f4000000000000000000000000000000000000000000000000000000000815260048101829052601f6024820152604401610377565b6109d38360036115bf565b60ff168111610a3157806109e88460036115bf565b6109f39060016113ec565b6040517f9dd9e6d8000000000000000000000000000000000000000000000000000000008152600481019290925260ff166024820152604401610377565b60005b63ffffffff8516600090815260026020526040902060010154811015610ad25763ffffffff85166000908152600260205260408120600101805483908110610a7e57610a7e611435565b600091825260208083209091015463ffffffff891683526002808352604080852073ffffffffffffffffffffffffffffffffffffffff9093168552910190915281205550610acb816114e2565b9050610a34565b5063ffffffff84166000908152600260205260409020610af690600101838361104c565b5060005b81811015610c54576000838383818110610b1657610b16611435565b9050602002016020810190610b2b91906113a2565b63ffffffff8716600090815260026020818152604080842073ffffffffffffffffffffffffffffffffffffffff86168552909201905290205490915015610bb6576040517fe021c4f200000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff82166004820152602401610377565b610bc18260016113ec565b63ffffffff8716600090815260026020818152604080842073ffffffffffffffffffffffffffffffffffffffff909616808552868401835290842060ff959095169094559081526001938401805494850181558252902090910180547fffffffffffffffffffffffff0000000000000000000000000000000000000000169091179055610c4d816114e2565b9050610afa565b50505063ffffffff91909116600090815260026020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660ff909216919091179055565b60015473ffffffffffffffffffffffffffffffffffffffff163314610d20576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e6572000000000000000000006044820152606401610377565b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b610da4610eb5565b610dad81610f38565b50565b60008060008084602081518110610dc957610dc9611435565b60209101015160f81c600114610e2a5784602081518110610dec57610dec611435565b01602001516040517f7207be2000000000000000000000000000000000000000000000000000000000815260f89190911c6004820152602401610377565b50505050602181015160458201516049830151608b90930151919360e091821c9390911c9160f01c90565b60008060006041845114610e9757836040517f2adfdc300000000000000000000000000000000000000000000000000000000081526004016103779190611323565b50505060208101516040820151606090920151909260009190911a90565b60005473ffffffffffffffffffffffffffffffffffffffff163314610f36576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e6572000000000000000000006044820152606401610377565b565b3373ffffffffffffffffffffffffffffffffffffffff821603610fb7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c660000000000000000006044820152606401610377565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b604051806103e00160405280601f906020820280368337509192915050565b8280548282559060005260206000209081019282156110c4579160200282015b828111156110c45781547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff84351617825560209092019160019091019061106c565b506110d09291506110d4565b5090565b5b808211156110d057600081556001016110d5565b803573ffffffffffffffffffffffffffffffffffffffff8116811461110d57600080fd5b919050565b60008083601f84011261112457600080fd5b50813567ffffffffffffffff81111561113c57600080fd5b60208301915083602082850101111561115457600080fd5b9250929050565b60008083601f84011261116d57600080fd5b50813567ffffffffffffffff81111561118557600080fd5b6020830191508360208260051b850101111561115457600080fd5b60008060008060008060006080888a0312156111bb57600080fd5b6111c4886110e9565b9650602088013567ffffffffffffffff808211156111e157600080fd5b6111ed8b838c01611112565b909850965060408a013591508082111561120657600080fd5b6112128b838c01611112565b909650945060608a013591508082111561122b57600080fd5b506112388a828b0161115b565b989b979a50959850939692959293505050565b6000806000806060858703121561126157600080fd5b843563ffffffff8116811461127557600080fd5b9350602085013560ff8116811461128b57600080fd5b9250604085013567ffffffffffffffff8111156112a757600080fd5b6112b38782880161115b565b95989497509550505050565b6000815180845260005b818110156112e5576020818501810151868301820152016112c9565b5060006020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b60208152600061133660208301846112bf565b9392505050565b60008060006060848603121561135257600080fd5b61135b846110e9565b92506020840135915060408401357fffff0000000000000000000000000000000000000000000000000000000000008116811461139757600080fd5b809150509250925092565b6000602082840312156113b457600080fd5b611336826110e9565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60ff8181168382160190811115611405576114056113bd565b92915050565b8183823760009101908152919050565b838152818360208301376000910160200190815292915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe184360301811261149957600080fd5b83018035915067ffffffffffffffff8211156114b457600080fd5b60200191503681900382131561115457600080fd5b60ff8281168282160390811115611405576114056113bd565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203611513576115136113bd565b5060010190565b6000808585111561152a57600080fd5b8386111561153757600080fd5b5050820193919092039150565b8183528181602085013750600060208284010152600060207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116840101905092915050565b6040815260006115a1604083018688611544565b82810360208401526115b4818587611544565b979650505050505050565b60ff81811683821602908116908181146115db576115db6113bd565b509291505056fea164736f6c6343000813000a", } var KeystoneForwarderABI = KeystoneForwarderMetaData.ABI diff --git a/core/gethwrappers/keystone/generation/generated-wrapper-dependency-versions-do-not-edit.txt b/core/gethwrappers/keystone/generation/generated-wrapper-dependency-versions-do-not-edit.txt index 21de8cb7d79..d2812166c89 100644 --- a/core/gethwrappers/keystone/generation/generated-wrapper-dependency-versions-do-not-edit.txt +++ b/core/gethwrappers/keystone/generation/generated-wrapper-dependency-versions-do-not-edit.txt @@ -1,4 +1,4 @@ GETH_VERSION: 1.13.8 -forwarder: ../../../contracts/solc/v0.8.19/KeystoneForwarder/KeystoneForwarder.abi ../../../contracts/solc/v0.8.19/KeystoneForwarder/KeystoneForwarder.bin 06d5f16f927bfc29653824ca4b113628d1620ed95b371e5abb827c142e561b49 +forwarder: ../../../contracts/solc/v0.8.19/KeystoneForwarder/KeystoneForwarder.abi ../../../contracts/solc/v0.8.19/KeystoneForwarder/KeystoneForwarder.bin 0e411f039188c9477447d4b45a12291a06b43afce2d7724e1f636ac27d050b19 keystone_capability_registry: ../../../contracts/solc/v0.8.19/CapabilityRegistry/CapabilityRegistry.abi ../../../contracts/solc/v0.8.19/CapabilityRegistry/CapabilityRegistry.bin 0a79d0eba13fd4a4b83d7618bb181c21c42222f3cc6c5a90a09302f685555033 ocr3_capability: ../../../contracts/solc/v0.8.19/OCR3Capability/OCR3Capability.abi ../../../contracts/solc/v0.8.19/OCR3Capability/OCR3Capability.bin 9dcbdf55bd5729ba266148da3f17733eb592c871c2108ccca546618628fd9ad2 From 3ce2f6df31618245a5dae727c5d7927774680fc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bla=C5=BE=20Hrastnik?= Date: Wed, 5 Jun 2024 01:03:10 +0900 Subject: [PATCH 3/4] Fix tests --- .../src/v0.8/keystone/KeystoneForwarder.sol | 9 ++--- .../test/KeystoneForwarderBaseTest.t.sol | 1 + .../test/KeystoneForwarder_ReportTest.t.sol | 40 +++++++++++-------- .../src/v0.8/keystone/test/mocks/Receiver.sol | 6 +-- 4 files changed, 32 insertions(+), 24 deletions(-) diff --git a/contracts/src/v0.8/keystone/KeystoneForwarder.sol b/contracts/src/v0.8/keystone/KeystoneForwarder.sol index 8eefe29dde5..a54c3686f0c 100644 --- a/contracts/src/v0.8/keystone/KeystoneForwarder.sol +++ b/contracts/src/v0.8/keystone/KeystoneForwarder.sol @@ -224,7 +224,7 @@ contract KeystoneForwarder is IForwarder, ConfirmedOwner, TypeAndVersionInterfac function _getMetadata( bytes memory rawReport ) internal pure returns (bytes32 workflowExecutionId, uint32 donId, uint32 donConfigVersion, bytes2 reportId) { - // (first 32 bytes contain length of the report) + // (first 32 bytes of memory contain length of the report) // version // offset 32, size 1 // workflow_execution_id // offset 33, size 32 // timestamp // offset 65, size 4 @@ -234,8 +234,8 @@ contract KeystoneForwarder is IForwarder, ConfirmedOwner, TypeAndVersionInterfac // workflow_name // offset 109, size 10 // workflow_owner // offset 119, size 20 // report_name // offset 139, size 2 - if (uint8(rawReport[32]) != 1) { - revert InvalidVersion(uint8(rawReport[32])); + if (uint8(rawReport[0]) != 1) { + revert InvalidVersion(uint8(rawReport[0])); } assembly { workflowExecutionId := mload(add(rawReport, 33)) @@ -243,8 +243,7 @@ contract KeystoneForwarder is IForwarder, ConfirmedOwner, TypeAndVersionInterfac donId := shr(mul(28, 8), mload(add(rawReport, 69))) // shift right by 28 bytes to get the actual value donConfigVersion := shr(mul(28, 8), mload(add(rawReport, 73))) - // shift right by 30 bytes to get the actual value - reportId := shr(mul(30, 8), mload(add(rawReport, 139))) + reportId := mload(add(rawReport, 139)) } } diff --git a/contracts/src/v0.8/keystone/test/KeystoneForwarderBaseTest.t.sol b/contracts/src/v0.8/keystone/test/KeystoneForwarderBaseTest.t.sol index d2801abb5af..16b85f79fdb 100644 --- a/contracts/src/v0.8/keystone/test/KeystoneForwarderBaseTest.t.sol +++ b/contracts/src/v0.8/keystone/test/KeystoneForwarderBaseTest.t.sol @@ -11,6 +11,7 @@ contract BaseTest is Test { uint256 internal constant MAX_ORACLES = 31; uint32 internal DON_ID = 0x01020304; uint8 internal F = 1; + uint32 internal CONFIG_VERSION = 1; struct Signer { uint256 mockPrivateKey; diff --git a/contracts/src/v0.8/keystone/test/KeystoneForwarder_ReportTest.t.sol b/contracts/src/v0.8/keystone/test/KeystoneForwarder_ReportTest.t.sol index bb209e4cf98..236851fde14 100644 --- a/contracts/src/v0.8/keystone/test/KeystoneForwarder_ReportTest.t.sol +++ b/contracts/src/v0.8/keystone/test/KeystoneForwarder_ReportTest.t.sol @@ -5,19 +5,20 @@ import {BaseTest} from "./KeystoneForwarderBaseTest.t.sol"; import {KeystoneForwarder} from "../KeystoneForwarder.sol"; contract KeystoneForwarder_ReportTest is BaseTest { - event MessageReceived(bytes32 indexed workflowId, address indexed workflowOwner, bytes[] mercuryReports); - event ReportProcessed( - address indexed receiver, - address indexed workflowOwner, - bytes32 indexed workflowExecutionId, - bool result - ); + event MessageReceived(bytes metadata, bytes[] mercuryReports); + event ReportProcessed(address indexed receiver, bytes32 indexed workflowExecutionId, bool result); + uint8 internal version = 1; + uint32 internal timestamp = 0; bytes32 internal workflowId = hex"6d795f6964000000000000000000000000000000000000000000000000000000"; + bytes10 internal workflowName = hex"000000000000DEADBEEF"; address internal workflowOwner = address(51); bytes32 internal executionId = hex"6d795f657865637574696f6e5f69640000000000000000000000000000000000"; + bytes2 internal reportId = hex"0001"; bytes[] internal mercuryReports = new bytes[](2); bytes internal rawReports; + bytes internal header; + bytes internal metadata; bytes internal report; bytes internal reportContext = new bytes(96); uint256 internal requiredSignaturesNum = F + 1; @@ -32,7 +33,9 @@ contract KeystoneForwarder_ReportTest is BaseTest { mercuryReports[1] = hex"aabbccdd"; rawReports = abi.encode(mercuryReports); - report = abi.encodePacked(workflowId, DON_ID, executionId, workflowOwner, rawReports); + metadata = abi.encodePacked(workflowId, workflowName, workflowOwner, reportId); + header = abi.encodePacked(version, executionId, timestamp, DON_ID, CONFIG_VERSION, metadata); + report = abi.encodePacked(header, rawReports); for (uint256 i = 0; i < requiredSignaturesNum; i++) { (uint8 v, bytes32 r, bytes32 s) = vm.sign( @@ -48,10 +51,15 @@ contract KeystoneForwarder_ReportTest is BaseTest { function test_RevertWhen_ReportHasIncorrectDON() public { uint32 invalidDONId = 111; bytes memory reportWithInvalidDONId = abi.encodePacked( - workflowId, - invalidDONId, + version, executionId, + timestamp, + invalidDONId, + CONFIG_VERSION, + workflowId, + workflowName, workflowOwner, + reportId, rawReports ); @@ -112,11 +120,11 @@ contract KeystoneForwarder_ReportTest is BaseTest { s_forwarder.report(address(s_receiver), report, reportContext, signatures); } - function test_RevertWhen_ReportAlreadyProcessed() public { + function test_RevertWhen_AlreadyProcessed() public { s_forwarder.report(address(s_receiver), report, reportContext, signatures); - bytes32 reportId = keccak256(bytes.concat(bytes20(uint160(address(s_receiver))), executionId)); + bytes32 combinedId = keccak256(bytes.concat(bytes20(uint160(address(s_receiver))), executionId, reportId)); - vm.expectRevert(abi.encodeWithSelector(KeystoneForwarder.ReportAlreadyProcessed.selector, reportId)); + vm.expectRevert(abi.encodeWithSelector(KeystoneForwarder.AlreadyProcessed.selector, combinedId)); s_forwarder.report(address(s_receiver), report, reportContext, signatures); } @@ -125,15 +133,15 @@ contract KeystoneForwarder_ReportTest is BaseTest { // bytes memory report = hex"6d795f6964000000000000000000000000000000000000000000000000000000010203046d795f657865637574696f6e5f696400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000301020300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004aabbccdd00000000000000000000000000000000000000000000000000000000"; vm.expectEmit(address(s_receiver)); - emit MessageReceived(workflowId, workflowOwner, mercuryReports); + emit MessageReceived(metadata, mercuryReports); vm.expectEmit(address(s_forwarder)); - emit ReportProcessed(address(s_receiver), workflowOwner, executionId, true); + emit ReportProcessed(address(s_receiver), executionId, true); s_forwarder.report(address(s_receiver), report, reportContext, signatures); // validate transmitter was recorded - address transmitter = s_forwarder.getTransmitter(address(s_receiver), executionId); + address transmitter = s_forwarder.getTransmitter(address(s_receiver), executionId, reportId); assertEq(transmitter, TRANSMITTER, "transmitter mismatch"); } } diff --git a/contracts/src/v0.8/keystone/test/mocks/Receiver.sol b/contracts/src/v0.8/keystone/test/mocks/Receiver.sol index 5d2f646445b..25e8755641b 100644 --- a/contracts/src/v0.8/keystone/test/mocks/Receiver.sol +++ b/contracts/src/v0.8/keystone/test/mocks/Receiver.sol @@ -4,13 +4,13 @@ pragma solidity ^0.8.19; import {IReceiver} from "../../interfaces/IReceiver.sol"; contract Receiver is IReceiver { - event MessageReceived(bytes32 indexed workflowId, address indexed workflowOwner, bytes[] mercuryReports); + event MessageReceived(bytes metadata, bytes[] mercuryReports); constructor() {} - function onReport(bytes32 workflowId, address workflowOwner, bytes calldata rawReport) external { + function onReport(bytes calldata metadata, bytes calldata rawReport) external { // parse actual report bytes[] memory mercuryReports = abi.decode(rawReport, (bytes[])); - emit MessageReceived(workflowId, workflowOwner, mercuryReports); + emit MessageReceived(metadata, mercuryReports); } } From a36ebde9b841e62c385f1fa67ceebf8f7838e082 Mon Sep 17 00:00:00 2001 From: "app-token-issuer-infra-releng[bot]" <120227048+app-token-issuer-infra-releng[bot]@users.noreply.github.com> Date: Wed, 5 Jun 2024 07:36:08 +0000 Subject: [PATCH 4/4] Update gethwrappers --- core/gethwrappers/keystone/generated/forwarder/forwarder.go | 2 +- .../generated-wrapper-dependency-versions-do-not-edit.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/gethwrappers/keystone/generated/forwarder/forwarder.go b/core/gethwrappers/keystone/generated/forwarder/forwarder.go index d0e235909e8..6fd963d7886 100644 --- a/core/gethwrappers/keystone/generated/forwarder/forwarder.go +++ b/core/gethwrappers/keystone/generated/forwarder/forwarder.go @@ -32,7 +32,7 @@ var ( var KeystoneForwarderMetaData = &bind.MetaData{ ABI: "[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"messageId\",\"type\":\"bytes32\"}],\"name\":\"AlreadyProcessed\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"signer\",\"type\":\"address\"}],\"name\":\"DuplicateSigner\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"numSigners\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxSigners\",\"type\":\"uint256\"}],\"name\":\"ExcessSigners\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FaultToleranceMustBePositive\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"numSigners\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"minSigners\",\"type\":\"uint256\"}],\"name\":\"InsufficientSigners\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"donId\",\"type\":\"uint32\"}],\"name\":\"InvalidDonId\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidReport\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"name\":\"InvalidSignature\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expected\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"received\",\"type\":\"uint256\"}],\"name\":\"InvalidSignatureCount\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"signer\",\"type\":\"address\"}],\"name\":\"InvalidSigner\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"InvalidVersion\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ReentrantCall\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"workflowExecutionId\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"result\",\"type\":\"bool\"}],\"name\":\"ReportProcessed\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"workflowExecutionId\",\"type\":\"bytes32\"},{\"internalType\":\"bytes2\",\"name\":\"reportId\",\"type\":\"bytes2\"}],\"name\":\"getTransmitter\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"receiverAddress\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"rawReport\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"reportContext\",\"type\":\"bytes\"},{\"internalType\":\"bytes[]\",\"name\":\"signatures\",\"type\":\"bytes[]\"}],\"name\":\"report\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"donId\",\"type\":\"uint32\"},{\"internalType\":\"uint8\",\"name\":\"f\",\"type\":\"uint8\"},{\"internalType\":\"address[]\",\"name\":\"signers\",\"type\":\"address[]\"}],\"name\":\"setConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"typeAndVersion\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"pure\",\"type\":\"function\"}]", - Bin: "0x608060405234801561001057600080fd5b5033806000816100675760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615610097576100978161009f565b505050610148565b336001600160a01b038216036100f75760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640161005e565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b6115ef806101576000396000f3fe608060405234801561001057600080fd5b506004361061007d5760003560e01c806379ba50971161005b57806379ba5097146100f25780638864b864146100fa5780638da5cb5b146101d3578063f2fde38b146101f157600080fd5b80631128956514610082578063134a46f014610097578063181f5a77146100aa575b600080fd5b6100956100903660046111a0565b610204565b005b6100956100a536600461124b565b61093e565b604080518082018252601781527f4b657973746f6e65466f7277617264657220312e302e30000000000000000000602082015290516100e99190611323565b60405180910390f35b610095610c9f565b6101ae61010836600461133d565b6040805160609490941b7fffffffffffffffffffffffffffffffffffffffff0000000000000000000000001660208086019190915260348501939093527fffff000000000000000000000000000000000000000000000000000000000000919091166054840152805160368185030181526056909301815282519282019290922060009081526003909152205473ffffffffffffffffffffffffffffffffffffffff1690565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016100e9565b60005473ffffffffffffffffffffffffffffffffffffffff166101ae565b6100956101ff3660046113a2565b610d9c565b60015474010000000000000000000000000000000000000000900460ff1615610259576040517f37ed32e800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600180547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1674010000000000000000000000000000000000000000179055606d8510156102d3576040517fb55ac75400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600080600061031789898080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610db092505050565b63ffffffff831660009081526002602052604081205494975092955093505060ff9091169003610380576040517fea1b312900000000000000000000000000000000000000000000000000000000815263ffffffff831660048201526024015b60405180910390fd5b604080517fffffffffffffffffffffffffffffffffffffffff00000000000000000000000060608d901b16602080830191909152603482018690527fffff000000000000000000000000000000000000000000000000000000000000841660548301528251808303603601815260569092018352815191810191909120600081815260039092529190205473ffffffffffffffffffffffffffffffffffffffff161561045b576040517f1a20d3e600000000000000000000000000000000000000000000000000000000815260048101829052602401610377565b63ffffffff831660009081526002602052604090205485906104819060ff1660016113ec565b60ff16146104ec5763ffffffff83166000908152600260205260409020546104ad9060ff1660016113ec565b6040517fd6022e8e00000000000000000000000000000000000000000000000000000000815260ff909116600482015260248101869052604401610377565b60008a8a6040516104fe92919061140b565b604051908190038120610517918b908b9060200161141b565b60405160208183030381529060405280519060200120905061053761102d565b6000805b888110156107a55760008060006105a98d8d8681811061055d5761055d611435565b905060200281019061056f9190611464565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610e5592505050565b9194509250905060006001886105c084601b6113ec565b6040805160008152602081018083529390935260ff90911690820152606081018690526080810185905260a0016020604051602081039080840390855afa15801561060f573d6000803e3d6000fd5b5050604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015163ffffffff8e1660009081526002602081815284832073ffffffffffffffffffffffffffffffffffffffff851684529091019052918220549850925060ff8816900390506106ca576040517fbf18af4300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff82166004820152602401610377565b6106d56001876114c9565b955060008760ff8816601f81106106ee576106ee611435565b602002015173ffffffffffffffffffffffffffffffffffffffff1614610758576040517fe021c4f200000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff82166004820152602401610377565b80878760ff16601f811061076e5761076e611435565b73ffffffffffffffffffffffffffffffffffffffff90921660209290920201525061079e92508391506114e29050565b905061053b565b5050505060008b73ffffffffffffffffffffffffffffffffffffffff1663805f21328c8c602d90606d926107db9392919061151a565b8e8e606d9080926107ee9392919061151a565b6040518563ffffffff1660e01b815260040161080d949392919061158d565b600060405180830381600087803b15801561082757600080fd5b505af1925050508015610838575060015b15610841575060015b604080518082018252338152821515602080830191825260008681526003909152839020915182549151151574010000000000000000000000000000000000000000027fffffffffffffffffffffff00000000000000000000000000000000000000000090921673ffffffffffffffffffffffffffffffffffffffff9182161791909117909155905186918e16907fbe015fd2fd7c1a00158e111095c794ae7030eb413d2a0990e5b78d3114df1d499061090090851515815260200190565b60405180910390a35050600180547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff16905550505050505050505050565b610946610eb5565b8260ff16600003610983576040517f0743bae600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b601f8111156109c8576040517f61750f4000000000000000000000000000000000000000000000000000000000815260048101829052601f6024820152604401610377565b6109d38360036115bf565b60ff168111610a3157806109e88460036115bf565b6109f39060016113ec565b6040517f9dd9e6d8000000000000000000000000000000000000000000000000000000008152600481019290925260ff166024820152604401610377565b60005b63ffffffff8516600090815260026020526040902060010154811015610ad25763ffffffff85166000908152600260205260408120600101805483908110610a7e57610a7e611435565b600091825260208083209091015463ffffffff891683526002808352604080852073ffffffffffffffffffffffffffffffffffffffff9093168552910190915281205550610acb816114e2565b9050610a34565b5063ffffffff84166000908152600260205260409020610af690600101838361104c565b5060005b81811015610c54576000838383818110610b1657610b16611435565b9050602002016020810190610b2b91906113a2565b63ffffffff8716600090815260026020818152604080842073ffffffffffffffffffffffffffffffffffffffff86168552909201905290205490915015610bb6576040517fe021c4f200000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff82166004820152602401610377565b610bc18260016113ec565b63ffffffff8716600090815260026020818152604080842073ffffffffffffffffffffffffffffffffffffffff909616808552868401835290842060ff959095169094559081526001938401805494850181558252902090910180547fffffffffffffffffffffffff0000000000000000000000000000000000000000169091179055610c4d816114e2565b9050610afa565b50505063ffffffff91909116600090815260026020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660ff909216919091179055565b60015473ffffffffffffffffffffffffffffffffffffffff163314610d20576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e6572000000000000000000006044820152606401610377565b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b610da4610eb5565b610dad81610f38565b50565b60008060008084602081518110610dc957610dc9611435565b60209101015160f81c600114610e2a5784602081518110610dec57610dec611435565b01602001516040517f7207be2000000000000000000000000000000000000000000000000000000000815260f89190911c6004820152602401610377565b50505050602181015160458201516049830151608b90930151919360e091821c9390911c9160f01c90565b60008060006041845114610e9757836040517f2adfdc300000000000000000000000000000000000000000000000000000000081526004016103779190611323565b50505060208101516040820151606090920151909260009190911a90565b60005473ffffffffffffffffffffffffffffffffffffffff163314610f36576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e6572000000000000000000006044820152606401610377565b565b3373ffffffffffffffffffffffffffffffffffffffff821603610fb7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c660000000000000000006044820152606401610377565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b604051806103e00160405280601f906020820280368337509192915050565b8280548282559060005260206000209081019282156110c4579160200282015b828111156110c45781547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff84351617825560209092019160019091019061106c565b506110d09291506110d4565b5090565b5b808211156110d057600081556001016110d5565b803573ffffffffffffffffffffffffffffffffffffffff8116811461110d57600080fd5b919050565b60008083601f84011261112457600080fd5b50813567ffffffffffffffff81111561113c57600080fd5b60208301915083602082850101111561115457600080fd5b9250929050565b60008083601f84011261116d57600080fd5b50813567ffffffffffffffff81111561118557600080fd5b6020830191508360208260051b850101111561115457600080fd5b60008060008060008060006080888a0312156111bb57600080fd5b6111c4886110e9565b9650602088013567ffffffffffffffff808211156111e157600080fd5b6111ed8b838c01611112565b909850965060408a013591508082111561120657600080fd5b6112128b838c01611112565b909650945060608a013591508082111561122b57600080fd5b506112388a828b0161115b565b989b979a50959850939692959293505050565b6000806000806060858703121561126157600080fd5b843563ffffffff8116811461127557600080fd5b9350602085013560ff8116811461128b57600080fd5b9250604085013567ffffffffffffffff8111156112a757600080fd5b6112b38782880161115b565b95989497509550505050565b6000815180845260005b818110156112e5576020818501810151868301820152016112c9565b5060006020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b60208152600061133660208301846112bf565b9392505050565b60008060006060848603121561135257600080fd5b61135b846110e9565b92506020840135915060408401357fffff0000000000000000000000000000000000000000000000000000000000008116811461139757600080fd5b809150509250925092565b6000602082840312156113b457600080fd5b611336826110e9565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60ff8181168382160190811115611405576114056113bd565b92915050565b8183823760009101908152919050565b838152818360208301376000910160200190815292915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe184360301811261149957600080fd5b83018035915067ffffffffffffffff8211156114b457600080fd5b60200191503681900382131561115457600080fd5b60ff8281168282160390811115611405576114056113bd565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203611513576115136113bd565b5060010190565b6000808585111561152a57600080fd5b8386111561153757600080fd5b5050820193919092039150565b8183528181602085013750600060208284010152600060207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116840101905092915050565b6040815260006115a1604083018688611544565b82810360208401526115b4818587611544565b979650505050505050565b60ff81811683821602908116908181146115db576115db6113bd565b509291505056fea164736f6c6343000813000a", + Bin: "0x608060405234801561001057600080fd5b5033806000816100675760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615610097576100978161009f565b505050610148565b336001600160a01b038216036100f75760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640161005e565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b6115ec806101576000396000f3fe608060405234801561001057600080fd5b506004361061007d5760003560e01c806379ba50971161005b57806379ba5097146100f25780638864b864146100fa5780638da5cb5b146101d3578063f2fde38b146101f157600080fd5b80631128956514610082578063134a46f014610097578063181f5a77146100aa575b600080fd5b61009561009036600461119d565b610204565b005b6100956100a5366004611248565b61093e565b604080518082018252601781527f4b657973746f6e65466f7277617264657220312e302e30000000000000000000602082015290516100e99190611320565b60405180910390f35b610095610c9f565b6101ae61010836600461133a565b6040805160609490941b7fffffffffffffffffffffffffffffffffffffffff0000000000000000000000001660208086019190915260348501939093527fffff000000000000000000000000000000000000000000000000000000000000919091166054840152805160368185030181526056909301815282519282019290922060009081526003909152205473ffffffffffffffffffffffffffffffffffffffff1690565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016100e9565b60005473ffffffffffffffffffffffffffffffffffffffff166101ae565b6100956101ff36600461139f565b610d9c565b60015474010000000000000000000000000000000000000000900460ff1615610259576040517f37ed32e800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600180547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1674010000000000000000000000000000000000000000179055606d8510156102d3576040517fb55ac75400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600080600061031789898080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610db092505050565b63ffffffff831660009081526002602052604081205494975092955093505060ff9091169003610380576040517fea1b312900000000000000000000000000000000000000000000000000000000815263ffffffff831660048201526024015b60405180910390fd5b604080517fffffffffffffffffffffffffffffffffffffffff00000000000000000000000060608d901b16602080830191909152603482018690527fffff000000000000000000000000000000000000000000000000000000000000841660548301528251808303603601815260569092018352815191810191909120600081815260039092529190205473ffffffffffffffffffffffffffffffffffffffff161561045b576040517f1a20d3e600000000000000000000000000000000000000000000000000000000815260048101829052602401610377565b63ffffffff831660009081526002602052604090205485906104819060ff1660016113e9565b60ff16146104ec5763ffffffff83166000908152600260205260409020546104ad9060ff1660016113e9565b6040517fd6022e8e00000000000000000000000000000000000000000000000000000000815260ff909116600482015260248101869052604401610377565b60008a8a6040516104fe929190611408565b604051908190038120610517918b908b90602001611418565b60405160208183030381529060405280519060200120905061053761102a565b6000805b888110156107a55760008060006105a98d8d8681811061055d5761055d611432565b905060200281019061056f9190611461565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610e5292505050565b9194509250905060006001886105c084601b6113e9565b6040805160008152602081018083529390935260ff90911690820152606081018690526080810185905260a0016020604051602081039080840390855afa15801561060f573d6000803e3d6000fd5b5050604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015163ffffffff8e1660009081526002602081815284832073ffffffffffffffffffffffffffffffffffffffff851684529091019052918220549850925060ff8816900390506106ca576040517fbf18af4300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff82166004820152602401610377565b6106d56001876114c6565b955060008760ff8816601f81106106ee576106ee611432565b602002015173ffffffffffffffffffffffffffffffffffffffff1614610758576040517fe021c4f200000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff82166004820152602401610377565b80878760ff16601f811061076e5761076e611432565b73ffffffffffffffffffffffffffffffffffffffff90921660209290920201525061079e92508391506114df9050565b905061053b565b5050505060008b73ffffffffffffffffffffffffffffffffffffffff1663805f21328c8c602d90606d926107db93929190611517565b8e8e606d9080926107ee93929190611517565b6040518563ffffffff1660e01b815260040161080d949392919061158a565b600060405180830381600087803b15801561082757600080fd5b505af1925050508015610838575060015b15610841575060015b604080518082018252338152821515602080830191825260008681526003909152839020915182549151151574010000000000000000000000000000000000000000027fffffffffffffffffffffff00000000000000000000000000000000000000000090921673ffffffffffffffffffffffffffffffffffffffff9182161791909117909155905186918e16907fbe015fd2fd7c1a00158e111095c794ae7030eb413d2a0990e5b78d3114df1d499061090090851515815260200190565b60405180910390a35050600180547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff16905550505050505050505050565b610946610eb2565b8260ff16600003610983576040517f0743bae600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b601f8111156109c8576040517f61750f4000000000000000000000000000000000000000000000000000000000815260048101829052601f6024820152604401610377565b6109d38360036115bc565b60ff168111610a3157806109e88460036115bc565b6109f39060016113e9565b6040517f9dd9e6d8000000000000000000000000000000000000000000000000000000008152600481019290925260ff166024820152604401610377565b60005b63ffffffff8516600090815260026020526040902060010154811015610ad25763ffffffff85166000908152600260205260408120600101805483908110610a7e57610a7e611432565b600091825260208083209091015463ffffffff891683526002808352604080852073ffffffffffffffffffffffffffffffffffffffff9093168552910190915281205550610acb816114df565b9050610a34565b5063ffffffff84166000908152600260205260409020610af6906001018383611049565b5060005b81811015610c54576000838383818110610b1657610b16611432565b9050602002016020810190610b2b919061139f565b63ffffffff8716600090815260026020818152604080842073ffffffffffffffffffffffffffffffffffffffff86168552909201905290205490915015610bb6576040517fe021c4f200000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff82166004820152602401610377565b610bc18260016113e9565b63ffffffff8716600090815260026020818152604080842073ffffffffffffffffffffffffffffffffffffffff909616808552868401835290842060ff959095169094559081526001938401805494850181558252902090910180547fffffffffffffffffffffffff0000000000000000000000000000000000000000169091179055610c4d816114df565b9050610afa565b50505063ffffffff91909116600090815260026020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660ff909216919091179055565b60015473ffffffffffffffffffffffffffffffffffffffff163314610d20576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e6572000000000000000000006044820152606401610377565b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b610da4610eb2565b610dad81610f35565b50565b60008060008084600081518110610dc957610dc9611432565b60209101015160f81c600114610e2a5784600081518110610dec57610dec611432565b01602001516040517f7207be2000000000000000000000000000000000000000000000000000000000815260f89190911c6004820152602401610377565b50505050602181015160458201516049830151608b90930151919360e091821c9390911c9190565b60008060006041845114610e9457836040517f2adfdc300000000000000000000000000000000000000000000000000000000081526004016103779190611320565b50505060208101516040820151606090920151909260009190911a90565b60005473ffffffffffffffffffffffffffffffffffffffff163314610f33576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e6572000000000000000000006044820152606401610377565b565b3373ffffffffffffffffffffffffffffffffffffffff821603610fb4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c660000000000000000006044820152606401610377565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b604051806103e00160405280601f906020820280368337509192915050565b8280548282559060005260206000209081019282156110c1579160200282015b828111156110c15781547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff843516178255602090920191600190910190611069565b506110cd9291506110d1565b5090565b5b808211156110cd57600081556001016110d2565b803573ffffffffffffffffffffffffffffffffffffffff8116811461110a57600080fd5b919050565b60008083601f84011261112157600080fd5b50813567ffffffffffffffff81111561113957600080fd5b60208301915083602082850101111561115157600080fd5b9250929050565b60008083601f84011261116a57600080fd5b50813567ffffffffffffffff81111561118257600080fd5b6020830191508360208260051b850101111561115157600080fd5b60008060008060008060006080888a0312156111b857600080fd5b6111c1886110e6565b9650602088013567ffffffffffffffff808211156111de57600080fd5b6111ea8b838c0161110f565b909850965060408a013591508082111561120357600080fd5b61120f8b838c0161110f565b909650945060608a013591508082111561122857600080fd5b506112358a828b01611158565b989b979a50959850939692959293505050565b6000806000806060858703121561125e57600080fd5b843563ffffffff8116811461127257600080fd5b9350602085013560ff8116811461128857600080fd5b9250604085013567ffffffffffffffff8111156112a457600080fd5b6112b087828801611158565b95989497509550505050565b6000815180845260005b818110156112e2576020818501810151868301820152016112c6565b5060006020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b60208152600061133360208301846112bc565b9392505050565b60008060006060848603121561134f57600080fd5b611358846110e6565b92506020840135915060408401357fffff0000000000000000000000000000000000000000000000000000000000008116811461139457600080fd5b809150509250925092565b6000602082840312156113b157600080fd5b611333826110e6565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60ff8181168382160190811115611402576114026113ba565b92915050565b8183823760009101908152919050565b838152818360208301376000910160200190815292915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe184360301811261149657600080fd5b83018035915067ffffffffffffffff8211156114b157600080fd5b60200191503681900382131561115157600080fd5b60ff8281168282160390811115611402576114026113ba565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203611510576115106113ba565b5060010190565b6000808585111561152757600080fd5b8386111561153457600080fd5b5050820193919092039150565b8183528181602085013750600060208284010152600060207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116840101905092915050565b60408152600061159e604083018688611541565b82810360208401526115b1818587611541565b979650505050505050565b60ff81811683821602908116908181146115d8576115d86113ba565b509291505056fea164736f6c6343000813000a", } var KeystoneForwarderABI = KeystoneForwarderMetaData.ABI diff --git a/core/gethwrappers/keystone/generation/generated-wrapper-dependency-versions-do-not-edit.txt b/core/gethwrappers/keystone/generation/generated-wrapper-dependency-versions-do-not-edit.txt index d2812166c89..9167c638fbb 100644 --- a/core/gethwrappers/keystone/generation/generated-wrapper-dependency-versions-do-not-edit.txt +++ b/core/gethwrappers/keystone/generation/generated-wrapper-dependency-versions-do-not-edit.txt @@ -1,4 +1,4 @@ GETH_VERSION: 1.13.8 -forwarder: ../../../contracts/solc/v0.8.19/KeystoneForwarder/KeystoneForwarder.abi ../../../contracts/solc/v0.8.19/KeystoneForwarder/KeystoneForwarder.bin 0e411f039188c9477447d4b45a12291a06b43afce2d7724e1f636ac27d050b19 +forwarder: ../../../contracts/solc/v0.8.19/KeystoneForwarder/KeystoneForwarder.abi ../../../contracts/solc/v0.8.19/KeystoneForwarder/KeystoneForwarder.bin 892c6ced16576bebd887eb581147c02139853d5143a0c9b77704efefd4ab7ec7 keystone_capability_registry: ../../../contracts/solc/v0.8.19/CapabilityRegistry/CapabilityRegistry.abi ../../../contracts/solc/v0.8.19/CapabilityRegistry/CapabilityRegistry.bin 0a79d0eba13fd4a4b83d7618bb181c21c42222f3cc6c5a90a09302f685555033 ocr3_capability: ../../../contracts/solc/v0.8.19/OCR3Capability/OCR3Capability.abi ../../../contracts/solc/v0.8.19/OCR3Capability/OCR3Capability.bin 9dcbdf55bd5729ba266148da3f17733eb592c871c2108ccca546618628fd9ad2