From 9def6a654fd1ea692a377061f42c7bb47941322f Mon Sep 17 00:00:00 2001 From: Kartik Chopra Date: Thu, 2 May 2024 14:46:30 -0400 Subject: [PATCH] feat: introduce the use of dispatch timestamp (#12) * feat(decay): adds decay v2 mechanism * feat(decay): update name of structure variable * feat(decay): allow future dispatchTimestamp * feat(decay): resolves comments made by shawn * chore: update abi and gocodegen * feat(decayv2): use direct timestamp in oracle * feat(decayv2): add timestamp to rpc api * feat(decayv2): updates decay in p2p layer * chore: removes redundant l2client * chore: start docker network in cli script * chore: uses existing gitignore from main * chore: update test provider to send dispatch time * chore: adds some seconds decay end timestamp for testing * chore: fixes underflow of dispatch drift * chore: removes --no-cache flag from sl build * chore: update decay range of real bidder * feat: fix bugs in dockerfile for e2e * chore: print decay percentage from oracle * feat: use free holesky endpoint * chore: avoid real bidder from pnaic * chore: nit fix real-bidder * chore: constructs demo mode * chore: bugfix for negative decay * feat: update demo to send bid externally * feat: removes demo * chore: nit rmv testing var * feat: minor script improvement * chore: remove demo profile from docker * chore: redundant spaces * chore: move to constant for testing dispatch * chore: nit fix warning * feat: adds struct to protobuf * feat: moves struct to proto file * chore: lowercase a variable * chore: update expected error to lowercase * feat: reverts moves struct to proto file This reverts commit 99f5dbeba4613772130cd8e6de9cf4b6287a4eb5. * feat: reverts adds struct to protobuf This reverts commit be832af64849e3fd276ecdc1afdf05264d851f65. * chore: remove sepolia key from script --- contracts-abi/abi/PreConfCommitmentStore.abi | 54 ++- .../PreConfCommitmentStore.go | 114 ++++-- contracts/contracts/PreConfirmations.sol | 28 +- .../interfaces/IPreConfirmations.sol | 10 +- contracts/scripts/DeployScripts.s.sol | 3 +- contracts/test/OracleTest.sol | 47 ++- contracts/test/PreConfirmationConfTest.sol | 127 +++++- contracts/test/ProviderRegistryTest.sol | 3 +- external/geth | 2 +- mev-commit-cli.sh | 47 +-- oracle/pkg/node/node.go | 8 +- oracle/pkg/settler/settler.go | 1 + oracle/pkg/updater/updater.go | 11 +- oracle/pkg/updater/updater_test.go | 24 +- p2p/e2e-compose.yml | 23 +- p2p/gen/go/bidderapi/v1/bidderapi.pb.go | 113 ++--- p2p/gen/go/providerapi/v1/providerapi.pb.go | 387 ++++++++++-------- .../bidderapi/v1/bidderapi.swagger.yaml | 4 + .../providerapi/v1/providerapi.swagger.yaml | 6 + p2p/integrationtest/bidder/main.go | 2 +- p2p/integrationtest/provider/main.go | 6 +- p2p/integrationtest/real-bidder/Dockerfile | 6 +- p2p/integrationtest/real-bidder/main.go | 4 +- p2p/pkg/contracts/preconf/preconf.go | 3 + p2p/pkg/contracts/preconf/preconf_test.go | 3 + p2p/pkg/node/node.go | 7 +- p2p/pkg/preconfirmation/preconfirmation.go | 6 +- .../preconfirmation/preconfirmation_test.go | 15 +- p2p/pkg/rpc/provider/service.go | 25 +- p2p/pkg/rpc/provider/service_test.go | 40 +- p2p/rpc/bidderapi/v1/bidderapi.proto | 3 + p2p/rpc/providerapi/v1/providerapi.proto | 8 +- 32 files changed, 704 insertions(+), 436 deletions(-) diff --git a/contracts-abi/abi/PreConfCommitmentStore.abi b/contracts-abi/abi/PreConfCommitmentStore.abi index e5dfe243e..417c5f575 100644 --- a/contracts-abi/abi/PreConfCommitmentStore.abi +++ b/contracts-abi/abi/PreConfCommitmentStore.abi @@ -21,6 +21,11 @@ "name": "_owner", "type": "address", "internalType": "address" + }, + { + "name": "_commitment_dispatch_window", + "type": "uint64", + "internalType": "uint64" } ], "stateMutability": "nonpayable" @@ -154,6 +159,19 @@ ], "stateMutability": "view" }, + { + "type": "function", + "name": "commitment_dispatch_window", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint64", + "internalType": "uint64" + } + ], + "stateMutability": "view" + }, { "type": "function", "name": "commitments", @@ -226,9 +244,9 @@ "internalType": "bytes" }, { - "name": "blockCommitedAt", - "type": "uint256", - "internalType": "uint256" + "name": "dispatchTimestamp", + "type": "uint64", + "internalType": "uint64" } ], "stateMutability": "view" @@ -368,9 +386,9 @@ "internalType": "bytes" }, { - "name": "blockCommitedAt", - "type": "uint256", - "internalType": "uint256" + "name": "dispatchTimestamp", + "type": "uint64", + "internalType": "uint64" } ] } @@ -447,9 +465,9 @@ "internalType": "bytes" }, { - "name": "blockCommitedAt", - "type": "uint256", - "internalType": "uint256" + "name": "dispatchTimestamp", + "type": "uint64", + "internalType": "uint64" } ] } @@ -726,6 +744,11 @@ "name": "commitmentSignature", "type": "bytes", "internalType": "bytes" + }, + { + "name": "dispatchTimestamp", + "type": "uint64", + "internalType": "uint64" } ], "outputs": [ @@ -776,6 +799,19 @@ "outputs": [], "stateMutability": "nonpayable" }, + { + "type": "function", + "name": "updateCommitmentDispatchWindow", + "inputs": [ + { + "name": "newDispatchWindow", + "type": "uint64", + "internalType": "uint64" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, { "type": "function", "name": "updateOracle", diff --git a/contracts-abi/clients/PreConfCommitmentStore/PreConfCommitmentStore.go b/contracts-abi/clients/PreConfCommitmentStore/PreConfCommitmentStore.go index 684503b98..3aa2e376d 100644 --- a/contracts-abi/clients/PreConfCommitmentStore/PreConfCommitmentStore.go +++ b/contracts-abi/clients/PreConfCommitmentStore/PreConfCommitmentStore.go @@ -43,12 +43,12 @@ type PreConfCommitmentStorePreConfCommitment struct { CommitmentHash [32]byte BidSignature []byte CommitmentSignature []byte - BlockCommitedAt *big.Int + DispatchTimestamp uint64 } // PreconfcommitmentstoreMetaData contains all meta data concerning the Preconfcommitmentstore contract. var PreconfcommitmentstoreMetaData = &bind.MetaData{ - ABI: "[{\"type\":\"constructor\",\"inputs\":[{\"name\":\"_providerRegistry\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_bidderRegistry\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_oracle\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_owner\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"fallback\",\"stateMutability\":\"payable\"},{\"type\":\"receive\",\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"DOMAIN_SEPARATOR_BID\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"DOMAIN_SEPARATOR_PRECONF\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"EIP712_BID_TYPEHASH\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"EIP712_COMMITMENT_TYPEHASH\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"_bytesToHexString\",\"inputs\":[{\"name\":\"_bytes\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"pure\"},{\"type\":\"function\",\"name\":\"bidderRegistry\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIBidderRegistry\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"blockCommitments\",\"inputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"commitmentCount\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"commitments\",\"inputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"commitmentUsed\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"bidder\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"commiter\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"bid\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"blockNumber\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"bidHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"decayStartTimeStamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"decayEndTimeStamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"txnHash\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"commitmentHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"bidSignature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"commitmentSignature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"blockCommitedAt\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"commitmentsCount\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getBidHash\",\"inputs\":[{\"name\":\"_txnHash\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"_bid\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"_blockNumber\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"_decayStartTimeStamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"_decayEndTimeStamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getCommitment\",\"inputs\":[{\"name\":\"commitmentIndex\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structPreConfCommitmentStore.PreConfCommitment\",\"components\":[{\"name\":\"commitmentUsed\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"bidder\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"commiter\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"bid\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"blockNumber\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"bidHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"decayStartTimeStamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"decayEndTimeStamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"txnHash\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"commitmentHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"bidSignature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"commitmentSignature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"blockCommitedAt\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getCommitmentIndex\",\"inputs\":[{\"name\":\"commitment\",\"type\":\"tuple\",\"internalType\":\"structPreConfCommitmentStore.PreConfCommitment\",\"components\":[{\"name\":\"commitmentUsed\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"bidder\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"commiter\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"bid\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"blockNumber\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"bidHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"decayStartTimeStamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"decayEndTimeStamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"txnHash\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"commitmentHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"bidSignature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"commitmentSignature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"blockCommitedAt\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"pure\"},{\"type\":\"function\",\"name\":\"getCommitmentsByBlockNumber\",\"inputs\":[{\"name\":\"blockNumber\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32[]\",\"internalType\":\"bytes32[]\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getCommitmentsByCommitter\",\"inputs\":[{\"name\":\"commiter\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32[]\",\"internalType\":\"bytes32[]\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getPreConfHash\",\"inputs\":[{\"name\":\"_txnHash\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"_bid\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"_blockNumber\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"_decayStartTimeStamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"_decayEndTimeStamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"_bidHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"_bidSignature\",\"type\":\"string\",\"internalType\":\"string\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getTxnHashFromCommitment\",\"inputs\":[{\"name\":\"commitmentIndex\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"txnHash\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"initiateReward\",\"inputs\":[{\"name\":\"commitmentIndex\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"residualBidPercentAfterDecay\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"initiateSlash\",\"inputs\":[{\"name\":\"commitmentIndex\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"residualBidPercentAfterDecay\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"lastProcessedBlock\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"oracle\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"owner\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"providerCommitments\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"providerRegistry\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIProviderRegistry\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"renounceOwnership\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"storeCommitment\",\"inputs\":[{\"name\":\"bid\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"blockNumber\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"txnHash\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"decayStartTimeStamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"decayEndTimeStamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"bidSignature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"commitmentSignature\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"commitmentIndex\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"transferOwnership\",\"inputs\":[{\"name\":\"newOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"unlockBidFunds\",\"inputs\":[{\"name\":\"commitmentDigest\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"updateBidderRegistry\",\"inputs\":[{\"name\":\"newBidderRegistry\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"updateOracle\",\"inputs\":[{\"name\":\"newOracle\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"updateProviderRegistry\",\"inputs\":[{\"name\":\"newProviderRegistry\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"verifyBid\",\"inputs\":[{\"name\":\"bid\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"blockNumber\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"decayStartTimeStamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"decayEndTimeStamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"txnHash\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"bidSignature\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"messageDigest\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"recoveredAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"stake\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"verifyPreConfCommitment\",\"inputs\":[{\"name\":\"txnHash\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"bid\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"blockNumber\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"decayStartTimeStamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"decayEndTimeStamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"bidHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"bidSignature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"commitmentSignature\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"preConfHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"commiterAddress\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"event\",\"name\":\"OwnershipTransferred\",\"inputs\":[{\"name\":\"previousOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"newOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"SignatureVerified\",\"inputs\":[{\"name\":\"signer\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"txnHash\",\"type\":\"string\",\"indexed\":false,\"internalType\":\"string\"},{\"name\":\"bid\",\"type\":\"uint64\",\"indexed\":true,\"internalType\":\"uint64\"},{\"name\":\"blockNumber\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false}]", + ABI: "[{\"type\":\"constructor\",\"inputs\":[{\"name\":\"_providerRegistry\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_bidderRegistry\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_oracle\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_owner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_commitment_dispatch_window\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"fallback\",\"stateMutability\":\"payable\"},{\"type\":\"receive\",\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"DOMAIN_SEPARATOR_BID\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"DOMAIN_SEPARATOR_PRECONF\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"EIP712_BID_TYPEHASH\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"EIP712_COMMITMENT_TYPEHASH\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"_bytesToHexString\",\"inputs\":[{\"name\":\"_bytes\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"pure\"},{\"type\":\"function\",\"name\":\"bidderRegistry\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIBidderRegistry\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"blockCommitments\",\"inputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"commitmentCount\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"commitment_dispatch_window\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"commitments\",\"inputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"commitmentUsed\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"bidder\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"commiter\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"bid\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"blockNumber\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"bidHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"decayStartTimeStamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"decayEndTimeStamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"txnHash\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"commitmentHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"bidSignature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"commitmentSignature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"dispatchTimestamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"commitmentsCount\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getBidHash\",\"inputs\":[{\"name\":\"_txnHash\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"_bid\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"_blockNumber\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"_decayStartTimeStamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"_decayEndTimeStamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getCommitment\",\"inputs\":[{\"name\":\"commitmentIndex\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structPreConfCommitmentStore.PreConfCommitment\",\"components\":[{\"name\":\"commitmentUsed\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"bidder\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"commiter\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"bid\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"blockNumber\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"bidHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"decayStartTimeStamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"decayEndTimeStamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"txnHash\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"commitmentHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"bidSignature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"commitmentSignature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"dispatchTimestamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getCommitmentIndex\",\"inputs\":[{\"name\":\"commitment\",\"type\":\"tuple\",\"internalType\":\"structPreConfCommitmentStore.PreConfCommitment\",\"components\":[{\"name\":\"commitmentUsed\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"bidder\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"commiter\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"bid\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"blockNumber\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"bidHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"decayStartTimeStamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"decayEndTimeStamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"txnHash\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"commitmentHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"bidSignature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"commitmentSignature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"dispatchTimestamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"pure\"},{\"type\":\"function\",\"name\":\"getCommitmentsByBlockNumber\",\"inputs\":[{\"name\":\"blockNumber\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32[]\",\"internalType\":\"bytes32[]\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getCommitmentsByCommitter\",\"inputs\":[{\"name\":\"commiter\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32[]\",\"internalType\":\"bytes32[]\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getPreConfHash\",\"inputs\":[{\"name\":\"_txnHash\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"_bid\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"_blockNumber\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"_decayStartTimeStamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"_decayEndTimeStamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"_bidHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"_bidSignature\",\"type\":\"string\",\"internalType\":\"string\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getTxnHashFromCommitment\",\"inputs\":[{\"name\":\"commitmentIndex\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"txnHash\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"initiateReward\",\"inputs\":[{\"name\":\"commitmentIndex\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"residualBidPercentAfterDecay\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"initiateSlash\",\"inputs\":[{\"name\":\"commitmentIndex\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"residualBidPercentAfterDecay\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"lastProcessedBlock\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"oracle\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"owner\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"providerCommitments\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"providerRegistry\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIProviderRegistry\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"renounceOwnership\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"storeCommitment\",\"inputs\":[{\"name\":\"bid\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"blockNumber\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"txnHash\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"decayStartTimeStamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"decayEndTimeStamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"bidSignature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"commitmentSignature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"dispatchTimestamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"outputs\":[{\"name\":\"commitmentIndex\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"transferOwnership\",\"inputs\":[{\"name\":\"newOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"unlockBidFunds\",\"inputs\":[{\"name\":\"commitmentDigest\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"updateBidderRegistry\",\"inputs\":[{\"name\":\"newBidderRegistry\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"updateCommitmentDispatchWindow\",\"inputs\":[{\"name\":\"newDispatchWindow\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"updateOracle\",\"inputs\":[{\"name\":\"newOracle\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"updateProviderRegistry\",\"inputs\":[{\"name\":\"newProviderRegistry\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"verifyBid\",\"inputs\":[{\"name\":\"bid\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"blockNumber\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"decayStartTimeStamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"decayEndTimeStamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"txnHash\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"bidSignature\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"messageDigest\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"recoveredAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"stake\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"verifyPreConfCommitment\",\"inputs\":[{\"name\":\"txnHash\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"bid\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"blockNumber\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"decayStartTimeStamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"decayEndTimeStamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"bidHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"bidSignature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"commitmentSignature\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"preConfHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"commiterAddress\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"event\",\"name\":\"OwnershipTransferred\",\"inputs\":[{\"name\":\"previousOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"newOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"SignatureVerified\",\"inputs\":[{\"name\":\"signer\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"txnHash\",\"type\":\"string\",\"indexed\":false,\"internalType\":\"string\"},{\"name\":\"bid\",\"type\":\"uint64\",\"indexed\":true,\"internalType\":\"uint64\"},{\"name\":\"blockNumber\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false}]", } // PreconfcommitmentstoreABI is the input ABI used to generate the binding from. @@ -445,9 +445,40 @@ func (_Preconfcommitmentstore *PreconfcommitmentstoreCallerSession) CommitmentCo return _Preconfcommitmentstore.Contract.CommitmentCount(&_Preconfcommitmentstore.CallOpts) } +// CommitmentDispatchWindow is a free data retrieval call binding the contract method 0x39b41321. +// +// Solidity: function commitment_dispatch_window() view returns(uint64) +func (_Preconfcommitmentstore *PreconfcommitmentstoreCaller) CommitmentDispatchWindow(opts *bind.CallOpts) (uint64, error) { + var out []interface{} + err := _Preconfcommitmentstore.contract.Call(opts, &out, "commitment_dispatch_window") + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + +} + +// CommitmentDispatchWindow is a free data retrieval call binding the contract method 0x39b41321. +// +// Solidity: function commitment_dispatch_window() view returns(uint64) +func (_Preconfcommitmentstore *PreconfcommitmentstoreSession) CommitmentDispatchWindow() (uint64, error) { + return _Preconfcommitmentstore.Contract.CommitmentDispatchWindow(&_Preconfcommitmentstore.CallOpts) +} + +// CommitmentDispatchWindow is a free data retrieval call binding the contract method 0x39b41321. +// +// Solidity: function commitment_dispatch_window() view returns(uint64) +func (_Preconfcommitmentstore *PreconfcommitmentstoreCallerSession) CommitmentDispatchWindow() (uint64, error) { + return _Preconfcommitmentstore.Contract.CommitmentDispatchWindow(&_Preconfcommitmentstore.CallOpts) +} + // Commitments is a free data retrieval call binding the contract method 0x839df945. // -// Solidity: function commitments(bytes32 ) view returns(bool commitmentUsed, address bidder, address commiter, uint64 bid, uint64 blockNumber, bytes32 bidHash, uint64 decayStartTimeStamp, uint64 decayEndTimeStamp, string txnHash, bytes32 commitmentHash, bytes bidSignature, bytes commitmentSignature, uint256 blockCommitedAt) +// Solidity: function commitments(bytes32 ) view returns(bool commitmentUsed, address bidder, address commiter, uint64 bid, uint64 blockNumber, bytes32 bidHash, uint64 decayStartTimeStamp, uint64 decayEndTimeStamp, string txnHash, bytes32 commitmentHash, bytes bidSignature, bytes commitmentSignature, uint64 dispatchTimestamp) func (_Preconfcommitmentstore *PreconfcommitmentstoreCaller) Commitments(opts *bind.CallOpts, arg0 [32]byte) (struct { CommitmentUsed bool Bidder common.Address @@ -461,7 +492,7 @@ func (_Preconfcommitmentstore *PreconfcommitmentstoreCaller) Commitments(opts *b CommitmentHash [32]byte BidSignature []byte CommitmentSignature []byte - BlockCommitedAt *big.Int + DispatchTimestamp uint64 }, error) { var out []interface{} err := _Preconfcommitmentstore.contract.Call(opts, &out, "commitments", arg0) @@ -479,7 +510,7 @@ func (_Preconfcommitmentstore *PreconfcommitmentstoreCaller) Commitments(opts *b CommitmentHash [32]byte BidSignature []byte CommitmentSignature []byte - BlockCommitedAt *big.Int + DispatchTimestamp uint64 }) if err != nil { return *outstruct, err @@ -497,7 +528,7 @@ func (_Preconfcommitmentstore *PreconfcommitmentstoreCaller) Commitments(opts *b outstruct.CommitmentHash = *abi.ConvertType(out[9], new([32]byte)).(*[32]byte) outstruct.BidSignature = *abi.ConvertType(out[10], new([]byte)).(*[]byte) outstruct.CommitmentSignature = *abi.ConvertType(out[11], new([]byte)).(*[]byte) - outstruct.BlockCommitedAt = *abi.ConvertType(out[12], new(*big.Int)).(**big.Int) + outstruct.DispatchTimestamp = *abi.ConvertType(out[12], new(uint64)).(*uint64) return *outstruct, err @@ -505,7 +536,7 @@ func (_Preconfcommitmentstore *PreconfcommitmentstoreCaller) Commitments(opts *b // Commitments is a free data retrieval call binding the contract method 0x839df945. // -// Solidity: function commitments(bytes32 ) view returns(bool commitmentUsed, address bidder, address commiter, uint64 bid, uint64 blockNumber, bytes32 bidHash, uint64 decayStartTimeStamp, uint64 decayEndTimeStamp, string txnHash, bytes32 commitmentHash, bytes bidSignature, bytes commitmentSignature, uint256 blockCommitedAt) +// Solidity: function commitments(bytes32 ) view returns(bool commitmentUsed, address bidder, address commiter, uint64 bid, uint64 blockNumber, bytes32 bidHash, uint64 decayStartTimeStamp, uint64 decayEndTimeStamp, string txnHash, bytes32 commitmentHash, bytes bidSignature, bytes commitmentSignature, uint64 dispatchTimestamp) func (_Preconfcommitmentstore *PreconfcommitmentstoreSession) Commitments(arg0 [32]byte) (struct { CommitmentUsed bool Bidder common.Address @@ -519,14 +550,14 @@ func (_Preconfcommitmentstore *PreconfcommitmentstoreSession) Commitments(arg0 [ CommitmentHash [32]byte BidSignature []byte CommitmentSignature []byte - BlockCommitedAt *big.Int + DispatchTimestamp uint64 }, error) { return _Preconfcommitmentstore.Contract.Commitments(&_Preconfcommitmentstore.CallOpts, arg0) } // Commitments is a free data retrieval call binding the contract method 0x839df945. // -// Solidity: function commitments(bytes32 ) view returns(bool commitmentUsed, address bidder, address commiter, uint64 bid, uint64 blockNumber, bytes32 bidHash, uint64 decayStartTimeStamp, uint64 decayEndTimeStamp, string txnHash, bytes32 commitmentHash, bytes bidSignature, bytes commitmentSignature, uint256 blockCommitedAt) +// Solidity: function commitments(bytes32 ) view returns(bool commitmentUsed, address bidder, address commiter, uint64 bid, uint64 blockNumber, bytes32 bidHash, uint64 decayStartTimeStamp, uint64 decayEndTimeStamp, string txnHash, bytes32 commitmentHash, bytes bidSignature, bytes commitmentSignature, uint64 dispatchTimestamp) func (_Preconfcommitmentstore *PreconfcommitmentstoreCallerSession) Commitments(arg0 [32]byte) (struct { CommitmentUsed bool Bidder common.Address @@ -540,7 +571,7 @@ func (_Preconfcommitmentstore *PreconfcommitmentstoreCallerSession) Commitments( CommitmentHash [32]byte BidSignature []byte CommitmentSignature []byte - BlockCommitedAt *big.Int + DispatchTimestamp uint64 }, error) { return _Preconfcommitmentstore.Contract.Commitments(&_Preconfcommitmentstore.CallOpts, arg0) } @@ -609,7 +640,7 @@ func (_Preconfcommitmentstore *PreconfcommitmentstoreCallerSession) GetBidHash(_ // GetCommitment is a free data retrieval call binding the contract method 0x7795820c. // -// Solidity: function getCommitment(bytes32 commitmentIndex) view returns((bool,address,address,uint64,uint64,bytes32,uint64,uint64,string,bytes32,bytes,bytes,uint256)) +// Solidity: function getCommitment(bytes32 commitmentIndex) view returns((bool,address,address,uint64,uint64,bytes32,uint64,uint64,string,bytes32,bytes,bytes,uint64)) func (_Preconfcommitmentstore *PreconfcommitmentstoreCaller) GetCommitment(opts *bind.CallOpts, commitmentIndex [32]byte) (PreConfCommitmentStorePreConfCommitment, error) { var out []interface{} err := _Preconfcommitmentstore.contract.Call(opts, &out, "getCommitment", commitmentIndex) @@ -626,21 +657,21 @@ func (_Preconfcommitmentstore *PreconfcommitmentstoreCaller) GetCommitment(opts // GetCommitment is a free data retrieval call binding the contract method 0x7795820c. // -// Solidity: function getCommitment(bytes32 commitmentIndex) view returns((bool,address,address,uint64,uint64,bytes32,uint64,uint64,string,bytes32,bytes,bytes,uint256)) +// Solidity: function getCommitment(bytes32 commitmentIndex) view returns((bool,address,address,uint64,uint64,bytes32,uint64,uint64,string,bytes32,bytes,bytes,uint64)) func (_Preconfcommitmentstore *PreconfcommitmentstoreSession) GetCommitment(commitmentIndex [32]byte) (PreConfCommitmentStorePreConfCommitment, error) { return _Preconfcommitmentstore.Contract.GetCommitment(&_Preconfcommitmentstore.CallOpts, commitmentIndex) } // GetCommitment is a free data retrieval call binding the contract method 0x7795820c. // -// Solidity: function getCommitment(bytes32 commitmentIndex) view returns((bool,address,address,uint64,uint64,bytes32,uint64,uint64,string,bytes32,bytes,bytes,uint256)) +// Solidity: function getCommitment(bytes32 commitmentIndex) view returns((bool,address,address,uint64,uint64,bytes32,uint64,uint64,string,bytes32,bytes,bytes,uint64)) func (_Preconfcommitmentstore *PreconfcommitmentstoreCallerSession) GetCommitment(commitmentIndex [32]byte) (PreConfCommitmentStorePreConfCommitment, error) { return _Preconfcommitmentstore.Contract.GetCommitment(&_Preconfcommitmentstore.CallOpts, commitmentIndex) } -// GetCommitmentIndex is a free data retrieval call binding the contract method 0xebdb90e4. +// GetCommitmentIndex is a free data retrieval call binding the contract method 0x01b1abce. // -// Solidity: function getCommitmentIndex((bool,address,address,uint64,uint64,bytes32,uint64,uint64,string,bytes32,bytes,bytes,uint256) commitment) pure returns(bytes32) +// Solidity: function getCommitmentIndex((bool,address,address,uint64,uint64,bytes32,uint64,uint64,string,bytes32,bytes,bytes,uint64) commitment) pure returns(bytes32) func (_Preconfcommitmentstore *PreconfcommitmentstoreCaller) GetCommitmentIndex(opts *bind.CallOpts, commitment PreConfCommitmentStorePreConfCommitment) ([32]byte, error) { var out []interface{} err := _Preconfcommitmentstore.contract.Call(opts, &out, "getCommitmentIndex", commitment) @@ -655,16 +686,16 @@ func (_Preconfcommitmentstore *PreconfcommitmentstoreCaller) GetCommitmentIndex( } -// GetCommitmentIndex is a free data retrieval call binding the contract method 0xebdb90e4. +// GetCommitmentIndex is a free data retrieval call binding the contract method 0x01b1abce. // -// Solidity: function getCommitmentIndex((bool,address,address,uint64,uint64,bytes32,uint64,uint64,string,bytes32,bytes,bytes,uint256) commitment) pure returns(bytes32) +// Solidity: function getCommitmentIndex((bool,address,address,uint64,uint64,bytes32,uint64,uint64,string,bytes32,bytes,bytes,uint64) commitment) pure returns(bytes32) func (_Preconfcommitmentstore *PreconfcommitmentstoreSession) GetCommitmentIndex(commitment PreConfCommitmentStorePreConfCommitment) ([32]byte, error) { return _Preconfcommitmentstore.Contract.GetCommitmentIndex(&_Preconfcommitmentstore.CallOpts, commitment) } -// GetCommitmentIndex is a free data retrieval call binding the contract method 0xebdb90e4. +// GetCommitmentIndex is a free data retrieval call binding the contract method 0x01b1abce. // -// Solidity: function getCommitmentIndex((bool,address,address,uint64,uint64,bytes32,uint64,uint64,string,bytes32,bytes,bytes,uint256) commitment) pure returns(bytes32) +// Solidity: function getCommitmentIndex((bool,address,address,uint64,uint64,bytes32,uint64,uint64,string,bytes32,bytes,bytes,uint64) commitment) pure returns(bytes32) func (_Preconfcommitmentstore *PreconfcommitmentstoreCallerSession) GetCommitmentIndex(commitment PreConfCommitmentStorePreConfCommitment) ([32]byte, error) { return _Preconfcommitmentstore.Contract.GetCommitmentIndex(&_Preconfcommitmentstore.CallOpts, commitment) } @@ -1106,25 +1137,25 @@ func (_Preconfcommitmentstore *PreconfcommitmentstoreTransactorSession) Renounce return _Preconfcommitmentstore.Contract.RenounceOwnership(&_Preconfcommitmentstore.TransactOpts) } -// StoreCommitment is a paid mutator transaction binding the contract method 0xbfd21439. +// StoreCommitment is a paid mutator transaction binding the contract method 0xfcc3a9bc. // -// Solidity: function storeCommitment(uint64 bid, uint64 blockNumber, string txnHash, uint64 decayStartTimeStamp, uint64 decayEndTimeStamp, bytes bidSignature, bytes commitmentSignature) returns(bytes32 commitmentIndex) -func (_Preconfcommitmentstore *PreconfcommitmentstoreTransactor) StoreCommitment(opts *bind.TransactOpts, bid uint64, blockNumber uint64, txnHash string, decayStartTimeStamp uint64, decayEndTimeStamp uint64, bidSignature []byte, commitmentSignature []byte) (*types.Transaction, error) { - return _Preconfcommitmentstore.contract.Transact(opts, "storeCommitment", bid, blockNumber, txnHash, decayStartTimeStamp, decayEndTimeStamp, bidSignature, commitmentSignature) +// Solidity: function storeCommitment(uint64 bid, uint64 blockNumber, string txnHash, uint64 decayStartTimeStamp, uint64 decayEndTimeStamp, bytes bidSignature, bytes commitmentSignature, uint64 dispatchTimestamp) returns(bytes32 commitmentIndex) +func (_Preconfcommitmentstore *PreconfcommitmentstoreTransactor) StoreCommitment(opts *bind.TransactOpts, bid uint64, blockNumber uint64, txnHash string, decayStartTimeStamp uint64, decayEndTimeStamp uint64, bidSignature []byte, commitmentSignature []byte, dispatchTimestamp uint64) (*types.Transaction, error) { + return _Preconfcommitmentstore.contract.Transact(opts, "storeCommitment", bid, blockNumber, txnHash, decayStartTimeStamp, decayEndTimeStamp, bidSignature, commitmentSignature, dispatchTimestamp) } -// StoreCommitment is a paid mutator transaction binding the contract method 0xbfd21439. +// StoreCommitment is a paid mutator transaction binding the contract method 0xfcc3a9bc. // -// Solidity: function storeCommitment(uint64 bid, uint64 blockNumber, string txnHash, uint64 decayStartTimeStamp, uint64 decayEndTimeStamp, bytes bidSignature, bytes commitmentSignature) returns(bytes32 commitmentIndex) -func (_Preconfcommitmentstore *PreconfcommitmentstoreSession) StoreCommitment(bid uint64, blockNumber uint64, txnHash string, decayStartTimeStamp uint64, decayEndTimeStamp uint64, bidSignature []byte, commitmentSignature []byte) (*types.Transaction, error) { - return _Preconfcommitmentstore.Contract.StoreCommitment(&_Preconfcommitmentstore.TransactOpts, bid, blockNumber, txnHash, decayStartTimeStamp, decayEndTimeStamp, bidSignature, commitmentSignature) +// Solidity: function storeCommitment(uint64 bid, uint64 blockNumber, string txnHash, uint64 decayStartTimeStamp, uint64 decayEndTimeStamp, bytes bidSignature, bytes commitmentSignature, uint64 dispatchTimestamp) returns(bytes32 commitmentIndex) +func (_Preconfcommitmentstore *PreconfcommitmentstoreSession) StoreCommitment(bid uint64, blockNumber uint64, txnHash string, decayStartTimeStamp uint64, decayEndTimeStamp uint64, bidSignature []byte, commitmentSignature []byte, dispatchTimestamp uint64) (*types.Transaction, error) { + return _Preconfcommitmentstore.Contract.StoreCommitment(&_Preconfcommitmentstore.TransactOpts, bid, blockNumber, txnHash, decayStartTimeStamp, decayEndTimeStamp, bidSignature, commitmentSignature, dispatchTimestamp) } -// StoreCommitment is a paid mutator transaction binding the contract method 0xbfd21439. +// StoreCommitment is a paid mutator transaction binding the contract method 0xfcc3a9bc. // -// Solidity: function storeCommitment(uint64 bid, uint64 blockNumber, string txnHash, uint64 decayStartTimeStamp, uint64 decayEndTimeStamp, bytes bidSignature, bytes commitmentSignature) returns(bytes32 commitmentIndex) -func (_Preconfcommitmentstore *PreconfcommitmentstoreTransactorSession) StoreCommitment(bid uint64, blockNumber uint64, txnHash string, decayStartTimeStamp uint64, decayEndTimeStamp uint64, bidSignature []byte, commitmentSignature []byte) (*types.Transaction, error) { - return _Preconfcommitmentstore.Contract.StoreCommitment(&_Preconfcommitmentstore.TransactOpts, bid, blockNumber, txnHash, decayStartTimeStamp, decayEndTimeStamp, bidSignature, commitmentSignature) +// Solidity: function storeCommitment(uint64 bid, uint64 blockNumber, string txnHash, uint64 decayStartTimeStamp, uint64 decayEndTimeStamp, bytes bidSignature, bytes commitmentSignature, uint64 dispatchTimestamp) returns(bytes32 commitmentIndex) +func (_Preconfcommitmentstore *PreconfcommitmentstoreTransactorSession) StoreCommitment(bid uint64, blockNumber uint64, txnHash string, decayStartTimeStamp uint64, decayEndTimeStamp uint64, bidSignature []byte, commitmentSignature []byte, dispatchTimestamp uint64) (*types.Transaction, error) { + return _Preconfcommitmentstore.Contract.StoreCommitment(&_Preconfcommitmentstore.TransactOpts, bid, blockNumber, txnHash, decayStartTimeStamp, decayEndTimeStamp, bidSignature, commitmentSignature, dispatchTimestamp) } // TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. @@ -1190,6 +1221,27 @@ func (_Preconfcommitmentstore *PreconfcommitmentstoreTransactorSession) UpdateBi return _Preconfcommitmentstore.Contract.UpdateBidderRegistry(&_Preconfcommitmentstore.TransactOpts, newBidderRegistry) } +// UpdateCommitmentDispatchWindow is a paid mutator transaction binding the contract method 0x03800560. +// +// Solidity: function updateCommitmentDispatchWindow(uint64 newDispatchWindow) returns() +func (_Preconfcommitmentstore *PreconfcommitmentstoreTransactor) UpdateCommitmentDispatchWindow(opts *bind.TransactOpts, newDispatchWindow uint64) (*types.Transaction, error) { + return _Preconfcommitmentstore.contract.Transact(opts, "updateCommitmentDispatchWindow", newDispatchWindow) +} + +// UpdateCommitmentDispatchWindow is a paid mutator transaction binding the contract method 0x03800560. +// +// Solidity: function updateCommitmentDispatchWindow(uint64 newDispatchWindow) returns() +func (_Preconfcommitmentstore *PreconfcommitmentstoreSession) UpdateCommitmentDispatchWindow(newDispatchWindow uint64) (*types.Transaction, error) { + return _Preconfcommitmentstore.Contract.UpdateCommitmentDispatchWindow(&_Preconfcommitmentstore.TransactOpts, newDispatchWindow) +} + +// UpdateCommitmentDispatchWindow is a paid mutator transaction binding the contract method 0x03800560. +// +// Solidity: function updateCommitmentDispatchWindow(uint64 newDispatchWindow) returns() +func (_Preconfcommitmentstore *PreconfcommitmentstoreTransactorSession) UpdateCommitmentDispatchWindow(newDispatchWindow uint64) (*types.Transaction, error) { + return _Preconfcommitmentstore.Contract.UpdateCommitmentDispatchWindow(&_Preconfcommitmentstore.TransactOpts, newDispatchWindow) +} + // UpdateOracle is a paid mutator transaction binding the contract method 0x1cb44dfc. // // Solidity: function updateOracle(address newOracle) returns() diff --git a/contracts/contracts/PreConfirmations.sol b/contracts/contracts/PreConfirmations.sol index 3cab0fe6d..d4f180c07 100644 --- a/contracts/contracts/PreConfirmations.sol +++ b/contracts/contracts/PreConfirmations.sol @@ -27,6 +27,9 @@ contract PreConfCommitmentStore is Ownable { bytes32 public constant EIP712_BID_TYPEHASH = keccak256("PreConfBid(string txnHash,uint64 bid,uint64 blockNumber,uint64 decayStartTimeStamp,uint64 decayEndTimeStamp)"); + // Represents the dispatch window in milliseconds + uint64 public commitment_dispatch_window; + /// @dev commitment counter uint256 public commitmentCount; @@ -75,7 +78,7 @@ contract PreConfCommitmentStore is Ownable { bytes32 commitmentHash; bytes bidSignature; bytes commitmentSignature; - uint256 blockCommitedAt; + uint64 dispatchTimestamp; } /// @dev Event to log successful verifications @@ -119,7 +122,8 @@ contract PreConfCommitmentStore is Ownable { address _providerRegistry, address _bidderRegistry, address _oracle, - address _owner + address _owner, + uint64 _commitment_dispatch_window ) { oracle = _oracle; providerRegistry = IProviderRegistry(_providerRegistry); @@ -142,6 +146,15 @@ contract PreConfCommitmentStore is Ownable { keccak256("1") ) ); + commitment_dispatch_window = _commitment_dispatch_window; + } + + /** + * @dev Updates the commitment dispatch window to a new value. This function can only be called by the contract owner. + * @param newDispatchWindow The new dispatch window value to be set. + */ + function updateCommitmentDispatchWindow(uint64 newDispatchWindow) external onlyOwner { + commitment_dispatch_window = newDispatchWindow; } /** @@ -289,6 +302,8 @@ contract PreConfCommitmentStore is Ownable { ); } + + /** * @dev Store a commitment. * @param bid The bid amount. @@ -296,6 +311,7 @@ contract PreConfCommitmentStore is Ownable { * @param txnHash The transaction hash. * @param bidSignature The signature of the bid. * @param commitmentSignature The signature of the commitment. + * @param dispatchTimestamp The timestamp at which the commitment is dispatched * @return commitmentIndex The index of the stored commitment */ function storeCommitment( @@ -305,7 +321,8 @@ contract PreConfCommitmentStore is Ownable { uint64 decayStartTimeStamp, uint64 decayEndTimeStamp, bytes calldata bidSignature, - bytes memory commitmentSignature + bytes memory commitmentSignature, + uint64 dispatchTimestamp ) public returns (bytes32 commitmentIndex) { (bytes32 bHash, address bidderAddress, uint256 stake) = verifyBid( bid, @@ -315,6 +332,9 @@ contract PreConfCommitmentStore is Ownable { txnHash, bidSignature ); + + require(dispatchTimestamp >= block.timestamp || block.timestamp - dispatchTimestamp < commitment_dispatch_window, "Invalid dispatch timestamp, block.timestamp - dispatchTimestamp < commitment_dispatch_window"); + // This helps in avoiding stack too deep { bytes32 commitmentDigest = getPreConfHash( @@ -345,7 +365,7 @@ contract PreConfCommitmentStore is Ownable { commitmentDigest, bidSignature, commitmentSignature, - block.number + dispatchTimestamp ); commitmentIndex = getCommitmentIndex(newCommitment); diff --git a/contracts/contracts/interfaces/IPreConfirmations.sol b/contracts/contracts/interfaces/IPreConfirmations.sol index ec5448e6b..d48be0aea 100644 --- a/contracts/contracts/interfaces/IPreConfirmations.sol +++ b/contracts/contracts/interfaces/IPreConfirmations.sol @@ -22,7 +22,7 @@ interface IPreConfCommitmentStore { bytes32 commitmentHash; bytes bidSignature; bytes commitmentSignature; - uint256 blockCommitedAt; + uint64 dispatchTimestamp; } @@ -66,12 +66,16 @@ interface IPreConfCommitmentStore { uint64 blockNumber, string memory txnHash, string memory commitmentHash, + uint64 decayStartTimeStamp, + uint64 decayEndTimeStamp, bytes calldata bidSignature, - bytes memory commitmentSignature - ) external returns (uint256); + bytes memory commitmentSignature, + uint64 dispatchTimestamp + ) external returns (bytes32 commitmentIndex); function getCommitmentsByBlockNumber(uint256 blockNumber) external view returns (bytes32[] memory); + function updateCommitmentDispatchWindow(uint64 newDispatchWindow) external; function getCommitment(bytes32 commitmentIndex) external view returns (PreConfCommitment memory); diff --git a/contracts/scripts/DeployScripts.s.sol b/contracts/scripts/DeployScripts.s.sol index 691e30120..b26f99b94 100644 --- a/contracts/scripts/DeployScripts.s.sol +++ b/contracts/scripts/DeployScripts.s.sol @@ -47,6 +47,7 @@ contract DeployScript is Script, Create2Deployer { address feeRecipient = address(0x68bC10674b265f266b4b1F079Fa06eF4045c3ab9); uint16 feePercent = 2; uint256 nextRequestedBlockNumber = 4958905; + uint64 commitmentDispatchWindow = 250; // Forge deploy with salt uses create2 proxy from https://github.com/primevprotocol/deterministic-deployment-proxy bytes32 salt = 0x8989000000000000000000000000000000000000000000000000000000000000; @@ -57,7 +58,7 @@ contract DeployScript is Script, Create2Deployer { ProviderRegistry providerRegistry = new ProviderRegistry{salt: salt}(minStake, feeRecipient, feePercent, msg.sender); console.log("ProviderRegistry deployed to:", address(providerRegistry)); - PreConfCommitmentStore preConfCommitmentStore = new PreConfCommitmentStore{salt: salt}(address(providerRegistry), address(bidderRegistry), feeRecipient, msg.sender); + PreConfCommitmentStore preConfCommitmentStore = new PreConfCommitmentStore{salt: salt}(address(providerRegistry), address(bidderRegistry), feeRecipient, msg.sender, commitmentDispatchWindow); console.log("PreConfCommitmentStore deployed to:", address(preConfCommitmentStore)); providerRegistry.setPreconfirmationsContract(address(preConfCommitmentStore)); diff --git a/contracts/test/OracleTest.sol b/contracts/test/OracleTest.sol index d64b92a8b..6d977405d 100644 --- a/contracts/test/OracleTest.sol +++ b/contracts/test/OracleTest.sol @@ -21,6 +21,7 @@ contract OracleTest is Test { uint64 testNumber2; BidderRegistry internal bidderRegistry; TestCommitment internal _testCommitmentAliceBob; + uint64 internal dispatchTimestampTesting; struct TestCommitment { uint64 bid; @@ -32,6 +33,7 @@ contract OracleTest is Test { bytes32 commitmentDigest; bytes bidSignature; bytes commitmentSignature; + uint64 dispatchTimestamp; } // Events to match against @@ -53,7 +55,8 @@ contract OracleTest is Test { 0xa0327970258c49b922969af74d60299a648c50f69a2d98d6ab43f32f64ac2100, 0x54c118e537dd7cf63b5388a5fc8322f0286a978265d0338b108a8ca9d155dccc, hex"876c1216c232828be9fabb14981c8788cebdf6ed66e563c4a2ccc82a577d052543207aeeb158a32d8977736797ae250c63ef69a82cd85b727da21e20d030fb311b", - hex"ec0f11f77a9e96bb9c2345f031a5d12dca8d01de8a2e957cf635be14802f9ad01c6183688f0c2672639e90cc2dce0662d9bea3337306ca7d4b56dd80326aaa231b" + hex"ec0f11f77a9e96bb9c2345f031a5d12dca8d01de8a2e957cf635be14802f9ad01c6183688f0c2672639e90cc2dce0662d9bea3337306ca7d4b56dd80326aaa231b", + 1000 ); feePercent = 10; @@ -71,7 +74,8 @@ contract OracleTest is Test { address(providerRegistry), // Provider Registry address(bidderRegistry), // User Registry feeRecipient, // Oracle - address(this) // Owner + address(this), + 500 ); address ownerInstance = 0x6d503Fd50142C7C469C7c6B64794B55bfa6883f3; @@ -87,6 +91,10 @@ contract OracleTest is Test { bidderRegistry.setPreconfirmationsContract(address(preConfCommitmentStore)); providerRegistry.setPreconfirmationsContract(address(preConfCommitmentStore)); + // We set the system time to 1010 and dispatchTimestamps for testing to 1000 + dispatchTimestampTesting = 1000; + vm.warp(1010); + } function test_MultipleBlockBuildersRegistred() public { @@ -142,7 +150,8 @@ contract OracleTest is Test { _testCommitmentAliceBob.decayStartTimestamp, _testCommitmentAliceBob.decayEndTimestamp, bidderPk, - providerPk + providerPk, + _testCommitmentAliceBob.dispatchTimestamp ); string[] memory txnList = new string[](1); @@ -172,7 +181,7 @@ contract OracleTest is Test { providerRegistry.registerAndStake{value: 250 ether}(); vm.stopPrank(); - bytes32 index = constructAndStoreCommitment(bid, blockNumber, txn, 10, 20, bidderPk, providerPk); + bytes32 index = constructAndStoreCommitment(bid, blockNumber, txn, 10, 20, bidderPk, providerPk, dispatchTimestampTesting); vm.startPrank(address(0x6d503Fd50142C7C469C7c6B64794B55bfa6883f3)); oracle.addBuilderAddress(blockBuilderName, provider); @@ -202,7 +211,7 @@ contract OracleTest is Test { providerRegistry.registerAndStake{value: 250 ether}(); vm.stopPrank(); - bytes32 index = constructAndStoreCommitment(bid, blockNumber, txn, 10, 20, bidderPk, providerPk); + bytes32 index = constructAndStoreCommitment(bid, blockNumber, txn, 10, 20, bidderPk, providerPk, dispatchTimestampTesting); vm.startPrank(address(0x6d503Fd50142C7C469C7c6B64794B55bfa6883f3)); oracle.addBuilderAddress(blockBuilderName, provider); @@ -236,8 +245,8 @@ contract OracleTest is Test { providerRegistry.registerAndStake{value: 250 ether}(); vm.stopPrank(); - bytes32 index1 = constructAndStoreCommitment(bid, blockNumber, txn1, 10, 20, bidderPk, providerPk); - bytes32 index2 = constructAndStoreCommitment(bid, blockNumber, txn2, 10, 20, bidderPk, providerPk); + bytes32 index1 = constructAndStoreCommitment(bid, blockNumber, txn1, 10, 20, bidderPk, providerPk,dispatchTimestampTesting); + bytes32 index2 = constructAndStoreCommitment(bid, blockNumber, txn2, 10, 20, bidderPk, providerPk,dispatchTimestampTesting); vm.startPrank(address(0x6d503Fd50142C7C469C7c6B64794B55bfa6883f3)); oracle.addBuilderAddress(blockBuilderName, provider); @@ -276,10 +285,10 @@ contract OracleTest is Test { providerRegistry.registerAndStake{value: 250 ether}(); vm.stopPrank(); - bytes32 index1 = constructAndStoreCommitment(bid, blockNumber, txn1, 10, 20, bidderPk, providerPk); - bytes32 index2 = constructAndStoreCommitment(bid, blockNumber, txn2, 10, 20, bidderPk, providerPk); - bytes32 index3 = constructAndStoreCommitment(bid, blockNumber, txn3, 10, 20, bidderPk, providerPk); - bytes32 index4 = constructAndStoreCommitment(bid, blockNumber, txn4, 10, 20, bidderPk, providerPk); + bytes32 index1 = constructAndStoreCommitment(bid, blockNumber, txn1, 10, 20, bidderPk, providerPk,dispatchTimestampTesting); + bytes32 index2 = constructAndStoreCommitment(bid, blockNumber, txn2, 10, 20, bidderPk, providerPk,dispatchTimestampTesting); + bytes32 index3 = constructAndStoreCommitment(bid, blockNumber, txn3, 10, 20, bidderPk, providerPk,dispatchTimestampTesting); + bytes32 index4 = constructAndStoreCommitment(bid, blockNumber, txn4, 10, 20, bidderPk, providerPk,dispatchTimestampTesting); vm.startPrank(address(0x6d503Fd50142C7C469C7c6B64794B55bfa6883f3)); @@ -323,13 +332,13 @@ contract OracleTest is Test { providerRegistry.registerAndStake{value: 250 ether}(); vm.stopPrank(); - bytes32 index1 = constructAndStoreCommitment(bid, blockNumber, txn1, 10, 20, bidderPk, providerPk); + bytes32 index1 = constructAndStoreCommitment(bid, blockNumber, txn1, 10, 20, bidderPk, providerPk ,dispatchTimestampTesting); assertEq(bidderRegistry.bidderPrepaidBalances(bidder), 250 ether - bid); - bytes32 index2 = constructAndStoreCommitment(bid, blockNumber, txn2, 10, 20, bidderPk, providerPk); + bytes32 index2 = constructAndStoreCommitment(bid, blockNumber, txn2, 10, 20, bidderPk, providerPk ,dispatchTimestampTesting); assertEq(bidderRegistry.bidderPrepaidBalances(bidder), 250 ether - 2*bid); - bytes32 index3 = constructAndStoreCommitment(bid, blockNumber, txn3, 10, 20, bidderPk, providerPk); + bytes32 index3 = constructAndStoreCommitment(bid, blockNumber, txn3, 10, 20, bidderPk, providerPk, dispatchTimestampTesting); assertEq(bidderRegistry.bidderPrepaidBalances(bidder), 250 ether - 3*bid); - bytes32 index4 = constructAndStoreCommitment(bid, blockNumber, txn4, 10, 20, bidderPk, providerPk); + bytes32 index4 = constructAndStoreCommitment(bid, blockNumber, txn4, 10, 20, bidderPk, providerPk, dispatchTimestampTesting); assertEq(bidderRegistry.bidderPrepaidBalances(bidder), 250 ether - 4*bid); vm.startPrank(address(0x6d503Fd50142C7C469C7c6B64794B55bfa6883f3)); @@ -370,7 +379,7 @@ contract OracleTest is Test { providerRegistry.registerAndStake{value: 250 ether}(); vm.stopPrank(); - bytes32 index = constructAndStoreCommitment(bid, blockNumber, txn, 10, 20, bidderPk, providerPk); + bytes32 index = constructAndStoreCommitment(bid, blockNumber, txn, 10, 20, bidderPk, providerPk, dispatchTimestampTesting); PreConfCommitmentStore.PreConfCommitment memory commitment = preConfCommitmentStore.getCommitment(index); vm.startPrank(address(0x6d503Fd50142C7C469C7c6B64794B55bfa6883f3)); @@ -397,7 +406,8 @@ contract OracleTest is Test { uint64 decayStartTimestamp, uint64 decayEndTimestamp, uint256 bidderPk, - uint256 signerPk + uint256 signerPk, + uint64 dispatchTimestamp ) public returns (bytes32 commitmentIndex) { bytes32 bidHash = preConfCommitmentStore.getBidHash( txnHash, @@ -431,7 +441,8 @@ contract OracleTest is Test { decayStartTimestamp, decayEndTimestamp, bidSignature, - commitmentSignature + commitmentSignature, + dispatchTimestamp ); return commitmentIndex; diff --git a/contracts/test/PreConfirmationConfTest.sol b/contracts/test/PreConfirmationConfTest.sol index 34ffc8e04..4797e7b52 100644 --- a/contracts/test/PreConfirmationConfTest.sol +++ b/contracts/test/PreConfirmationConfTest.sol @@ -20,6 +20,7 @@ contract TestPreConfCommitmentStore is Test { bytes32 commitmentDigest; bytes bidSignature; bytes commitmentSignature; + uint64 dispatchTimestamp; } TestCommitment internal _testCommitmentAliceBob; @@ -42,7 +43,8 @@ contract TestPreConfCommitmentStore is Test { 0xa0327970258c49b922969af74d60299a648c50f69a2d98d6ab43f32f64ac2100, 0x54c118e537dd7cf63b5388a5fc8322f0286a978265d0338b108a8ca9d155dccc, hex"876c1216c232828be9fabb14981c8788cebdf6ed66e563c4a2ccc82a577d052543207aeeb158a32d8977736797ae250c63ef69a82cd85b727da21e20d030fb311b", - hex"ec0f11f77a9e96bb9c2345f031a5d12dca8d01de8a2e957cf635be14802f9ad01c6183688f0c2672639e90cc2dce0662d9bea3337306ca7d4b56dd80326aaa231b" + hex"ec0f11f77a9e96bb9c2345f031a5d12dca8d01de8a2e957cf635be14802f9ad01c6183688f0c2672639e90cc2dce0662d9bea3337306ca7d4b56dd80326aaa231b", + 15 ); feePercent = 10; @@ -61,10 +63,14 @@ contract TestPreConfCommitmentStore is Test { address(providerRegistry), // Provider Registry address(bidderRegistry), // User Registry feeRecipient, // Oracle - address(this) // Owner + address(this), + 500 ); bidderRegistry.setPreconfirmationsContract(address(preConfCommitmentStore)); + + // Sets fake block timestamp + vm.warp(16); } function test_Initialize() public { @@ -115,7 +121,98 @@ contract TestPreConfCommitmentStore is Test { _testCommitmentAliceBob.decayStartTimestamp, _testCommitmentAliceBob.decayEndTimestamp, signature, - _testCommitmentAliceBob.commitmentSignature + _testCommitmentAliceBob.commitmentSignature, + _testCommitmentAliceBob.dispatchTimestamp + ); + } + + + function test_StoreCommitmentFailureDueToTimestampValidation() public { + bytes32 bidHash = preConfCommitmentStore.getBidHash( + _testCommitmentAliceBob.txnHash, + _testCommitmentAliceBob.bid, + _testCommitmentAliceBob.blockNumber, + _testCommitmentAliceBob.decayStartTimestamp, + _testCommitmentAliceBob.decayEndTimestamp + ); + (address bidder, uint256 bidderPk) = makeAddrAndKey("alice"); + // Wallet memory kartik = vm.createWallet('test wallet'); + (uint8 v,bytes32 r, bytes32 s) = vm.sign(bidderPk, bidHash); + bytes memory signature = abi.encodePacked(r, s, v); + + vm.deal(bidder, 200000 ether); + vm.prank(bidder); + bidderRegistry.prepay{value: 1e18 wei}(); + + (bytes32 digest, address recoveredAddress, uint256 stake) = preConfCommitmentStore.verifyBid( + _testCommitmentAliceBob.bid, + _testCommitmentAliceBob.blockNumber, + _testCommitmentAliceBob.decayStartTimestamp, + _testCommitmentAliceBob.decayEndTimestamp, + _testCommitmentAliceBob.txnHash, + signature); + + assertEq(stake, 1e18 wei); + assertEq(bidder, recoveredAddress); + assertEq(digest, bidHash); + vm.warp(1000); + vm.expectRevert("Invalid dispatch timestamp, block.timestamp - dispatchTimestamp < commitment_dispatch_window"); + preConfCommitmentStore.storeCommitment( + _testCommitmentAliceBob.bid, + _testCommitmentAliceBob.blockNumber, + _testCommitmentAliceBob.txnHash, + _testCommitmentAliceBob.decayStartTimestamp, + _testCommitmentAliceBob.decayEndTimestamp, + signature, + _testCommitmentAliceBob.commitmentSignature, + _testCommitmentAliceBob.dispatchTimestamp + ); + + } + + + function test_StoreCommitmentFailureDueToTimestampValidationWithNewWindow() public { + bytes32 bidHash = preConfCommitmentStore.getBidHash( + _testCommitmentAliceBob.txnHash, + _testCommitmentAliceBob.bid, + _testCommitmentAliceBob.blockNumber, + _testCommitmentAliceBob.decayStartTimestamp, + _testCommitmentAliceBob.decayEndTimestamp + ); + (address bidder, uint256 bidderPk) = makeAddrAndKey("alice"); + // Wallet memory kartik = vm.createWallet('test wallet'); + (uint8 v,bytes32 r, bytes32 s) = vm.sign(bidderPk, bidHash); + bytes memory signature = abi.encodePacked(r, s, v); + + vm.deal(bidder, 200000 ether); + vm.prank(bidder); + bidderRegistry.prepay{value: 1e18 wei}(); + + (bytes32 digest, address recoveredAddress, uint256 stake) = preConfCommitmentStore.verifyBid( + _testCommitmentAliceBob.bid, + _testCommitmentAliceBob.blockNumber, + _testCommitmentAliceBob.decayStartTimestamp, + _testCommitmentAliceBob.decayEndTimestamp, + _testCommitmentAliceBob.txnHash, + signature); + + assertEq(stake, 1e18 wei); + assertEq(bidder, recoveredAddress); + assertEq(digest, bidHash); + + vm.prank(preConfCommitmentStore.owner()); + preConfCommitmentStore.updateCommitmentDispatchWindow(200); + vm.warp(200 + _testCommitmentAliceBob.dispatchTimestamp); + vm.expectRevert("Invalid dispatch timestamp, block.timestamp - dispatchTimestamp < commitment_dispatch_window"); + preConfCommitmentStore.storeCommitment( + _testCommitmentAliceBob.bid, + _testCommitmentAliceBob.blockNumber, + _testCommitmentAliceBob.txnHash, + _testCommitmentAliceBob.decayStartTimestamp, + _testCommitmentAliceBob.decayEndTimestamp, + signature, + _testCommitmentAliceBob.commitmentSignature, + _testCommitmentAliceBob.dispatchTimestamp ); } @@ -219,7 +316,8 @@ contract TestPreConfCommitmentStore is Test { _testCommitmentAliceBob.decayStartTimestamp, _testCommitmentAliceBob.decayEndTimestamp, _testCommitmentAliceBob.bidSignature, - _testCommitmentAliceBob.commitmentSignature + _testCommitmentAliceBob.commitmentSignature, + _testCommitmentAliceBob.dispatchTimestamp ); // Step 3: Verify the stored commitment @@ -277,7 +375,8 @@ contract TestPreConfCommitmentStore is Test { uint64 decayStartTimestamp, uint64 decayEndTimestamp, bytes memory bidSignature, - bytes memory commitmentSignature + bytes memory commitmentSignature, + uint64 dispatchTimestamp ) internal returns (bytes32) { bytes32 commitmentIndex = preConfCommitmentStore.storeCommitment( bid, @@ -286,7 +385,8 @@ contract TestPreConfCommitmentStore is Test { decayStartTimestamp, decayEndTimestamp, bidSignature, - commitmentSignature + commitmentSignature, + dispatchTimestamp ); return commitmentIndex; @@ -372,7 +472,8 @@ contract TestPreConfCommitmentStore is Test { _testCommitmentAliceBob.decayStartTimestamp, _testCommitmentAliceBob.decayEndTimestamp, _testCommitmentAliceBob.bidSignature, - _testCommitmentAliceBob.commitmentSignature + _testCommitmentAliceBob.commitmentSignature, + _testCommitmentAliceBob.dispatchTimestamp ); PreConfCommitmentStore.PreConfCommitment memory storedCommitment = preConfCommitmentStore.getCommitment( @@ -427,7 +528,8 @@ contract TestPreConfCommitmentStore is Test { _testCommitmentAliceBob.decayStartTimestamp, _testCommitmentAliceBob.decayEndTimestamp, _testCommitmentAliceBob.bidSignature, - _testCommitmentAliceBob.commitmentSignature + _testCommitmentAliceBob.commitmentSignature, + _testCommitmentAliceBob.dispatchTimestamp ); providerRegistry.setPreconfirmationsContract( address(preConfCommitmentStore) @@ -485,7 +587,8 @@ contract TestPreConfCommitmentStore is Test { _testCommitmentAliceBob.decayStartTimestamp, _testCommitmentAliceBob.decayEndTimestamp, _testCommitmentAliceBob.bidSignature, - _testCommitmentAliceBob.commitmentSignature + _testCommitmentAliceBob.commitmentSignature, + _testCommitmentAliceBob.dispatchTimestamp ); (address commiter, ) = makeAddrAndKey("bob"); vm.deal(commiter, 5 ether); @@ -502,7 +605,6 @@ contract TestPreConfCommitmentStore is Test { } } - function test_InitiateRewardFullyDecayed() public { // Assuming you have a stored commitment { @@ -541,7 +643,8 @@ contract TestPreConfCommitmentStore is Test { _testCommitmentAliceBob.decayStartTimestamp, _testCommitmentAliceBob.decayEndTimestamp, _testCommitmentAliceBob.bidSignature, - _testCommitmentAliceBob.commitmentSignature + _testCommitmentAliceBob.commitmentSignature, + _testCommitmentAliceBob.dispatchTimestamp ); (address commiter, ) = makeAddrAndKey("bob"); vm.deal(commiter, 5 ether); @@ -572,4 +675,4 @@ contract TestPreConfCommitmentStore is Test { } return string(_string); } -} +} \ No newline at end of file diff --git a/contracts/test/ProviderRegistryTest.sol b/contracts/test/ProviderRegistryTest.sol index b3da8d335..8be9fa6cc 100644 --- a/contracts/test/ProviderRegistryTest.sol +++ b/contracts/test/ProviderRegistryTest.sol @@ -37,7 +37,8 @@ contract ProviderRegistryTest is Test { address(providerRegistry), // Provider Registry address(bidderRegistry), // User Registry feeRecipient, // Oracle - address(this) // Owner + address(this), + 500 ); provider = vm.addr(1); diff --git a/external/geth b/external/geth index 8383ab8c8..66a4f6f02 160000 --- a/external/geth +++ b/external/geth @@ -1 +1 @@ -Subproject commit 8383ab8c83543c5c4853d3516f48971004928fb2 +Subproject commit 66a4f6f02ed0c067f50fec97b57abd0b341f387b diff --git a/mev-commit-cli.sh b/mev-commit-cli.sh index 0cb99a6f0..c22fb7dd1 100755 --- a/mev-commit-cli.sh +++ b/mev-commit-cli.sh @@ -1,7 +1,7 @@ #!/bin/bash # Default RPC URL and Paths -L1_RPC_BASE_URL=https://sepolia.infura.io/v3 +L1_RPC_BASE_URL=https://ethereum-holesky-rpc.publicnode.com DEFAULT_RPC_URL="http://sl-bootnode:8545" PRIMEV_DIR="$HOME/.primev" DEFAULT_CHAIN_ID="17864" @@ -9,6 +9,11 @@ DEFAULT_CHAIN_ID="17864" # Default Docker network name DOCKER_NETWORK_NAME="primev_net" +# Contract addresses +BIDDER_REGISTRY="0x02CcEcB19c6D7EFe583C8b97022cB4b4C0B65608" +PROVIDER_REGISTRY="0xF69451b49598F11c63956bAD5E27f55114200753" +PRECONF_CONTRACT="0x86281283DA6D9e3987A55Aa702140fAB4dC71B27" + # Default values for optional arguments rpc_url=$DEFAULT_RPC_URL datadog_key="" @@ -62,13 +67,13 @@ start_mev_commit_minimal() { # Create or overwrite the .env file echo "Setting .env file..." cat > "p2p/integrationtest/.env" <<-EOF - BIDDER_REGISTRY=0xded9029fC3789ED393D62686c0c0f9dfA92aA2f6 - PROVIDER_REGISTRY=0xFA19327bDBf2632aAB7C77e61DC69DbC872d5AC1 - PRECONF_CONTRACT=0x1F8989fAd5f0538D794Fd9fa15d50942F305f367 + BIDDER_REGISTRY=${BIDDER_REGISTRY} + PROVIDER_REGISTRY=${PROVIDER_REGISTRY} + PRECONF_CONTRACT=${PRECONF_CONTRACT} RPC_URL=${rpc_url} PRIVATE_KEY=ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 - L1_RPC_URL="${L1_RPC_BASE_URL}/${sepolia_key}" + L1_RPC_URL="${L1_RPC_BASE_URL}" EOF docker compose --profile minimal-setup -f "p2p/integration-compose.yml" up --build -d @@ -76,9 +81,7 @@ EOF start_mev_commit_e2e() { local datadog_key="" - local sepolia_key="" echo "Starting MEV-Commit..." - # Loop through arguments and process them for arg in "$@" do @@ -87,26 +90,22 @@ start_mev_commit_e2e() { datadog_key="${arg#*=}" shift # Remove --datadog-key= from processing ;; - --sepolia-key=*) - sepolia_key="${arg#*=}" - shift # Remove --sepolia-key= from processing - ;; *) # Unknown option ;; esac done + echo "Setting .env file..." - # Create or overwrite the .env file cat > "p2p/integrationtest/.env" <<-EOF - BIDDER_REGISTRY=0xded9029fC3789ED393D62686c0c0f9dfA92aA2f6 - PROVIDER_REGISTRY=0xFA19327bDBf2632aAB7C77e61DC69DbC872d5AC1 - PRECONF_CONTRACT=0x1F8989fAd5f0538D794Fd9fa15d50942F305f367 + BIDDER_REGISTRY=${BIDDER_REGISTRY} + PROVIDER_REGISTRY=${PROVIDER_REGISTRY} + PRECONF_CONTRACT=${PRECONF_CONTRACT} RPC_URL=${rpc_url} PRIVATE_KEY=ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 - L1_RPC_URL="${L1_RPC_BASE_URL}/${sepolia_key}" + L1_RPC_URL="${L1_RPC_BASE_URL}" EOF @@ -176,7 +175,7 @@ deploy_contracts() { } start_oracle(){ - local l1_url=${L1_RPC_BASE_URL}/$1 + local l1_url=${L1_RPC_BASE_URL} local datadog_key=$2 # Run Docker Compose L1_URL="$l1_url" DD_KEY="$datadog_key" docker compose -f "oracle/integration-compose.yml" up -d --build @@ -348,26 +347,27 @@ start_service() { local service_name=$1 case $service_name in "all") + create_docker_network start_settlement_layer "$datadog_key" deploy_contracts "$rpc_url" start_mev_commit "$datadog_key" - start_oracle "$sepolia_key" "$datadog_key" + start_oracle "$datadog_key" start_hyperlane "$public_rpc_url" ;; "e2e") initialize_environment start_settlement_layer "$datadog_key" deploy_contracts "$rpc_url" - start_mev_commit_e2e "--sepolia-key=$sepolia_key" "--datadog-key=$datadog_key" + start_mev_commit_e2e "--datadog-key=$datadog_key" sleep 12 - start_oracle "$sepolia_key" "$datadog_key" + start_oracle "$datadog_key" start_hyperlane "$public_rpc_url" ;; "mev-commit") start_mev_commit "$datadog_key" ;; "oracle") - start_oracle "$sepolia_key" "$datadog_key" + start_oracle "$datadog_key" ;; "sl") start_settlement_layer "$datadog_key" @@ -415,7 +415,6 @@ show_help() { echo " --rpc-url URL Set the internal RPC URL for mev-commit-geth" echo " --public-rpc-url URL Set the public RPC URL for mev-commit-geth" echo " --datadog-key KEY Set the Datadog key" - echo " --sepolia-key KEY Set the Sepolia key" echo "" echo "Examples:" echo " $0 start all --rpc-url http://localhost:8545 Start all services with a specific RPC URL" @@ -445,10 +444,6 @@ while [[ "$#" -gt 0 ]]; do datadog_key="$2" shift 2 ;; - --sepolia-key) - sepolia_key="$2" - shift 2 - ;; start|stop|deploy_contracts|update|clean|init_network) command="$1" shift diff --git a/oracle/pkg/node/node.go b/oracle/pkg/node/node.go index b5e6c6a25..efcf5ba44 100644 --- a/oracle/pkg/node/node.go +++ b/oracle/pkg/node/node.go @@ -83,12 +83,6 @@ func NewNode(opts *Options) (*Node, error) { return nil, err } - l2Client, err := ethclient.Dial(opts.SettlementRPCUrl) - if err != nil { - nd.logger.Error("Failed to connect to the L2 Ethereum client", "error", err) - return nil, err - } - ctx, cancel := context.WithCancel(context.Background()) var listenerL1Client l1Listener.EthClient @@ -150,7 +144,7 @@ func NewNode(opts *Options) (*Node, error) { } oc := &rollupclient.OracleSession{Contract: oracleContract, CallOpts: callOpts} - updtr := updater.NewUpdater(nd.logger.With("component", "updater"), l1Client, l2Client, st, oc, pc) + updtr := updater.NewUpdater(nd.logger.With("component", "updater"), l1Client, st, oc, pc) updtrClosed := updtr.Start(ctx) settlr := settler.NewSettler( diff --git a/oracle/pkg/settler/settler.go b/oracle/pkg/settler/settler.go index 273d6fe6a..89b9e9fae 100644 --- a/oracle/pkg/settler/settler.go +++ b/oracle/pkg/settler/settler.go @@ -285,6 +285,7 @@ RESTART: "builder", settlement.Builder, "settlementType", string(settlement.Type), "nonce", commitmentPostingTxn.Nonce(), + "decay", settlement.DecayPercentage, ) return nil diff --git a/oracle/pkg/updater/updater.go b/oracle/pkg/updater/updater.go index 3619a54ae..69db88606 100644 --- a/oracle/pkg/updater/updater.go +++ b/oracle/pkg/updater/updater.go @@ -54,7 +54,6 @@ type Preconf interface { type Updater struct { logger *slog.Logger l1Client EVMClient - l2Client EVMClient winnerRegister WinnerRegister preconfClient Preconf rollupClient Oracle @@ -65,7 +64,6 @@ type Updater struct { func NewUpdater( logger *slog.Logger, l1Client EVMClient, - l2Client EVMClient, winnerRegister WinnerRegister, rollupClient Oracle, preconfClient Preconf, @@ -73,7 +71,6 @@ func NewUpdater( return &Updater{ logger: logger, l1Client: l1Client, - l2Client: l2Client, winnerRegister: winnerRegister, preconfClient: preconfClient, rollupClient: rollupClient, @@ -154,11 +151,7 @@ func (u *Updater) Start(ctx context.Context) <-chan struct{} { return fmt.Errorf("failed to get commitment: %w", err) } - l2Block, err := u.l2Client.BlockByNumber(ctx, commitment.BlockCommitedAt) - if err != nil { - return fmt.Errorf("failed to get L2 Block: %w", err) - } - decayPercentage := computeDecayPercentage(commitment.DecayStartTimeStamp, commitment.DecayEndTimeStamp, l2Block.Header().Time) + decayPercentage := computeDecayPercentage(commitment.DecayStartTimeStamp, commitment.DecayEndTimeStamp, commitment.DispatchTimestamp) settlementType := settler.SettlementTypeReturn @@ -238,7 +231,7 @@ func (u *Updater) Start(ctx context.Context) <-chan struct{} { // The computation does not care what format the timestamps are in, as long as they are consistent // (e.g they could be unix or unixMili timestamps) func computeDecayPercentage(startTimestamp, endTimestamp, commitTimestamp uint64) int64 { - if startTimestamp >= endTimestamp || startTimestamp > commitTimestamp { + if startTimestamp >= endTimestamp || startTimestamp > commitTimestamp || endTimestamp <= commitTimestamp { return 0 } diff --git a/oracle/pkg/updater/updater_test.go b/oracle/pkg/updater/updater_test.go index be788e40a..86f0e87da 100644 --- a/oracle/pkg/updater/updater_test.go +++ b/oracle/pkg/updater/updater_test.go @@ -58,7 +58,6 @@ func TestUpdater(t *testing.T) { // timestamp of the First block commitment is X startTimestamp := time.UnixMilli(1615195200000) - midTimestamp := startTimestamp.Add(time.Duration(2.5 * float64(time.Second))) endTimestamp := startTimestamp.Add(5 * time.Second) key, err := crypto.GenerateKey() @@ -90,7 +89,7 @@ func TestUpdater(t *testing.T) { Commiter: builderAddr, TxnHash: strings.TrimPrefix(txn.Hash().Hex(), "0x"), CommitmentHash: common.HexToHash(fmt.Sprintf("0x%02d", i)), - BlockCommitedAt: big.NewInt(0), + DispatchTimestamp: uint64((startTimestamp.UnixMilli() + endTimestamp.UnixMilli()) / 2), DecayStartTimeStamp: uint64(startTimestamp.UnixMilli()), DecayEndTimeStamp: uint64(endTimestamp.UnixMilli()), } @@ -99,7 +98,7 @@ func TestUpdater(t *testing.T) { Commiter: otherBuilderAddr, TxnHash: strings.TrimPrefix(txn.Hash().Hex(), "0x"), CommitmentHash: common.HexToHash(fmt.Sprintf("0x%02d", i)), - BlockCommitedAt: big.NewInt(0), + DispatchTimestamp: uint64((startTimestamp.UnixMilli() + endTimestamp.UnixMilli()) / 2), DecayStartTimeStamp: uint64(startTimestamp.UnixMilli()), DecayEndTimeStamp: uint64(endTimestamp.UnixMilli()), } @@ -119,7 +118,7 @@ func TestUpdater(t *testing.T) { Commiter: builderAddr, TxnHash: bundle, CommitmentHash: common.HexToHash(fmt.Sprintf("0x%02d", i)), - BlockCommitedAt: big.NewInt(0), + DispatchTimestamp: uint64((startTimestamp.UnixMilli() + endTimestamp.UnixMilli()) / 2), DecayStartTimeStamp: uint64(startTimestamp.UnixMilli()), DecayEndTimeStamp: uint64(endTimestamp.UnixMilli()), } @@ -136,11 +135,6 @@ func TestUpdater(t *testing.T) { block: types.NewBlock(&types.Header{}, txns, nil, nil, NewHasher()), } - l2Client := &testL1Client{ - blockNum: 0, - block: types.NewBlock(&types.Header{Time: uint64(midTimestamp.UnixMilli())}, txns, nil, nil, NewHasher()), - } - testOracle := &testOracle{ builder: "test", builderAddr: builderAddr, @@ -154,7 +148,6 @@ func TestUpdater(t *testing.T) { updtr := updater.NewUpdater( slog.New(slog.NewTextHandler(io.Discard, nil)), l1Client, - l2Client, testWinnerRegister, testOracle, testPreconf, @@ -247,9 +240,9 @@ func TestUpdaterBundlesFailure(t *testing.T) { } commitments[string(idxBytes[:])] = preconf.PreConfCommitmentStorePreConfCommitment{ - Commiter: builderAddr, - TxnHash: bundle, - BlockCommitedAt: big.NewInt(0), + Commiter: builderAddr, + TxnHash: bundle, + DispatchTimestamp: 0, } } @@ -264,10 +257,6 @@ func TestUpdaterBundlesFailure(t *testing.T) { block: types.NewBlock(&types.Header{}, txns, nil, nil, NewHasher()), } - l2Client := &testL1Client{ - blockNum: 0, - block: types.NewBlock(&types.Header{Time: uint64(time.Now().UnixMilli())}, txns, nil, nil, NewHasher()), - } testOracle := &testOracle{ builder: "test", builderAddr: builderAddr, @@ -281,7 +270,6 @@ func TestUpdaterBundlesFailure(t *testing.T) { updtr := updater.NewUpdater( slog.New(slog.NewTextHandler(io.Discard, nil)), l1Client, - l2Client, testWinnerRegister, testOracle, testPreconf, diff --git a/p2p/e2e-compose.yml b/p2p/e2e-compose.yml index 93fec045c..f8f24e545 100644 --- a/p2p/e2e-compose.yml +++ b/p2p/e2e-compose.yml @@ -57,6 +57,7 @@ services: profiles: - minimal-setup - e2etest + - demo labels: com.datadoghq.ad.check_names: '["openmetrics"]' com.datadoghq.ad.init_configs: '[{}]' @@ -89,6 +90,7 @@ services: profiles: - minimal-setup - e2etest + - demo labels: com.datadoghq.ad.check_names: '["openmetrics"]' com.datadoghq.ad.init_configs: '[{}]' @@ -251,6 +253,7 @@ services: profiles: - minimal-setup - e2etest + - demo labels: com.datadoghq.ad.check_names: '["openmetrics"]' com.datadoghq.ad.init_configs: '[{}]' @@ -573,26 +576,6 @@ services: profiles: - e2etest - datadog-agent: - image: gcr.io/datadoghq/agent:latest - restart: always - volumes: - - /var/run/docker.sock:/var/run/docker.sock:ro - - /proc/:/host/proc/:ro - - /sys/fs/cgroup/:/host/sys/fs/cgroup:ro - environment: - - DD_API_KEY=${DD_KEY} - - DD_TAGS=env:e2e - - DD_SITE=datadoghq.com - - DD_LOGS_ENABLED=true - - DD_LOGS_CONFIG_CONTAINER_COLLECT_ALL=true - - DD_CONTAINER_EXCLUDE="name:datadog-agent" - networks: - primev_net: - ipv4_address: 172.29.58.3 - profiles: - - agent - networks: primev_net: external: true \ No newline at end of file diff --git a/p2p/gen/go/bidderapi/v1/bidderapi.pb.go b/p2p/gen/go/bidderapi/v1/bidderapi.pb.go index b4cc95730..ad62c11ae 100644 --- a/p2p/gen/go/bidderapi/v1/bidderapi.pb.go +++ b/p2p/gen/go/bidderapi/v1/bidderapi.pb.go @@ -249,6 +249,7 @@ type Commitment struct { ProviderAddress string `protobuf:"bytes,8,opt,name=provider_address,json=providerAddress,proto3" json:"provider_address,omitempty"` DecayStartTimestamp int64 `protobuf:"varint,9,opt,name=decay_start_timestamp,json=decayStartTimestamp,proto3" json:"decay_start_timestamp,omitempty"` DecayEndTimestamp int64 `protobuf:"varint,10,opt,name=decay_end_timestamp,json=decayEndTimestamp,proto3" json:"decay_end_timestamp,omitempty"` + DispatchTimestamp int64 `protobuf:"varint,11,opt,name=dispatch_timestamp,json=dispatchTimestamp,proto3" json:"dispatch_timestamp,omitempty"` } func (x *Commitment) Reset() { @@ -353,6 +354,13 @@ func (x *Commitment) GetDecayEndTimestamp() int64 { return 0 } +func (x *Commitment) GetDispatchTimestamp() int64 { + if x != nil { + return x.DispatchTimestamp + } + return 0 +} + var File_bidderapi_v1_bidderapi_proto protoreflect.FileDescriptor var file_bidderapi_v1_bidderapi_proto_rawDesc = []byte{ @@ -486,7 +494,7 @@ var file_bidderapi_v1_bidderapi_proto_rawDesc = []byte{ 0x75, 0x6e, 0x74, 0x22, 0x3a, 0x20, 0x22, 0x31, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x22, 0x2c, 0x20, 0x22, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x22, 0x3a, 0x20, 0x31, 0x32, 0x33, 0x34, - 0x35, 0x36, 0x7d, 0x22, 0xf7, 0x09, 0x0a, 0x0a, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, + 0x35, 0x36, 0x7d, 0x22, 0xdc, 0x0a, 0x0a, 0x0a, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x95, 0x01, 0x0a, 0x09, 0x74, 0x78, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x42, 0x78, 0x92, 0x41, 0x75, 0x32, 0x61, 0x48, 0x65, 0x78, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, @@ -565,54 +573,61 @@ var file_bidderapi_v1_bidderapi_proto_rawDesc = []byte{ 0x29, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x20, 0x61, 0x74, 0x20, 0x77, 0x68, 0x69, 0x63, 0x68, 0x20, 0x74, 0x68, 0x65, 0x20, 0x62, 0x69, 0x64, 0x20, 0x65, 0x6e, 0x64, 0x73, 0x20, 0x64, 0x65, 0x63, 0x61, 0x79, 0x69, 0x6e, 0x67, 0x2e, 0x52, 0x11, 0x64, 0x65, 0x63, 0x61, - 0x79, 0x45, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x32, 0xae, 0x03, - 0x0a, 0x06, 0x42, 0x69, 0x64, 0x64, 0x65, 0x72, 0x12, 0x53, 0x0a, 0x07, 0x53, 0x65, 0x6e, 0x64, - 0x42, 0x69, 0x64, 0x12, 0x11, 0x2e, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x2e, - 0x76, 0x31, 0x2e, 0x42, 0x69, 0x64, 0x1a, 0x18, 0x2e, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x61, - 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, - 0x22, 0x19, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x13, 0x3a, 0x01, 0x2a, 0x22, 0x0e, 0x2f, 0x76, 0x31, - 0x2f, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x2f, 0x62, 0x69, 0x64, 0x30, 0x01, 0x12, 0x70, 0x0a, - 0x0f, 0x50, 0x72, 0x65, 0x70, 0x61, 0x79, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x61, 0x6e, 0x63, 0x65, - 0x12, 0x1b, 0x2e, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, - 0x50, 0x72, 0x65, 0x70, 0x61, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, - 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x65, - 0x70, 0x61, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x22, 0x82, 0xd3, 0xe4, - 0x93, 0x02, 0x1c, 0x22, 0x1a, 0x2f, 0x76, 0x31, 0x2f, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x2f, - 0x70, 0x72, 0x65, 0x70, 0x61, 0x79, 0x2f, 0x7b, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x7d, 0x12, - 0x6a, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x61, 0x6e, 0x63, 0x65, 0x12, - 0x1a, 0x2e, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x45, - 0x6d, 0x70, 0x74, 0x79, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x1a, 0x1c, 0x2e, 0x62, 0x69, - 0x64, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x65, 0x70, 0x61, - 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x20, 0x82, 0xd3, 0xe4, 0x93, 0x02, - 0x1a, 0x12, 0x18, 0x2f, 0x76, 0x31, 0x2f, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x2f, 0x67, 0x65, - 0x74, 0x5f, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x71, 0x0a, 0x0f, 0x47, - 0x65, 0x74, 0x4d, 0x69, 0x6e, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x1a, - 0x2e, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x6d, - 0x70, 0x74, 0x79, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x1a, 0x1c, 0x2e, 0x62, 0x69, 0x64, - 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x65, 0x70, 0x61, 0x79, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x24, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1e, - 0x12, 0x1c, 0x2f, 0x76, 0x31, 0x2f, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x2f, 0x67, 0x65, 0x74, - 0x5f, 0x6d, 0x69, 0x6e, 0x5f, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x61, 0x6e, 0x63, 0x65, 0x42, 0xb6, - 0x02, 0x92, 0x41, 0x7a, 0x12, 0x78, 0x0a, 0x0a, 0x42, 0x69, 0x64, 0x64, 0x65, 0x72, 0x20, 0x41, - 0x50, 0x49, 0x2a, 0x5d, 0x0a, 0x1b, 0x42, 0x75, 0x73, 0x69, 0x6e, 0x65, 0x73, 0x73, 0x20, 0x53, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x20, 0x4c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x20, 0x31, 0x2e, - 0x31, 0x12, 0x3e, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, - 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x65, 0x76, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x63, 0x6f, 0x6c, 0x2f, 0x6d, 0x65, 0x76, 0x2d, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x2f, - 0x62, 0x6c, 0x6f, 0x62, 0x2f, 0x6d, 0x61, 0x69, 0x6e, 0x2f, 0x4c, 0x49, 0x43, 0x45, 0x4e, 0x53, - 0x45, 0x32, 0x0b, 0x31, 0x2e, 0x30, 0x2e, 0x30, 0x2d, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x0a, 0x10, - 0x63, 0x6f, 0x6d, 0x2e, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, - 0x42, 0x0e, 0x42, 0x69, 0x64, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x50, 0x72, 0x6f, 0x74, 0x6f, - 0x50, 0x01, 0x5a, 0x44, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, - 0x72, 0x69, 0x6d, 0x65, 0x76, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2f, 0x6d, 0x65, - 0x76, 0x2d, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x67, 0x6f, 0x2f, - 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x3b, 0x62, 0x69, 0x64, - 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x42, 0x58, 0x58, 0xaa, 0x02, - 0x0c, 0x42, 0x69, 0x64, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0c, - 0x42, 0x69, 0x64, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x18, 0x42, - 0x69, 0x64, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, - 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0d, 0x42, 0x69, 0x64, 0x64, 0x65, 0x72, - 0x61, 0x70, 0x69, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x79, 0x45, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x63, 0x0a, + 0x12, 0x64, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, + 0x61, 0x6d, 0x70, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x03, 0x42, 0x34, 0x92, 0x41, 0x31, 0x32, 0x2f, + 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x20, 0x61, 0x74, 0x20, 0x77, 0x68, 0x69, + 0x63, 0x68, 0x20, 0x74, 0x68, 0x65, 0x20, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, + 0x74, 0x20, 0x69, 0x73, 0x20, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, 0x64, 0x2e, 0x52, + 0x11, 0x64, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, + 0x6d, 0x70, 0x32, 0xae, 0x03, 0x0a, 0x06, 0x42, 0x69, 0x64, 0x64, 0x65, 0x72, 0x12, 0x53, 0x0a, + 0x07, 0x53, 0x65, 0x6e, 0x64, 0x42, 0x69, 0x64, 0x12, 0x11, 0x2e, 0x62, 0x69, 0x64, 0x64, 0x65, + 0x72, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x69, 0x64, 0x1a, 0x18, 0x2e, 0x62, 0x69, + 0x64, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, + 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x22, 0x19, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x13, 0x3a, 0x01, 0x2a, + 0x22, 0x0e, 0x2f, 0x76, 0x31, 0x2f, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x2f, 0x62, 0x69, 0x64, + 0x30, 0x01, 0x12, 0x70, 0x0a, 0x0f, 0x50, 0x72, 0x65, 0x70, 0x61, 0x79, 0x41, 0x6c, 0x6c, 0x6f, + 0x77, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x1b, 0x2e, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x61, 0x70, + 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x65, 0x70, 0x61, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x76, + 0x31, 0x2e, 0x50, 0x72, 0x65, 0x70, 0x61, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x22, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1c, 0x22, 0x1a, 0x2f, 0x76, 0x31, 0x2f, 0x62, 0x69, + 0x64, 0x64, 0x65, 0x72, 0x2f, 0x70, 0x72, 0x65, 0x70, 0x61, 0x79, 0x2f, 0x7b, 0x61, 0x6d, 0x6f, + 0x75, 0x6e, 0x74, 0x7d, 0x12, 0x6a, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x6f, 0x77, + 0x61, 0x6e, 0x63, 0x65, 0x12, 0x1a, 0x2e, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, + 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x1a, 0x1c, 0x2e, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, + 0x50, 0x72, 0x65, 0x70, 0x61, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x20, + 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1a, 0x12, 0x18, 0x2f, 0x76, 0x31, 0x2f, 0x62, 0x69, 0x64, 0x64, + 0x65, 0x72, 0x2f, 0x67, 0x65, 0x74, 0x5f, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x61, 0x6e, 0x63, 0x65, + 0x12, 0x71, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x4d, 0x69, 0x6e, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x61, + 0x6e, 0x63, 0x65, 0x12, 0x1a, 0x2e, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x2e, + 0x76, 0x31, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x1a, + 0x1c, 0x2e, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x50, + 0x72, 0x65, 0x70, 0x61, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x24, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x1e, 0x12, 0x1c, 0x2f, 0x76, 0x31, 0x2f, 0x62, 0x69, 0x64, 0x64, 0x65, + 0x72, 0x2f, 0x67, 0x65, 0x74, 0x5f, 0x6d, 0x69, 0x6e, 0x5f, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x61, + 0x6e, 0x63, 0x65, 0x42, 0xb6, 0x02, 0x92, 0x41, 0x7a, 0x12, 0x78, 0x0a, 0x0a, 0x42, 0x69, 0x64, + 0x64, 0x65, 0x72, 0x20, 0x41, 0x50, 0x49, 0x2a, 0x5d, 0x0a, 0x1b, 0x42, 0x75, 0x73, 0x69, 0x6e, + 0x65, 0x73, 0x73, 0x20, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x20, 0x4c, 0x69, 0x63, 0x65, 0x6e, + 0x73, 0x65, 0x20, 0x31, 0x2e, 0x31, 0x12, 0x3e, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x65, + 0x76, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2f, 0x6d, 0x65, 0x76, 0x2d, 0x63, 0x6f, + 0x6d, 0x6d, 0x69, 0x74, 0x2f, 0x62, 0x6c, 0x6f, 0x62, 0x2f, 0x6d, 0x61, 0x69, 0x6e, 0x2f, 0x4c, + 0x49, 0x43, 0x45, 0x4e, 0x53, 0x45, 0x32, 0x0b, 0x31, 0x2e, 0x30, 0x2e, 0x30, 0x2d, 0x61, 0x6c, + 0x70, 0x68, 0x61, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x2e, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x31, 0x42, 0x0e, 0x42, 0x69, 0x64, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, + 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x44, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x65, 0x76, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, + 0x6f, 0x6c, 0x2f, 0x6d, 0x65, 0x76, 0x2d, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x2f, 0x67, 0x65, + 0x6e, 0x2f, 0x67, 0x6f, 0x2f, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x2f, 0x76, + 0x31, 0x3b, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x76, 0x31, 0xa2, 0x02, 0x03, + 0x42, 0x58, 0x58, 0xaa, 0x02, 0x0c, 0x42, 0x69, 0x64, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x2e, + 0x56, 0x31, 0xca, 0x02, 0x0c, 0x42, 0x69, 0x64, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x5c, 0x56, + 0x31, 0xe2, 0x02, 0x18, 0x42, 0x69, 0x64, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x5c, 0x56, 0x31, + 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0d, 0x42, + 0x69, 0x64, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/p2p/gen/go/providerapi/v1/providerapi.pb.go b/p2p/gen/go/providerapi/v1/providerapi.pb.go index 3d4d89d01..a3c2a0ac6 100644 --- a/p2p/gen/go/providerapi/v1/providerapi.pb.go +++ b/p2p/gen/go/providerapi/v1/providerapi.pb.go @@ -296,8 +296,9 @@ type BidResponse struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - BidDigest []byte `protobuf:"bytes,1,opt,name=bid_digest,json=bidDigest,proto3" json:"bid_digest,omitempty"` - Status BidResponse_Status `protobuf:"varint,2,opt,name=status,proto3,enum=providerapi.v1.BidResponse_Status" json:"status,omitempty"` + BidDigest []byte `protobuf:"bytes,1,opt,name=bid_digest,json=bidDigest,proto3" json:"bid_digest,omitempty"` + Status BidResponse_Status `protobuf:"varint,2,opt,name=status,proto3,enum=providerapi.v1.BidResponse_Status" json:"status,omitempty"` + DispatchTimestamp int64 `protobuf:"varint,3,opt,name=dispatch_timestamp,json=dispatchTimestamp,proto3" json:"dispatch_timestamp,omitempty"` } func (x *BidResponse) Reset() { @@ -346,6 +347,13 @@ func (x *BidResponse) GetStatus() BidResponse_Status { return BidResponse_STATUS_UNSPECIFIED } +func (x *BidResponse) GetDispatchTimestamp() int64 { + if x != nil { + return x.DispatchTimestamp + } + return 0 +} + type PendingTxnsResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -693,7 +701,7 @@ var file_providerapi_v1_providerapi_proto_rawDesc = []byte{ 0x4a, 0x77, 0x59, 0x38, 0x36, 0x6c, 0x2f, 0x59, 0x75, 0x37, 0x79, 0x41, 0x48, 0x31, 0x35, 0x39, 0x51, 0x72, 0x50, 0x48, 0x55, 0x30, 0x71, 0x6a, 0x32, 0x50, 0x2b, 0x59, 0x46, 0x6a, 0x2b, 0x6c, 0x6c, 0x62, 0x75, 0x49, 0x31, 0x5a, 0x79, 0x67, 0x64, 0x78, 0x47, 0x73, 0x58, 0x38, 0x2b, 0x50, - 0x33, 0x62, 0x79, 0x4d, 0x45, 0x41, 0x35, 0x69, 0x67, 0x3d, 0x3d, 0x22, 0x7d, 0x22, 0x8a, 0x04, + 0x33, 0x62, 0x79, 0x4d, 0x45, 0x41, 0x35, 0x69, 0x67, 0x3d, 0x3d, 0x22, 0x7d, 0x22, 0x81, 0x06, 0x0a, 0x0b, 0x42, 0x69, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x53, 0x0a, 0x0a, 0x62, 0x69, 0x64, 0x5f, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x34, 0x92, 0x41, 0x31, 0x32, 0x2f, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x20, 0x6f, @@ -706,190 +714,205 @@ var file_providerapi_v1_providerapi_proto_rawDesc = []byte{ 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x42, 0x23, 0x92, 0x41, 0x14, 0x32, 0x12, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x62, 0x69, 0x64, 0x2e, 0xba, 0x48, 0x09, 0x82, 0x01, 0x06, 0x10, 0x01, 0x1a, 0x02, 0x01, 0x02, 0x52, 0x06, 0x73, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x22, 0x4a, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x16, 0x0a, - 0x12, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, - 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x13, 0x0a, 0x0f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, - 0x41, 0x43, 0x43, 0x45, 0x50, 0x54, 0x45, 0x44, 0x10, 0x01, 0x12, 0x13, 0x0a, 0x0f, 0x53, 0x54, - 0x41, 0x54, 0x55, 0x53, 0x5f, 0x52, 0x45, 0x4a, 0x45, 0x43, 0x54, 0x45, 0x44, 0x10, 0x02, 0x3a, - 0xf8, 0x01, 0x92, 0x41, 0xf4, 0x01, 0x0a, 0x69, 0x2a, 0x0c, 0x42, 0x69, 0x64, 0x20, 0x72, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0x44, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x20, 0x73, 0x65, 0x6e, 0x74, 0x20, 0x62, 0x79, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x72, 0x6f, - 0x76, 0x69, 0x64, 0x65, 0x72, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x74, 0x68, 0x65, 0x20, 0x64, - 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x62, - 0x69, 0x64, 0x20, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x2e, 0xd2, 0x01, 0x09, 0x62, - 0x69, 0x64, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0xd2, 0x01, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x32, 0x86, 0x01, 0x7b, 0x22, 0x62, 0x69, 0x64, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x22, - 0x3a, 0x20, 0x22, 0x39, 0x64, 0x4a, 0x69, 0x6e, 0x77, 0x4c, 0x2b, 0x46, 0x5a, 0x36, 0x42, 0x31, - 0x78, 0x73, 0x49, 0x51, 0x51, 0x6f, 0x38, 0x74, 0x38, 0x42, 0x30, 0x5a, 0x58, 0x4a, 0x75, 0x62, - 0x4a, 0x77, 0x59, 0x38, 0x36, 0x6c, 0x2f, 0x59, 0x75, 0x37, 0x79, 0x41, 0x48, 0x31, 0x35, 0x39, - 0x51, 0x72, 0x50, 0x48, 0x55, 0x30, 0x71, 0x6a, 0x32, 0x50, 0x2b, 0x59, 0x46, 0x6a, 0x2b, 0x6c, - 0x6c, 0x62, 0x75, 0x49, 0x31, 0x5a, 0x79, 0x67, 0x64, 0x78, 0x47, 0x73, 0x58, 0x38, 0x2b, 0x50, - 0x33, 0x62, 0x79, 0x4d, 0x45, 0x41, 0x35, 0x69, 0x67, 0x3d, 0x3d, 0x22, 0x2c, 0x20, 0x22, 0x73, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x3a, 0x20, 0x22, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, - 0x41, 0x43, 0x43, 0x45, 0x50, 0x54, 0x45, 0x44, 0x22, 0x7d, 0x22, 0xfc, 0x01, 0x0a, 0x13, 0x50, - 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x54, 0x78, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x88, 0x01, 0x0a, 0x0c, 0x70, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x74, - 0x78, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x70, 0x72, 0x6f, 0x76, - 0x69, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, - 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x42, 0x44, 0x92, 0x41, 0x41, 0x32, - 0x3f, 0x4c, 0x69, 0x73, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x70, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, - 0x20, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x69, 0x6e, - 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x20, 0x70, 0x72, - 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x5f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, - 0x52, 0x0b, 0x70, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x54, 0x78, 0x6e, 0x73, 0x3a, 0x5a, 0x92, - 0x41, 0x57, 0x0a, 0x55, 0x2a, 0x19, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x20, 0x74, 0x72, - 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x32, - 0x2a, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x69, 0x6e, 0x66, - 0x6f, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x74, 0x68, - 0x65, 0x20, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x2e, 0xd2, 0x01, 0x0b, 0x70, 0x65, - 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x54, 0x78, 0x6e, 0x73, 0x22, 0xa5, 0x04, 0x0a, 0x0f, 0x54, 0x72, - 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x91, 0x01, - 0x0a, 0x07, 0x74, 0x78, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, - 0x78, 0x92, 0x41, 0x75, 0x32, 0x61, 0x48, 0x65, 0x78, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, - 0x20, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, - 0x20, 0x68, 0x61, 0x73, 0x68, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x74, 0x72, 0x61, - 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x74, 0x68, - 0x65, 0x20, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x20, 0x77, 0x61, 0x6e, 0x74, 0x73, 0x20, 0x74, - 0x6f, 0x20, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, - 0x20, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x8a, 0x01, 0x0f, 0x5b, 0x61, 0x2d, 0x66, 0x41, 0x2d, - 0x46, 0x30, 0x2d, 0x39, 0x5d, 0x7b, 0x36, 0x34, 0x7d, 0x52, 0x06, 0x74, 0x78, 0x48, 0x61, 0x73, - 0x68, 0x12, 0x3a, 0x0a, 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, - 0x42, 0x24, 0x92, 0x41, 0x21, 0x32, 0x1f, 0x4e, 0x6f, 0x6e, 0x63, 0x65, 0x20, 0x75, 0x73, 0x65, - 0x64, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x74, 0x68, 0x65, 0x20, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, - 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x12, 0x45, 0x0a, - 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x2b, - 0x92, 0x41, 0x28, 0x32, 0x26, 0x54, 0x69, 0x6d, 0x65, 0x20, 0x77, 0x68, 0x65, 0x6e, 0x20, 0x74, - 0x68, 0x65, 0x20, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x77, - 0x61, 0x73, 0x20, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x52, 0x07, 0x63, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x64, 0x3a, 0xfa, 0x01, 0x92, 0x41, 0xf6, 0x01, 0x0a, 0x59, 0x2a, 0x10, 0x54, - 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x69, 0x6e, 0x66, 0x6f, 0x32, - 0x2a, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x69, 0x6e, 0x66, - 0x6f, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x74, 0x68, - 0x65, 0x20, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x2e, 0xd2, 0x01, 0x06, 0x74, 0x78, - 0x48, 0x61, 0x73, 0x68, 0xd2, 0x01, 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0xd2, 0x01, 0x07, 0x63, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x32, 0x98, 0x01, 0x7b, 0x22, 0x74, 0x78, 0x48, 0x61, 0x73, - 0x68, 0x22, 0x3a, 0x20, 0x22, 0x37, 0x31, 0x63, 0x31, 0x33, 0x34, 0x38, 0x66, 0x32, 0x64, 0x37, - 0x66, 0x66, 0x37, 0x65, 0x38, 0x31, 0x34, 0x66, 0x39, 0x63, 0x33, 0x36, 0x31, 0x37, 0x39, 0x38, - 0x33, 0x37, 0x30, 0x33, 0x34, 0x33, 0x35, 0x65, 0x61, 0x37, 0x34, 0x34, 0x36, 0x64, 0x65, 0x34, - 0x32, 0x30, 0x61, 0x65, 0x61, 0x63, 0x34, 0x38, 0x38, 0x62, 0x66, 0x31, 0x64, 0x65, 0x33, 0x35, - 0x37, 0x33, 0x37, 0x65, 0x38, 0x22, 0x2c, 0x20, 0x22, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x22, 0x3a, - 0x20, 0x31, 0x32, 0x33, 0x34, 0x2c, 0x20, 0x22, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x22, - 0x3a, 0x20, 0x22, 0x32, 0x30, 0x30, 0x39, 0x2d, 0x31, 0x31, 0x2d, 0x31, 0x30, 0x20, 0x32, 0x33, - 0x3a, 0x30, 0x30, 0x3a, 0x30, 0x30, 0x20, 0x2b, 0x30, 0x30, 0x30, 0x30, 0x20, 0x55, 0x54, 0x43, - 0x20, 0x6d, 0x3d, 0x2b, 0x30, 0x2e, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, 0x22, - 0x7d, 0x22, 0xad, 0x02, 0x0a, 0x09, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x52, 0x65, 0x71, 0x12, - 0x83, 0x01, 0x0a, 0x07, 0x74, 0x78, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x42, 0x6a, 0x92, 0x41, 0x67, 0x32, 0x53, 0x48, 0x65, 0x78, 0x20, 0x73, 0x74, 0x72, 0x69, - 0x6e, 0x67, 0x20, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x20, 0x6f, 0x66, 0x20, 0x74, - 0x68, 0x65, 0x20, 0x68, 0x61, 0x73, 0x68, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x74, - 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, - 0x74, 0x68, 0x65, 0x20, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x20, 0x77, 0x61, 0x6e, 0x74, 0x73, - 0x20, 0x74, 0x6f, 0x20, 0x63, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x2e, 0x8a, 0x01, 0x0f, 0x5b, 0x61, - 0x2d, 0x66, 0x41, 0x2d, 0x46, 0x30, 0x2d, 0x39, 0x5d, 0x7b, 0x36, 0x34, 0x7d, 0x52, 0x06, 0x74, - 0x78, 0x48, 0x61, 0x73, 0x68, 0x3a, 0x99, 0x01, 0x92, 0x41, 0x95, 0x01, 0x0a, 0x5b, 0x2a, 0x0e, - 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x20, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x32, 0x40, - 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x20, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, - 0x6f, 0x6e, 0x20, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, - 0x67, 0x65, 0x20, 0x66, 0x72, 0x6f, 0x6d, 0x20, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x73, 0x20, - 0x74, 0x6f, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x2e, - 0xd2, 0x01, 0x06, 0x74, 0x78, 0x48, 0x61, 0x73, 0x68, 0x32, 0x36, 0x7b, 0x22, 0x74, 0x78, 0x48, - 0x61, 0x73, 0x68, 0x22, 0x3a, 0x20, 0x22, 0x39, 0x31, 0x61, 0x38, 0x39, 0x42, 0x36, 0x33, 0x33, - 0x31, 0x39, 0x34, 0x63, 0x30, 0x44, 0x38, 0x36, 0x43, 0x35, 0x33, 0x39, 0x41, 0x31, 0x41, 0x35, - 0x42, 0x31, 0x34, 0x44, 0x43, 0x43, 0x61, 0x63, 0x66, 0x44, 0x34, 0x37, 0x30, 0x39, 0x34, 0x22, - 0x7d, 0x22, 0xb8, 0x02, 0x0a, 0x0e, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x83, 0x01, 0x0a, 0x07, 0x74, 0x78, 0x5f, 0x68, 0x61, 0x73, 0x68, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x6a, 0x92, 0x41, 0x67, 0x32, 0x53, 0x48, 0x65, 0x78, + 0x74, 0x75, 0x73, 0x12, 0xb4, 0x01, 0x0a, 0x12, 0x64, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, + 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, + 0x42, 0x84, 0x01, 0x92, 0x41, 0x80, 0x01, 0x32, 0x7e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, + 0x6d, 0x70, 0x20, 0x61, 0x74, 0x20, 0x77, 0x68, 0x69, 0x63, 0x68, 0x20, 0x74, 0x68, 0x65, 0x20, + 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x69, 0x73, 0x20, 0x61, 0x63, + 0x63, 0x65, 0x70, 0x74, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, + 0x65, 0x72, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x69, 0x73, 0x20, 0x75, 0x73, 0x65, 0x64, 0x20, 0x74, + 0x6f, 0x20, 0x63, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x65, 0x78, + 0x70, 0x65, 0x63, 0x74, 0x65, 0x64, 0x20, 0x72, 0x65, 0x76, 0x65, 0x6e, 0x75, 0x65, 0x20, 0x66, + 0x72, 0x6f, 0x6d, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x72, 0x65, 0x63, 0x6f, 0x6e, 0x66, 0x69, + 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x11, 0x64, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, + 0x68, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x22, 0x4a, 0x0a, 0x06, 0x53, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x12, 0x16, 0x0a, 0x12, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x55, + 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x13, 0x0a, 0x0f, + 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x41, 0x43, 0x43, 0x45, 0x50, 0x54, 0x45, 0x44, 0x10, + 0x01, 0x12, 0x13, 0x0a, 0x0f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x52, 0x45, 0x4a, 0x45, + 0x43, 0x54, 0x45, 0x44, 0x10, 0x02, 0x3a, 0xb8, 0x02, 0x92, 0x41, 0xb4, 0x02, 0x0a, 0x82, 0x01, + 0x2a, 0x0c, 0x42, 0x69, 0x64, 0x20, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0x44, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x20, 0x73, 0x65, 0x6e, 0x74, 0x20, 0x62, 0x79, + 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x20, 0x77, 0x69, + 0x74, 0x68, 0x20, 0x74, 0x68, 0x65, 0x20, 0x64, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x20, + 0x6f, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x62, 0x69, 0x64, 0x20, 0x72, 0x65, 0x63, 0x65, 0x69, + 0x76, 0x65, 0x64, 0x2e, 0xd2, 0x01, 0x09, 0x62, 0x69, 0x64, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, + 0xd2, 0x01, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0xd2, 0x01, 0x16, 0x64, 0x65, 0x63, 0x61, + 0x79, 0x44, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, + 0x6d, 0x70, 0x32, 0xac, 0x01, 0x7b, 0x22, 0x62, 0x69, 0x64, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, + 0x22, 0x3a, 0x20, 0x22, 0x39, 0x64, 0x4a, 0x69, 0x6e, 0x77, 0x4c, 0x2b, 0x46, 0x5a, 0x36, 0x42, + 0x31, 0x78, 0x73, 0x49, 0x51, 0x51, 0x6f, 0x38, 0x74, 0x38, 0x42, 0x30, 0x5a, 0x58, 0x4a, 0x75, + 0x62, 0x4a, 0x77, 0x59, 0x38, 0x36, 0x6c, 0x2f, 0x59, 0x75, 0x37, 0x79, 0x41, 0x48, 0x31, 0x35, + 0x39, 0x51, 0x72, 0x50, 0x48, 0x55, 0x30, 0x71, 0x6a, 0x32, 0x50, 0x2b, 0x59, 0x46, 0x6a, 0x2b, + 0x6c, 0x6c, 0x62, 0x75, 0x49, 0x31, 0x5a, 0x79, 0x67, 0x64, 0x78, 0x47, 0x73, 0x58, 0x38, 0x2b, + 0x50, 0x33, 0x62, 0x79, 0x4d, 0x45, 0x41, 0x35, 0x69, 0x67, 0x3d, 0x3d, 0x22, 0x2c, 0x20, 0x22, + 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x3a, 0x20, 0x22, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, + 0x5f, 0x41, 0x43, 0x43, 0x45, 0x50, 0x54, 0x45, 0x44, 0x22, 0x2c, 0x20, 0x22, 0x64, 0x65, 0x63, + 0x61, 0x79, 0x44, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, + 0x61, 0x6d, 0x70, 0x22, 0x3a, 0x20, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x30, + 0x7d, 0x22, 0xfc, 0x01, 0x0a, 0x13, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x54, 0x78, 0x6e, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x88, 0x01, 0x0a, 0x0c, 0x70, 0x65, + 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x74, 0x78, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x1f, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x76, + 0x31, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x66, + 0x6f, 0x42, 0x44, 0x92, 0x41, 0x41, 0x32, 0x3f, 0x4c, 0x69, 0x73, 0x74, 0x20, 0x6f, 0x66, 0x20, + 0x70, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x20, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x72, 0x6f, 0x76, + 0x69, 0x64, 0x65, 0x72, 0x20, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x5f, 0x72, 0x65, + 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x52, 0x0b, 0x70, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, + 0x54, 0x78, 0x6e, 0x73, 0x3a, 0x5a, 0x92, 0x41, 0x57, 0x0a, 0x55, 0x2a, 0x19, 0x50, 0x65, 0x6e, + 0x64, 0x69, 0x6e, 0x67, 0x20, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x32, 0x2a, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x20, 0x69, 0x6e, 0x66, 0x6f, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x65, + 0x64, 0x20, 0x62, 0x79, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, + 0x72, 0x2e, 0xd2, 0x01, 0x0b, 0x70, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x54, 0x78, 0x6e, 0x73, + 0x22, 0xa5, 0x04, 0x0a, 0x0f, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x91, 0x01, 0x0a, 0x07, 0x74, 0x78, 0x5f, 0x68, 0x61, 0x73, 0x68, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x78, 0x92, 0x41, 0x75, 0x32, 0x61, 0x48, 0x65, 0x78, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x68, 0x61, 0x73, 0x68, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x74, 0x68, 0x65, 0x20, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x20, - 0x77, 0x61, 0x6e, 0x74, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x63, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x2e, - 0x8a, 0x01, 0x0f, 0x5b, 0x61, 0x2d, 0x66, 0x41, 0x2d, 0x46, 0x30, 0x2d, 0x39, 0x5d, 0x7b, 0x36, - 0x34, 0x7d, 0x52, 0x06, 0x74, 0x78, 0x48, 0x61, 0x73, 0x68, 0x3a, 0x9f, 0x01, 0x92, 0x41, 0x9b, - 0x01, 0x0a, 0x49, 0x2a, 0x0f, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x20, 0x72, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x32, 0x2d, 0x48, 0x61, 0x73, 0x68, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, - 0x65, 0x20, 0x63, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x74, - 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x72, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x2e, 0xd2, 0x01, 0x06, 0x74, 0x78, 0x48, 0x61, 0x73, 0x68, 0x32, 0x4e, 0x7b, 0x22, - 0x74, 0x78, 0x48, 0x61, 0x73, 0x68, 0x22, 0x3a, 0x20, 0x22, 0x37, 0x31, 0x63, 0x31, 0x33, 0x34, - 0x38, 0x66, 0x32, 0x64, 0x37, 0x66, 0x66, 0x37, 0x65, 0x38, 0x31, 0x34, 0x66, 0x39, 0x63, 0x33, - 0x36, 0x31, 0x37, 0x39, 0x38, 0x33, 0x37, 0x30, 0x33, 0x34, 0x33, 0x35, 0x65, 0x61, 0x37, 0x34, - 0x34, 0x36, 0x64, 0x65, 0x34, 0x32, 0x30, 0x61, 0x65, 0x61, 0x63, 0x34, 0x38, 0x38, 0x62, 0x66, - 0x31, 0x64, 0x65, 0x33, 0x35, 0x37, 0x33, 0x37, 0x65, 0x38, 0x22, 0x7d, 0x32, 0xc5, 0x06, 0x0a, - 0x08, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x12, 0x65, 0x0a, 0x0b, 0x52, 0x65, 0x63, - 0x65, 0x69, 0x76, 0x65, 0x42, 0x69, 0x64, 0x73, 0x12, 0x1c, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, - 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x4d, - 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x1a, 0x13, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, - 0x72, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x69, 0x64, 0x22, 0x21, 0x82, 0xd3, 0xe4, - 0x93, 0x02, 0x1b, 0x12, 0x19, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, - 0x72, 0x2f, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x5f, 0x62, 0x69, 0x64, 0x73, 0x30, 0x01, - 0x12, 0x7d, 0x0a, 0x11, 0x53, 0x65, 0x6e, 0x64, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x65, - 0x64, 0x42, 0x69, 0x64, 0x73, 0x12, 0x1b, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, - 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x69, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x1a, 0x1c, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, - 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, - 0x22, 0x2b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x25, 0x3a, 0x01, 0x2a, 0x22, 0x20, 0x2f, 0x76, 0x31, - 0x2f, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x2f, 0x73, 0x65, 0x6e, 0x64, 0x5f, 0x70, - 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x65, 0x64, 0x5f, 0x62, 0x69, 0x64, 0x73, 0x28, 0x01, 0x12, - 0x7a, 0x0a, 0x0d, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x53, 0x74, 0x61, 0x6b, 0x65, - 0x12, 0x1c, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x76, - 0x31, 0x2e, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, - 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, - 0x53, 0x74, 0x61, 0x6b, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2c, 0x82, - 0xd3, 0xe4, 0x93, 0x02, 0x26, 0x22, 0x24, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x76, 0x69, - 0x64, 0x65, 0x72, 0x2f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x73, 0x74, 0x61, - 0x6b, 0x65, 0x2f, 0x7b, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x7d, 0x12, 0x67, 0x0a, 0x08, 0x47, - 0x65, 0x74, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x12, 0x1c, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, - 0x65, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x4d, 0x65, - 0x73, 0x73, 0x61, 0x67, 0x65, 0x1a, 0x1d, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, + 0x77, 0x61, 0x6e, 0x74, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, + 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x8a, 0x01, + 0x0f, 0x5b, 0x61, 0x2d, 0x66, 0x41, 0x2d, 0x46, 0x30, 0x2d, 0x39, 0x5d, 0x7b, 0x36, 0x34, 0x7d, + 0x52, 0x06, 0x74, 0x78, 0x48, 0x61, 0x73, 0x68, 0x12, 0x3a, 0x0a, 0x05, 0x6e, 0x6f, 0x6e, 0x63, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x42, 0x24, 0x92, 0x41, 0x21, 0x32, 0x1f, 0x4e, 0x6f, + 0x6e, 0x63, 0x65, 0x20, 0x75, 0x73, 0x65, 0x64, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x74, 0x68, 0x65, + 0x20, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x05, 0x6e, + 0x6f, 0x6e, 0x63, 0x65, 0x12, 0x45, 0x0a, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x2b, 0x92, 0x41, 0x28, 0x32, 0x26, 0x54, 0x69, 0x6d, 0x65, + 0x20, 0x77, 0x68, 0x65, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x77, 0x61, 0x73, 0x20, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x64, 0x2e, 0x52, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x3a, 0xfa, 0x01, 0x92, 0x41, + 0xf6, 0x01, 0x0a, 0x59, 0x2a, 0x10, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x20, 0x69, 0x6e, 0x66, 0x6f, 0x32, 0x2a, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x20, 0x69, 0x6e, 0x66, 0x6f, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x65, + 0x64, 0x20, 0x62, 0x79, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, + 0x72, 0x2e, 0xd2, 0x01, 0x06, 0x74, 0x78, 0x48, 0x61, 0x73, 0x68, 0xd2, 0x01, 0x05, 0x6e, 0x6f, + 0x6e, 0x63, 0x65, 0xd2, 0x01, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x32, 0x98, 0x01, + 0x7b, 0x22, 0x74, 0x78, 0x48, 0x61, 0x73, 0x68, 0x22, 0x3a, 0x20, 0x22, 0x37, 0x31, 0x63, 0x31, + 0x33, 0x34, 0x38, 0x66, 0x32, 0x64, 0x37, 0x66, 0x66, 0x37, 0x65, 0x38, 0x31, 0x34, 0x66, 0x39, + 0x63, 0x33, 0x36, 0x31, 0x37, 0x39, 0x38, 0x33, 0x37, 0x30, 0x33, 0x34, 0x33, 0x35, 0x65, 0x61, + 0x37, 0x34, 0x34, 0x36, 0x64, 0x65, 0x34, 0x32, 0x30, 0x61, 0x65, 0x61, 0x63, 0x34, 0x38, 0x38, + 0x62, 0x66, 0x31, 0x64, 0x65, 0x33, 0x35, 0x37, 0x33, 0x37, 0x65, 0x38, 0x22, 0x2c, 0x20, 0x22, + 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x22, 0x3a, 0x20, 0x31, 0x32, 0x33, 0x34, 0x2c, 0x20, 0x22, 0x63, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x22, 0x3a, 0x20, 0x22, 0x32, 0x30, 0x30, 0x39, 0x2d, 0x31, + 0x31, 0x2d, 0x31, 0x30, 0x20, 0x32, 0x33, 0x3a, 0x30, 0x30, 0x3a, 0x30, 0x30, 0x20, 0x2b, 0x30, + 0x30, 0x30, 0x30, 0x20, 0x55, 0x54, 0x43, 0x20, 0x6d, 0x3d, 0x2b, 0x30, 0x2e, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, 0x22, 0x7d, 0x22, 0xad, 0x02, 0x0a, 0x09, 0x43, 0x61, 0x6e, + 0x63, 0x65, 0x6c, 0x52, 0x65, 0x71, 0x12, 0x83, 0x01, 0x0a, 0x07, 0x74, 0x78, 0x5f, 0x68, 0x61, + 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x6a, 0x92, 0x41, 0x67, 0x32, 0x53, 0x48, + 0x65, 0x78, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x69, + 0x6e, 0x67, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x68, 0x61, 0x73, 0x68, 0x20, 0x6f, + 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x74, 0x68, 0x65, 0x20, 0x62, 0x69, 0x64, 0x64, 0x65, + 0x72, 0x20, 0x77, 0x61, 0x6e, 0x74, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x63, 0x61, 0x6e, 0x63, 0x65, + 0x6c, 0x2e, 0x8a, 0x01, 0x0f, 0x5b, 0x61, 0x2d, 0x66, 0x41, 0x2d, 0x46, 0x30, 0x2d, 0x39, 0x5d, + 0x7b, 0x36, 0x34, 0x7d, 0x52, 0x06, 0x74, 0x78, 0x48, 0x61, 0x73, 0x68, 0x3a, 0x99, 0x01, 0x92, + 0x41, 0x95, 0x01, 0x0a, 0x5b, 0x2a, 0x0e, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x20, 0x72, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x32, 0x40, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x20, 0x74, 0x72, + 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x66, 0x72, 0x6f, 0x6d, 0x20, 0x62, + 0x69, 0x64, 0x64, 0x65, 0x72, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x72, + 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x2e, 0xd2, 0x01, 0x06, 0x74, 0x78, 0x48, 0x61, 0x73, 0x68, + 0x32, 0x36, 0x7b, 0x22, 0x74, 0x78, 0x48, 0x61, 0x73, 0x68, 0x22, 0x3a, 0x20, 0x22, 0x39, 0x31, + 0x61, 0x38, 0x39, 0x42, 0x36, 0x33, 0x33, 0x31, 0x39, 0x34, 0x63, 0x30, 0x44, 0x38, 0x36, 0x43, + 0x35, 0x33, 0x39, 0x41, 0x31, 0x41, 0x35, 0x42, 0x31, 0x34, 0x44, 0x43, 0x43, 0x61, 0x63, 0x66, + 0x44, 0x34, 0x37, 0x30, 0x39, 0x34, 0x22, 0x7d, 0x22, 0xb8, 0x02, 0x0a, 0x0e, 0x43, 0x61, 0x6e, + 0x63, 0x65, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x83, 0x01, 0x0a, 0x07, + 0x74, 0x78, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x6a, 0x92, + 0x41, 0x67, 0x32, 0x53, 0x48, 0x65, 0x78, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x65, + 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x68, + 0x61, 0x73, 0x68, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x74, 0x72, 0x61, 0x6e, 0x73, + 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x74, 0x68, 0x65, 0x20, + 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x20, 0x77, 0x61, 0x6e, 0x74, 0x73, 0x20, 0x74, 0x6f, 0x20, + 0x63, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x2e, 0x8a, 0x01, 0x0f, 0x5b, 0x61, 0x2d, 0x66, 0x41, 0x2d, + 0x46, 0x30, 0x2d, 0x39, 0x5d, 0x7b, 0x36, 0x34, 0x7d, 0x52, 0x06, 0x74, 0x78, 0x48, 0x61, 0x73, + 0x68, 0x3a, 0x9f, 0x01, 0x92, 0x41, 0x9b, 0x01, 0x0a, 0x49, 0x2a, 0x0f, 0x43, 0x61, 0x6e, 0x63, + 0x65, 0x6c, 0x20, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0x2d, 0x48, 0x61, 0x73, + 0x68, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x63, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x6c, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x20, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0xd2, 0x01, 0x06, 0x74, 0x78, 0x48, + 0x61, 0x73, 0x68, 0x32, 0x4e, 0x7b, 0x22, 0x74, 0x78, 0x48, 0x61, 0x73, 0x68, 0x22, 0x3a, 0x20, + 0x22, 0x37, 0x31, 0x63, 0x31, 0x33, 0x34, 0x38, 0x66, 0x32, 0x64, 0x37, 0x66, 0x66, 0x37, 0x65, + 0x38, 0x31, 0x34, 0x66, 0x39, 0x63, 0x33, 0x36, 0x31, 0x37, 0x39, 0x38, 0x33, 0x37, 0x30, 0x33, + 0x34, 0x33, 0x35, 0x65, 0x61, 0x37, 0x34, 0x34, 0x36, 0x64, 0x65, 0x34, 0x32, 0x30, 0x61, 0x65, + 0x61, 0x63, 0x34, 0x38, 0x38, 0x62, 0x66, 0x31, 0x64, 0x65, 0x33, 0x35, 0x37, 0x33, 0x37, 0x65, + 0x38, 0x22, 0x7d, 0x32, 0xc5, 0x06, 0x0a, 0x08, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, + 0x12, 0x65, 0x0a, 0x0b, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x42, 0x69, 0x64, 0x73, 0x12, + 0x1c, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, + 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x1a, 0x13, 0x2e, + 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x42, + 0x69, 0x64, 0x22, 0x21, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1b, 0x12, 0x19, 0x2f, 0x76, 0x31, 0x2f, + 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x2f, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, + 0x5f, 0x62, 0x69, 0x64, 0x73, 0x30, 0x01, 0x12, 0x7d, 0x0a, 0x11, 0x53, 0x65, 0x6e, 0x64, 0x50, + 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x65, 0x64, 0x42, 0x69, 0x64, 0x73, 0x12, 0x1b, 0x2e, 0x70, + 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x69, + 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x1c, 0x2e, 0x70, 0x72, 0x6f, 0x76, + 0x69, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, + 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x2b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x25, 0x3a, + 0x01, 0x2a, 0x22, 0x20, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, + 0x2f, 0x73, 0x65, 0x6e, 0x64, 0x5f, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x65, 0x64, 0x5f, + 0x62, 0x69, 0x64, 0x73, 0x28, 0x01, 0x12, 0x7a, 0x0a, 0x0d, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, + 0x65, 0x72, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x12, 0x1c, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, + 0x65, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x18, 0x12, 0x16, 0x2f, 0x76, - 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x2f, 0x67, 0x65, 0x74, 0x5f, 0x73, - 0x74, 0x61, 0x6b, 0x65, 0x12, 0x6e, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x4d, 0x69, 0x6e, 0x53, 0x74, - 0x61, 0x6b, 0x65, 0x12, 0x1c, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x61, 0x70, - 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, - 0x65, 0x1a, 0x1d, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x2e, - 0x76, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x22, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1c, 0x12, 0x1a, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x72, - 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x2f, 0x67, 0x65, 0x74, 0x5f, 0x6d, 0x69, 0x6e, 0x5f, 0x73, - 0x74, 0x61, 0x6b, 0x65, 0x12, 0x7a, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x50, 0x65, 0x6e, 0x64, 0x69, - 0x6e, 0x67, 0x54, 0x78, 0x6e, 0x73, 0x12, 0x1c, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, - 0x72, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x4d, 0x65, 0x73, - 0x73, 0x61, 0x67, 0x65, 0x1a, 0x23, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x61, - 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x54, 0x78, 0x6e, - 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x25, 0x82, 0xd3, 0xe4, 0x93, 0x02, - 0x1f, 0x12, 0x1d, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x2f, - 0x67, 0x65, 0x74, 0x5f, 0x70, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x74, 0x78, 0x6e, 0x73, - 0x12, 0x81, 0x01, 0x0a, 0x11, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x54, 0x72, 0x61, 0x6e, 0x73, - 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x19, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, - 0x72, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x52, 0x65, - 0x71, 0x1a, 0x1e, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x2e, - 0x76, 0x31, 0x2e, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x31, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2b, 0x22, 0x29, 0x2f, 0x76, 0x31, 0x2f, 0x70, - 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x2f, 0x63, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x5f, 0x74, - 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x7b, 0x74, 0x78, 0x5f, 0x68, - 0x61, 0x73, 0x68, 0x7d, 0x42, 0xc8, 0x02, 0x92, 0x41, 0x7c, 0x12, 0x7a, 0x0a, 0x0c, 0x50, 0x72, - 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x20, 0x41, 0x50, 0x49, 0x2a, 0x5d, 0x0a, 0x1b, 0x42, 0x75, - 0x73, 0x69, 0x6e, 0x65, 0x73, 0x73, 0x20, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x20, 0x4c, 0x69, - 0x63, 0x65, 0x6e, 0x73, 0x65, 0x20, 0x31, 0x2e, 0x31, 0x12, 0x3e, 0x68, 0x74, 0x74, 0x70, 0x73, - 0x3a, 0x2f, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, - 0x69, 0x6d, 0x65, 0x76, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2f, 0x6d, 0x65, 0x76, - 0x2d, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x2f, 0x62, 0x6c, 0x6f, 0x62, 0x2f, 0x6d, 0x61, 0x69, - 0x6e, 0x2f, 0x4c, 0x49, 0x43, 0x45, 0x4e, 0x53, 0x45, 0x32, 0x0b, 0x31, 0x2e, 0x30, 0x2e, 0x30, - 0x2d, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x0a, 0x12, 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x76, - 0x69, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x42, 0x10, 0x50, 0x72, 0x6f, 0x76, - 0x69, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x48, - 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x65, - 0x76, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2f, 0x6d, 0x65, 0x76, 0x2d, 0x63, 0x6f, - 0x6d, 0x6d, 0x69, 0x74, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x67, 0x6f, 0x2f, 0x70, 0x72, 0x6f, 0x76, - 0x69, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x3b, 0x70, 0x72, 0x6f, 0x76, 0x69, - 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x50, 0x58, 0x58, 0xaa, 0x02, - 0x0e, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x56, 0x31, 0xca, - 0x02, 0x0e, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x5c, 0x56, 0x31, - 0xe2, 0x02, 0x1a, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x5c, 0x56, - 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0f, - 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x3a, 0x3a, 0x56, 0x31, 0x62, - 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x26, 0x22, 0x24, 0x2f, 0x76, + 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x2f, 0x72, 0x65, 0x67, 0x69, 0x73, + 0x74, 0x65, 0x72, 0x5f, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x2f, 0x7b, 0x61, 0x6d, 0x6f, 0x75, 0x6e, + 0x74, 0x7d, 0x12, 0x67, 0x0a, 0x08, 0x47, 0x65, 0x74, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x12, 0x1c, + 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, + 0x45, 0x6d, 0x70, 0x74, 0x79, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x1a, 0x1d, 0x2e, 0x70, + 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, + 0x61, 0x6b, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1e, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x18, 0x12, 0x16, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, + 0x72, 0x2f, 0x67, 0x65, 0x74, 0x5f, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x12, 0x6e, 0x0a, 0x0b, 0x47, + 0x65, 0x74, 0x4d, 0x69, 0x6e, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x12, 0x1c, 0x2e, 0x70, 0x72, 0x6f, + 0x76, 0x69, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x6d, 0x70, 0x74, + 0x79, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x1a, 0x1d, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, + 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x22, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1c, 0x12, + 0x1a, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x2f, 0x67, 0x65, + 0x74, 0x5f, 0x6d, 0x69, 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x12, 0x7a, 0x0a, 0x0e, 0x47, + 0x65, 0x74, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x54, 0x78, 0x6e, 0x73, 0x12, 0x1c, 0x2e, + 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x45, + 0x6d, 0x70, 0x74, 0x79, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x1a, 0x23, 0x2e, 0x70, 0x72, + 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x65, 0x6e, + 0x64, 0x69, 0x6e, 0x67, 0x54, 0x78, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x25, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1f, 0x12, 0x1d, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x72, + 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x2f, 0x67, 0x65, 0x74, 0x5f, 0x70, 0x65, 0x6e, 0x64, 0x69, + 0x6e, 0x67, 0x5f, 0x74, 0x78, 0x6e, 0x73, 0x12, 0x81, 0x01, 0x0a, 0x11, 0x43, 0x61, 0x6e, 0x63, + 0x65, 0x6c, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x19, 0x2e, + 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x43, + 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x52, 0x65, 0x71, 0x1a, 0x1e, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, + 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x31, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2b, + 0x22, 0x29, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x2f, 0x63, + 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x5f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x2f, 0x7b, 0x74, 0x78, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x7d, 0x42, 0xc8, 0x02, 0x92, 0x41, + 0x7c, 0x12, 0x7a, 0x0a, 0x0c, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x20, 0x41, 0x50, + 0x49, 0x2a, 0x5d, 0x0a, 0x1b, 0x42, 0x75, 0x73, 0x69, 0x6e, 0x65, 0x73, 0x73, 0x20, 0x53, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x20, 0x4c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x20, 0x31, 0x2e, 0x31, + 0x12, 0x3e, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x65, 0x76, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x63, 0x6f, 0x6c, 0x2f, 0x6d, 0x65, 0x76, 0x2d, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x2f, 0x62, + 0x6c, 0x6f, 0x62, 0x2f, 0x6d, 0x61, 0x69, 0x6e, 0x2f, 0x4c, 0x49, 0x43, 0x45, 0x4e, 0x53, 0x45, + 0x32, 0x0b, 0x31, 0x2e, 0x30, 0x2e, 0x30, 0x2d, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x0a, 0x12, 0x63, + 0x6f, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x76, + 0x31, 0x42, 0x10, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x50, 0x72, + 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x48, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x65, 0x76, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, + 0x2f, 0x6d, 0x65, 0x76, 0x2d, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x2f, 0x67, 0x65, 0x6e, 0x2f, + 0x67, 0x6f, 0x2f, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x2f, 0x76, + 0x31, 0x3b, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x76, 0x31, 0xa2, + 0x02, 0x03, 0x50, 0x58, 0x58, 0xaa, 0x02, 0x0e, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, + 0x61, 0x70, 0x69, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0e, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, + 0x72, 0x61, 0x70, 0x69, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1a, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, + 0x65, 0x72, 0x61, 0x70, 0x69, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0f, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x61, + 0x70, 0x69, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/p2p/gen/openapi/bidderapi/v1/bidderapi.swagger.yaml b/p2p/gen/openapi/bidderapi/v1/bidderapi.swagger.yaml index 5ad93c7f4..24f38f2ab 100644 --- a/p2p/gen/openapi/bidderapi/v1/bidderapi.swagger.yaml +++ b/p2p/gen/openapi/bidderapi/v1/bidderapi.swagger.yaml @@ -181,6 +181,10 @@ definitions: type: string format: int64 description: Timestamp at which the bid ends decaying. + dispatchTimestamp: + type: string + format: int64 + description: Timestamp at which the commitment is published. v1PrepayResponse: type: object example: diff --git a/p2p/gen/openapi/providerapi/v1/providerapi.swagger.yaml b/p2p/gen/openapi/providerapi/v1/providerapi.swagger.yaml index dafd3a5a8..f673b7fd5 100644 --- a/p2p/gen/openapi/providerapi/v1/providerapi.swagger.yaml +++ b/p2p/gen/openapi/providerapi/v1/providerapi.swagger.yaml @@ -206,6 +206,7 @@ definitions: type: object example: bidDigest: 9dJinwL+FZ6B1xsIQQo8t8B0ZXJubJwY86l/Yu7yAH159QrPHU0qj2P+YFj+llbuI1ZygdxGsX8+P3byMEA5ig== + decayDispatchTimestamp: 1.23456789e+09 status: STATUS_ACCEPTED properties: bidDigest: @@ -215,11 +216,16 @@ definitions: status: $ref: '#/definitions/v1BidResponseStatus' description: Status of the bid. + dispatchTimestamp: + type: string + format: int64 + description: Timestamp at which the commitment is accepted by provider and is used to compute the expected revenue from the preconfirmation description: Response sent by the provider with the decision on the bid received. title: Bid response required: - bidDigest - status + - decayDispatchTimestamp v1BidResponseStatus: type: string enum: diff --git a/p2p/integrationtest/bidder/main.go b/p2p/integrationtest/bidder/main.go index c723d4d7d..2635e1901 100644 --- a/p2p/integrationtest/bidder/main.go +++ b/p2p/integrationtest/bidder/main.go @@ -297,7 +297,7 @@ func sendBid( Amount: strconv.Itoa(int(amount)), BlockNumber: int64(blkNum) + 5, DecayStartTimestamp: time.Now().UnixMilli() - (time.Duration(8 * time.Second).Milliseconds()), - DecayEndTimestamp: time.Now().UnixMilli(), + DecayEndTimestamp: time.Now().UnixMilli() + (time.Duration(8 * time.Second).Milliseconds()), } logger.Info("sending bid", "bid", bid) diff --git a/p2p/integrationtest/provider/main.go b/p2p/integrationtest/provider/main.go index 17e207a48..06e70b7ed 100644 --- a/p2p/integrationtest/provider/main.go +++ b/p2p/integrationtest/provider/main.go @@ -9,6 +9,7 @@ import ( "math/rand" "net/http" "os" + "time" providerapiv1 "github.com/primevprotocol/mev-commit/p2p/gen/go/providerapi/v1" "github.com/primevprotocol/mev-commit/x/util" @@ -149,8 +150,9 @@ func main() { } } err = providerClient.SendBidResponse(context.Background(), &providerapiv1.BidResponse{ - BidDigest: bid.BidDigest, - Status: status, + BidDigest: bid.BidDigest, + Status: status, + DispatchTimestamp: time.Now().UnixMilli(), }) if err != nil { logger.Error("failed to send bid response", "error", err) diff --git a/p2p/integrationtest/real-bidder/Dockerfile b/p2p/integrationtest/real-bidder/Dockerfile index dc8e6b373..48a4128b2 100644 --- a/p2p/integrationtest/real-bidder/Dockerfile +++ b/p2p/integrationtest/real-bidder/Dockerfile @@ -2,10 +2,8 @@ FROM golang:1.22.1 AS builder WORKDIR /app COPY ./p2p ./p2p -WORKDIR ./p2p/integrationtest/provider -RUN go mod tidy && \ - go mod vendor && \ - CGO_ENABLED=0 GOOS=linux go build -o bidder-emulator main.go +WORKDIR ./p2p/integrationtest/real-bidder +RUN CGO_ENABLED=0 GOOS=linux go build -o bidder-emulator main.go FROM alpine:latest diff --git a/p2p/integrationtest/real-bidder/main.go b/p2p/integrationtest/real-bidder/main.go index 199f1f700..75b497ec5 100644 --- a/p2p/integrationtest/real-bidder/main.go +++ b/p2p/integrationtest/real-bidder/main.go @@ -147,9 +147,9 @@ func main() { throtle := time.Duration(12000*time.Millisecond) / time.Duration(len(block)) logger.Info("thortling set", "throtle", throtle.String()) bundle := 1 - for j := 0; j < len(block); j += bundle { + for j := 0; j+10 < len(block); j += bundle { bundle := rand.Intn(10) - err = sendBid(bidderClient, logger, rpcClient, block[j:j+bundle], int64(blkNum), (time.Now().UnixMilli())-10000, (time.Now().UnixMilli())) + err = sendBid(bidderClient, logger, rpcClient, block[j:j+bundle], int64(blkNum), (time.Now().UnixMilli())-500, (time.Now().UnixMilli() + 500)) if err != nil { logger.Error("failed to send bid", "err", err) } diff --git a/p2p/pkg/contracts/preconf/preconf.go b/p2p/pkg/contracts/preconf/preconf.go index 34784d5c2..ea7cac170 100644 --- a/p2p/pkg/contracts/preconf/preconf.go +++ b/p2p/pkg/contracts/preconf/preconf.go @@ -33,6 +33,7 @@ type Interface interface { decayEndTimeStamp uint64, bidSignature []byte, commitmentSignature []byte, + decayDispatchTimestamp uint64, ) error } @@ -65,6 +66,7 @@ func (p *preconfContract) StoreCommitment( decayEndTimeStamp uint64, bidSignature []byte, commitmentSignature []byte, + decayDispatchTimestamp uint64, ) error { callData, err := p.preconfABI.Pack( @@ -76,6 +78,7 @@ func (p *preconfContract) StoreCommitment( decayEndTimeStamp, bidSignature, commitmentSignature, + decayDispatchTimestamp, ) if err != nil { p.logger.Error("preconf contract storeCommitment pack error", "err", err) diff --git a/p2p/pkg/contracts/preconf/preconf_test.go b/p2p/pkg/contracts/preconf/preconf_test.go index 6270ce1d6..040ba5c11 100644 --- a/p2p/pkg/contracts/preconf/preconf_test.go +++ b/p2p/pkg/contracts/preconf/preconf_test.go @@ -27,6 +27,7 @@ func TestPreconfContract(t *testing.T) { commitment := []byte("abcdef") decayStart := uint64(1710095453035) decayEnd := uint64(1710095454035) + dispatchTimestamp := decayStart + (decayEnd-decayStart)/2 expCallData, err := preconfcontract.PreConfABI().Pack( "storeCommitment", @@ -37,6 +38,7 @@ func TestPreconfContract(t *testing.T) { decayEnd, bidSig, commitment, + dispatchTimestamp, ) if err != nil { @@ -85,6 +87,7 @@ func TestPreconfContract(t *testing.T) { decayEnd, bidSig, commitment, + dispatchTimestamp, ) if err != nil { t.Fatal(err) diff --git a/p2p/pkg/node/node.go b/p2p/pkg/node/node.go index f0d4f8e76..78cca89df 100644 --- a/p2p/pkg/node/node.go +++ b/p2p/pkg/node/node.go @@ -358,9 +358,9 @@ type noOpBidProcessor struct{} func (noOpBidProcessor) ProcessBid( _ context.Context, _ *preconfpb.Bid, -) (chan providerapiv1.BidResponse_Status, error) { - statusC := make(chan providerapiv1.BidResponse_Status, 5) - statusC <- providerapiv1.BidResponse_STATUS_ACCEPTED +) (chan providerapi.ProcessedBidResponse, error) { + statusC := make(chan providerapi.ProcessedBidResponse, 5) + statusC <- providerapi.ProcessedBidResponse{Status: providerapiv1.BidResponse_STATUS_ACCEPTED, DispatchTimestamp: time.Now().UnixMilli()} close(statusC) return statusC, nil @@ -377,6 +377,7 @@ func (noOpCommitmentDA) StoreCommitment( _ uint64, _ []byte, _ []byte, + _ uint64, ) error { return nil } diff --git a/p2p/pkg/preconfirmation/preconfirmation.go b/p2p/pkg/preconfirmation/preconfirmation.go index 5882fef32..d51c0101d 100644 --- a/p2p/pkg/preconfirmation/preconfirmation.go +++ b/p2p/pkg/preconfirmation/preconfirmation.go @@ -13,6 +13,7 @@ import ( providerapiv1 "github.com/primevprotocol/mev-commit/p2p/gen/go/providerapi/v1" preconfcontract "github.com/primevprotocol/mev-commit/p2p/pkg/contracts/preconf" "github.com/primevprotocol/mev-commit/p2p/pkg/p2p" + providerapi "github.com/primevprotocol/mev-commit/p2p/pkg/rpc/provider" signer "github.com/primevprotocol/mev-commit/p2p/pkg/signer/preconfsigner" "github.com/primevprotocol/mev-commit/p2p/pkg/topology" "google.golang.org/grpc/codes" @@ -44,7 +45,7 @@ type BidderStore interface { } type BidProcessor interface { - ProcessBid(context.Context, *preconfpb.Bid) (chan providerapiv1.BidResponse_Status, error) + ProcessBid(context.Context, *preconfpb.Bid) (chan providerapi.ProcessedBidResponse, error) } func New( @@ -221,7 +222,7 @@ func (p *Preconfirmation) handleBid( case <-ctx.Done(): return ctx.Err() case st := <-statusC: - switch st { + switch st.Status { case providerapiv1.BidResponse_STATUS_REJECTED: return status.Errorf(codes.Internal, "bid rejected") case providerapiv1.BidResponse_STATUS_ACCEPTED: @@ -239,6 +240,7 @@ func (p *Preconfirmation) handleBid( uint64(preConfirmation.Bid.DecayEndTimestamp), preConfirmation.Bid.Signature, preConfirmation.Signature, + uint64(st.DispatchTimestamp), ) if err != nil { p.logger.Error("storing commitment", "error", err) diff --git a/p2p/pkg/preconfirmation/preconfirmation_test.go b/p2p/pkg/preconfirmation/preconfirmation_test.go index 83cd75110..75fdc4fb5 100644 --- a/p2p/pkg/preconfirmation/preconfirmation_test.go +++ b/p2p/pkg/preconfirmation/preconfirmation_test.go @@ -15,6 +15,7 @@ import ( "github.com/primevprotocol/mev-commit/p2p/pkg/p2p" p2ptest "github.com/primevprotocol/mev-commit/p2p/pkg/p2p/testing" "github.com/primevprotocol/mev-commit/p2p/pkg/preconfirmation" + providerapi "github.com/primevprotocol/mev-commit/p2p/pkg/rpc/provider" "github.com/primevprotocol/mev-commit/p2p/pkg/topology" ) @@ -56,15 +57,15 @@ func (t *testSigner) VerifyPreConfirmation(_ *preconfpb.PreConfirmation) (*commo } type testProcessor struct { - status providerapiv1.BidResponse_Status + BidResponse providerapi.ProcessedBidResponse } func (t *testProcessor) ProcessBid( _ context.Context, _ *preconfpb.Bid, -) (chan providerapiv1.BidResponse_Status, error) { - statusC := make(chan providerapiv1.BidResponse_Status, 1) - statusC <- t.status +) (chan providerapi.ProcessedBidResponse, error) { + statusC := make(chan providerapi.ProcessedBidResponse, 1) + statusC <- providerapi.ProcessedBidResponse{Status: t.BidResponse.Status, DispatchTimestamp: t.BidResponse.DispatchTimestamp} return statusC, nil } @@ -79,6 +80,7 @@ func (t *testCommitmentDA) StoreCommitment( _ uint64, _ []byte, _ []byte, + _ uint64, ) error { return nil } @@ -132,7 +134,10 @@ func TestPreconfBidSubmission(t *testing.T) { topo := &testTopo{server} us := &testBidderStore{} proc := &testProcessor{ - status: providerapiv1.BidResponse_STATUS_ACCEPTED, + BidResponse: providerapi.ProcessedBidResponse{ + Status: providerapiv1.BidResponse_STATUS_ACCEPTED, + DispatchTimestamp: 10, + }, } signer := &testSigner{ bid: bid, diff --git a/p2p/pkg/rpc/provider/service.go b/p2p/pkg/rpc/provider/service.go index 43ac201cc..29c8666d7 100644 --- a/p2p/pkg/rpc/provider/service.go +++ b/p2p/pkg/rpc/provider/service.go @@ -20,10 +20,15 @@ import ( "google.golang.org/grpc/status" ) +type ProcessedBidResponse struct { + Status providerapiv1.BidResponse_Status + DispatchTimestamp int64 +} + type Service struct { providerapiv1.UnimplementedProviderServer receiver chan *providerapiv1.Bid - bidsInProcess map[string]func(providerapiv1.BidResponse_Status) + bidsInProcess map[string]func(ProcessedBidResponse) bidsMu sync.Mutex logger *slog.Logger owner common.Address @@ -47,7 +52,7 @@ func NewService( ) *Service { return &Service{ receiver: make(chan *providerapiv1.Bid), - bidsInProcess: make(map[string]func(providerapiv1.BidResponse_Status)), + bidsInProcess: make(map[string]func(ProcessedBidResponse)), registryContract: registryContract, owner: owner, logger: logger, @@ -67,7 +72,7 @@ func toString(bid *providerapiv1.Bid) string { func (s *Service) ProcessBid( ctx context.Context, bid *preconfpb.Bid, -) (chan providerapiv1.BidResponse_Status, error) { +) (chan ProcessedBidResponse, error) { bidMsg := &providerapiv1.Bid{ TxHashes: strings.Split(bid.TxHash, ","), BidAmount: bid.BidAmount, @@ -82,10 +87,13 @@ func (s *Service) ProcessBid( return nil, err } - respC := make(chan providerapiv1.BidResponse_Status, 1) + respC := make(chan ProcessedBidResponse, 1) s.bidsMu.Lock() - s.bidsInProcess[string(bid.Digest)] = func(status providerapiv1.BidResponse_Status) { - respC <- status + s.bidsInProcess[string(bid.Digest)] = func(bidResponse ProcessedBidResponse) { + respC <- ProcessedBidResponse{ + Status: bidResponse.Status, + DispatchTimestamp: bidResponse.DispatchTimestamp, + } close(respC) } s.bidsMu.Unlock() @@ -150,7 +158,10 @@ func (s *Service) SendProcessedBids(srv providerapiv1.Provider_SendProcessedBids "bidDigest", hex.EncodeToString(status.BidDigest), "status", status.Status.String(), ) - callback(status.Status) + callback(ProcessedBidResponse{ + Status: status.Status, + DispatchTimestamp: status.DispatchTimestamp, + }) if status.Status == providerapiv1.BidResponse_STATUS_ACCEPTED { s.metrics.BidsAcceptedByProviderCount.Inc() } else { diff --git a/p2p/pkg/rpc/provider/service_test.go b/p2p/pkg/rpc/provider/service_test.go index f52ab623c..2e61ca996 100644 --- a/p2p/pkg/rpc/provider/service_test.go +++ b/p2p/pkg/rpc/provider/service_test.go @@ -180,11 +180,12 @@ func TestBidHandling(t *testing.T) { t.Parallel() type testCase struct { - name string - bid *preconfpb.Bid - status providerapiv1.BidResponse_Status - noStatus bool - processErr string + name string + bid *preconfpb.Bid + status providerapiv1.BidResponse_Status + noStatus bool + processErr string + decayDispatchTimestamp int64 } for _, tc := range []testCase{ @@ -204,7 +205,8 @@ func TestBidHandling(t *testing.T) { DecayStartTimestamp: 199, DecayEndTimestamp: 299, }, - status: providerapiv1.BidResponse_STATUS_ACCEPTED, + status: providerapiv1.BidResponse_STATUS_ACCEPTED, + decayDispatchTimestamp: 10, }, { name: "rejected bid", @@ -217,7 +219,8 @@ func TestBidHandling(t *testing.T) { DecayStartTimestamp: 199, DecayEndTimestamp: 299, }, - status: providerapiv1.BidResponse_STATUS_REJECTED, + status: providerapiv1.BidResponse_STATUS_REJECTED, + decayDispatchTimestamp: 10, }, { name: "invalid bid status", @@ -230,8 +233,9 @@ func TestBidHandling(t *testing.T) { DecayStartTimestamp: 199, DecayEndTimestamp: 299, }, - status: providerapiv1.BidResponse_STATUS_UNSPECIFIED, - noStatus: true, + status: providerapiv1.BidResponse_STATUS_UNSPECIFIED, + noStatus: true, + decayDispatchTimestamp: 10, }, { name: "invalid bid txHash", @@ -244,7 +248,8 @@ func TestBidHandling(t *testing.T) { DecayStartTimestamp: 199, DecayEndTimestamp: 299, }, - processErr: "tx_hashes: tx_hashes must be a valid array of transaction hashes", + processErr: "tx_hashes: tx_hashes must be a valid array of transaction hashes", + decayDispatchTimestamp: 10, }, { name: "invalid bid amount", @@ -257,7 +262,8 @@ func TestBidHandling(t *testing.T) { DecayStartTimestamp: 199, DecayEndTimestamp: 299, }, - processErr: "bid_amount: bid_amount must be a valid integer", + processErr: "bid_amount: bid_amount must be a valid integer", + decayDispatchTimestamp: 10, }, { name: "invalid bid block number", @@ -270,7 +276,8 @@ func TestBidHandling(t *testing.T) { DecayStartTimestamp: 199, DecayEndTimestamp: 299, }, - processErr: "block_number: value must be greater than 0", + processErr: "block_number: value must be greater than 0", + decayDispatchTimestamp: 10, }, } { t.Run(tc.name, func(t *testing.T) { @@ -320,8 +327,9 @@ func TestBidHandling(t *testing.T) { break } err := sndr.Send(&providerapiv1.BidResponse{ - BidDigest: bid.BidDigest, - Status: tc.status, + BidDigest: bid.BidDigest, + Status: tc.status, + DispatchTimestamp: tc.decayDispatchTimestamp, }) if err != nil { break @@ -342,8 +350,8 @@ func TestBidHandling(t *testing.T) { select { case resp := <-respC: - if resp != tc.status { - t.Fatalf("expected status to be %v, got %v", tc.status, resp) + if resp.Status != tc.status { + t.Fatalf("expected status to be %v, got %v", tc.status, resp.Status) } if tc.noStatus { t.Fatalf("expected no status, got %v", resp) diff --git a/p2p/rpc/bidderapi/v1/bidderapi.proto b/p2p/rpc/bidderapi/v1/bidderapi.proto index 09a7cd3cc..5030e87e6 100644 --- a/p2p/rpc/bidderapi/v1/bidderapi.proto +++ b/p2p/rpc/bidderapi/v1/bidderapi.proto @@ -159,4 +159,7 @@ message Commitment { int64 decay_end_timestamp = 10 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { description: "Timestamp at which the bid ends decaying." }]; + int64 dispatch_timestamp = 11 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + description: "Timestamp at which the commitment is published." + }]; }; diff --git a/p2p/rpc/providerapi/v1/providerapi.proto b/p2p/rpc/providerapi/v1/providerapi.proto index dfa1aeb52..dfd2c5704 100644 --- a/p2p/rpc/providerapi/v1/providerapi.proto +++ b/p2p/rpc/providerapi/v1/providerapi.proto @@ -148,15 +148,14 @@ message Bid { expression: "uint(this) > 0" }]; }; - message BidResponse { option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { json_schema: { title: "Bid response" description: "Response sent by the provider with the decision on the bid received." - required: ["bidDigest", "status"] + required: ["bidDigest", "status", "decayDispatchTimestamp"] } - example: "{\"bidDigest\": \"9dJinwL+FZ6B1xsIQQo8t8B0ZXJubJwY86l/Yu7yAH159QrPHU0qj2P+YFj+llbuI1ZygdxGsX8+P3byMEA5ig==\", \"status\": \"STATUS_ACCEPTED\"}" + example: "{\"bidDigest\": \"9dJinwL+FZ6B1xsIQQo8t8B0ZXJubJwY86l/Yu7yAH159QrPHU0qj2P+YFj+llbuI1ZygdxGsX8+P3byMEA5ig==\", \"status\": \"STATUS_ACCEPTED\", \"decayDispatchTimestamp\": 1234567890}" }; bytes bid_digest = 1 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { description: "Digest of the bid message signed by the bidder." @@ -175,6 +174,9 @@ message BidResponse { 2 ] }]; + int64 dispatch_timestamp = 3 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + description: "Timestamp at which the commitment is accepted by provider and is used to compute the expected revenue from the preconfirmation" + }]; }; message PendingTxnsResponse {