From 5f4e628f551d0f49bdb15f4179c29499c75c9136 Mon Sep 17 00:00:00 2001 From: Mikhail Wall Date: Tue, 25 Jun 2024 00:47:56 +0200 Subject: [PATCH 01/18] feat: added bidder autodeposit --- contracts-abi/abi/BidderRegistry.abi | 67 ++++ contracts-abi/abi/BlockTracker.abi | 13 - contracts-abi/abi/Oracle.abi | 4 +- .../clients/BidderRegistry/BidderRegistry.go | 191 ++++++++- .../clients/BlockTracker/BlockTracker.go | 136 +------ contracts-abi/clients/Oracle/Oracle.go | 32 +- contracts/contracts/BidderRegistry.sol | 72 ++++ contracts/contracts/BlockTracker.sol | 3 - contracts/contracts/Oracle.sol | 2 +- contracts/test/BidderRegistryTest.sol | 71 +++- oracle/pkg/apiserver/dashboard.go | 2 +- p2p/gen/go/bidderapi/v1/bidderapi.pb.go | 364 +++++++++++++----- p2p/gen/go/bidderapi/v1/bidderapi.pb.gw.go | 190 +++++++++ p2p/gen/go/bidderapi/v1/bidderapi_grpc.pb.go | 98 ++++- .../bidderapi/v1/bidderapi.swagger.yaml | 73 ++++ p2p/integrationtest/real-bidder/main.go | 74 ++-- p2p/pkg/depositmanager/autodeposit.go | 142 +++++++ p2p/pkg/node/node.go | 8 + p2p/pkg/rpc/bidder/service.go | 89 +++++ p2p/pkg/rpc/bidder/service_test.go | 25 ++ p2p/rpc/bidderapi/v1/bidderapi.proto | 30 ++ 21 files changed, 1396 insertions(+), 290 deletions(-) create mode 100644 p2p/pkg/depositmanager/autodeposit.go diff --git a/contracts-abi/abi/BidderRegistry.abi b/contracts-abi/abi/BidderRegistry.abi index 82fcc757d..d8176895d 100644 --- a/contracts-abi/abi/BidderRegistry.abi +++ b/contracts-abi/abi/BidderRegistry.abi @@ -127,6 +127,24 @@ ], "stateMutability": "view" }, + { + "type": "function", + "name": "depositForNWindows", + "inputs": [ + { + "name": "window", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "n", + "type": "uint16", + "internalType": "uint16" + } + ], + "outputs": [], + "stateMutability": "payable" + }, { "type": "function", "name": "depositForSpecificWindow", @@ -334,6 +352,24 @@ ], "stateMutability": "view" }, + { + "type": "function", + "name": "moveDepositToWindow", + "inputs": [ + { + "name": "fromWindow", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "toWindow", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, { "type": "function", "name": "owner", @@ -603,6 +639,37 @@ "outputs": [], "stateMutability": "nonpayable" }, + { + "type": "event", + "name": "BidderMovedFunds", + "inputs": [ + { + "name": "bidder", + "type": "address", + "indexed": true, + "internalType": "address" + }, + { + "name": "fromWindow", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + }, + { + "name": "toWindow", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + }, + { + "name": "amount", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + } + ], + "anonymous": false + }, { "type": "event", "name": "BidderRegistered", diff --git a/contracts-abi/abi/BlockTracker.abi b/contracts-abi/abi/BlockTracker.abi index 5871c267e..d29ddbea6 100644 --- a/contracts-abi/abi/BlockTracker.abi +++ b/contracts-abi/abi/BlockTracker.abi @@ -284,19 +284,6 @@ ], "anonymous": false }, - { - "type": "event", - "name": "NewBlocksPerWindow", - "inputs": [ - { - "name": "blocksPerWindow", - "type": "uint256", - "indexed": false, - "internalType": "uint256" - } - ], - "anonymous": false - }, { "type": "event", "name": "NewL1Block", diff --git a/contracts-abi/abi/Oracle.abi b/contracts-abi/abi/Oracle.abi index e165f8b64..3c26816fd 100644 --- a/contracts-abi/abi/Oracle.abi +++ b/contracts-abi/abi/Oracle.abi @@ -169,9 +169,9 @@ "name": "CommitmentProcessed", "inputs": [ { - "name": "commitmentHash", + "name": "commitmentIndex", "type": "bytes32", - "indexed": false, + "indexed": true, "internalType": "bytes32" }, { diff --git a/contracts-abi/clients/BidderRegistry/BidderRegistry.go b/contracts-abi/clients/BidderRegistry/BidderRegistry.go index 453f93687..a66edfd10 100644 --- a/contracts-abi/clients/BidderRegistry/BidderRegistry.go +++ b/contracts-abi/clients/BidderRegistry/BidderRegistry.go @@ -31,7 +31,7 @@ var ( // BidderregistryMetaData contains all meta data concerning the Bidderregistry contract. var BidderregistryMetaData = &bind.MetaData{ - ABI: "[{\"type\":\"constructor\",\"inputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"fallback\",\"stateMutability\":\"payable\"},{\"type\":\"receive\",\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"BidPayment\",\"inputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"bidder\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"bidAmt\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"state\",\"type\":\"uint8\",\"internalType\":\"enumIBidderRegistry.State\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"OpenBid\",\"inputs\":[{\"name\":\"commitmentDigest\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"bid\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"bidder\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"blockNumber\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"UPGRADE_INTERFACE_VERSION\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"bidderRegistered\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"blockTrackerContract\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIBlockTracker\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"blocksPerWindow\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"depositForSpecificWindow\",\"inputs\":[{\"name\":\"window\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"feePercent\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint16\",\"internalType\":\"uint16\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"feeRecipient\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"feeRecipientAmount\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getDeposit\",\"inputs\":[{\"name\":\"bidder\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"window\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getFeeRecipientAmount\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getProviderAmount\",\"inputs\":[{\"name\":\"provider\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"initialize\",\"inputs\":[{\"name\":\"_minDeposit\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_feeRecipient\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_feePercent\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"_owner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_blockTracker\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_blocksPerWindow\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"lockedFunds\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"maxBidPerBlock\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"minDeposit\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"owner\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"preConfirmationsContract\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"protocolFeeAmount\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"providerAmount\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"proxiableUUID\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"renounceOwnership\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"retrieveFunds\",\"inputs\":[{\"name\":\"windowToSettle\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"commitmentDigest\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"provider\",\"type\":\"address\",\"internalType\":\"addresspayable\"},{\"name\":\"residualBidPercentAfterDecay\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setNewFeePercent\",\"inputs\":[{\"name\":\"newFeePercent\",\"type\":\"uint16\",\"internalType\":\"uint16\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setNewFeeRecipient\",\"inputs\":[{\"name\":\"newFeeRecipient\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setPreconfirmationsContract\",\"inputs\":[{\"name\":\"contractAddress\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"transferOwnership\",\"inputs\":[{\"name\":\"newOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"unlockFunds\",\"inputs\":[{\"name\":\"window\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"bidID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"upgradeToAndCall\",\"inputs\":[{\"name\":\"newImplementation\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"data\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"usedFunds\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"withdrawBidderAmountFromWindow\",\"inputs\":[{\"name\":\"bidder\",\"type\":\"address\",\"internalType\":\"addresspayable\"},{\"name\":\"window\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"withdrawFeeRecipientAmount\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"withdrawProtocolFee\",\"inputs\":[{\"name\":\"bidder\",\"type\":\"address\",\"internalType\":\"addresspayable\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"withdrawProviderAmount\",\"inputs\":[{\"name\":\"provider\",\"type\":\"address\",\"internalType\":\"addresspayable\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"event\",\"name\":\"BidderRegistered\",\"inputs\":[{\"name\":\"bidder\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"depositedAmount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"windowNumber\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"BidderWithdrawal\",\"inputs\":[{\"name\":\"bidder\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"window\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"amount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"FundsRetrieved\",\"inputs\":[{\"name\":\"commitmentDigest\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"bidder\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"window\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"amount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"FundsRewarded\",\"inputs\":[{\"name\":\"commitmentDigest\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"bidder\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"provider\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"window\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"amount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Initialized\",\"inputs\":[{\"name\":\"version\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"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\":\"Upgraded\",\"inputs\":[{\"name\":\"implementation\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"AddressEmptyCode\",\"inputs\":[{\"name\":\"target\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"ERC1967InvalidImplementation\",\"inputs\":[{\"name\":\"implementation\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"ERC1967NonPayable\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"FailedInnerCall\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidInitialization\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"NotInitializing\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"OwnableInvalidOwner\",\"inputs\":[{\"name\":\"owner\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"OwnableUnauthorizedAccount\",\"inputs\":[{\"name\":\"account\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"ReentrancyGuardReentrantCall\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"UUPSUnauthorizedCallContext\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"UUPSUnsupportedProxiableUUID\",\"inputs\":[{\"name\":\"slot\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]}]", + ABI: "[{\"type\":\"constructor\",\"inputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"fallback\",\"stateMutability\":\"payable\"},{\"type\":\"receive\",\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"BidPayment\",\"inputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"bidder\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"bidAmt\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"state\",\"type\":\"uint8\",\"internalType\":\"enumIBidderRegistry.State\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"OpenBid\",\"inputs\":[{\"name\":\"commitmentDigest\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"bid\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"bidder\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"blockNumber\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"bidderRegistered\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"blockTrackerContract\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIBlockTracker\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"blocksPerWindow\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"depositForSpecificWindow\",\"inputs\":[{\"name\":\"window\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"feePercent\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint16\",\"internalType\":\"uint16\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"feeRecipient\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"feeRecipientAmount\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getDeposit\",\"inputs\":[{\"name\":\"bidder\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"window\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getFeeRecipientAmount\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getProviderAmount\",\"inputs\":[{\"name\":\"provider\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"initialize\",\"inputs\":[{\"name\":\"_minDeposit\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_feeRecipient\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_feePercent\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"_owner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_blockTracker\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_blocksPerWindow\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"lockedFunds\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"maxBidPerBlock\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"minDeposit\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"owner\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"preConfirmationsContract\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"protocolFeeAmount\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"providerAmount\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"renounceOwnership\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"retrieveFunds\",\"inputs\":[{\"name\":\"windowToSettle\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"commitmentDigest\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"provider\",\"type\":\"address\",\"internalType\":\"addresspayable\"},{\"name\":\"residualBidPercentAfterDecay\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setNewFeePercent\",\"inputs\":[{\"name\":\"newFeePercent\",\"type\":\"uint16\",\"internalType\":\"uint16\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setNewFeeRecipient\",\"inputs\":[{\"name\":\"newFeeRecipient\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setPreconfirmationsContract\",\"inputs\":[{\"name\":\"contractAddress\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"transferOwnership\",\"inputs\":[{\"name\":\"newOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"unlockFunds\",\"inputs\":[{\"name\":\"window\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"bidID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"usedFunds\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"withdrawBidderAmountFromWindow\",\"inputs\":[{\"name\":\"bidder\",\"type\":\"address\",\"internalType\":\"addresspayable\"},{\"name\":\"window\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"withdrawFeeRecipientAmount\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"withdrawProtocolFee\",\"inputs\":[{\"name\":\"bidder\",\"type\":\"address\",\"internalType\":\"addresspayable\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"withdrawProviderAmount\",\"inputs\":[{\"name\":\"provider\",\"type\":\"address\",\"internalType\":\"addresspayable\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"event\",\"name\":\"BidderRegistered\",\"inputs\":[{\"name\":\"bidder\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"depositedAmount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"windowNumber\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"BidderWithdrawal\",\"inputs\":[{\"name\":\"bidder\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"window\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"amount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"FundsRetrieved\",\"inputs\":[{\"name\":\"commitmentDigest\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"bidder\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"window\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"amount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"FundsRewarded\",\"inputs\":[{\"name\":\"commitmentDigest\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"bidder\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"provider\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"window\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"amount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Initialized\",\"inputs\":[{\"name\":\"version\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OwnershipTransferred\",\"inputs\":[{\"name\":\"previousOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"newOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"InvalidInitialization\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"NotInitializing\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"OwnableInvalidOwner\",\"inputs\":[{\"name\":\"owner\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"OwnableUnauthorizedAccount\",\"inputs\":[{\"name\":\"account\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"ReentrancyGuardReentrantCall\",\"inputs\":[]}]", } // BidderregistryABI is the input ABI used to generate the binding from. @@ -840,6 +840,27 @@ func (_Bidderregistry *BidderregistryTransactorSession) OpenBid(commitmentDigest return _Bidderregistry.Contract.OpenBid(&_Bidderregistry.TransactOpts, commitmentDigest, bid, bidder, blockNumber) } +// DepositForNWindows is a paid mutator transaction binding the contract method 0xaac7617f. +// +// Solidity: function depositForNWindows(uint256 window, uint16 n) payable returns() +func (_Bidderregistry *BidderregistryTransactor) DepositForNWindows(opts *bind.TransactOpts, window *big.Int, n uint16) (*types.Transaction, error) { + return _Bidderregistry.contract.Transact(opts, "depositForNWindows", window, n) +} + +// DepositForNWindows is a paid mutator transaction binding the contract method 0xaac7617f. +// +// Solidity: function depositForNWindows(uint256 window, uint16 n) payable returns() +func (_Bidderregistry *BidderregistrySession) DepositForNWindows(window *big.Int, n uint16) (*types.Transaction, error) { + return _Bidderregistry.Contract.DepositForNWindows(&_Bidderregistry.TransactOpts, window, n) +} + +// DepositForNWindows is a paid mutator transaction binding the contract method 0xaac7617f. +// +// Solidity: function depositForNWindows(uint256 window, uint16 n) payable returns() +func (_Bidderregistry *BidderregistryTransactorSession) DepositForNWindows(window *big.Int, n uint16) (*types.Transaction, error) { + return _Bidderregistry.Contract.DepositForNWindows(&_Bidderregistry.TransactOpts, window, n) +} + // DepositForSpecificWindow is a paid mutator transaction binding the contract method 0xe5e4bf4c. // // Solidity: function depositForSpecificWindow(uint256 window) payable returns() @@ -882,6 +903,27 @@ func (_Bidderregistry *BidderregistryTransactorSession) Initialize(_minDeposit * return _Bidderregistry.Contract.Initialize(&_Bidderregistry.TransactOpts, _minDeposit, _feeRecipient, _feePercent, _owner, _blockTracker, _blocksPerWindow) } +// MoveDepositToWindow is a paid mutator transaction binding the contract method 0x73dac150. +// +// Solidity: function moveDepositToWindow(uint256 fromWindow, uint256 toWindow) returns() +func (_Bidderregistry *BidderregistryTransactor) MoveDepositToWindow(opts *bind.TransactOpts, fromWindow *big.Int, toWindow *big.Int) (*types.Transaction, error) { + return _Bidderregistry.contract.Transact(opts, "moveDepositToWindow", fromWindow, toWindow) +} + +// MoveDepositToWindow is a paid mutator transaction binding the contract method 0x73dac150. +// +// Solidity: function moveDepositToWindow(uint256 fromWindow, uint256 toWindow) returns() +func (_Bidderregistry *BidderregistrySession) MoveDepositToWindow(fromWindow *big.Int, toWindow *big.Int) (*types.Transaction, error) { + return _Bidderregistry.Contract.MoveDepositToWindow(&_Bidderregistry.TransactOpts, fromWindow, toWindow) +} + +// MoveDepositToWindow is a paid mutator transaction binding the contract method 0x73dac150. +// +// Solidity: function moveDepositToWindow(uint256 fromWindow, uint256 toWindow) returns() +func (_Bidderregistry *BidderregistryTransactorSession) MoveDepositToWindow(fromWindow *big.Int, toWindow *big.Int) (*types.Transaction, error) { + return _Bidderregistry.Contract.MoveDepositToWindow(&_Bidderregistry.TransactOpts, fromWindow, toWindow) +} + // RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. // // Solidity: function renounceOwnership() returns() @@ -1176,6 +1218,153 @@ func (_Bidderregistry *BidderregistryTransactorSession) Receive() (*types.Transa return _Bidderregistry.Contract.Receive(&_Bidderregistry.TransactOpts) } +// BidderregistryBidderMovedFundsIterator is returned from FilterBidderMovedFunds and is used to iterate over the raw logs and unpacked data for BidderMovedFunds events raised by the Bidderregistry contract. +type BidderregistryBidderMovedFundsIterator struct { + Event *BidderregistryBidderMovedFunds // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *BidderregistryBidderMovedFundsIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(BidderregistryBidderMovedFunds) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(BidderregistryBidderMovedFunds) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *BidderregistryBidderMovedFundsIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *BidderregistryBidderMovedFundsIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// BidderregistryBidderMovedFunds represents a BidderMovedFunds event raised by the Bidderregistry contract. +type BidderregistryBidderMovedFunds struct { + Bidder common.Address + FromWindow *big.Int + ToWindow *big.Int + Amount *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterBidderMovedFunds is a free log retrieval operation binding the contract event 0xc6f0b69dd53688553b5b6f9f791e83055ccbd1875750b877276fe0a31dbf1812. +// +// Solidity: event BidderMovedFunds(address indexed bidder, uint256 fromWindow, uint256 toWindow, uint256 amount) +func (_Bidderregistry *BidderregistryFilterer) FilterBidderMovedFunds(opts *bind.FilterOpts, bidder []common.Address) (*BidderregistryBidderMovedFundsIterator, error) { + + var bidderRule []interface{} + for _, bidderItem := range bidder { + bidderRule = append(bidderRule, bidderItem) + } + + logs, sub, err := _Bidderregistry.contract.FilterLogs(opts, "BidderMovedFunds", bidderRule) + if err != nil { + return nil, err + } + return &BidderregistryBidderMovedFundsIterator{contract: _Bidderregistry.contract, event: "BidderMovedFunds", logs: logs, sub: sub}, nil +} + +// WatchBidderMovedFunds is a free log subscription operation binding the contract event 0xc6f0b69dd53688553b5b6f9f791e83055ccbd1875750b877276fe0a31dbf1812. +// +// Solidity: event BidderMovedFunds(address indexed bidder, uint256 fromWindow, uint256 toWindow, uint256 amount) +func (_Bidderregistry *BidderregistryFilterer) WatchBidderMovedFunds(opts *bind.WatchOpts, sink chan<- *BidderregistryBidderMovedFunds, bidder []common.Address) (event.Subscription, error) { + + var bidderRule []interface{} + for _, bidderItem := range bidder { + bidderRule = append(bidderRule, bidderItem) + } + + logs, sub, err := _Bidderregistry.contract.WatchLogs(opts, "BidderMovedFunds", bidderRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(BidderregistryBidderMovedFunds) + if err := _Bidderregistry.contract.UnpackLog(event, "BidderMovedFunds", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseBidderMovedFunds is a log parse operation binding the contract event 0xc6f0b69dd53688553b5b6f9f791e83055ccbd1875750b877276fe0a31dbf1812. +// +// Solidity: event BidderMovedFunds(address indexed bidder, uint256 fromWindow, uint256 toWindow, uint256 amount) +func (_Bidderregistry *BidderregistryFilterer) ParseBidderMovedFunds(log types.Log) (*BidderregistryBidderMovedFunds, error) { + event := new(BidderregistryBidderMovedFunds) + if err := _Bidderregistry.contract.UnpackLog(event, "BidderMovedFunds", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + // BidderregistryBidderRegisteredIterator is returned from FilterBidderRegistered and is used to iterate over the raw logs and unpacked data for BidderRegistered events raised by the Bidderregistry contract. type BidderregistryBidderRegisteredIterator struct { Event *BidderregistryBidderRegistered // Event containing the contract specifics and raw log diff --git a/contracts-abi/clients/BlockTracker/BlockTracker.go b/contracts-abi/clients/BlockTracker/BlockTracker.go index 460a5e8cd..b40663412 100644 --- a/contracts-abi/clients/BlockTracker/BlockTracker.go +++ b/contracts-abi/clients/BlockTracker/BlockTracker.go @@ -31,7 +31,7 @@ var ( // BlocktrackerMetaData contains all meta data concerning the Blocktracker contract. var BlocktrackerMetaData = &bind.MetaData{ - ABI: "[{\"type\":\"constructor\",\"inputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"fallback\",\"stateMutability\":\"payable\"},{\"type\":\"receive\",\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"UPGRADE_INTERFACE_VERSION\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"addBuilderAddress\",\"inputs\":[{\"name\":\"builderName\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"builderAddress\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"blockBuilderNameToAddress\",\"inputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"blockWinners\",\"inputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"blocksPerWindow\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"currentWindow\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getBlockWinner\",\"inputs\":[{\"name\":\"blockNumber\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getBlocksPerWindow\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getBuilder\",\"inputs\":[{\"name\":\"builderNameGrafiti\",\"type\":\"string\",\"internalType\":\"string\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getCurrentWindow\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"initialize\",\"inputs\":[{\"name\":\"_owner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_blocksPerWindow\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"owner\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"proxiableUUID\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"recordL1Block\",\"inputs\":[{\"name\":\"_blockNumber\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_winnerGraffiti\",\"type\":\"string\",\"internalType\":\"string\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"renounceOwnership\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"transferOwnership\",\"inputs\":[{\"name\":\"newOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"upgradeToAndCall\",\"inputs\":[{\"name\":\"newImplementation\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"data\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"event\",\"name\":\"Initialized\",\"inputs\":[{\"name\":\"version\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"NewBlocksPerWindow\",\"inputs\":[{\"name\":\"blocksPerWindow\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"NewL1Block\",\"inputs\":[{\"name\":\"blockNumber\",\"type\":\"uint256\",\"indexed\":true,\"internalType\":\"uint256\"},{\"name\":\"winner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"window\",\"type\":\"uint256\",\"indexed\":true,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"NewWindow\",\"inputs\":[{\"name\":\"window\",\"type\":\"uint256\",\"indexed\":true,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"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\":\"Upgraded\",\"inputs\":[{\"name\":\"implementation\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"AddressEmptyCode\",\"inputs\":[{\"name\":\"target\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"ERC1967InvalidImplementation\",\"inputs\":[{\"name\":\"implementation\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"ERC1967NonPayable\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"FailedInnerCall\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidInitialization\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"NotInitializing\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"OwnableInvalidOwner\",\"inputs\":[{\"name\":\"owner\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"OwnableUnauthorizedAccount\",\"inputs\":[{\"name\":\"account\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"UUPSUnauthorizedCallContext\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"UUPSUnsupportedProxiableUUID\",\"inputs\":[{\"name\":\"slot\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]}]", + ABI: "[{\"type\":\"constructor\",\"inputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"fallback\",\"stateMutability\":\"payable\"},{\"type\":\"receive\",\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"addBuilderAddress\",\"inputs\":[{\"name\":\"builderName\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"builderAddress\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"blockBuilderNameToAddress\",\"inputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"blockWinners\",\"inputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"blocksPerWindow\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"currentWindow\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getBlockWinner\",\"inputs\":[{\"name\":\"blockNumber\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getBlocksPerWindow\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getBuilder\",\"inputs\":[{\"name\":\"builderNameGrafiti\",\"type\":\"string\",\"internalType\":\"string\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getCurrentWindow\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"initialize\",\"inputs\":[{\"name\":\"_owner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_blocksPerWindow\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"owner\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"recordL1Block\",\"inputs\":[{\"name\":\"_blockNumber\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_winnerGraffiti\",\"type\":\"string\",\"internalType\":\"string\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"renounceOwnership\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"transferOwnership\",\"inputs\":[{\"name\":\"newOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"event\",\"name\":\"Initialized\",\"inputs\":[{\"name\":\"version\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"NewBlocksPerWindow\",\"inputs\":[{\"name\":\"blocksPerWindow\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"NewL1Block\",\"inputs\":[{\"name\":\"blockNumber\",\"type\":\"uint256\",\"indexed\":true,\"internalType\":\"uint256\"},{\"name\":\"winner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"window\",\"type\":\"uint256\",\"indexed\":true,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"NewWindow\",\"inputs\":[{\"name\":\"window\",\"type\":\"uint256\",\"indexed\":true,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OwnershipTransferred\",\"inputs\":[{\"name\":\"previousOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"newOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"InvalidInitialization\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"NotInitializing\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"OwnableInvalidOwner\",\"inputs\":[{\"name\":\"owner\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"OwnableUnauthorizedAccount\",\"inputs\":[{\"name\":\"account\",\"type\":\"address\",\"internalType\":\"address\"}]}]", } // BlocktrackerABI is the input ABI used to generate the binding from. @@ -823,140 +823,6 @@ func (_Blocktracker *BlocktrackerFilterer) ParseInitialized(log types.Log) (*Blo return event, nil } -// BlocktrackerNewBlocksPerWindowIterator is returned from FilterNewBlocksPerWindow and is used to iterate over the raw logs and unpacked data for NewBlocksPerWindow events raised by the Blocktracker contract. -type BlocktrackerNewBlocksPerWindowIterator struct { - Event *BlocktrackerNewBlocksPerWindow // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *BlocktrackerNewBlocksPerWindowIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(BlocktrackerNewBlocksPerWindow) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(BlocktrackerNewBlocksPerWindow) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *BlocktrackerNewBlocksPerWindowIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *BlocktrackerNewBlocksPerWindowIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// BlocktrackerNewBlocksPerWindow represents a NewBlocksPerWindow event raised by the Blocktracker contract. -type BlocktrackerNewBlocksPerWindow struct { - BlocksPerWindow *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterNewBlocksPerWindow is a free log retrieval operation binding the contract event 0xd2abfe7e41e182f2121a97e57d5133f2ccef005fb15e25ef2f09d4a6657e20e0. -// -// Solidity: event NewBlocksPerWindow(uint256 blocksPerWindow) -func (_Blocktracker *BlocktrackerFilterer) FilterNewBlocksPerWindow(opts *bind.FilterOpts) (*BlocktrackerNewBlocksPerWindowIterator, error) { - - logs, sub, err := _Blocktracker.contract.FilterLogs(opts, "NewBlocksPerWindow") - if err != nil { - return nil, err - } - return &BlocktrackerNewBlocksPerWindowIterator{contract: _Blocktracker.contract, event: "NewBlocksPerWindow", logs: logs, sub: sub}, nil -} - -// WatchNewBlocksPerWindow is a free log subscription operation binding the contract event 0xd2abfe7e41e182f2121a97e57d5133f2ccef005fb15e25ef2f09d4a6657e20e0. -// -// Solidity: event NewBlocksPerWindow(uint256 blocksPerWindow) -func (_Blocktracker *BlocktrackerFilterer) WatchNewBlocksPerWindow(opts *bind.WatchOpts, sink chan<- *BlocktrackerNewBlocksPerWindow) (event.Subscription, error) { - - logs, sub, err := _Blocktracker.contract.WatchLogs(opts, "NewBlocksPerWindow") - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(BlocktrackerNewBlocksPerWindow) - if err := _Blocktracker.contract.UnpackLog(event, "NewBlocksPerWindow", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseNewBlocksPerWindow is a log parse operation binding the contract event 0xd2abfe7e41e182f2121a97e57d5133f2ccef005fb15e25ef2f09d4a6657e20e0. -// -// Solidity: event NewBlocksPerWindow(uint256 blocksPerWindow) -func (_Blocktracker *BlocktrackerFilterer) ParseNewBlocksPerWindow(log types.Log) (*BlocktrackerNewBlocksPerWindow, error) { - event := new(BlocktrackerNewBlocksPerWindow) - if err := _Blocktracker.contract.UnpackLog(event, "NewBlocksPerWindow", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - // BlocktrackerNewL1BlockIterator is returned from FilterNewL1Block and is used to iterate over the raw logs and unpacked data for NewL1Block events raised by the Blocktracker contract. type BlocktrackerNewL1BlockIterator struct { Event *BlocktrackerNewL1Block // Event containing the contract specifics and raw log diff --git a/contracts-abi/clients/Oracle/Oracle.go b/contracts-abi/clients/Oracle/Oracle.go index 8eb9d3753..1c8bcab63 100644 --- a/contracts-abi/clients/Oracle/Oracle.go +++ b/contracts-abi/clients/Oracle/Oracle.go @@ -31,7 +31,7 @@ var ( // OracleMetaData contains all meta data concerning the Oracle contract. var OracleMetaData = &bind.MetaData{ - ABI: "[{\"type\":\"constructor\",\"inputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"fallback\",\"stateMutability\":\"payable\"},{\"type\":\"receive\",\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"UPGRADE_INTERFACE_VERSION\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"blockBuilderNameToAddress\",\"inputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"initialize\",\"inputs\":[{\"name\":\"_preConfContract\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_blockTrackerContract\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_owner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"owner\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"processBuilderCommitmentForBlockNumber\",\"inputs\":[{\"name\":\"commitmentIndex\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"blockNumber\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"builder\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"isSlash\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"residualBidPercentAfterDecay\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"proxiableUUID\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"renounceOwnership\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"transferOwnership\",\"inputs\":[{\"name\":\"newOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"upgradeToAndCall\",\"inputs\":[{\"name\":\"newImplementation\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"data\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"event\",\"name\":\"CommitmentProcessed\",\"inputs\":[{\"name\":\"commitmentHash\",\"type\":\"bytes32\",\"indexed\":false,\"internalType\":\"bytes32\"},{\"name\":\"isSlash\",\"type\":\"bool\",\"indexed\":false,\"internalType\":\"bool\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Initialized\",\"inputs\":[{\"name\":\"version\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"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\":\"Upgraded\",\"inputs\":[{\"name\":\"implementation\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"AddressEmptyCode\",\"inputs\":[{\"name\":\"target\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"ERC1967InvalidImplementation\",\"inputs\":[{\"name\":\"implementation\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"ERC1967NonPayable\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"FailedInnerCall\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidInitialization\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"NotInitializing\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"OwnableInvalidOwner\",\"inputs\":[{\"name\":\"owner\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"OwnableUnauthorizedAccount\",\"inputs\":[{\"name\":\"account\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"UUPSUnauthorizedCallContext\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"UUPSUnsupportedProxiableUUID\",\"inputs\":[{\"name\":\"slot\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]}]", + ABI: "[{\"type\":\"constructor\",\"inputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"fallback\",\"stateMutability\":\"payable\"},{\"type\":\"receive\",\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"blockBuilderNameToAddress\",\"inputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"initialize\",\"inputs\":[{\"name\":\"_preConfContract\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_blockTrackerContract\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_owner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"owner\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"processBuilderCommitmentForBlockNumber\",\"inputs\":[{\"name\":\"commitmentIndex\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"blockNumber\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"builder\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"isSlash\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"residualBidPercentAfterDecay\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"renounceOwnership\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"transferOwnership\",\"inputs\":[{\"name\":\"newOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"event\",\"name\":\"CommitmentProcessed\",\"inputs\":[{\"name\":\"commitmentHash\",\"type\":\"bytes32\",\"indexed\":false,\"internalType\":\"bytes32\"},{\"name\":\"isSlash\",\"type\":\"bool\",\"indexed\":false,\"internalType\":\"bool\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Initialized\",\"inputs\":[{\"name\":\"version\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OwnershipTransferred\",\"inputs\":[{\"name\":\"previousOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"newOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"InvalidInitialization\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"NotInitializing\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"OwnableInvalidOwner\",\"inputs\":[{\"name\":\"owner\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"OwnableUnauthorizedAccount\",\"inputs\":[{\"name\":\"account\",\"type\":\"address\",\"internalType\":\"address\"}]}]", } // OracleABI is the input ABI used to generate the binding from. @@ -520,17 +520,22 @@ func (it *OracleCommitmentProcessedIterator) Close() error { // OracleCommitmentProcessed represents a CommitmentProcessed event raised by the Oracle contract. type OracleCommitmentProcessed struct { - CommitmentHash [32]byte - IsSlash bool - Raw types.Log // Blockchain specific contextual infos + CommitmentIndex [32]byte + IsSlash bool + Raw types.Log // Blockchain specific contextual infos } // FilterCommitmentProcessed is a free log retrieval operation binding the contract event 0xddc1768a3a762a04e5fd3abea8ae3b60e23bcf290f4a032280e6a726611d41f5. // -// Solidity: event CommitmentProcessed(bytes32 commitmentHash, bool isSlash) -func (_Oracle *OracleFilterer) FilterCommitmentProcessed(opts *bind.FilterOpts) (*OracleCommitmentProcessedIterator, error) { +// Solidity: event CommitmentProcessed(bytes32 indexed commitmentIndex, bool isSlash) +func (_Oracle *OracleFilterer) FilterCommitmentProcessed(opts *bind.FilterOpts, commitmentIndex [][32]byte) (*OracleCommitmentProcessedIterator, error) { + + var commitmentIndexRule []interface{} + for _, commitmentIndexItem := range commitmentIndex { + commitmentIndexRule = append(commitmentIndexRule, commitmentIndexItem) + } - logs, sub, err := _Oracle.contract.FilterLogs(opts, "CommitmentProcessed") + logs, sub, err := _Oracle.contract.FilterLogs(opts, "CommitmentProcessed", commitmentIndexRule) if err != nil { return nil, err } @@ -539,10 +544,15 @@ func (_Oracle *OracleFilterer) FilterCommitmentProcessed(opts *bind.FilterOpts) // WatchCommitmentProcessed is a free log subscription operation binding the contract event 0xddc1768a3a762a04e5fd3abea8ae3b60e23bcf290f4a032280e6a726611d41f5. // -// Solidity: event CommitmentProcessed(bytes32 commitmentHash, bool isSlash) -func (_Oracle *OracleFilterer) WatchCommitmentProcessed(opts *bind.WatchOpts, sink chan<- *OracleCommitmentProcessed) (event.Subscription, error) { +// Solidity: event CommitmentProcessed(bytes32 indexed commitmentIndex, bool isSlash) +func (_Oracle *OracleFilterer) WatchCommitmentProcessed(opts *bind.WatchOpts, sink chan<- *OracleCommitmentProcessed, commitmentIndex [][32]byte) (event.Subscription, error) { + + var commitmentIndexRule []interface{} + for _, commitmentIndexItem := range commitmentIndex { + commitmentIndexRule = append(commitmentIndexRule, commitmentIndexItem) + } - logs, sub, err := _Oracle.contract.WatchLogs(opts, "CommitmentProcessed") + logs, sub, err := _Oracle.contract.WatchLogs(opts, "CommitmentProcessed", commitmentIndexRule) if err != nil { return nil, err } @@ -576,7 +586,7 @@ func (_Oracle *OracleFilterer) WatchCommitmentProcessed(opts *bind.WatchOpts, si // ParseCommitmentProcessed is a log parse operation binding the contract event 0xddc1768a3a762a04e5fd3abea8ae3b60e23bcf290f4a032280e6a726611d41f5. // -// Solidity: event CommitmentProcessed(bytes32 commitmentHash, bool isSlash) +// Solidity: event CommitmentProcessed(bytes32 indexed commitmentIndex, bool isSlash) func (_Oracle *OracleFilterer) ParseCommitmentProcessed(log types.Log) (*OracleCommitmentProcessed, error) { event := new(OracleCommitmentProcessed) if err := _Oracle.contract.UnpackLog(event, "CommitmentProcessed", log); err != nil { diff --git a/contracts/contracts/BidderRegistry.sol b/contracts/contracts/BidderRegistry.sol index 5b503c97a..3896e5570 100644 --- a/contracts/contracts/BidderRegistry.sol +++ b/contracts/contracts/BidderRegistry.sol @@ -95,6 +95,14 @@ contract BidderRegistry is uint256 amount ); + /// @dev Event emitted when a bidder moves their deposit from one window to another + event BidderMovedFunds( + address indexed bidder, + uint256 fromWindow, + uint256 toWindow, + uint256 amount + ); + /** * @dev Fallback function to revert all calls, ensuring no unintended interactions. */ @@ -202,9 +210,70 @@ contract BidderRegistry is emit BidderRegistered(msg.sender, newLockedFunds, window); } + /** + * @dev Move deposit from one window to another. + * @param fromWindow The window from which the deposit is being moved. + * @param toWindow The window to which the deposit is being moved. + */ + function moveDepositToWindow( + uint256 fromWindow, + uint256 toWindow + ) external nonReentrant { + require( + fromWindow < toWindow, + "fromWindow should be less than toWindow" + ); + uint256 currentWindow = blockTrackerContract.getCurrentWindow(); + require( + fromWindow < currentWindow, + "funds can only be moved after the window is settled" + ); + uint256 deposit = lockedFunds[msg.sender][fromWindow]; + require(deposit > 0, "deposit amount is zero"); + + lockedFunds[msg.sender][fromWindow] = 0; + lockedFunds[msg.sender][toWindow] += deposit; + + emit BidderMovedFunds(msg.sender, fromWindow, toWindow, deposit); + } + + /** + * @dev Deposit for n windows. + * @param window The window for which the deposit is being made. + * @param n The number of windows for which the deposit is being made. + */ + function depositForNWindows( + uint256 window, + uint16 n + ) external payable { + require(msg.value >= minDeposit * n, "Insufficient deposit"); + + if (!bidderRegistered[msg.sender]) { + bidderRegistered[msg.sender] = true; + } + + uint256 amountToDeposit = msg.value / n; + uint256 remainingAmount = msg.value % n; // to handle rounding issues + + for (uint16 i = 0; i < n; i++) { + uint256 windowIndex = window + i; + uint256 currentLockedFunds = lockedFunds[msg.sender][windowIndex]; + + uint256 newLockedFunds = currentLockedFunds + amountToDeposit; + if (i == n - 1) { + newLockedFunds += remainingAmount; // Add the remainder to the last window + } + + lockedFunds[msg.sender][windowIndex] = newLockedFunds; + maxBidPerBlock[msg.sender][windowIndex] = newLockedFunds / blocksPerWindow; + + emit BidderRegistered(msg.sender, newLockedFunds, windowIndex); + } + } /** * @dev Check the deposit of a bidder. * @param bidder The address of the bidder. + * @param window The window for which the deposit is being checked. * @return The deposited amount for the bidder. */ function getDeposit( @@ -217,8 +286,10 @@ contract BidderRegistry is /** * @dev Retrieve funds from a bidder's deposit (only callable by the pre-confirmations contract). * @dev reenterancy not necessary but still putting here for precaution + * @param windowToSettle The window for which the funds are being retrieved. * @param commitmentDigest is the Bid ID that allows us to identify the bid, and deposit * @param provider The address to transfer the retrieved funds to. + * @param residualBidPercentAfterDecay The residual bid percent after decay. */ function retrieveFunds( uint256 windowToSettle, @@ -267,6 +338,7 @@ contract BidderRegistry is /** * @dev Return funds to a bidder's deposit (only callable by the pre-confirmations contract). * @dev reenterancy not necessary but still putting here for precaution + * @param window The window for which the funds are being retrieved. * @param bidID is the Bid ID that allows us to identify the bid, and deposit */ function unlockFunds( diff --git a/contracts/contracts/BlockTracker.sol b/contracts/contracts/BlockTracker.sol index 1f537637e..c9f228656 100644 --- a/contracts/contracts/BlockTracker.sol +++ b/contracts/contracts/BlockTracker.sol @@ -19,9 +19,6 @@ contract BlockTracker is OwnableUpgradeable, UUPSUpgradeable { /// @dev Event emitted when a new window is created. event NewWindow(uint256 indexed window); - /// @dev Event emitted when the number of blocks per window is updated. - event NewBlocksPerWindow(uint256 blocksPerWindow); - uint256 public currentWindow; uint256 public blocksPerWindow; diff --git a/contracts/contracts/Oracle.sol b/contracts/contracts/Oracle.sol index f594b83a3..c550891c0 100644 --- a/contracts/contracts/Oracle.sol +++ b/contracts/contracts/Oracle.sol @@ -65,7 +65,7 @@ contract Oracle is OwnableUpgradeable, UUPSUpgradeable { } /// @dev Event emitted when a commitment is processed. - event CommitmentProcessed(bytes32 commitmentHash, bool isSlash); + event CommitmentProcessed(bytes32 indexed commitmentIndex, bool isSlash); // Function to receive and process the block data (this would be automated in a real-world scenario) /** diff --git a/contracts/test/BidderRegistryTest.sol b/contracts/test/BidderRegistryTest.sol index 73d192567..3713be633 100644 --- a/contracts/test/BidderRegistryTest.sol +++ b/contracts/test/BidderRegistryTest.sol @@ -337,4 +337,73 @@ contract BidderRegistryTest is Test { bidderRegistry.depositForSpecificWindow{value: 5 ether}(nextWindow); bidderRegistry.withdrawProtocolFee(payable(address(bidder))); } -} + + function test_MoveDepositToWindow() public { + uint256 currentWindow = blockTracker.getCurrentWindow(); + uint256 nextWindow = currentWindow + 1; + vm.prank(bidder); + bidderRegistry.depositForSpecificWindow{value: 1 ether}(currentWindow); + uint64 blockNumber = uint64(blocksPerWindow + 2); + blockTracker.recordL1Block(blockNumber, "test"); + + vm.prank(bidder); + bidderRegistry.moveDepositToWindow(currentWindow, nextWindow); + uint256 oldWindowDeposit = bidderRegistry.getDeposit(bidder, currentWindow); + uint256 newWindowDeposit = bidderRegistry.getDeposit(bidder, nextWindow); + assertEq(oldWindowDeposit, 0); + assertEq(newWindowDeposit, 1 ether); + } + + function testFail_MoveDepositToWindowUnregisteredBidder() public { + address unregisteredBidder = vm.addr(2); + vm.startPrank(unregisteredBidder); + bidderRegistry.moveDepositToWindow(1, 2); + } + + function testFail_MoveDepositToWindowNoDeposit() public { + uint256 currentWindow = blockTracker.getCurrentWindow(); + uint256 nextWindow = currentWindow + 1; + vm.startPrank(bidder); + bidderRegistry.moveDepositToWindow(currentWindow, nextWindow); + } + + function testFail_MoveDepositToWindowInvalidToWindow() public { + uint256 currentWindow = blockTracker.getCurrentWindow(); + uint256 previousWindow = currentWindow - 1; + vm.startPrank(bidder); + bidderRegistry.depositForSpecificWindow{value: 1 ether}(currentWindow); + bidderRegistry.moveDepositToWindow(currentWindow, previousWindow); + } + + function test_DepositForNWindows() public { + uint256 currentWindow = blockTracker.getCurrentWindow(); + uint16 n = 3; + uint256 depositAmount = minStake * n; + + vm.startPrank(bidder); + vm.expectEmit(true, false, false, true); + for (uint16 i = 0; i < n; i++) { + emit BidderRegistered(bidder, depositAmount / n, currentWindow + i); + } + + bidderRegistry.depositForNWindows{value: depositAmount}(currentWindow, n); + + for (uint16 i = 0; i < n; i++) { + uint256 lockedFunds = bidderRegistry.lockedFunds(bidder, currentWindow + i); + assertEq(lockedFunds, depositAmount / n); + + uint256 maxBid = bidderRegistry.maxBidPerBlock(bidder, currentWindow + i); + assertEq(maxBid, (depositAmount / n) / blocksPerWindow); + } + + bool isBidderRegistered = bidderRegistry.bidderRegistered(bidder); + assertEq(isBidderRegistered, true); + } + + function testFail_DepositForNWindows_InsufficientDeposit() public { + uint256 currentWindow = blockTracker.getCurrentWindow(); + uint16 n = 3; + + vm.startPrank(bidder); + bidderRegistry.depositForNWindows{value: (minStake * n) - 1}(currentWindow, n); +}} diff --git a/oracle/pkg/apiserver/dashboard.go b/oracle/pkg/apiserver/dashboard.go index 5af82af4f..cf5fd72a5 100644 --- a/oracle/pkg/apiserver/dashboard.go +++ b/oracle/pkg/apiserver/dashboard.go @@ -88,7 +88,7 @@ func (s *Service) configureDashboard() error { events.NewEventHandler( "CommitmentProcessed", func(upd *oracle.OracleCommitmentProcessed) { - cmt, err := s.store.Settlement(context.Background(), upd.CommitmentHash[:]) + cmt, err := s.store.Settlement(context.Background(), upd.CommitmentIndex[:]) if err != nil { s.logger.Error("failed to get settlement", "error", err) return diff --git a/p2p/gen/go/bidderapi/v1/bidderapi.pb.go b/p2p/gen/go/bidderapi/v1/bidderapi.pb.go index 796b344da..4c7bc3c3c 100644 --- a/p2p/gen/go/bidderapi/v1/bidderapi.pb.go +++ b/p2p/gen/go/bidderapi/v1/bidderapi.pb.go @@ -142,6 +142,108 @@ func (x *DepositResponse) GetWindowNumber() *wrapperspb.UInt64Value { return nil } +type AutoDepositResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + AmountsAndWindowNumbers []*AutoDeposit `protobuf:"bytes,1,rep,name=amounts_and_window_numbers,json=amountsAndWindowNumbers,proto3" json:"amounts_and_window_numbers,omitempty"` +} + +func (x *AutoDepositResponse) Reset() { + *x = AutoDepositResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_bidderapi_v1_bidderapi_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AutoDepositResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AutoDepositResponse) ProtoMessage() {} + +func (x *AutoDepositResponse) ProtoReflect() protoreflect.Message { + mi := &file_bidderapi_v1_bidderapi_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AutoDepositResponse.ProtoReflect.Descriptor instead. +func (*AutoDepositResponse) Descriptor() ([]byte, []int) { + return file_bidderapi_v1_bidderapi_proto_rawDescGZIP(), []int{2} +} + +func (x *AutoDepositResponse) GetAmountsAndWindowNumbers() []*AutoDeposit { + if x != nil { + return x.AmountsAndWindowNumbers + } + return nil +} + +type AutoDeposit struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Amount string `protobuf:"bytes,1,opt,name=amount,proto3" json:"amount,omitempty"` + WindowNumber *wrapperspb.UInt64Value `protobuf:"bytes,2,opt,name=window_number,json=windowNumber,proto3" json:"window_number,omitempty"` +} + +func (x *AutoDeposit) Reset() { + *x = AutoDeposit{} + if protoimpl.UnsafeEnabled { + mi := &file_bidderapi_v1_bidderapi_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AutoDeposit) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AutoDeposit) ProtoMessage() {} + +func (x *AutoDeposit) ProtoReflect() protoreflect.Message { + mi := &file_bidderapi_v1_bidderapi_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AutoDeposit.ProtoReflect.Descriptor instead. +func (*AutoDeposit) Descriptor() ([]byte, []int) { + return file_bidderapi_v1_bidderapi_proto_rawDescGZIP(), []int{3} +} + +func (x *AutoDeposit) GetAmount() string { + if x != nil { + return x.Amount + } + return "" +} + +func (x *AutoDeposit) GetWindowNumber() *wrapperspb.UInt64Value { + if x != nil { + return x.WindowNumber + } + return nil +} + type EmptyMessage struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -151,7 +253,7 @@ type EmptyMessage struct { func (x *EmptyMessage) Reset() { *x = EmptyMessage{} if protoimpl.UnsafeEnabled { - mi := &file_bidderapi_v1_bidderapi_proto_msgTypes[2] + mi := &file_bidderapi_v1_bidderapi_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -164,7 +266,7 @@ func (x *EmptyMessage) String() string { func (*EmptyMessage) ProtoMessage() {} func (x *EmptyMessage) ProtoReflect() protoreflect.Message { - mi := &file_bidderapi_v1_bidderapi_proto_msgTypes[2] + mi := &file_bidderapi_v1_bidderapi_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -177,7 +279,7 @@ func (x *EmptyMessage) ProtoReflect() protoreflect.Message { // Deprecated: Use EmptyMessage.ProtoReflect.Descriptor instead. func (*EmptyMessage) Descriptor() ([]byte, []int) { - return file_bidderapi_v1_bidderapi_proto_rawDescGZIP(), []int{2} + return file_bidderapi_v1_bidderapi_proto_rawDescGZIP(), []int{4} } type GetDepositRequest struct { @@ -191,7 +293,7 @@ type GetDepositRequest struct { func (x *GetDepositRequest) Reset() { *x = GetDepositRequest{} if protoimpl.UnsafeEnabled { - mi := &file_bidderapi_v1_bidderapi_proto_msgTypes[3] + mi := &file_bidderapi_v1_bidderapi_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -204,7 +306,7 @@ func (x *GetDepositRequest) String() string { func (*GetDepositRequest) ProtoMessage() {} func (x *GetDepositRequest) ProtoReflect() protoreflect.Message { - mi := &file_bidderapi_v1_bidderapi_proto_msgTypes[3] + mi := &file_bidderapi_v1_bidderapi_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -217,7 +319,7 @@ func (x *GetDepositRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetDepositRequest.ProtoReflect.Descriptor instead. func (*GetDepositRequest) Descriptor() ([]byte, []int) { - return file_bidderapi_v1_bidderapi_proto_rawDescGZIP(), []int{3} + return file_bidderapi_v1_bidderapi_proto_rawDescGZIP(), []int{5} } func (x *GetDepositRequest) GetWindowNumber() *wrapperspb.UInt64Value { @@ -238,7 +340,7 @@ type WithdrawRequest struct { func (x *WithdrawRequest) Reset() { *x = WithdrawRequest{} if protoimpl.UnsafeEnabled { - mi := &file_bidderapi_v1_bidderapi_proto_msgTypes[4] + mi := &file_bidderapi_v1_bidderapi_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -251,7 +353,7 @@ func (x *WithdrawRequest) String() string { func (*WithdrawRequest) ProtoMessage() {} func (x *WithdrawRequest) ProtoReflect() protoreflect.Message { - mi := &file_bidderapi_v1_bidderapi_proto_msgTypes[4] + mi := &file_bidderapi_v1_bidderapi_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -264,7 +366,7 @@ func (x *WithdrawRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use WithdrawRequest.ProtoReflect.Descriptor instead. func (*WithdrawRequest) Descriptor() ([]byte, []int) { - return file_bidderapi_v1_bidderapi_proto_rawDescGZIP(), []int{4} + return file_bidderapi_v1_bidderapi_proto_rawDescGZIP(), []int{6} } func (x *WithdrawRequest) GetWindowNumber() *wrapperspb.UInt64Value { @@ -286,7 +388,7 @@ type WithdrawResponse struct { func (x *WithdrawResponse) Reset() { *x = WithdrawResponse{} if protoimpl.UnsafeEnabled { - mi := &file_bidderapi_v1_bidderapi_proto_msgTypes[5] + mi := &file_bidderapi_v1_bidderapi_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -299,7 +401,7 @@ func (x *WithdrawResponse) String() string { func (*WithdrawResponse) ProtoMessage() {} func (x *WithdrawResponse) ProtoReflect() protoreflect.Message { - mi := &file_bidderapi_v1_bidderapi_proto_msgTypes[5] + mi := &file_bidderapi_v1_bidderapi_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -312,7 +414,7 @@ func (x *WithdrawResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use WithdrawResponse.ProtoReflect.Descriptor instead. func (*WithdrawResponse) Descriptor() ([]byte, []int) { - return file_bidderapi_v1_bidderapi_proto_rawDescGZIP(), []int{5} + return file_bidderapi_v1_bidderapi_proto_rawDescGZIP(), []int{7} } func (x *WithdrawResponse) GetAmount() string { @@ -344,7 +446,7 @@ type Bid struct { func (x *Bid) Reset() { *x = Bid{} if protoimpl.UnsafeEnabled { - mi := &file_bidderapi_v1_bidderapi_proto_msgTypes[6] + mi := &file_bidderapi_v1_bidderapi_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -357,7 +459,7 @@ func (x *Bid) String() string { func (*Bid) ProtoMessage() {} func (x *Bid) ProtoReflect() protoreflect.Message { - mi := &file_bidderapi_v1_bidderapi_proto_msgTypes[6] + mi := &file_bidderapi_v1_bidderapi_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -370,7 +472,7 @@ func (x *Bid) ProtoReflect() protoreflect.Message { // Deprecated: Use Bid.ProtoReflect.Descriptor instead. func (*Bid) Descriptor() ([]byte, []int) { - return file_bidderapi_v1_bidderapi_proto_rawDescGZIP(), []int{6} + return file_bidderapi_v1_bidderapi_proto_rawDescGZIP(), []int{8} } func (x *Bid) GetTxHashes() []string { @@ -429,7 +531,7 @@ type Commitment struct { func (x *Commitment) Reset() { *x = Commitment{} if protoimpl.UnsafeEnabled { - mi := &file_bidderapi_v1_bidderapi_proto_msgTypes[7] + mi := &file_bidderapi_v1_bidderapi_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -442,7 +544,7 @@ func (x *Commitment) String() string { func (*Commitment) ProtoMessage() {} func (x *Commitment) ProtoReflect() protoreflect.Message { - mi := &file_bidderapi_v1_bidderapi_proto_msgTypes[7] + mi := &file_bidderapi_v1_bidderapi_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -455,7 +557,7 @@ func (x *Commitment) ProtoReflect() protoreflect.Message { // Deprecated: Use Commitment.ProtoReflect.Descriptor instead. func (*Commitment) Descriptor() ([]byte, []int) { - return file_bidderapi_v1_bidderapi_proto_rawDescGZIP(), []int{7} + return file_bidderapi_v1_bidderapi_proto_rawDescGZIP(), []int{9} } func (x *Commitment) GetTxHashes() []string { @@ -619,7 +721,36 @@ var file_bidderapi_v1_bidderapi_proto_rawDesc = []byte{ 0x6d, 0x6f, 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, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x22, 0x3a, 0x20, - 0x31, 0x20, 0x7d, 0x22, 0x0e, 0x0a, 0x0c, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x4d, 0x65, 0x73, 0x73, + 0x31, 0x20, 0x7d, 0x22, 0xe3, 0x02, 0x0a, 0x13, 0x41, 0x75, 0x74, 0x6f, 0x44, 0x65, 0x70, 0x6f, + 0x73, 0x69, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x56, 0x0a, 0x1a, 0x61, + 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x5f, 0x61, 0x6e, 0x64, 0x5f, 0x77, 0x69, 0x6e, 0x64, 0x6f, + 0x77, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x19, 0x2e, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x41, + 0x75, 0x74, 0x6f, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, 0x17, 0x61, 0x6d, 0x6f, 0x75, + 0x6e, 0x74, 0x73, 0x41, 0x6e, 0x64, 0x57, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x4e, 0x75, 0x6d, 0x62, + 0x65, 0x72, 0x73, 0x3a, 0xf3, 0x01, 0x92, 0x41, 0xef, 0x01, 0x0a, 0x45, 0x2a, 0x14, 0x41, 0x75, + 0x74, 0x6f, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x20, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x32, 0x2d, 0x41, 0x75, 0x74, 0x6f, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x20, + 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x20, 0x66, 0x72, 0x6f, 0x6d, 0x20, 0x74, 0x68, 0x65, + 0x20, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x20, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, + 0x2e, 0x32, 0xa5, 0x01, 0x5b, 0x7b, 0x22, 0x61, 0x6d, 0x6f, 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, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x5f, 0x6e, + 0x75, 0x6d, 0x62, 0x65, 0x72, 0x22, 0x3a, 0x20, 0x31, 0x7d, 0x2c, 0x20, 0x7b, 0x22, 0x61, 0x6d, + 0x6f, 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, 0x77, + 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x22, 0x3a, 0x20, 0x32, + 0x7d, 0x2c, 0x20, 0x7b, 0x22, 0x61, 0x6d, 0x6f, 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, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x5f, 0x6e, 0x75, 0x6d, + 0x62, 0x65, 0x72, 0x22, 0x3a, 0x20, 0x33, 0x7d, 0x5d, 0x22, 0x68, 0x0a, 0x0b, 0x41, 0x75, 0x74, + 0x6f, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, + 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, + 0x12, 0x41, 0x0a, 0x0d, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, + 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, 0x49, 0x6e, 0x74, 0x36, 0x34, + 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0c, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x4e, 0x75, 0x6d, + 0x62, 0x65, 0x72, 0x22, 0x0e, 0x0a, 0x0c, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0xa9, 0x02, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x93, 0x02, 0x0a, 0x0d, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, @@ -854,7 +985,7 @@ var file_bidderapi_v1_bidderapi_proto_rawDesc = []byte{ 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, 0x90, 0x04, 0x0a, + 0x74, 0x63, 0x68, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x32, 0xff, 0x05, 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, @@ -867,47 +998,62 @@ var file_bidderapi_v1_bidderapi_proto_rawDesc = []byte{ 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x23, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x22, 0x1b, 0x2f, 0x76, 0x31, 0x2f, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x2f, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, - 0x2f, 0x7b, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x7d, 0x12, 0x6c, 0x0a, 0x0a, 0x47, 0x65, 0x74, - 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x12, 0x1f, 0x2e, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, - 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, - 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x62, 0x69, 0x64, 0x64, 0x65, + 0x2f, 0x7b, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x7d, 0x12, 0x78, 0x0a, 0x0b, 0x41, 0x75, 0x74, + 0x6f, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x12, 0x1c, 0x2e, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x18, 0x12, - 0x16, 0x2f, 0x76, 0x31, 0x2f, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x2f, 0x67, 0x65, 0x74, 0x5f, - 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x12, 0x6e, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x4d, 0x69, - 0x6e, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x12, 0x1a, 0x2e, 0x62, 0x69, 0x64, 0x64, 0x65, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x75, 0x74, 0x6f, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, + 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x28, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x22, 0x22, 0x20, 0x2f, 0x76, 0x31, 0x2f, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x2f, 0x61, 0x75, + 0x74, 0x6f, 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x2f, 0x7b, 0x61, 0x6d, 0x6f, 0x75, + 0x6e, 0x74, 0x7d, 0x12, 0x73, 0x0a, 0x11, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x41, 0x75, 0x74, + 0x6f, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 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, 0x1d, 0x2e, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, - 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x22, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1c, 0x12, 0x1a, 0x2f, 0x76, 0x31, - 0x2f, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x2f, 0x67, 0x65, 0x74, 0x5f, 0x6d, 0x69, 0x6e, 0x5f, - 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x12, 0x66, 0x0a, 0x08, 0x57, 0x69, 0x74, 0x68, 0x64, - 0x72, 0x61, 0x77, 0x12, 0x1d, 0x2e, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x2e, - 0x76, 0x31, 0x2e, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x76, - 0x31, 0x2e, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x1b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x15, 0x22, 0x13, 0x2f, 0x76, 0x31, 0x2f, - 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x2f, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x42, - 0xaa, 0x02, 0x92, 0x41, 0x72, 0x12, 0x70, 0x0a, 0x0a, 0x42, 0x69, 0x64, 0x64, 0x65, 0x72, 0x20, - 0x41, 0x50, 0x49, 0x2a, 0x55, 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, 0x36, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x67, 0x69, 0x74, 0x68, + 0x73, 0x61, 0x67, 0x65, 0x1a, 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, + 0x22, 0x26, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x22, 0x1e, 0x2f, 0x76, 0x31, 0x2f, 0x62, 0x69, + 0x64, 0x64, 0x65, 0x72, 0x2f, 0x63, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x5f, 0x61, 0x75, 0x74, 0x6f, + 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x12, 0x6c, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x44, + 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x12, 0x1f, 0x2e, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, + 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x18, 0x12, 0x16, + 0x2f, 0x76, 0x31, 0x2f, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x2f, 0x67, 0x65, 0x74, 0x5f, 0x64, + 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x12, 0x6e, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x4d, 0x69, 0x6e, + 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 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, 0x1d, 0x2e, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x2e, + 0x76, 0x31, 0x2e, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x22, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1c, 0x12, 0x1a, 0x2f, 0x76, 0x31, 0x2f, + 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x2f, 0x67, 0x65, 0x74, 0x5f, 0x6d, 0x69, 0x6e, 0x5f, 0x64, + 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x12, 0x66, 0x0a, 0x08, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, + 0x61, 0x77, 0x12, 0x1d, 0x2e, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x76, + 0x31, 0x2e, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x1e, 0x2e, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, + 0x2e, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x1b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x15, 0x22, 0x13, 0x2f, 0x76, 0x31, 0x2f, 0x62, + 0x69, 0x64, 0x64, 0x65, 0x72, 0x2f, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x42, 0xaa, + 0x02, 0x92, 0x41, 0x72, 0x12, 0x70, 0x0a, 0x0a, 0x42, 0x69, 0x64, 0x64, 0x65, 0x72, 0x20, 0x41, + 0x50, 0x49, 0x2a, 0x55, 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, 0x36, 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, 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, 0x40, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x65, 0x76, 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, 0x40, 0x67, 0x69, 0x74, - 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x65, 0x76, 0x2f, 0x6d, - 0x65, 0x76, 0x2d, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x2f, 0x70, 0x32, 0x70, 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, + 0x76, 0x2d, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x2f, 0x70, 0x32, 0x70, 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 ( @@ -922,40 +1068,48 @@ func file_bidderapi_v1_bidderapi_proto_rawDescGZIP() []byte { return file_bidderapi_v1_bidderapi_proto_rawDescData } -var file_bidderapi_v1_bidderapi_proto_msgTypes = make([]protoimpl.MessageInfo, 8) +var file_bidderapi_v1_bidderapi_proto_msgTypes = make([]protoimpl.MessageInfo, 10) var file_bidderapi_v1_bidderapi_proto_goTypes = []interface{}{ (*DepositRequest)(nil), // 0: bidderapi.v1.DepositRequest (*DepositResponse)(nil), // 1: bidderapi.v1.DepositResponse - (*EmptyMessage)(nil), // 2: bidderapi.v1.EmptyMessage - (*GetDepositRequest)(nil), // 3: bidderapi.v1.GetDepositRequest - (*WithdrawRequest)(nil), // 4: bidderapi.v1.WithdrawRequest - (*WithdrawResponse)(nil), // 5: bidderapi.v1.WithdrawResponse - (*Bid)(nil), // 6: bidderapi.v1.Bid - (*Commitment)(nil), // 7: bidderapi.v1.Commitment - (*wrapperspb.UInt64Value)(nil), // 8: google.protobuf.UInt64Value + (*AutoDepositResponse)(nil), // 2: bidderapi.v1.AutoDepositResponse + (*AutoDeposit)(nil), // 3: bidderapi.v1.AutoDeposit + (*EmptyMessage)(nil), // 4: bidderapi.v1.EmptyMessage + (*GetDepositRequest)(nil), // 5: bidderapi.v1.GetDepositRequest + (*WithdrawRequest)(nil), // 6: bidderapi.v1.WithdrawRequest + (*WithdrawResponse)(nil), // 7: bidderapi.v1.WithdrawResponse + (*Bid)(nil), // 8: bidderapi.v1.Bid + (*Commitment)(nil), // 9: bidderapi.v1.Commitment + (*wrapperspb.UInt64Value)(nil), // 10: google.protobuf.UInt64Value } var file_bidderapi_v1_bidderapi_proto_depIdxs = []int32{ - 8, // 0: bidderapi.v1.DepositRequest.window_number:type_name -> google.protobuf.UInt64Value - 8, // 1: bidderapi.v1.DepositRequest.block_number:type_name -> google.protobuf.UInt64Value - 8, // 2: bidderapi.v1.DepositResponse.window_number:type_name -> google.protobuf.UInt64Value - 8, // 3: bidderapi.v1.GetDepositRequest.window_number:type_name -> google.protobuf.UInt64Value - 8, // 4: bidderapi.v1.WithdrawRequest.window_number:type_name -> google.protobuf.UInt64Value - 8, // 5: bidderapi.v1.WithdrawResponse.window_number:type_name -> google.protobuf.UInt64Value - 6, // 6: bidderapi.v1.Bidder.SendBid:input_type -> bidderapi.v1.Bid - 0, // 7: bidderapi.v1.Bidder.Deposit:input_type -> bidderapi.v1.DepositRequest - 3, // 8: bidderapi.v1.Bidder.GetDeposit:input_type -> bidderapi.v1.GetDepositRequest - 2, // 9: bidderapi.v1.Bidder.GetMinDeposit:input_type -> bidderapi.v1.EmptyMessage - 4, // 10: bidderapi.v1.Bidder.Withdraw:input_type -> bidderapi.v1.WithdrawRequest - 7, // 11: bidderapi.v1.Bidder.SendBid:output_type -> bidderapi.v1.Commitment - 1, // 12: bidderapi.v1.Bidder.Deposit:output_type -> bidderapi.v1.DepositResponse - 1, // 13: bidderapi.v1.Bidder.GetDeposit:output_type -> bidderapi.v1.DepositResponse - 1, // 14: bidderapi.v1.Bidder.GetMinDeposit:output_type -> bidderapi.v1.DepositResponse - 5, // 15: bidderapi.v1.Bidder.Withdraw:output_type -> bidderapi.v1.WithdrawResponse - 11, // [11:16] is the sub-list for method output_type - 6, // [6:11] is the sub-list for method input_type - 6, // [6:6] is the sub-list for extension type_name - 6, // [6:6] is the sub-list for extension extendee - 0, // [0:6] is the sub-list for field type_name + 10, // 0: bidderapi.v1.DepositRequest.window_number:type_name -> google.protobuf.UInt64Value + 10, // 1: bidderapi.v1.DepositRequest.block_number:type_name -> google.protobuf.UInt64Value + 10, // 2: bidderapi.v1.DepositResponse.window_number:type_name -> google.protobuf.UInt64Value + 3, // 3: bidderapi.v1.AutoDepositResponse.amounts_and_window_numbers:type_name -> bidderapi.v1.AutoDeposit + 10, // 4: bidderapi.v1.AutoDeposit.window_number:type_name -> google.protobuf.UInt64Value + 10, // 5: bidderapi.v1.GetDepositRequest.window_number:type_name -> google.protobuf.UInt64Value + 10, // 6: bidderapi.v1.WithdrawRequest.window_number:type_name -> google.protobuf.UInt64Value + 10, // 7: bidderapi.v1.WithdrawResponse.window_number:type_name -> google.protobuf.UInt64Value + 8, // 8: bidderapi.v1.Bidder.SendBid:input_type -> bidderapi.v1.Bid + 0, // 9: bidderapi.v1.Bidder.Deposit:input_type -> bidderapi.v1.DepositRequest + 0, // 10: bidderapi.v1.Bidder.AutoDeposit:input_type -> bidderapi.v1.DepositRequest + 4, // 11: bidderapi.v1.Bidder.CancelAutoDeposit:input_type -> bidderapi.v1.EmptyMessage + 5, // 12: bidderapi.v1.Bidder.GetDeposit:input_type -> bidderapi.v1.GetDepositRequest + 4, // 13: bidderapi.v1.Bidder.GetMinDeposit:input_type -> bidderapi.v1.EmptyMessage + 6, // 14: bidderapi.v1.Bidder.Withdraw:input_type -> bidderapi.v1.WithdrawRequest + 9, // 15: bidderapi.v1.Bidder.SendBid:output_type -> bidderapi.v1.Commitment + 1, // 16: bidderapi.v1.Bidder.Deposit:output_type -> bidderapi.v1.DepositResponse + 2, // 17: bidderapi.v1.Bidder.AutoDeposit:output_type -> bidderapi.v1.AutoDepositResponse + 4, // 18: bidderapi.v1.Bidder.CancelAutoDeposit:output_type -> bidderapi.v1.EmptyMessage + 1, // 19: bidderapi.v1.Bidder.GetDeposit:output_type -> bidderapi.v1.DepositResponse + 1, // 20: bidderapi.v1.Bidder.GetMinDeposit:output_type -> bidderapi.v1.DepositResponse + 7, // 21: bidderapi.v1.Bidder.Withdraw:output_type -> bidderapi.v1.WithdrawResponse + 15, // [15:22] is the sub-list for method output_type + 8, // [8:15] is the sub-list for method input_type + 8, // [8:8] is the sub-list for extension type_name + 8, // [8:8] is the sub-list for extension extendee + 0, // [0:8] is the sub-list for field type_name } func init() { file_bidderapi_v1_bidderapi_proto_init() } @@ -989,7 +1143,7 @@ func file_bidderapi_v1_bidderapi_proto_init() { } } file_bidderapi_v1_bidderapi_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*EmptyMessage); i { + switch v := v.(*AutoDepositResponse); i { case 0: return &v.state case 1: @@ -1001,7 +1155,7 @@ func file_bidderapi_v1_bidderapi_proto_init() { } } file_bidderapi_v1_bidderapi_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetDepositRequest); i { + switch v := v.(*AutoDeposit); i { case 0: return &v.state case 1: @@ -1013,7 +1167,7 @@ func file_bidderapi_v1_bidderapi_proto_init() { } } file_bidderapi_v1_bidderapi_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*WithdrawRequest); i { + switch v := v.(*EmptyMessage); i { case 0: return &v.state case 1: @@ -1025,7 +1179,7 @@ func file_bidderapi_v1_bidderapi_proto_init() { } } file_bidderapi_v1_bidderapi_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*WithdrawResponse); i { + switch v := v.(*GetDepositRequest); i { case 0: return &v.state case 1: @@ -1037,7 +1191,7 @@ func file_bidderapi_v1_bidderapi_proto_init() { } } file_bidderapi_v1_bidderapi_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Bid); i { + switch v := v.(*WithdrawRequest); i { case 0: return &v.state case 1: @@ -1049,6 +1203,30 @@ func file_bidderapi_v1_bidderapi_proto_init() { } } file_bidderapi_v1_bidderapi_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*WithdrawResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_bidderapi_v1_bidderapi_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Bid); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_bidderapi_v1_bidderapi_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Commitment); i { case 0: return &v.state @@ -1067,7 +1245,7 @@ func file_bidderapi_v1_bidderapi_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_bidderapi_v1_bidderapi_proto_rawDesc, NumEnums: 0, - NumMessages: 8, + NumMessages: 10, NumExtensions: 0, NumServices: 1, }, diff --git a/p2p/gen/go/bidderapi/v1/bidderapi.pb.gw.go b/p2p/gen/go/bidderapi/v1/bidderapi.pb.gw.go index 32da4ca38..dd5d996d9 100644 --- a/p2p/gen/go/bidderapi/v1/bidderapi.pb.gw.go +++ b/p2p/gen/go/bidderapi/v1/bidderapi.pb.gw.go @@ -122,6 +122,94 @@ func local_request_Bidder_Deposit_0(ctx context.Context, marshaler runtime.Marsh } +var ( + filter_Bidder_AutoDeposit_0 = &utilities.DoubleArray{Encoding: map[string]int{"amount": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} +) + +func request_Bidder_AutoDeposit_0(ctx context.Context, marshaler runtime.Marshaler, client BidderClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq DepositRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["amount"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "amount") + } + + protoReq.Amount, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "amount", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Bidder_AutoDeposit_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.AutoDeposit(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Bidder_AutoDeposit_0(ctx context.Context, marshaler runtime.Marshaler, server BidderServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq DepositRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["amount"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "amount") + } + + protoReq.Amount, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "amount", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Bidder_AutoDeposit_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.AutoDeposit(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Bidder_CancelAutoDeposit_0(ctx context.Context, marshaler runtime.Marshaler, client BidderClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq EmptyMessage + var metadata runtime.ServerMetadata + + msg, err := client.CancelAutoDeposit(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Bidder_CancelAutoDeposit_0(ctx context.Context, marshaler runtime.Marshaler, server BidderServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq EmptyMessage + var metadata runtime.ServerMetadata + + msg, err := server.CancelAutoDeposit(ctx, &protoReq) + return msg, metadata, err + +} + var ( filter_Bidder_GetDeposit_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} ) @@ -250,6 +338,56 @@ func RegisterBidderHandlerServer(ctx context.Context, mux *runtime.ServeMux, ser }) + mux.Handle("POST", pattern_Bidder_AutoDeposit_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/bidderapi.v1.Bidder/AutoDeposit", runtime.WithHTTPPathPattern("/v1/bidder/auto_deposit/{amount}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Bidder_AutoDeposit_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_Bidder_AutoDeposit_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_Bidder_CancelAutoDeposit_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/bidderapi.v1.Bidder/CancelAutoDeposit", runtime.WithHTTPPathPattern("/v1/bidder/cancel_auto_deposit")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Bidder_CancelAutoDeposit_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_Bidder_CancelAutoDeposit_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Bidder_GetDeposit_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -410,6 +548,50 @@ func RegisterBidderHandlerClient(ctx context.Context, mux *runtime.ServeMux, cli }) + mux.Handle("POST", pattern_Bidder_AutoDeposit_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/bidderapi.v1.Bidder/AutoDeposit", runtime.WithHTTPPathPattern("/v1/bidder/auto_deposit/{amount}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Bidder_AutoDeposit_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_Bidder_AutoDeposit_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_Bidder_CancelAutoDeposit_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/bidderapi.v1.Bidder/CancelAutoDeposit", runtime.WithHTTPPathPattern("/v1/bidder/cancel_auto_deposit")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Bidder_CancelAutoDeposit_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_Bidder_CancelAutoDeposit_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Bidder_GetDeposit_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -484,6 +666,10 @@ var ( pattern_Bidder_Deposit_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"v1", "bidder", "deposit", "amount"}, "")) + pattern_Bidder_AutoDeposit_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"v1", "bidder", "auto_deposit", "amount"}, "")) + + pattern_Bidder_CancelAutoDeposit_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "bidder", "cancel_auto_deposit"}, "")) + pattern_Bidder_GetDeposit_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "bidder", "get_deposit"}, "")) pattern_Bidder_GetMinDeposit_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "bidder", "get_min_deposit"}, "")) @@ -496,6 +682,10 @@ var ( forward_Bidder_Deposit_0 = runtime.ForwardResponseMessage + forward_Bidder_AutoDeposit_0 = runtime.ForwardResponseMessage + + forward_Bidder_CancelAutoDeposit_0 = runtime.ForwardResponseMessage + forward_Bidder_GetDeposit_0 = runtime.ForwardResponseMessage forward_Bidder_GetMinDeposit_0 = runtime.ForwardResponseMessage diff --git a/p2p/gen/go/bidderapi/v1/bidderapi_grpc.pb.go b/p2p/gen/go/bidderapi/v1/bidderapi_grpc.pb.go index 6af2bd228..ef5e02b38 100644 --- a/p2p/gen/go/bidderapi/v1/bidderapi_grpc.pb.go +++ b/p2p/gen/go/bidderapi/v1/bidderapi_grpc.pb.go @@ -19,11 +19,13 @@ import ( const _ = grpc.SupportPackageIsVersion8 const ( - Bidder_SendBid_FullMethodName = "/bidderapi.v1.Bidder/SendBid" - Bidder_Deposit_FullMethodName = "/bidderapi.v1.Bidder/Deposit" - Bidder_GetDeposit_FullMethodName = "/bidderapi.v1.Bidder/GetDeposit" - Bidder_GetMinDeposit_FullMethodName = "/bidderapi.v1.Bidder/GetMinDeposit" - Bidder_Withdraw_FullMethodName = "/bidderapi.v1.Bidder/Withdraw" + Bidder_SendBid_FullMethodName = "/bidderapi.v1.Bidder/SendBid" + Bidder_Deposit_FullMethodName = "/bidderapi.v1.Bidder/Deposit" + Bidder_AutoDeposit_FullMethodName = "/bidderapi.v1.Bidder/AutoDeposit" + Bidder_CancelAutoDeposit_FullMethodName = "/bidderapi.v1.Bidder/CancelAutoDeposit" + Bidder_GetDeposit_FullMethodName = "/bidderapi.v1.Bidder/GetDeposit" + Bidder_GetMinDeposit_FullMethodName = "/bidderapi.v1.Bidder/GetMinDeposit" + Bidder_Withdraw_FullMethodName = "/bidderapi.v1.Bidder/Withdraw" ) // BidderClient is the client API for Bidder service. @@ -38,6 +40,14 @@ type BidderClient interface { // // Deposit is called by the bidder node to add deposit in the bidder registry. Deposit(ctx context.Context, in *DepositRequest, opts ...grpc.CallOption) (*DepositResponse, error) + // AutoDeposit + // + // AutoDeposit is called by the bidder node to add deposit in the bidder registry and move funds automatily from one window to another. + AutoDeposit(ctx context.Context, in *DepositRequest, opts ...grpc.CallOption) (*AutoDepositResponse, error) + // CancelAutoDeposit + // + // CancelAutoDeposit is called by the bidder node to cancel the auto deposit. + CancelAutoDeposit(ctx context.Context, in *EmptyMessage, opts ...grpc.CallOption) (*EmptyMessage, error) // GetDeposit // // GetDeposit is called by the bidder to get its deposit in the bidder registry. @@ -103,6 +113,26 @@ func (c *bidderClient) Deposit(ctx context.Context, in *DepositRequest, opts ... return out, nil } +func (c *bidderClient) AutoDeposit(ctx context.Context, in *DepositRequest, opts ...grpc.CallOption) (*AutoDepositResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(AutoDepositResponse) + err := c.cc.Invoke(ctx, Bidder_AutoDeposit_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *bidderClient) CancelAutoDeposit(ctx context.Context, in *EmptyMessage, opts ...grpc.CallOption) (*EmptyMessage, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(EmptyMessage) + err := c.cc.Invoke(ctx, Bidder_CancelAutoDeposit_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *bidderClient) GetDeposit(ctx context.Context, in *GetDepositRequest, opts ...grpc.CallOption) (*DepositResponse, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(DepositResponse) @@ -145,6 +175,14 @@ type BidderServer interface { // // Deposit is called by the bidder node to add deposit in the bidder registry. Deposit(context.Context, *DepositRequest) (*DepositResponse, error) + // AutoDeposit + // + // AutoDeposit is called by the bidder node to add deposit in the bidder registry and move funds automatily from one window to another. + AutoDeposit(context.Context, *DepositRequest) (*AutoDepositResponse, error) + // CancelAutoDeposit + // + // CancelAutoDeposit is called by the bidder node to cancel the auto deposit. + CancelAutoDeposit(context.Context, *EmptyMessage) (*EmptyMessage, error) // GetDeposit // // GetDeposit is called by the bidder to get its deposit in the bidder registry. @@ -170,6 +208,12 @@ func (UnimplementedBidderServer) SendBid(*Bid, Bidder_SendBidServer) error { func (UnimplementedBidderServer) Deposit(context.Context, *DepositRequest) (*DepositResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Deposit not implemented") } +func (UnimplementedBidderServer) AutoDeposit(context.Context, *DepositRequest) (*AutoDepositResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method AutoDeposit not implemented") +} +func (UnimplementedBidderServer) CancelAutoDeposit(context.Context, *EmptyMessage) (*EmptyMessage, error) { + return nil, status.Errorf(codes.Unimplemented, "method CancelAutoDeposit not implemented") +} func (UnimplementedBidderServer) GetDeposit(context.Context, *GetDepositRequest) (*DepositResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetDeposit not implemented") } @@ -231,6 +275,42 @@ func _Bidder_Deposit_Handler(srv interface{}, ctx context.Context, dec func(inte return interceptor(ctx, in, info, handler) } +func _Bidder_AutoDeposit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DepositRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BidderServer).AutoDeposit(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Bidder_AutoDeposit_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BidderServer).AutoDeposit(ctx, req.(*DepositRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Bidder_CancelAutoDeposit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(EmptyMessage) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BidderServer).CancelAutoDeposit(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Bidder_CancelAutoDeposit_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BidderServer).CancelAutoDeposit(ctx, req.(*EmptyMessage)) + } + return interceptor(ctx, in, info, handler) +} + func _Bidder_GetDeposit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(GetDepositRequest) if err := dec(in); err != nil { @@ -296,6 +376,14 @@ var Bidder_ServiceDesc = grpc.ServiceDesc{ MethodName: "Deposit", Handler: _Bidder_Deposit_Handler, }, + { + MethodName: "AutoDeposit", + Handler: _Bidder_AutoDeposit_Handler, + }, + { + MethodName: "CancelAutoDeposit", + Handler: _Bidder_CancelAutoDeposit_Handler, + }, { MethodName: "GetDeposit", Handler: _Bidder_GetDeposit_Handler, diff --git a/p2p/gen/openapi/bidderapi/v1/bidderapi.swagger.yaml b/p2p/gen/openapi/bidderapi/v1/bidderapi.swagger.yaml index 0fbdabdbd..b21327382 100644 --- a/p2p/gen/openapi/bidderapi/v1/bidderapi.swagger.yaml +++ b/p2p/gen/openapi/bidderapi/v1/bidderapi.swagger.yaml @@ -10,6 +10,38 @@ consumes: produces: - application/json paths: + /v1/bidder/auto_deposit/{amount}: + post: + summary: AutoDeposit + description: AutoDeposit is called by the bidder node to add deposit in the bidder registry and move funds automatily from one window to another. + operationId: Bidder_AutoDeposit + responses: + "200": + description: A successful response. + schema: + $ref: '#/definitions/v1AutoDepositResponse' + default: + description: An unexpected error response. + schema: + $ref: '#/definitions/googlerpcStatus' + parameters: + - name: amount + description: Amount of ETH to be deposited in wei. + in: path + required: true + type: string + - name: windowNumber + description: Optional window number for querying deposit. If not specified, the current block number is used. + in: query + required: false + type: string + format: uint64 + - name: blockNumber + description: Optional block number for querying deposit. If specified, calculate window based on this block number. + in: query + required: false + type: string + format: uint64 /v1/bidder/bid: post: summary: SendBid @@ -37,6 +69,20 @@ paths: required: true schema: $ref: '#/definitions/bidderapiv1Bid' + /v1/bidder/cancel_auto_deposit: + post: + summary: CancelAutoDeposit + description: CancelAutoDeposit is called by the bidder node to cancel the auto deposit. + operationId: Bidder_CancelAutoDeposit + responses: + "200": + description: A successful response. + schema: + $ref: '#/definitions/bidderapiv1EmptyMessage' + default: + description: An unexpected error response. + schema: + $ref: '#/definitions/googlerpcStatus' /v1/bidder/deposit/{amount}: post: summary: Deposit @@ -126,6 +172,14 @@ paths: type: string format: uint64 definitions: + bidderapiv1AutoDeposit: + type: object + properties: + amount: + type: string + windowNumber: + type: string + format: uint64 bidderapiv1Bid: type: object example: @@ -163,6 +217,8 @@ definitions: - txHashes - amount - blockNumber + bidderapiv1EmptyMessage: + type: object googlerpcStatus: type: object properties: @@ -182,6 +238,23 @@ definitions: '@type': type: string additionalProperties: {} + v1AutoDepositResponse: + type: object + example: + - amount: "1000000000000000000" + window_number: 1 + - amount: "1000000000000000000" + window_number: 2 + - amount: "1000000000000000000" + window_number: 3 + properties: + amountsAndWindowNumbers: + type: array + items: + type: object + $ref: '#/definitions/bidderapiv1AutoDeposit' + description: AutoDeposit deposit from the bidder registry. + title: AutoDeposit response v1Commitment: type: object properties: diff --git a/p2p/integrationtest/real-bidder/main.go b/p2p/integrationtest/real-bidder/main.go index 7d00a1709..458e8fd17 100644 --- a/p2p/integrationtest/real-bidder/main.go +++ b/p2p/integrationtest/real-bidder/main.go @@ -148,34 +148,60 @@ func main() { wg := sync.WaitGroup{} - wg.Add(1) - go func() { - ticker := time.NewTicker(10 * time.Minute) - defer ticker.Stop() + // wg.Add(1) + // go func() { + // ticker := time.NewTicker(10 * time.Minute) + // defer ticker.Stop() + + // minDepositResp, err := bidderClient.GetMinDeposit(context.Background(), &pb.EmptyMessage{}) + // if err != nil { + // logger.Error("failed to get min deposit", "err", err) + // return + // } + + // minDeposit, set := big.NewInt(0).SetString(minDepositResp.Amount, 10) + // if !set { + // logger.Error("failed to parse min deposit amount") + // return + // } + + // minDepositAmt := new(big.Int).Mul(minDeposit, big.NewInt(10)) + + // for { + // err = checkOrDeposit(bidderClient, logger, minDepositAmt) + // if err != nil { + // logger.Error("failed to check or stake", "err", err) + // } + // <-ticker.C + // } + // }() + + minDepositResp, err := bidderClient.GetMinDeposit(context.Background(), &pb.EmptyMessage{}) + if err != nil { + logger.Error("failed to get min deposit", "err", err) + return + } - minDepositResp, err := bidderClient.GetMinDeposit(context.Background(), &pb.EmptyMessage{}) - if err != nil { - logger.Error("failed to get min deposit", "err", err) - return - } + minDeposit, set := big.NewInt(0).SetString(minDepositResp.Amount, 10) + if !set { + logger.Error("failed to parse min deposit amount") + return + } - minDeposit, set := big.NewInt(0).SetString(minDepositResp.Amount, 10) - if !set { - logger.Error("failed to parse min deposit amount") - return - } + minDepositAmt := new(big.Int).Mul(minDeposit, big.NewInt(10)) - minDepositAmt := new(big.Int).Mul(minDeposit, big.NewInt(10)) - - for { - err = checkOrDeposit(bidderClient, logger, minDepositAmt) - if err != nil { - logger.Error("failed to check or stake", "err", err) - } - <-ticker.C - } - }() + minDepositAmt = new(big.Int).Mul(minDepositAmt, big.NewInt(3)) + resp, err := bidderClient.AutoDeposit(context.Background(), &pb.DepositRequest{ + Amount: minDepositAmt.String(), + }) + if err != nil { + logger.Error("failed to auto deposit", "err", err) + return + } + for _, v := range resp.AmountsAndWindowNumbers { + logger.Info("auto deposit", "amount", v.Amount, "window", v.WindowNumber) + } type blockWithTxns struct { blockNum int64 txns []string diff --git a/p2p/pkg/depositmanager/autodeposit.go b/p2p/pkg/depositmanager/autodeposit.go new file mode 100644 index 000000000..6dcbb4e7a --- /dev/null +++ b/p2p/pkg/depositmanager/autodeposit.go @@ -0,0 +1,142 @@ +package depositmanager + +import ( + "context" + "fmt" + "log/slog" + "math/big" + + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/core/types" + blocktracker "github.com/primev/mev-commit/contracts-abi/clients/BlockTracker" + bidderapiv1 "github.com/primev/mev-commit/p2p/gen/go/bidderapi/v1" + "github.com/primev/mev-commit/x/contracts/events" + "golang.org/x/sync/errgroup" +) + +type OptsGetter func(context.Context) (*bind.TransactOpts, error) + +type BidderRegistryContract interface { + MoveDepositToWindow(opts *bind.TransactOpts, fromWindow *big.Int, toWindow *big.Int) (*types.Transaction, error) +} + +type AutoDepositTracker struct { + deposits map[uint64]bool + windowChan chan *blocktracker.BlocktrackerNewWindow + eventMgr events.EventManager + isWorking bool + brContract BidderRegistryContract + optsGetter OptsGetter + logger *slog.Logger + cancelFunc context.CancelFunc +} + +func NewAutoDepositTracker( + evtMgr events.EventManager, + brContract BidderRegistryContract, + optsGetter OptsGetter, + logger *slog.Logger, +) *AutoDepositTracker { + return &AutoDepositTracker{ + deposits: make(map[uint64]bool), + eventMgr: evtMgr, + brContract: brContract, + optsGetter: optsGetter, + windowChan: make(chan *blocktracker.BlocktrackerNewWindow, 1), + logger: logger, + } +} + +func (adt *AutoDepositTracker) DoAutoMoveToAnotherWindow(ads []*bidderapiv1.AutoDeposit) <-chan struct{} { + if adt.isWorking { + return nil + } + adt.isWorking = true + + for _, ad := range ads { + adt.deposits[ad.WindowNumber.Value] = true + } + + doneChan := make(chan struct{}) + + eg, egCtx := errgroup.WithContext(context.Background()) + egCtx, cancel := context.WithCancel(egCtx) + adt.cancelFunc = cancel + + evt := events.NewEventHandler( + "NewWindow", + func(update *blocktracker.BlocktrackerNewWindow) { + adt.logger.Info( + "new window event", + "window", update.Window, + ) + select { + case <-egCtx.Done(): + case adt.windowChan <- update: + } + }, + ) + + sub, err := adt.eventMgr.Subscribe(evt) + if err != nil { + close(doneChan) + return doneChan + } + + eg.Go(func() error { + defer sub.Unsubscribe() + + select { + case <-egCtx.Done(): + adt.logger.Info("event subscription context done") + return nil + case err := <-sub.Err(): + return fmt.Errorf("error in event subscription: %w", err) + } + }) + + eg.Go(func() error { + for { + select { + case <-egCtx.Done(): + adt.logger.Info("context done") + return nil + case window := <-adt.windowChan: + // logic for 3 windows for deposit + fromWindow := new(big.Int).Sub(window.Window, big.NewInt(1)) + if _, ok := adt.deposits[fromWindow.Uint64()]; !ok { + continue + } + toWindow := new(big.Int).Add(window.Window, big.NewInt(1)) + + opts, err := adt.optsGetter(egCtx) + if err != nil { + return err + } + txn, err := adt.brContract.MoveDepositToWindow(opts, fromWindow, toWindow) + if err != nil { + return err + } + adt.logger.Info("move deposit to window", "hash", txn.Hash(), "from", fromWindow, "to", toWindow) + delete(adt.deposits, fromWindow.Uint64()) + adt.deposits[toWindow.Uint64()] = true + } + } + }) + + go func() { + defer close(doneChan) + if err := eg.Wait(); err != nil { + adt.logger.Error("error in errgroup", "err", err) + } + adt.isWorking = false + }() + + return doneChan +} + +func (adt *AutoDepositTracker) Stop() { + if adt.cancelFunc != nil { + adt.cancelFunc() + } +} diff --git a/p2p/pkg/node/node.go b/p2p/pkg/node/node.go index 51d0286c3..827269245 100644 --- a/p2p/pkg/node/node.go +++ b/p2p/pkg/node/node.go @@ -435,6 +435,13 @@ func NewNode(opts *Options) (*Node, error) { srv.RegisterMetricsCollectors(preconfProto.Metrics()...) + autoDeposit := depositmanager.NewAutoDepositTracker( + evtMgr, + bidderRegistry, + optsGetter, + opts.Logger.With("component", "auto_deposit_tracker"), + ) + bidderAPI := bidderapi.NewService( opts.KeySigner.GetAddress(), blocksPerWindow, @@ -444,6 +451,7 @@ func NewNode(opts *Options) (*Node, error) { validator, monitor, optsGetter, + autoDeposit, opts.Logger.With("component", "bidderapi"), ) bidderapiv1.RegisterBidderServer(grpcServer, bidderAPI) diff --git a/p2p/pkg/rpc/bidder/service.go b/p2p/pkg/rpc/bidder/service.go index 6c5d99185..40931dbb4 100644 --- a/p2p/pkg/rpc/bidder/service.go +++ b/p2p/pkg/rpc/bidder/service.go @@ -29,6 +29,7 @@ type Service struct { blockTrackerContract BlockTrackerContract watcher TxWatcher optsGetter OptsGetter + autoDepositTracker AutoDepositTracker logger *slog.Logger metrics *metrics validator *protovalidate.Validator @@ -43,6 +44,7 @@ func NewService( validator *protovalidate.Validator, watcher TxWatcher, optsGetter OptsGetter, + autoDepositTracker AutoDepositTracker, logger *slog.Logger, ) *Service { return &Service{ @@ -55,16 +57,23 @@ func NewService( optsGetter: optsGetter, logger: logger, metrics: newMetrics(), + autoDepositTracker: autoDepositTracker, validator: validator, } } +type AutoDepositTracker interface { + DoAutoMoveToAnotherWindow([]*bidderapiv1.AutoDeposit) <-chan struct{} + Stop() +} + type PreconfSender interface { SendBid(context.Context, string, string, int64, int64, int64) (chan *preconfirmationv1.PreConfirmation, error) } type BidderRegistryContract interface { DepositForSpecificWindow(*bind.TransactOpts, *big.Int) (*types.Transaction, error) + DepositForNWindows(*bind.TransactOpts, *big.Int, uint16) (*types.Transaction, error) WithdrawBidderAmountFromWindow(*bind.TransactOpts, common.Address, *big.Int) (*types.Transaction, error) GetDeposit(*bind.CallOpts, common.Address, *big.Int) (*big.Int, error) MinDeposit(*bind.CallOpts) (*big.Int, error) @@ -316,3 +325,83 @@ func (s *Service) Withdraw( return nil, status.Errorf(codes.Internal, "missing log for withdrawal") } + +func (s *Service) AutoDeposit( + ctx context.Context, + r *bidderapiv1.DepositRequest, +) (*bidderapiv1.AutoDepositResponse, error) { + err := s.validator.Validate(r) + if err != nil { + return nil, status.Errorf(codes.InvalidArgument, "validating auto deposit request: %v", err) + } + + currentWindow, err := s.blockTrackerContract.GetCurrentWindow() + if err != nil { + return nil, status.Errorf(codes.Internal, "getting current window: %v", err) + } + + windowToDeposit, err := s.calculateWindowToDeposit(ctx, r, currentWindow.Uint64()) + if err != nil { + return nil, status.Errorf(codes.InvalidArgument, "calculating window to deposit: %v", err) + } + + amount, success := big.NewInt(0).SetString(r.Amount, 10) + if !success { + return nil, status.Errorf(codes.InvalidArgument, "parsing amount: %v", r.Amount) + } + + opts, err := s.optsGetter(ctx) + if err != nil { + return nil, status.Errorf(codes.Internal, "getting transact opts: %v", err) + } + opts.Value = amount + + // Deposit for 3 windows + tx, err := s.registryContract.DepositForNWindows(opts, windowToDeposit, 3) + if err != nil { + return nil, status.Errorf(codes.Internal, "deposit: %v", err) + } + + receipt, err := s.watcher.WaitForReceipt(ctx, tx) + if err != nil { + return nil, status.Errorf(codes.Internal, "waiting for receipt: %v", err) + } + + if receipt.Status != types.ReceiptStatusSuccessful { + return nil, status.Errorf(codes.Internal, "receipt status: %v", receipt.Status) + } + + var ads []*bidderapiv1.AutoDeposit + + for _, log := range receipt.Logs { + if registration, err := s.registryContract.ParseBidderRegistered(*log); err == nil { + s.logger.Info("deposit successful", "amount", registration.DepositedAmount, "window", registration.WindowNumber) + ads = append(ads, &bidderapiv1.AutoDeposit{ + Amount: registration.DepositedAmount.String(), + WindowNumber: wrapperspb.UInt64(registration.WindowNumber.Uint64()), + }) + } + } + + if len(ads) > 0 { + s.autoDepositTracker.DoAutoMoveToAnotherWindow(ads) + return &bidderapiv1.AutoDepositResponse{AmountsAndWindowNumbers: ads}, nil + } + + s.logger.Error( + "deposit successful but missing log", + "txHash", receipt.TxHash.Hex(), + "window", windowToDeposit, + "logs", receipt.Logs, + ) + + return nil, status.Errorf(codes.Internal, "missing log for deposit") +} + +func (s *Service) CancelDeposit( + ctx context.Context, + _ *bidderapiv1.EmptyMessage, +) (*bidderapiv1.EmptyMessage, error) { + s.autoDepositTracker.Stop() + return &bidderapiv1.EmptyMessage{}, nil +} diff --git a/p2p/pkg/rpc/bidder/service_test.go b/p2p/pkg/rpc/bidder/service_test.go index 710c2e4cc..9094dde2a 100644 --- a/p2p/pkg/rpc/bidder/service_test.go +++ b/p2p/pkg/rpc/bidder/service_test.go @@ -88,6 +88,11 @@ func (t *testRegistryContract) DepositForSpecificWindow(opts *bind.TransactOpts, return types.NewTransaction(1, common.Address{}, nil, 0, nil, nil), nil } +func (t *testRegistryContract) DepositForNWindows(opts *bind.TransactOpts, _ *big.Int, _ uint16) (*types.Transaction, error) { + t.deposit = opts.Value + return types.NewTransaction(1, common.Address{}, nil, 0, nil, nil), nil +} + func (t *testRegistryContract) WithdrawBidderAmountFromWindow( opts *bind.TransactOpts, address common.Address, @@ -118,6 +123,24 @@ func (t *testRegistryContract) ParseBidderWithdrawal(_ types.Log) (*bidderregist }, nil } +type testAutoDepositTracker struct { + deposits map[uint64]bool +} + +func (t *testAutoDepositTracker) DoAutoMoveToAnotherWindow(ads []*bidderapiv1.AutoDeposit) <-chan struct{} { + for _, ad := range ads { + t.deposits[ad.WindowNumber.Value] = true + } + + doneChan := make(chan struct{}) + close(doneChan) + + return doneChan +} + +func (t *testAutoDepositTracker) Stop() { +} + type testTxWatcher struct { nonce int } @@ -162,6 +185,7 @@ func startServer(t *testing.T) bidderapiv1.BidderClient { registryContract := &testRegistryContract{minDeposit: big.NewInt(100000000000000000)} sender := &testSender{noOfPreconfs: 2} blockTrackerContract := &testBlockTrackerContract{blocksPerWindow: 64, blockNumberToWinner: make(map[uint64]common.Address)} + testAutoDepositTracker := &testAutoDepositTracker{deposits: make(map[uint64]bool)} srvImpl := bidderapi.NewService( owner, blockTrackerContract.blocksPerWindow, @@ -176,6 +200,7 @@ func startServer(t *testing.T) bidderapiv1.BidderClient { Context: ctx, }, nil }, + testAutoDepositTracker, logger, ) diff --git a/p2p/rpc/bidderapi/v1/bidderapi.proto b/p2p/rpc/bidderapi/v1/bidderapi.proto index 77391c04c..17675e5bf 100644 --- a/p2p/rpc/bidderapi/v1/bidderapi.proto +++ b/p2p/rpc/bidderapi/v1/bidderapi.proto @@ -34,6 +34,21 @@ service Bidder { rpc Deposit(DepositRequest) returns (DepositResponse) { option (google.api.http) = {post: "/v1/bidder/deposit/{amount}"}; } + + // AutoDeposit + // + // AutoDeposit is called by the bidder node to add deposit in the bidder registry and move funds automatily from one window to another. + rpc AutoDeposit(DepositRequest) returns (AutoDepositResponse) { + option (google.api.http) = {post: "/v1/bidder/auto_deposit/{amount}"}; + } + + // CancelAutoDeposit + // + // CancelAutoDeposit is called by the bidder node to cancel the auto deposit. + rpc CancelAutoDeposit(EmptyMessage) returns (EmptyMessage) { + option (google.api.http) = {post: "/v1/bidder/cancel_auto_deposit"}; + } + // GetDeposit // // GetDeposit is called by the bidder to get its deposit in the bidder registry. @@ -103,6 +118,21 @@ message DepositResponse { google.protobuf.UInt64Value window_number = 2; }; +message AutoDepositResponse { + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { + json_schema: { + title: "AutoDeposit response" + description: "AutoDeposit deposit from the bidder registry." + } + example: "[{\"amount\": \"1000000000000000000\", \"window_number\": 1}, {\"amount\": \"1000000000000000000\", \"window_number\": 2}, {\"amount\": \"1000000000000000000\", \"window_number\": 3}]" + }; + repeated AutoDeposit amounts_and_window_numbers = 1; +}; + +message AutoDeposit { + string amount = 1; + google.protobuf.UInt64Value window_number = 2; +} message EmptyMessage {}; message GetDepositRequest { From 773f6efdfd6bd3ebd3dee4b68839e0949de8c075 Mon Sep 17 00:00:00 2001 From: Mikhail Wall Date: Tue, 25 Jun 2024 16:32:23 +0200 Subject: [PATCH 02/18] fix: fixed cancellation signature --- p2p/pkg/rpc/bidder/service.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/p2p/pkg/rpc/bidder/service.go b/p2p/pkg/rpc/bidder/service.go index 40931dbb4..c0b93e2f5 100644 --- a/p2p/pkg/rpc/bidder/service.go +++ b/p2p/pkg/rpc/bidder/service.go @@ -398,7 +398,7 @@ func (s *Service) AutoDeposit( return nil, status.Errorf(codes.Internal, "missing log for deposit") } -func (s *Service) CancelDeposit( +func (s *Service) CancelAutoDeposit( ctx context.Context, _ *bidderapiv1.EmptyMessage, ) (*bidderapiv1.EmptyMessage, error) { From 21b6bfb4209c5c0442494d0dd52ba0e39eb5e227 Mon Sep 17 00:00:00 2001 From: Mikhail Wall Date: Thu, 27 Jun 2024 00:53:19 +0200 Subject: [PATCH 03/18] feat: added withdraw --- contracts-abi/abi/BidderRegistry.abi | 31 + .../clients/BidderRegistry/BidderRegistry.go | 44 +- contracts/contracts/BidderRegistry.sol | 81 +- contracts/test/OracleTest.sol | 2 +- p2p/gen/go/bidderapi/v1/bidderapi.pb.go | 940 +++++++++++------- p2p/gen/go/bidderapi/v1/bidderapi.pb.gw.go | 138 +++ p2p/gen/go/bidderapi/v1/bidderapi_grpc.pb.go | 112 ++- .../bidderapi/v1/bidderapi.swagger.yaml | 68 +- p2p/pkg/depositmanager/autodeposit.go | 150 ++- p2p/pkg/depositmanager/autodeposit_test.go | 110 ++ p2p/pkg/rpc/bidder/service.go | 73 +- p2p/pkg/rpc/bidder/service_test.go | 34 +- p2p/rpc/bidderapi/v1/bidderapi.proto | 39 +- 13 files changed, 1392 insertions(+), 430 deletions(-) create mode 100644 p2p/pkg/depositmanager/autodeposit_test.go diff --git a/contracts-abi/abi/BidderRegistry.abi b/contracts-abi/abi/BidderRegistry.abi index d8176895d..5dd67c052 100644 --- a/contracts-abi/abi/BidderRegistry.abi +++ b/contracts-abi/abi/BidderRegistry.abi @@ -613,6 +613,37 @@ "outputs": [], "stateMutability": "nonpayable" }, + { + "type": "function", + "name": "withdrawFromNWindows", + "inputs": [ + { + "name": "window", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "n", + "type": "uint16", + "internalType": "uint16" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "withdrawFromSpecificWindows", + "inputs": [ + { + "name": "windows", + "type": "uint256[]", + "internalType": "uint256[]" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, { "type": "function", "name": "withdrawProtocolFee", diff --git a/contracts-abi/clients/BidderRegistry/BidderRegistry.go b/contracts-abi/clients/BidderRegistry/BidderRegistry.go index a66edfd10..ff3df8ba9 100644 --- a/contracts-abi/clients/BidderRegistry/BidderRegistry.go +++ b/contracts-abi/clients/BidderRegistry/BidderRegistry.go @@ -31,7 +31,7 @@ var ( // BidderregistryMetaData contains all meta data concerning the Bidderregistry contract. var BidderregistryMetaData = &bind.MetaData{ - ABI: "[{\"type\":\"constructor\",\"inputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"fallback\",\"stateMutability\":\"payable\"},{\"type\":\"receive\",\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"BidPayment\",\"inputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"bidder\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"bidAmt\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"state\",\"type\":\"uint8\",\"internalType\":\"enumIBidderRegistry.State\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"OpenBid\",\"inputs\":[{\"name\":\"commitmentDigest\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"bid\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"bidder\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"blockNumber\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"bidderRegistered\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"blockTrackerContract\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIBlockTracker\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"blocksPerWindow\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"depositForSpecificWindow\",\"inputs\":[{\"name\":\"window\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"feePercent\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint16\",\"internalType\":\"uint16\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"feeRecipient\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"feeRecipientAmount\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getDeposit\",\"inputs\":[{\"name\":\"bidder\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"window\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getFeeRecipientAmount\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getProviderAmount\",\"inputs\":[{\"name\":\"provider\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"initialize\",\"inputs\":[{\"name\":\"_minDeposit\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_feeRecipient\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_feePercent\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"_owner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_blockTracker\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_blocksPerWindow\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"lockedFunds\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"maxBidPerBlock\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"minDeposit\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"owner\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"preConfirmationsContract\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"protocolFeeAmount\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"providerAmount\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"renounceOwnership\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"retrieveFunds\",\"inputs\":[{\"name\":\"windowToSettle\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"commitmentDigest\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"provider\",\"type\":\"address\",\"internalType\":\"addresspayable\"},{\"name\":\"residualBidPercentAfterDecay\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setNewFeePercent\",\"inputs\":[{\"name\":\"newFeePercent\",\"type\":\"uint16\",\"internalType\":\"uint16\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setNewFeeRecipient\",\"inputs\":[{\"name\":\"newFeeRecipient\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setPreconfirmationsContract\",\"inputs\":[{\"name\":\"contractAddress\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"transferOwnership\",\"inputs\":[{\"name\":\"newOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"unlockFunds\",\"inputs\":[{\"name\":\"window\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"bidID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"usedFunds\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"withdrawBidderAmountFromWindow\",\"inputs\":[{\"name\":\"bidder\",\"type\":\"address\",\"internalType\":\"addresspayable\"},{\"name\":\"window\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"withdrawFeeRecipientAmount\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"withdrawProtocolFee\",\"inputs\":[{\"name\":\"bidder\",\"type\":\"address\",\"internalType\":\"addresspayable\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"withdrawProviderAmount\",\"inputs\":[{\"name\":\"provider\",\"type\":\"address\",\"internalType\":\"addresspayable\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"event\",\"name\":\"BidderRegistered\",\"inputs\":[{\"name\":\"bidder\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"depositedAmount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"windowNumber\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"BidderWithdrawal\",\"inputs\":[{\"name\":\"bidder\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"window\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"amount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"FundsRetrieved\",\"inputs\":[{\"name\":\"commitmentDigest\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"bidder\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"window\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"amount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"FundsRewarded\",\"inputs\":[{\"name\":\"commitmentDigest\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"bidder\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"provider\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"window\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"amount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Initialized\",\"inputs\":[{\"name\":\"version\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OwnershipTransferred\",\"inputs\":[{\"name\":\"previousOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"newOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"InvalidInitialization\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"NotInitializing\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"OwnableInvalidOwner\",\"inputs\":[{\"name\":\"owner\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"OwnableUnauthorizedAccount\",\"inputs\":[{\"name\":\"account\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"ReentrancyGuardReentrantCall\",\"inputs\":[]}]", + ABI: "[{\"type\":\"constructor\",\"inputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"fallback\",\"stateMutability\":\"payable\"},{\"type\":\"receive\",\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"BidPayment\",\"inputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"bidder\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"bidAmt\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"state\",\"type\":\"uint8\",\"internalType\":\"enumIBidderRegistry.State\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"OpenBid\",\"inputs\":[{\"name\":\"commitmentDigest\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"bid\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"bidder\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"blockNumber\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"bidderRegistered\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"blockTrackerContract\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIBlockTracker\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"blocksPerWindow\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"depositForNWindows\",\"inputs\":[{\"name\":\"window\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"n\",\"type\":\"uint16\",\"internalType\":\"uint16\"}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"depositForSpecificWindow\",\"inputs\":[{\"name\":\"window\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"feePercent\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint16\",\"internalType\":\"uint16\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"feeRecipient\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"feeRecipientAmount\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getDeposit\",\"inputs\":[{\"name\":\"bidder\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"window\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getFeeRecipientAmount\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getProviderAmount\",\"inputs\":[{\"name\":\"provider\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"initialize\",\"inputs\":[{\"name\":\"_minDeposit\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_feeRecipient\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_feePercent\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"_owner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_blockTracker\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_blocksPerWindow\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"lockedFunds\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"maxBidPerBlock\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"minDeposit\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"moveDepositToWindow\",\"inputs\":[{\"name\":\"fromWindow\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"toWindow\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"owner\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"preConfirmationsContract\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"protocolFeeAmount\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"providerAmount\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"renounceOwnership\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"retrieveFunds\",\"inputs\":[{\"name\":\"windowToSettle\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"commitmentDigest\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"provider\",\"type\":\"address\",\"internalType\":\"addresspayable\"},{\"name\":\"residualBidPercentAfterDecay\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setNewFeePercent\",\"inputs\":[{\"name\":\"newFeePercent\",\"type\":\"uint16\",\"internalType\":\"uint16\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setNewFeeRecipient\",\"inputs\":[{\"name\":\"newFeeRecipient\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setPreconfirmationsContract\",\"inputs\":[{\"name\":\"contractAddress\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"transferOwnership\",\"inputs\":[{\"name\":\"newOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"unlockFunds\",\"inputs\":[{\"name\":\"window\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"bidID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"usedFunds\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"withdrawBidderAmountFromWindow\",\"inputs\":[{\"name\":\"bidder\",\"type\":\"address\",\"internalType\":\"addresspayable\"},{\"name\":\"window\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"withdrawFeeRecipientAmount\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"withdrawProtocolFee\",\"inputs\":[{\"name\":\"bidder\",\"type\":\"address\",\"internalType\":\"addresspayable\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"withdrawProviderAmount\",\"inputs\":[{\"name\":\"provider\",\"type\":\"address\",\"internalType\":\"addresspayable\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"event\",\"name\":\"BidderMovedFunds\",\"inputs\":[{\"name\":\"bidder\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"fromWindow\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"toWindow\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"amount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"BidderRegistered\",\"inputs\":[{\"name\":\"bidder\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"depositedAmount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"windowNumber\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"BidderWithdrawal\",\"inputs\":[{\"name\":\"bidder\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"window\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"amount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"FundsRetrieved\",\"inputs\":[{\"name\":\"commitmentDigest\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"bidder\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"window\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"amount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"FundsRewarded\",\"inputs\":[{\"name\":\"commitmentDigest\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"bidder\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"provider\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"window\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"amount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Initialized\",\"inputs\":[{\"name\":\"version\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OwnershipTransferred\",\"inputs\":[{\"name\":\"previousOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"newOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"InvalidInitialization\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"NotInitializing\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"OwnableInvalidOwner\",\"inputs\":[{\"name\":\"owner\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"OwnableUnauthorizedAccount\",\"inputs\":[{\"name\":\"account\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"ReentrancyGuardReentrantCall\",\"inputs\":[]}]", } // BidderregistryABI is the input ABI used to generate the binding from. @@ -1134,6 +1134,48 @@ func (_Bidderregistry *BidderregistryTransactorSession) WithdrawFeeRecipientAmou return _Bidderregistry.Contract.WithdrawFeeRecipientAmount(&_Bidderregistry.TransactOpts) } +// WithdrawFromNWindows is a paid mutator transaction binding the contract method 0x6b0385df. +// +// Solidity: function withdrawFromNWindows(uint256 window, uint16 n) returns() +func (_Bidderregistry *BidderregistryTransactor) WithdrawFromNWindows(opts *bind.TransactOpts, window *big.Int, n uint16) (*types.Transaction, error) { + return _Bidderregistry.contract.Transact(opts, "withdrawFromNWindows", window, n) +} + +// WithdrawFromNWindows is a paid mutator transaction binding the contract method 0x6b0385df. +// +// Solidity: function withdrawFromNWindows(uint256 window, uint16 n) returns() +func (_Bidderregistry *BidderregistrySession) WithdrawFromNWindows(window *big.Int, n uint16) (*types.Transaction, error) { + return _Bidderregistry.Contract.WithdrawFromNWindows(&_Bidderregistry.TransactOpts, window, n) +} + +// WithdrawFromNWindows is a paid mutator transaction binding the contract method 0x6b0385df. +// +// Solidity: function withdrawFromNWindows(uint256 window, uint16 n) returns() +func (_Bidderregistry *BidderregistryTransactorSession) WithdrawFromNWindows(window *big.Int, n uint16) (*types.Transaction, error) { + return _Bidderregistry.Contract.WithdrawFromNWindows(&_Bidderregistry.TransactOpts, window, n) +} + +// WithdrawFromSpecificWindows is a paid mutator transaction binding the contract method 0x0a2c434c. +// +// Solidity: function withdrawFromSpecificWindows(uint256[] windows) returns() +func (_Bidderregistry *BidderregistryTransactor) WithdrawFromSpecificWindows(opts *bind.TransactOpts, windows []*big.Int) (*types.Transaction, error) { + return _Bidderregistry.contract.Transact(opts, "withdrawFromSpecificWindows", windows) +} + +// WithdrawFromSpecificWindows is a paid mutator transaction binding the contract method 0x0a2c434c. +// +// Solidity: function withdrawFromSpecificWindows(uint256[] windows) returns() +func (_Bidderregistry *BidderregistrySession) WithdrawFromSpecificWindows(windows []*big.Int) (*types.Transaction, error) { + return _Bidderregistry.Contract.WithdrawFromSpecificWindows(&_Bidderregistry.TransactOpts, windows) +} + +// WithdrawFromSpecificWindows is a paid mutator transaction binding the contract method 0x0a2c434c. +// +// Solidity: function withdrawFromSpecificWindows(uint256[] windows) returns() +func (_Bidderregistry *BidderregistryTransactorSession) WithdrawFromSpecificWindows(windows []*big.Int) (*types.Transaction, error) { + return _Bidderregistry.Contract.WithdrawFromSpecificWindows(&_Bidderregistry.TransactOpts, windows) +} + // WithdrawProtocolFee is a paid mutator transaction binding the contract method 0x668fb6dc. // // Solidity: function withdrawProtocolFee(address bidder) returns() diff --git a/contracts/contracts/BidderRegistry.sol b/contracts/contracts/BidderRegistry.sol index 3896e5570..8596ce678 100644 --- a/contracts/contracts/BidderRegistry.sol +++ b/contracts/contracts/BidderRegistry.sol @@ -232,8 +232,14 @@ contract BidderRegistry is require(deposit > 0, "deposit amount is zero"); lockedFunds[msg.sender][fromWindow] = 0; - lockedFunds[msg.sender][toWindow] += deposit; + maxBidPerBlock[msg.sender][fromWindow] = 0; + uint256 newLockedFunds = lockedFunds[msg.sender][toWindow] + deposit; + + lockedFunds[msg.sender][toWindow] = newLockedFunds; + maxBidPerBlock[msg.sender][toWindow] = newLockedFunds / blocksPerWindow; + + emit BidderRegistered(msg.sender, newLockedFunds, toWindow); emit BidderMovedFunds(msg.sender, fromWindow, toWindow, deposit); } @@ -242,10 +248,7 @@ contract BidderRegistry is * @param window The window for which the deposit is being made. * @param n The number of windows for which the deposit is being made. */ - function depositForNWindows( - uint256 window, - uint16 n - ) external payable { + function depositForNWindows(uint256 window, uint16 n) external payable { require(msg.value >= minDeposit * n, "Insufficient deposit"); if (!bidderRegistered[msg.sender]) { @@ -254,22 +257,79 @@ contract BidderRegistry is uint256 amountToDeposit = msg.value / n; uint256 remainingAmount = msg.value % n; // to handle rounding issues - + for (uint16 i = 0; i < n; i++) { uint256 windowIndex = window + i; uint256 currentLockedFunds = lockedFunds[msg.sender][windowIndex]; - + uint256 newLockedFunds = currentLockedFunds + amountToDeposit; if (i == n - 1) { newLockedFunds += remainingAmount; // Add the remainder to the last window } - + lockedFunds[msg.sender][windowIndex] = newLockedFunds; - maxBidPerBlock[msg.sender][windowIndex] = newLockedFunds / blocksPerWindow; + maxBidPerBlock[msg.sender][windowIndex] = + newLockedFunds / + blocksPerWindow; emit BidderRegistered(msg.sender, newLockedFunds, windowIndex); } - } + } + + function withdrawFromNWindows( + uint256 window, + uint16 n + ) external nonReentrant { + uint256 currentWindow = blockTrackerContract.getCurrentWindow(); + require( + window + n < currentWindow, + "funds can only be withdrawn after the window is settled" + ); + + uint256 totalAmount = 0; + for (uint16 i = 0; i < n; i++) { + uint256 windowIndex = window + i; + uint256 amount = lockedFunds[msg.sender][windowIndex]; + totalAmount += amount; + lockedFunds[msg.sender][windowIndex] = 0; + maxBidPerBlock[msg.sender][windowIndex] = 0; + emit BidderWithdrawal(msg.sender, window, amount); + } + + require(totalAmount > 0, "bidder Amount is zero"); + + (bool success, ) = msg.sender.call{value: totalAmount}(""); + require(success, "couldn't transfer to bidder"); + } + + function withdrawFromSpecificWindows( + uint256[] calldata windows + ) external nonReentrant { + uint256 currentWindow = blockTrackerContract.getCurrentWindow(); + address sender = msg.sender; + uint256 totalAmount; + + for (uint256 i = 0; i < windows.length; i++) { + uint256 window = windows[i]; + require( + window < currentWindow, + "funds can only be withdrawn after the window is settled" + ); + + uint256 amount = lockedFunds[sender][window]; + require(amount > 0, "bidder Amount is zero"); + + lockedFunds[sender][window] = 0; + maxBidPerBlock[sender][window] = 0; + emit BidderWithdrawal(sender, window, amount); + + totalAmount += amount; + } + + require(totalAmount > 0, "Total withdrawal amount is zero"); + (bool success, ) = sender.call{value: totalAmount}(""); + require(success, "Couldn't transfer to bidder"); + } /** * @dev Check the deposit of a bidder. * @param bidder The address of the bidder. @@ -473,6 +533,7 @@ contract BidderRegistry is lockedFunds[bidder][window] = 0; require(amount > 0, "bidder Amount is zero"); + maxBidPerBlock[bidder][window] = 0; (bool success, ) = bidder.call{value: amount}(""); require(success, "couldn't transfer to bidder"); diff --git a/contracts/test/OracleTest.sol b/contracts/test/OracleTest.sol index 77cee6204..0a5191b22 100644 --- a/contracts/test/OracleTest.sol +++ b/contracts/test/OracleTest.sol @@ -50,7 +50,7 @@ contract OracleTest is Test { uint256 blockNumber, string blockBuilderName ); - event CommitmentProcessed(bytes32 commitmentHash, bool isSlash); + event CommitmentProcessed(bytes32 indexed commitmentIndex, bool isSlash); event FundsRetrieved( bytes32 indexed commitmentDigest, uint256 window, diff --git a/p2p/gen/go/bidderapi/v1/bidderapi.pb.go b/p2p/gen/go/bidderapi/v1/bidderapi.pb.go index 4c7bc3c3c..11c6a83bd 100644 --- a/p2p/gen/go/bidderapi/v1/bidderapi.pb.go +++ b/p2p/gen/go/bidderapi/v1/bidderapi.pb.go @@ -189,6 +189,108 @@ func (x *AutoDepositResponse) GetAmountsAndWindowNumbers() []*AutoDeposit { return nil } +type AutoDepositStatusResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + AmountsAndWindowNumbers []*AutoDeposit `protobuf:"bytes,1,rep,name=amounts_and_window_numbers,json=amountsAndWindowNumbers,proto3" json:"amounts_and_window_numbers,omitempty"` + IsWorking bool `protobuf:"varint,2,opt,name=isWorking,proto3" json:"isWorking,omitempty"` +} + +func (x *AutoDepositStatusResponse) Reset() { + *x = AutoDepositStatusResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_bidderapi_v1_bidderapi_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AutoDepositStatusResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AutoDepositStatusResponse) ProtoMessage() {} + +func (x *AutoDepositStatusResponse) ProtoReflect() protoreflect.Message { + mi := &file_bidderapi_v1_bidderapi_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AutoDepositStatusResponse.ProtoReflect.Descriptor instead. +func (*AutoDepositStatusResponse) Descriptor() ([]byte, []int) { + return file_bidderapi_v1_bidderapi_proto_rawDescGZIP(), []int{3} +} + +func (x *AutoDepositStatusResponse) GetAmountsAndWindowNumbers() []*AutoDeposit { + if x != nil { + return x.AmountsAndWindowNumbers + } + return nil +} + +func (x *AutoDepositStatusResponse) GetIsWorking() bool { + if x != nil { + return x.IsWorking + } + return false +} + +type CancelAutoDepositResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + WindowNumbers []*wrapperspb.UInt64Value `protobuf:"bytes,1,rep,name=window_numbers,json=windowNumbers,proto3" json:"window_numbers,omitempty"` +} + +func (x *CancelAutoDepositResponse) Reset() { + *x = CancelAutoDepositResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_bidderapi_v1_bidderapi_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CancelAutoDepositResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CancelAutoDepositResponse) ProtoMessage() {} + +func (x *CancelAutoDepositResponse) ProtoReflect() protoreflect.Message { + mi := &file_bidderapi_v1_bidderapi_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CancelAutoDepositResponse.ProtoReflect.Descriptor instead. +func (*CancelAutoDepositResponse) Descriptor() ([]byte, []int) { + return file_bidderapi_v1_bidderapi_proto_rawDescGZIP(), []int{4} +} + +func (x *CancelAutoDepositResponse) GetWindowNumbers() []*wrapperspb.UInt64Value { + if x != nil { + return x.WindowNumbers + } + return nil +} + type AutoDeposit struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -201,7 +303,7 @@ type AutoDeposit struct { func (x *AutoDeposit) Reset() { *x = AutoDeposit{} if protoimpl.UnsafeEnabled { - mi := &file_bidderapi_v1_bidderapi_proto_msgTypes[3] + mi := &file_bidderapi_v1_bidderapi_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -214,7 +316,7 @@ func (x *AutoDeposit) String() string { func (*AutoDeposit) ProtoMessage() {} func (x *AutoDeposit) ProtoReflect() protoreflect.Message { - mi := &file_bidderapi_v1_bidderapi_proto_msgTypes[3] + mi := &file_bidderapi_v1_bidderapi_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -227,7 +329,7 @@ func (x *AutoDeposit) ProtoReflect() protoreflect.Message { // Deprecated: Use AutoDeposit.ProtoReflect.Descriptor instead. func (*AutoDeposit) Descriptor() ([]byte, []int) { - return file_bidderapi_v1_bidderapi_proto_rawDescGZIP(), []int{3} + return file_bidderapi_v1_bidderapi_proto_rawDescGZIP(), []int{5} } func (x *AutoDeposit) GetAmount() string { @@ -253,7 +355,7 @@ type EmptyMessage struct { func (x *EmptyMessage) Reset() { *x = EmptyMessage{} if protoimpl.UnsafeEnabled { - mi := &file_bidderapi_v1_bidderapi_proto_msgTypes[4] + mi := &file_bidderapi_v1_bidderapi_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -266,7 +368,7 @@ func (x *EmptyMessage) String() string { func (*EmptyMessage) ProtoMessage() {} func (x *EmptyMessage) ProtoReflect() protoreflect.Message { - mi := &file_bidderapi_v1_bidderapi_proto_msgTypes[4] + mi := &file_bidderapi_v1_bidderapi_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -279,7 +381,7 @@ func (x *EmptyMessage) ProtoReflect() protoreflect.Message { // Deprecated: Use EmptyMessage.ProtoReflect.Descriptor instead. func (*EmptyMessage) Descriptor() ([]byte, []int) { - return file_bidderapi_v1_bidderapi_proto_rawDescGZIP(), []int{4} + return file_bidderapi_v1_bidderapi_proto_rawDescGZIP(), []int{6} } type GetDepositRequest struct { @@ -293,7 +395,7 @@ type GetDepositRequest struct { func (x *GetDepositRequest) Reset() { *x = GetDepositRequest{} if protoimpl.UnsafeEnabled { - mi := &file_bidderapi_v1_bidderapi_proto_msgTypes[5] + mi := &file_bidderapi_v1_bidderapi_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -306,7 +408,7 @@ func (x *GetDepositRequest) String() string { func (*GetDepositRequest) ProtoMessage() {} func (x *GetDepositRequest) ProtoReflect() protoreflect.Message { - mi := &file_bidderapi_v1_bidderapi_proto_msgTypes[5] + mi := &file_bidderapi_v1_bidderapi_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -319,7 +421,7 @@ func (x *GetDepositRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetDepositRequest.ProtoReflect.Descriptor instead. func (*GetDepositRequest) Descriptor() ([]byte, []int) { - return file_bidderapi_v1_bidderapi_proto_rawDescGZIP(), []int{5} + return file_bidderapi_v1_bidderapi_proto_rawDescGZIP(), []int{7} } func (x *GetDepositRequest) GetWindowNumber() *wrapperspb.UInt64Value { @@ -340,7 +442,7 @@ type WithdrawRequest struct { func (x *WithdrawRequest) Reset() { *x = WithdrawRequest{} if protoimpl.UnsafeEnabled { - mi := &file_bidderapi_v1_bidderapi_proto_msgTypes[6] + mi := &file_bidderapi_v1_bidderapi_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -353,7 +455,7 @@ func (x *WithdrawRequest) String() string { func (*WithdrawRequest) ProtoMessage() {} func (x *WithdrawRequest) ProtoReflect() protoreflect.Message { - mi := &file_bidderapi_v1_bidderapi_proto_msgTypes[6] + mi := &file_bidderapi_v1_bidderapi_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -366,7 +468,7 @@ func (x *WithdrawRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use WithdrawRequest.ProtoReflect.Descriptor instead. func (*WithdrawRequest) Descriptor() ([]byte, []int) { - return file_bidderapi_v1_bidderapi_proto_rawDescGZIP(), []int{6} + return file_bidderapi_v1_bidderapi_proto_rawDescGZIP(), []int{8} } func (x *WithdrawRequest) GetWindowNumber() *wrapperspb.UInt64Value { @@ -388,7 +490,7 @@ type WithdrawResponse struct { func (x *WithdrawResponse) Reset() { *x = WithdrawResponse{} if protoimpl.UnsafeEnabled { - mi := &file_bidderapi_v1_bidderapi_proto_msgTypes[7] + mi := &file_bidderapi_v1_bidderapi_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -401,7 +503,7 @@ func (x *WithdrawResponse) String() string { func (*WithdrawResponse) ProtoMessage() {} func (x *WithdrawResponse) ProtoReflect() protoreflect.Message { - mi := &file_bidderapi_v1_bidderapi_proto_msgTypes[7] + mi := &file_bidderapi_v1_bidderapi_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -414,7 +516,7 @@ func (x *WithdrawResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use WithdrawResponse.ProtoReflect.Descriptor instead. func (*WithdrawResponse) Descriptor() ([]byte, []int) { - return file_bidderapi_v1_bidderapi_proto_rawDescGZIP(), []int{7} + return file_bidderapi_v1_bidderapi_proto_rawDescGZIP(), []int{9} } func (x *WithdrawResponse) GetAmount() string { @@ -446,7 +548,7 @@ type Bid struct { func (x *Bid) Reset() { *x = Bid{} if protoimpl.UnsafeEnabled { - mi := &file_bidderapi_v1_bidderapi_proto_msgTypes[8] + mi := &file_bidderapi_v1_bidderapi_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -459,7 +561,7 @@ func (x *Bid) String() string { func (*Bid) ProtoMessage() {} func (x *Bid) ProtoReflect() protoreflect.Message { - mi := &file_bidderapi_v1_bidderapi_proto_msgTypes[8] + mi := &file_bidderapi_v1_bidderapi_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -472,7 +574,7 @@ func (x *Bid) ProtoReflect() protoreflect.Message { // Deprecated: Use Bid.ProtoReflect.Descriptor instead. func (*Bid) Descriptor() ([]byte, []int) { - return file_bidderapi_v1_bidderapi_proto_rawDescGZIP(), []int{8} + return file_bidderapi_v1_bidderapi_proto_rawDescGZIP(), []int{10} } func (x *Bid) GetTxHashes() []string { @@ -531,7 +633,7 @@ type Commitment struct { func (x *Commitment) Reset() { *x = Commitment{} if protoimpl.UnsafeEnabled { - mi := &file_bidderapi_v1_bidderapi_proto_msgTypes[9] + mi := &file_bidderapi_v1_bidderapi_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -544,7 +646,7 @@ func (x *Commitment) String() string { func (*Commitment) ProtoMessage() {} func (x *Commitment) ProtoReflect() protoreflect.Message { - mi := &file_bidderapi_v1_bidderapi_proto_msgTypes[9] + mi := &file_bidderapi_v1_bidderapi_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -557,7 +659,7 @@ func (x *Commitment) ProtoReflect() protoreflect.Message { // Deprecated: Use Commitment.ProtoReflect.Descriptor instead. func (*Commitment) Descriptor() ([]byte, []int) { - return file_bidderapi_v1_bidderapi_proto_rawDescGZIP(), []int{9} + return file_bidderapi_v1_bidderapi_proto_rawDescGZIP(), []int{11} } func (x *Commitment) GetTxHashes() []string { @@ -743,317 +845,377 @@ var file_bidderapi_v1_bidderapi_proto_rawDesc = []byte{ 0x7d, 0x2c, 0x20, 0x7b, 0x22, 0x61, 0x6d, 0x6f, 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, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x5f, 0x6e, 0x75, 0x6d, - 0x62, 0x65, 0x72, 0x22, 0x3a, 0x20, 0x33, 0x7d, 0x5d, 0x22, 0x68, 0x0a, 0x0b, 0x41, 0x75, 0x74, - 0x6f, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, - 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, - 0x12, 0x41, 0x0a, 0x0d, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, - 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, 0x49, 0x6e, 0x74, 0x36, 0x34, - 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0c, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x4e, 0x75, 0x6d, - 0x62, 0x65, 0x72, 0x22, 0x0e, 0x0a, 0x0c, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x4d, 0x65, 0x73, 0x73, - 0x61, 0x67, 0x65, 0x22, 0xa9, 0x02, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x44, 0x65, 0x70, 0x6f, 0x73, - 0x69, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x93, 0x02, 0x0a, 0x0d, 0x77, 0x69, - 0x6e, 0x64, 0x6f, 0x77, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2e, 0x55, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42, - 0xcf, 0x01, 0x92, 0x41, 0x63, 0x32, 0x61, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, - 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x20, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x20, 0x66, 0x6f, - 0x72, 0x20, 0x71, 0x75, 0x65, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x64, 0x65, 0x70, 0x6f, 0x73, - 0x69, 0x74, 0x73, 0x2e, 0x20, 0x49, 0x66, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x73, 0x70, 0x65, 0x63, - 0x69, 0x66, 0x69, 0x65, 0x64, 0x2c, 0x20, 0x74, 0x68, 0x65, 0x20, 0x63, 0x75, 0x72, 0x72, 0x65, - 0x6e, 0x74, 0x20, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x20, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x20, - 0x69, 0x73, 0x20, 0x75, 0x73, 0x65, 0x64, 0x2e, 0xba, 0x48, 0x66, 0xba, 0x01, 0x63, 0x0a, 0x0d, - 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x36, 0x77, - 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x20, 0x6d, 0x75, 0x73, - 0x74, 0x20, 0x62, 0x65, 0x20, 0x61, 0x20, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x76, 0x65, 0x20, - 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x20, 0x69, 0x66, 0x20, 0x73, 0x70, 0x65, 0x63, 0x69, - 0x66, 0x69, 0x65, 0x64, 0x2e, 0x1a, 0x1a, 0x74, 0x68, 0x69, 0x73, 0x20, 0x3d, 0x3d, 0x20, 0x6e, - 0x75, 0x6c, 0x6c, 0x20, 0x7c, 0x7c, 0x20, 0x28, 0x74, 0x68, 0x69, 0x73, 0x20, 0x3e, 0x20, 0x30, - 0x29, 0x52, 0x0c, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x22, - 0x84, 0x03, 0x0a, 0x0f, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x94, 0x02, 0x0a, 0x0d, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x5f, 0x6e, - 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, 0x49, - 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42, 0xd0, 0x01, 0x92, 0x41, 0x64, 0x32, - 0x62, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, - 0x20, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x77, 0x69, 0x74, 0x68, - 0x64, 0x72, 0x61, 0x77, 0x69, 0x6e, 0x67, 0x20, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x73, - 0x2e, 0x20, 0x49, 0x66, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, - 0x65, 0x64, 0x2c, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6c, 0x61, 0x73, 0x74, 0x20, 0x77, 0x69, 0x6e, - 0x64, 0x6f, 0x77, 0x20, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x20, 0x69, 0x73, 0x20, 0x75, 0x73, - 0x65, 0x64, 0x2e, 0xba, 0x48, 0x66, 0xba, 0x01, 0x63, 0x0a, 0x0d, 0x77, 0x69, 0x6e, 0x64, 0x6f, - 0x77, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x36, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, - 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x20, 0x6d, 0x75, 0x73, 0x74, 0x20, 0x62, 0x65, 0x20, - 0x61, 0x20, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x76, 0x65, 0x20, 0x69, 0x6e, 0x74, 0x65, 0x67, - 0x65, 0x72, 0x20, 0x69, 0x66, 0x20, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x65, 0x64, 0x2e, - 0x1a, 0x1a, 0x74, 0x68, 0x69, 0x73, 0x20, 0x3d, 0x3d, 0x20, 0x6e, 0x75, 0x6c, 0x6c, 0x20, 0x7c, - 0x7c, 0x20, 0x28, 0x74, 0x68, 0x69, 0x73, 0x20, 0x3e, 0x20, 0x30, 0x29, 0x52, 0x0c, 0x77, 0x69, - 0x6e, 0x64, 0x6f, 0x77, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x3a, 0x5a, 0x92, 0x41, 0x57, 0x0a, - 0x3e, 0x2a, 0x10, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x20, 0x72, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x32, 0x2a, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x20, 0x64, 0x65, - 0x70, 0x6f, 0x73, 0x69, 0x74, 0x20, 0x66, 0x72, 0x6f, 0x6d, 0x20, 0x74, 0x68, 0x65, 0x20, 0x62, - 0x69, 0x64, 0x64, 0x65, 0x72, 0x20, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x32, - 0x15, 0x7b, 0x22, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, - 0x22, 0x3a, 0x20, 0x31, 0x20, 0x7d, 0x22, 0xeb, 0x01, 0x0a, 0x10, 0x57, 0x69, 0x74, 0x68, 0x64, - 0x72, 0x61, 0x77, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x61, - 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x6d, 0x6f, - 0x75, 0x6e, 0x74, 0x12, 0x41, 0x0a, 0x0d, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x5f, 0x6e, 0x75, - 0x6d, 0x62, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, 0x49, 0x6e, - 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0c, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, - 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x3a, 0x7c, 0x92, 0x41, 0x79, 0x0a, 0x3f, 0x2a, 0x11, 0x57, - 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x20, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x32, 0x2a, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x20, 0x64, 0x65, 0x70, 0x6f, 0x73, - 0x69, 0x74, 0x20, 0x66, 0x72, 0x6f, 0x6d, 0x20, 0x74, 0x68, 0x65, 0x20, 0x62, 0x69, 0x64, 0x64, - 0x65, 0x72, 0x20, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x32, 0x36, 0x7b, 0x22, + 0x62, 0x65, 0x72, 0x22, 0x3a, 0x20, 0x33, 0x7d, 0x5d, 0x22, 0xba, 0x03, 0x0a, 0x19, 0x41, 0x75, + 0x74, 0x6f, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x56, 0x0a, 0x1a, 0x61, 0x6d, 0x6f, 0x75, 0x6e, + 0x74, 0x73, 0x5f, 0x61, 0x6e, 0x64, 0x5f, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x5f, 0x6e, 0x75, + 0x6d, 0x62, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x62, 0x69, + 0x64, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x75, 0x74, 0x6f, 0x44, + 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, 0x17, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x41, + 0x6e, 0x64, 0x57, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x12, + 0x1c, 0x0a, 0x09, 0x69, 0x73, 0x57, 0x6f, 0x72, 0x6b, 0x69, 0x6e, 0x67, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x09, 0x69, 0x73, 0x57, 0x6f, 0x72, 0x6b, 0x69, 0x6e, 0x67, 0x3a, 0xa6, 0x02, + 0x92, 0x41, 0xa2, 0x02, 0x0a, 0x45, 0x2a, 0x14, 0x41, 0x75, 0x74, 0x6f, 0x44, 0x65, 0x70, 0x6f, + 0x73, 0x69, 0x74, 0x20, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0x2d, 0x41, 0x75, + 0x74, 0x6f, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x20, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, + 0x74, 0x20, 0x66, 0x72, 0x6f, 0x6d, 0x20, 0x74, 0x68, 0x65, 0x20, 0x62, 0x69, 0x64, 0x64, 0x65, + 0x72, 0x20, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x32, 0xd8, 0x01, 0x7b, 0x22, + 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x5f, 0x61, 0x6e, 0x64, 0x5f, 0x77, 0x69, 0x6e, 0x64, + 0x6f, 0x77, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x22, 0x3a, 0x20, 0x5b, 0x7b, 0x22, 0x61, 0x6d, 0x6f, 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, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x22, 0x3a, - 0x20, 0x31, 0x20, 0x7d, 0x22, 0xa6, 0x0b, 0x0a, 0x03, 0x42, 0x69, 0x64, 0x12, 0xa3, 0x02, 0x0a, - 0x09, 0x74, 0x78, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, - 0x42, 0x85, 0x02, 0x92, 0x41, 0x78, 0x32, 0x64, 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, 0x65, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, - 0x20, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 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, 0xba, 0x48, - 0x86, 0x01, 0xba, 0x01, 0x82, 0x01, 0x0a, 0x09, 0x74, 0x78, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x65, - 0x73, 0x12, 0x36, 0x74, 0x78, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x65, 0x73, 0x20, 0x6d, 0x75, 0x73, - 0x74, 0x20, 0x62, 0x65, 0x20, 0x61, 0x20, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x20, 0x61, 0x72, 0x72, - 0x61, 0x79, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, - 0x6e, 0x20, 0x68, 0x61, 0x73, 0x68, 0x65, 0x73, 0x2e, 0x1a, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, - 0x61, 0x6c, 0x6c, 0x28, 0x72, 0x2c, 0x20, 0x72, 0x2e, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x73, - 0x28, 0x27, 0x5e, 0x5b, 0x61, 0x2d, 0x66, 0x41, 0x2d, 0x46, 0x30, 0x2d, 0x39, 0x5d, 0x7b, 0x36, - 0x34, 0x7d, 0x24, 0x27, 0x29, 0x29, 0x20, 0x26, 0x26, 0x20, 0x73, 0x69, 0x7a, 0x65, 0x28, 0x74, - 0x68, 0x69, 0x73, 0x29, 0x20, 0x3e, 0x20, 0x30, 0x52, 0x08, 0x74, 0x78, 0x48, 0x61, 0x73, 0x68, - 0x65, 0x73, 0x12, 0xed, 0x01, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x42, 0xd4, 0x01, 0x92, 0x41, 0x76, 0x32, 0x6b, 0x41, 0x6d, 0x6f, 0x75, 0x6e, - 0x74, 0x20, 0x6f, 0x66, 0x20, 0x45, 0x54, 0x48, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x74, 0x68, - 0x65, 0x20, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x20, 0x69, 0x73, 0x20, 0x77, 0x69, 0x6c, 0x6c, - 0x69, 0x6e, 0x67, 0x20, 0x74, 0x6f, 0x20, 0x70, 0x61, 0x79, 0x20, 0x74, 0x6f, 0x20, 0x74, 0x68, - 0x65, 0x20, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x69, - 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x69, 0x6e, 0x67, 0x20, 0x74, 0x68, 0x65, 0x20, 0x74, 0x72, 0x61, - 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, - 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x8a, 0x01, 0x06, 0x5b, 0x30, 0x2d, 0x39, 0x5d, 0x2b, 0xba, - 0x48, 0x58, 0xba, 0x01, 0x55, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1f, 0x61, - 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x20, 0x6d, 0x75, 0x73, 0x74, 0x20, 0x62, 0x65, 0x20, 0x61, 0x20, - 0x76, 0x61, 0x6c, 0x69, 0x64, 0x20, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x2e, 0x1a, 0x2a, - 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x73, 0x28, 0x27, 0x5e, 0x5b, - 0x30, 0x2d, 0x39, 0x5d, 0x2b, 0x24, 0x27, 0x29, 0x20, 0x26, 0x26, 0x20, 0x75, 0x69, 0x6e, 0x74, - 0x28, 0x74, 0x68, 0x69, 0x73, 0x29, 0x20, 0x3e, 0x20, 0x30, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, - 0x6e, 0x74, 0x12, 0xb9, 0x01, 0x0a, 0x0c, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x6e, 0x75, 0x6d, - 0x62, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x42, 0x95, 0x01, 0x92, 0x41, 0x47, 0x32, - 0x45, 0x4d, 0x61, 0x78, 0x20, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x20, 0x6e, 0x75, 0x6d, 0x62, 0x65, - 0x72, 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, 0x74, 0x68, 0x65, 0x20, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, - 0x6f, 0x6e, 0x20, 0x69, 0x6e, 0x2e, 0xba, 0x48, 0x48, 0xba, 0x01, 0x45, 0x0a, 0x0c, 0x62, 0x6c, - 0x6f, 0x63, 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x25, 0x62, 0x6c, 0x6f, 0x63, - 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x20, 0x6d, 0x75, 0x73, 0x74, 0x20, 0x62, 0x65, - 0x20, 0x61, 0x20, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x20, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, - 0x2e, 0x1a, 0x0e, 0x75, 0x69, 0x6e, 0x74, 0x28, 0x74, 0x68, 0x69, 0x73, 0x29, 0x20, 0x3e, 0x20, - 0x30, 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0xc2, - 0x01, 0x0a, 0x15, 0x64, 0x65, 0x63, 0x61, 0x79, 0x5f, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x74, - 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x42, 0x8d, - 0x01, 0x92, 0x41, 0x2d, 0x32, 0x2b, 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, 0x73, 0x74, 0x61, 0x72, 0x74, 0x73, 0x20, 0x64, 0x65, 0x63, 0x61, 0x79, 0x69, 0x6e, 0x67, - 0x2e, 0xba, 0x48, 0x5a, 0xba, 0x01, 0x57, 0x0a, 0x15, 0x64, 0x65, 0x63, 0x61, 0x79, 0x5f, 0x73, - 0x74, 0x61, 0x72, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x2e, + 0x20, 0x31, 0x7d, 0x2c, 0x20, 0x7b, 0x22, 0x61, 0x6d, 0x6f, 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, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x5f, 0x6e, + 0x75, 0x6d, 0x62, 0x65, 0x72, 0x22, 0x3a, 0x20, 0x32, 0x7d, 0x2c, 0x20, 0x7b, 0x22, 0x61, 0x6d, + 0x6f, 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, 0x77, + 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x22, 0x3a, 0x20, 0x33, + 0x7d, 0x5d, 0x2c, 0x20, 0x22, 0x69, 0x73, 0x57, 0x6f, 0x72, 0x6b, 0x69, 0x6e, 0x67, 0x22, 0x3a, + 0x20, 0x74, 0x72, 0x75, 0x65, 0x7d, 0x22, 0xd7, 0x01, 0x0a, 0x19, 0x43, 0x61, 0x6e, 0x63, 0x65, + 0x6c, 0x41, 0x75, 0x74, 0x6f, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x43, 0x0a, 0x0e, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x5f, 0x6e, + 0x75, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, + 0x49, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0d, 0x77, 0x69, 0x6e, 0x64, + 0x6f, 0x77, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x3a, 0x75, 0x92, 0x41, 0x72, 0x0a, 0x51, + 0x2a, 0x1a, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x41, 0x75, 0x74, 0x6f, 0x44, 0x65, 0x70, 0x6f, + 0x73, 0x69, 0x74, 0x20, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0x33, 0x43, 0x61, + 0x6e, 0x63, 0x65, 0x6c, 0x41, 0x75, 0x74, 0x6f, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x20, + 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x20, 0x66, 0x72, 0x6f, 0x6d, 0x20, 0x74, 0x68, 0x65, + 0x20, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x20, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, + 0x2e, 0x32, 0x1d, 0x7b, 0x22, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x5f, 0x6e, 0x75, 0x6d, 0x62, + 0x65, 0x72, 0x73, 0x22, 0x3a, 0x20, 0x5b, 0x31, 0x2c, 0x20, 0x32, 0x2c, 0x20, 0x33, 0x5d, 0x7d, + 0x22, 0x68, 0x0a, 0x0b, 0x41, 0x75, 0x74, 0x6f, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x12, + 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x41, 0x0a, 0x0d, 0x77, 0x69, 0x6e, 0x64, 0x6f, + 0x77, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x55, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0c, 0x77, 0x69, + 0x6e, 0x64, 0x6f, 0x77, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x22, 0x0e, 0x0a, 0x0c, 0x45, 0x6d, + 0x70, 0x74, 0x79, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0xa9, 0x02, 0x0a, 0x11, 0x47, + 0x65, 0x74, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x93, 0x02, 0x0a, 0x0d, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x5f, 0x6e, 0x75, 0x6d, 0x62, + 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, 0x49, 0x6e, 0x74, 0x36, + 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42, 0xcf, 0x01, 0x92, 0x41, 0x63, 0x32, 0x61, 0x4f, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x20, 0x6e, 0x75, + 0x6d, 0x62, 0x65, 0x72, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x71, 0x75, 0x65, 0x72, 0x79, 0x69, 0x6e, + 0x67, 0x20, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x73, 0x2e, 0x20, 0x49, 0x66, 0x20, 0x6e, + 0x6f, 0x74, 0x20, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x65, 0x64, 0x2c, 0x20, 0x74, 0x68, + 0x65, 0x20, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x20, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x20, + 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x20, 0x69, 0x73, 0x20, 0x75, 0x73, 0x65, 0x64, 0x2e, 0xba, + 0x48, 0x66, 0xba, 0x01, 0x63, 0x0a, 0x0d, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x5f, 0x6e, 0x75, + 0x6d, 0x62, 0x65, 0x72, 0x12, 0x36, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x5f, 0x6e, 0x75, 0x6d, + 0x62, 0x65, 0x72, 0x20, 0x6d, 0x75, 0x73, 0x74, 0x20, 0x62, 0x65, 0x20, 0x61, 0x20, 0x70, 0x6f, + 0x73, 0x69, 0x74, 0x69, 0x76, 0x65, 0x20, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x20, 0x69, + 0x66, 0x20, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x65, 0x64, 0x2e, 0x1a, 0x1a, 0x74, 0x68, + 0x69, 0x73, 0x20, 0x3d, 0x3d, 0x20, 0x6e, 0x75, 0x6c, 0x6c, 0x20, 0x7c, 0x7c, 0x20, 0x28, 0x74, + 0x68, 0x69, 0x73, 0x20, 0x3e, 0x20, 0x30, 0x29, 0x52, 0x0c, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, + 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x22, 0x84, 0x03, 0x0a, 0x0f, 0x57, 0x69, 0x74, 0x68, 0x64, + 0x72, 0x61, 0x77, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x94, 0x02, 0x0a, 0x0d, 0x77, + 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, + 0x42, 0xd0, 0x01, 0x92, 0x41, 0x64, 0x32, 0x62, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, + 0x20, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x20, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x20, 0x66, + 0x6f, 0x72, 0x20, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x69, 0x6e, 0x67, 0x20, 0x64, + 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x73, 0x2e, 0x20, 0x49, 0x66, 0x20, 0x6e, 0x6f, 0x74, 0x20, + 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x65, 0x64, 0x2c, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6c, + 0x61, 0x73, 0x74, 0x20, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x20, 0x6e, 0x75, 0x6d, 0x62, 0x65, + 0x72, 0x20, 0x69, 0x73, 0x20, 0x75, 0x73, 0x65, 0x64, 0x2e, 0xba, 0x48, 0x66, 0xba, 0x01, 0x63, + 0x0a, 0x0d, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, + 0x36, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x20, 0x6d, + 0x75, 0x73, 0x74, 0x20, 0x62, 0x65, 0x20, 0x61, 0x20, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x76, + 0x65, 0x20, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x20, 0x69, 0x66, 0x20, 0x73, 0x70, 0x65, + 0x63, 0x69, 0x66, 0x69, 0x65, 0x64, 0x2e, 0x1a, 0x1a, 0x74, 0x68, 0x69, 0x73, 0x20, 0x3d, 0x3d, + 0x20, 0x6e, 0x75, 0x6c, 0x6c, 0x20, 0x7c, 0x7c, 0x20, 0x28, 0x74, 0x68, 0x69, 0x73, 0x20, 0x3e, + 0x20, 0x30, 0x29, 0x52, 0x0c, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x4e, 0x75, 0x6d, 0x62, 0x65, + 0x72, 0x3a, 0x5a, 0x92, 0x41, 0x57, 0x0a, 0x3e, 0x2a, 0x10, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, + 0x61, 0x77, 0x20, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x32, 0x2a, 0x57, 0x69, 0x74, 0x68, + 0x64, 0x72, 0x61, 0x77, 0x20, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x20, 0x66, 0x72, 0x6f, + 0x6d, 0x20, 0x74, 0x68, 0x65, 0x20, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x20, 0x72, 0x65, 0x67, + 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x32, 0x15, 0x7b, 0x22, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, + 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x22, 0x3a, 0x20, 0x31, 0x20, 0x7d, 0x22, 0xeb, 0x01, + 0x0a, 0x10, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x41, 0x0a, 0x0d, 0x77, 0x69, + 0x6e, 0x64, 0x6f, 0x77, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x55, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, + 0x0c, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x3a, 0x7c, 0x92, + 0x41, 0x79, 0x0a, 0x3f, 0x2a, 0x11, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x20, 0x72, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0x2a, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, + 0x77, 0x20, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x20, 0x66, 0x72, 0x6f, 0x6d, 0x20, 0x74, + 0x68, 0x65, 0x20, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x20, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, + 0x72, 0x79, 0x2e, 0x32, 0x36, 0x7b, 0x22, 0x61, 0x6d, 0x6f, 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, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x5f, 0x6e, + 0x75, 0x6d, 0x62, 0x65, 0x72, 0x22, 0x3a, 0x20, 0x31, 0x20, 0x7d, 0x22, 0xa6, 0x0b, 0x0a, 0x03, + 0x42, 0x69, 0x64, 0x12, 0xa3, 0x02, 0x0a, 0x09, 0x74, 0x78, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x65, + 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x42, 0x85, 0x02, 0x92, 0x41, 0x78, 0x32, 0x64, 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, 0x65, 0x73, + 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 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, 0xba, 0x48, 0x86, 0x01, 0xba, 0x01, 0x82, 0x01, 0x0a, 0x09, 0x74, + 0x78, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x65, 0x73, 0x12, 0x36, 0x74, 0x78, 0x5f, 0x68, 0x61, 0x73, + 0x68, 0x65, 0x73, 0x20, 0x6d, 0x75, 0x73, 0x74, 0x20, 0x62, 0x65, 0x20, 0x61, 0x20, 0x76, 0x61, + 0x6c, 0x69, 0x64, 0x20, 0x61, 0x72, 0x72, 0x61, 0x79, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x72, 0x61, + 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x68, 0x61, 0x73, 0x68, 0x65, 0x73, 0x2e, + 0x1a, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x61, 0x6c, 0x6c, 0x28, 0x72, 0x2c, 0x20, 0x72, 0x2e, + 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x73, 0x28, 0x27, 0x5e, 0x5b, 0x61, 0x2d, 0x66, 0x41, 0x2d, + 0x46, 0x30, 0x2d, 0x39, 0x5d, 0x7b, 0x36, 0x34, 0x7d, 0x24, 0x27, 0x29, 0x29, 0x20, 0x26, 0x26, + 0x20, 0x73, 0x69, 0x7a, 0x65, 0x28, 0x74, 0x68, 0x69, 0x73, 0x29, 0x20, 0x3e, 0x20, 0x30, 0x52, + 0x08, 0x74, 0x78, 0x48, 0x61, 0x73, 0x68, 0x65, 0x73, 0x12, 0xed, 0x01, 0x0a, 0x06, 0x61, 0x6d, + 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0xd4, 0x01, 0x92, 0x41, 0x76, + 0x32, 0x6b, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x45, 0x54, 0x48, 0x20, + 0x74, 0x68, 0x61, 0x74, 0x20, 0x74, 0x68, 0x65, 0x20, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x20, + 0x69, 0x73, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x69, 0x6e, 0x67, 0x20, 0x74, 0x6f, 0x20, 0x70, 0x61, + 0x79, 0x20, 0x74, 0x6f, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, + 0x72, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x69, 0x6e, 0x67, 0x20, + 0x74, 0x68, 0x65, 0x20, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, + 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x8a, 0x01, 0x06, + 0x5b, 0x30, 0x2d, 0x39, 0x5d, 0x2b, 0xba, 0x48, 0x58, 0xba, 0x01, 0x55, 0x0a, 0x06, 0x61, 0x6d, + 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1f, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x20, 0x6d, 0x75, 0x73, + 0x74, 0x20, 0x62, 0x65, 0x20, 0x61, 0x20, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x20, 0x69, 0x6e, 0x74, + 0x65, 0x67, 0x65, 0x72, 0x2e, 0x1a, 0x2a, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6d, 0x61, 0x74, 0x63, + 0x68, 0x65, 0x73, 0x28, 0x27, 0x5e, 0x5b, 0x30, 0x2d, 0x39, 0x5d, 0x2b, 0x24, 0x27, 0x29, 0x20, + 0x26, 0x26, 0x20, 0x75, 0x69, 0x6e, 0x74, 0x28, 0x74, 0x68, 0x69, 0x73, 0x29, 0x20, 0x3e, 0x20, + 0x30, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0xb9, 0x01, 0x0a, 0x0c, 0x62, 0x6c, + 0x6f, 0x63, 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, + 0x42, 0x95, 0x01, 0x92, 0x41, 0x47, 0x32, 0x45, 0x4d, 0x61, 0x78, 0x20, 0x62, 0x6c, 0x6f, 0x63, + 0x6b, 0x20, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 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, 0x74, 0x68, 0x65, 0x20, 0x74, 0x72, + 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x69, 0x6e, 0x2e, 0xba, 0x48, 0x48, + 0xba, 0x01, 0x45, 0x0a, 0x0c, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, + 0x72, 0x12, 0x25, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x20, + 0x6d, 0x75, 0x73, 0x74, 0x20, 0x62, 0x65, 0x20, 0x61, 0x20, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x20, + 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x2e, 0x1a, 0x0e, 0x75, 0x69, 0x6e, 0x74, 0x28, 0x74, + 0x68, 0x69, 0x73, 0x29, 0x20, 0x3e, 0x20, 0x30, 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, + 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0xc2, 0x01, 0x0a, 0x15, 0x64, 0x65, 0x63, 0x61, 0x79, 0x5f, + 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x03, 0x42, 0x8d, 0x01, 0x92, 0x41, 0x2d, 0x32, 0x2b, 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, 0x73, 0x74, 0x61, 0x72, 0x74, 0x73, 0x20, 0x64, + 0x65, 0x63, 0x61, 0x79, 0x69, 0x6e, 0x67, 0x2e, 0xba, 0x48, 0x5a, 0xba, 0x01, 0x57, 0x0a, 0x15, 0x64, 0x65, 0x63, 0x61, 0x79, 0x5f, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, - 0x73, 0x74, 0x61, 0x6d, 0x70, 0x20, 0x6d, 0x75, 0x73, 0x74, 0x20, 0x62, 0x65, 0x20, 0x61, 0x20, - 0x76, 0x61, 0x6c, 0x69, 0x64, 0x20, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x2e, 0x1a, 0x0e, - 0x75, 0x69, 0x6e, 0x74, 0x28, 0x74, 0x68, 0x69, 0x73, 0x29, 0x20, 0x3e, 0x20, 0x30, 0x52, 0x13, - 0x64, 0x65, 0x63, 0x61, 0x79, 0x53, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, - 0x61, 0x6d, 0x70, 0x12, 0xb8, 0x01, 0x0a, 0x13, 0x64, 0x65, 0x63, 0x61, 0x79, 0x5f, 0x65, 0x6e, - 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x05, 0x20, 0x01, 0x28, - 0x03, 0x42, 0x87, 0x01, 0x92, 0x41, 0x2b, 0x32, 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, 0xba, 0x48, 0x56, 0xba, 0x01, 0x53, 0x0a, 0x13, 0x64, 0x65, 0x63, 0x61, 0x79, 0x5f, - 0x65, 0x6e, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x2c, 0x64, + 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x2e, 0x64, 0x65, 0x63, 0x61, 0x79, 0x5f, 0x73, 0x74, 0x61, + 0x72, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x20, 0x6d, 0x75, 0x73, + 0x74, 0x20, 0x62, 0x65, 0x20, 0x61, 0x20, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x20, 0x69, 0x6e, 0x74, + 0x65, 0x67, 0x65, 0x72, 0x2e, 0x1a, 0x0e, 0x75, 0x69, 0x6e, 0x74, 0x28, 0x74, 0x68, 0x69, 0x73, + 0x29, 0x20, 0x3e, 0x20, 0x30, 0x52, 0x13, 0x64, 0x65, 0x63, 0x61, 0x79, 0x53, 0x74, 0x61, 0x72, + 0x74, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0xb8, 0x01, 0x0a, 0x13, 0x64, 0x65, 0x63, 0x61, 0x79, 0x5f, 0x65, 0x6e, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, - 0x6d, 0x70, 0x20, 0x6d, 0x75, 0x73, 0x74, 0x20, 0x62, 0x65, 0x20, 0x61, 0x20, 0x76, 0x61, 0x6c, - 0x69, 0x64, 0x20, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x2e, 0x1a, 0x0e, 0x75, 0x69, 0x6e, - 0x74, 0x28, 0x74, 0x68, 0x69, 0x73, 0x29, 0x20, 0x3e, 0x20, 0x30, 0x52, 0x11, 0x64, 0x65, 0x63, - 0x61, 0x79, 0x45, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x3a, 0xcc, - 0x02, 0x92, 0x41, 0xc8, 0x02, 0x0a, 0x73, 0x2a, 0x0b, 0x42, 0x69, 0x64, 0x20, 0x6d, 0x65, 0x73, - 0x73, 0x61, 0x67, 0x65, 0x32, 0x40, 0x55, 0x6e, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x20, 0x62, - 0x69, 0x64, 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, 0x62, - 0x69, 0x64, 0x64, 0x65, 0x72, 0x20, 0x6d, 0x65, 0x76, 0x2d, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, - 0x20, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0xd2, 0x01, 0x09, 0x74, 0x78, 0x5f, 0x68, 0x61, 0x73, 0x68, - 0x65, 0x73, 0xd2, 0x01, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0xd2, 0x01, 0x0c, 0x62, 0x6c, - 0x6f, 0x63, 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x32, 0xd0, 0x01, 0x7b, 0x22, 0x74, - 0x78, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x65, 0x73, 0x22, 0x3a, 0x20, 0x5b, 0x22, 0x66, 0x65, 0x34, - 0x63, 0x62, 0x34, 0x37, 0x64, 0x62, 0x33, 0x36, 0x33, 0x30, 0x35, 0x35, 0x31, 0x62, 0x65, 0x65, - 0x64, 0x66, 0x62, 0x64, 0x30, 0x32, 0x61, 0x37, 0x31, 0x65, 0x63, 0x63, 0x36, 0x39, 0x66, 0x64, - 0x35, 0x39, 0x37, 0x35, 0x38, 0x65, 0x32, 0x62, 0x61, 0x36, 0x39, 0x39, 0x36, 0x30, 0x36, 0x65, - 0x32, 0x64, 0x35, 0x63, 0x37, 0x34, 0x32, 0x38, 0x34, 0x66, 0x66, 0x61, 0x37, 0x22, 0x2c, 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, 0x5d, 0x2c, 0x20, 0x22, 0x61, 0x6d, 0x6f, 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, 0x5f, 0x6e, 0x75, 0x6d, - 0x62, 0x65, 0x72, 0x22, 0x3a, 0x20, 0x31, 0x32, 0x33, 0x34, 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, 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, 0x08, 0x74, 0x78, 0x48, 0x61, - 0x73, 0x68, 0x65, 0x73, 0x12, 0x8f, 0x01, 0x0a, 0x0a, 0x62, 0x69, 0x64, 0x5f, 0x61, 0x6d, 0x6f, - 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x70, 0x92, 0x41, 0x6d, 0x32, 0x6b, - 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x45, 0x54, 0x48, 0x20, 0x74, 0x68, - 0x61, 0x74, 0x20, 0x74, 0x68, 0x65, 0x20, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x20, 0x68, 0x61, - 0x73, 0x20, 0x61, 0x67, 0x72, 0x65, 0x65, 0x64, 0x20, 0x74, 0x6f, 0x20, 0x70, 0x61, 0x79, 0x20, - 0x74, 0x6f, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x20, - 0x66, 0x6f, 0x72, 0x20, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x69, 0x6e, 0x67, 0x20, 0x74, 0x68, - 0x65, 0x20, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x69, 0x6e, - 0x20, 0x74, 0x68, 0x65, 0x20, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x52, 0x09, 0x62, 0x69, 0x64, - 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x6d, 0x0a, 0x0c, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, - 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x42, 0x4a, 0x92, 0x41, - 0x47, 0x32, 0x45, 0x4d, 0x61, 0x78, 0x20, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x20, 0x6e, 0x75, 0x6d, - 0x62, 0x65, 0x72, 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, 0x74, 0x68, 0x65, 0x20, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, - 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x69, 0x6e, 0x2e, 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, - 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x7b, 0x0a, 0x13, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, - 0x64, 0x5f, 0x62, 0x69, 0x64, 0x5f, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x09, 0x42, 0x4b, 0x92, 0x41, 0x48, 0x32, 0x46, 0x48, 0x65, 0x78, 0x20, 0x73, 0x74, 0x72, - 0x69, 0x6e, 0x67, 0x20, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x20, 0x6f, 0x66, 0x20, - 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x62, 0x69, - 0x64, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, - 0x20, 0x62, 0x79, 0x20, 0x74, 0x68, 0x65, 0x20, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x2e, 0x52, - 0x11, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x42, 0x69, 0x64, 0x44, 0x69, 0x67, 0x65, - 0x73, 0x74, 0x12, 0x7d, 0x0a, 0x16, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x5f, 0x62, - 0x69, 0x64, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x09, 0x42, 0x47, 0x92, 0x41, 0x44, 0x32, 0x42, 0x48, 0x65, 0x78, 0x20, 0x73, 0x74, 0x72, - 0x69, 0x6e, 0x67, 0x20, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x20, 0x6f, 0x66, 0x20, - 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, - 0x20, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x73, 0x65, 0x6e, - 0x74, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x62, 0x69, 0x64, 0x2e, 0x52, 0x14, 0x72, 0x65, 0x63, - 0x65, 0x69, 0x76, 0x65, 0x64, 0x42, 0x69, 0x64, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, - 0x65, 0x12, 0x62, 0x0a, 0x11, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x5f, - 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x42, 0x35, 0x92, 0x41, - 0x32, 0x32, 0x30, 0x48, 0x65, 0x78, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x65, 0x6e, - 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x20, 0x6f, 0x66, 0x20, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, - 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, - 0x6e, 0x74, 0x2e, 0x52, 0x10, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x44, - 0x69, 0x67, 0x65, 0x73, 0x74, 0x12, 0x9e, 0x01, 0x0a, 0x14, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, - 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x07, - 0x20, 0x01, 0x28, 0x09, 0x42, 0x6b, 0x92, 0x41, 0x68, 0x32, 0x66, 0x48, 0x65, 0x78, 0x20, 0x73, - 0x74, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x20, 0x6f, - 0x66, 0x20, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x74, - 0x68, 0x65, 0x20, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x73, 0x69, - 0x67, 0x6e, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x72, 0x6f, 0x76, - 0x69, 0x64, 0x65, 0x72, 0x20, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x69, 0x6e, 0x67, 0x20, - 0x74, 0x68, 0x69, 0x73, 0x20, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, - 0x2e, 0x52, 0x13, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x53, 0x69, 0x67, - 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x88, 0x01, 0x0a, 0x10, 0x70, 0x72, 0x6f, 0x76, 0x69, - 0x64, 0x65, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, - 0x09, 0x42, 0x5d, 0x92, 0x41, 0x5a, 0x32, 0x58, 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, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, - 0x65, 0x20, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, - 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x20, 0x74, 0x68, 0x65, 0x20, 0x63, 0x6f, 0x6d, 0x6d, 0x69, - 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x2e, - 0x52, 0x0f, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, - 0x73, 0x12, 0x64, 0x0a, 0x15, 0x64, 0x65, 0x63, 0x61, 0x79, 0x5f, 0x73, 0x74, 0x61, 0x72, 0x74, - 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, - 0x42, 0x30, 0x92, 0x41, 0x2d, 0x32, 0x2b, 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, 0x73, 0x74, 0x61, 0x72, 0x74, 0x73, 0x20, 0x64, 0x65, 0x63, 0x61, 0x79, 0x69, 0x6e, - 0x67, 0x2e, 0x52, 0x13, 0x64, 0x65, 0x63, 0x61, 0x79, 0x53, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, - 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x5e, 0x0a, 0x13, 0x64, 0x65, 0x63, 0x61, 0x79, - 0x5f, 0x65, 0x6e, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x0a, - 0x20, 0x01, 0x28, 0x03, 0x42, 0x2e, 0x92, 0x41, 0x2b, 0x32, 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, 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, 0xff, 0x05, 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, 0x6b, 0x0a, 0x07, - 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x12, 0x1c, 0x2e, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, - 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x61, 0x70, - 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x23, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x22, 0x1b, 0x2f, 0x76, - 0x31, 0x2f, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x2f, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, - 0x2f, 0x7b, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x7d, 0x12, 0x78, 0x0a, 0x0b, 0x41, 0x75, 0x74, - 0x6f, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x12, 0x1c, 0x2e, 0x62, 0x69, 0x64, 0x64, 0x65, - 0x72, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x61, - 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x75, 0x74, 0x6f, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, - 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x28, 0x82, 0xd3, 0xe4, 0x93, 0x02, - 0x22, 0x22, 0x20, 0x2f, 0x76, 0x31, 0x2f, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x2f, 0x61, 0x75, - 0x74, 0x6f, 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x2f, 0x7b, 0x61, 0x6d, 0x6f, 0x75, - 0x6e, 0x74, 0x7d, 0x12, 0x73, 0x0a, 0x11, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x41, 0x75, 0x74, - 0x6f, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 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, 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, - 0x22, 0x26, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x22, 0x1e, 0x2f, 0x76, 0x31, 0x2f, 0x62, 0x69, - 0x64, 0x64, 0x65, 0x72, 0x2f, 0x63, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x5f, 0x61, 0x75, 0x74, 0x6f, - 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x12, 0x6c, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x44, - 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x12, 0x1f, 0x2e, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x61, - 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, - 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x18, 0x12, 0x16, - 0x2f, 0x76, 0x31, 0x2f, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x2f, 0x67, 0x65, 0x74, 0x5f, 0x64, - 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x12, 0x6e, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x4d, 0x69, 0x6e, - 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 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, 0x1d, 0x2e, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x2e, - 0x76, 0x31, 0x2e, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x22, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1c, 0x12, 0x1a, 0x2f, 0x76, 0x31, 0x2f, - 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x2f, 0x67, 0x65, 0x74, 0x5f, 0x6d, 0x69, 0x6e, 0x5f, 0x64, - 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x12, 0x66, 0x0a, 0x08, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, - 0x61, 0x77, 0x12, 0x1d, 0x2e, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x76, - 0x31, 0x2e, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x1e, 0x2e, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, - 0x2e, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x1b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x15, 0x22, 0x13, 0x2f, 0x76, 0x31, 0x2f, 0x62, - 0x69, 0x64, 0x64, 0x65, 0x72, 0x2f, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x42, 0xaa, - 0x02, 0x92, 0x41, 0x72, 0x12, 0x70, 0x0a, 0x0a, 0x42, 0x69, 0x64, 0x64, 0x65, 0x72, 0x20, 0x41, - 0x50, 0x49, 0x2a, 0x55, 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, 0x36, 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, 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, 0x40, 0x67, 0x69, 0x74, 0x68, - 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x65, 0x76, 0x2f, 0x6d, 0x65, - 0x76, 0x2d, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x2f, 0x70, 0x32, 0x70, 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, + 0x6d, 0x70, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x42, 0x87, 0x01, 0x92, 0x41, 0x2b, 0x32, 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, 0xba, 0x48, 0x56, 0xba, 0x01, 0x53, 0x0a, + 0x13, 0x64, 0x65, 0x63, 0x61, 0x79, 0x5f, 0x65, 0x6e, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x73, + 0x74, 0x61, 0x6d, 0x70, 0x12, 0x2c, 0x64, 0x65, 0x63, 0x61, 0x79, 0x5f, 0x65, 0x6e, 0x64, 0x5f, + 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x20, 0x6d, 0x75, 0x73, 0x74, 0x20, 0x62, + 0x65, 0x20, 0x61, 0x20, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x20, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, + 0x72, 0x2e, 0x1a, 0x0e, 0x75, 0x69, 0x6e, 0x74, 0x28, 0x74, 0x68, 0x69, 0x73, 0x29, 0x20, 0x3e, + 0x20, 0x30, 0x52, 0x11, 0x64, 0x65, 0x63, 0x61, 0x79, 0x45, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, + 0x73, 0x74, 0x61, 0x6d, 0x70, 0x3a, 0xcc, 0x02, 0x92, 0x41, 0xc8, 0x02, 0x0a, 0x73, 0x2a, 0x0b, + 0x42, 0x69, 0x64, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x32, 0x40, 0x55, 0x6e, 0x73, + 0x69, 0x67, 0x6e, 0x65, 0x64, 0x20, 0x62, 0x69, 0x64, 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, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x20, 0x6d, 0x65, 0x76, + 0x2d, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x20, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0xd2, 0x01, 0x09, + 0x74, 0x78, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x65, 0x73, 0xd2, 0x01, 0x06, 0x61, 0x6d, 0x6f, 0x75, + 0x6e, 0x74, 0xd2, 0x01, 0x0c, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, + 0x72, 0x32, 0xd0, 0x01, 0x7b, 0x22, 0x74, 0x78, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x65, 0x73, 0x22, + 0x3a, 0x20, 0x5b, 0x22, 0x66, 0x65, 0x34, 0x63, 0x62, 0x34, 0x37, 0x64, 0x62, 0x33, 0x36, 0x33, + 0x30, 0x35, 0x35, 0x31, 0x62, 0x65, 0x65, 0x64, 0x66, 0x62, 0x64, 0x30, 0x32, 0x61, 0x37, 0x31, + 0x65, 0x63, 0x63, 0x36, 0x39, 0x66, 0x64, 0x35, 0x39, 0x37, 0x35, 0x38, 0x65, 0x32, 0x62, 0x61, + 0x36, 0x39, 0x39, 0x36, 0x30, 0x36, 0x65, 0x32, 0x64, 0x35, 0x63, 0x37, 0x34, 0x32, 0x38, 0x34, + 0x66, 0x66, 0x61, 0x37, 0x22, 0x2c, 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, 0x5d, 0x2c, 0x20, 0x22, 0x61, 0x6d, 0x6f, + 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, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x22, 0x3a, 0x20, 0x31, 0x32, 0x33, + 0x34, 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, 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, 0x08, 0x74, 0x78, 0x48, 0x61, 0x73, 0x68, 0x65, 0x73, 0x12, 0x8f, 0x01, 0x0a, 0x0a, + 0x62, 0x69, 0x64, 0x5f, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x42, 0x70, 0x92, 0x41, 0x6d, 0x32, 0x6b, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x20, 0x6f, 0x66, + 0x20, 0x45, 0x54, 0x48, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x74, 0x68, 0x65, 0x20, 0x62, 0x69, + 0x64, 0x64, 0x65, 0x72, 0x20, 0x68, 0x61, 0x73, 0x20, 0x61, 0x67, 0x72, 0x65, 0x65, 0x64, 0x20, + 0x74, 0x6f, 0x20, 0x70, 0x61, 0x79, 0x20, 0x74, 0x6f, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x72, + 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x69, 0x6e, 0x63, 0x6c, 0x75, + 0x64, 0x69, 0x6e, 0x67, 0x20, 0x74, 0x68, 0x65, 0x20, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x62, 0x6c, 0x6f, 0x63, + 0x6b, 0x2e, 0x52, 0x09, 0x62, 0x69, 0x64, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x6d, 0x0a, + 0x0c, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x03, 0x42, 0x4a, 0x92, 0x41, 0x47, 0x32, 0x45, 0x4d, 0x61, 0x78, 0x20, 0x62, 0x6c, + 0x6f, 0x63, 0x6b, 0x20, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 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, 0x74, 0x68, 0x65, 0x20, + 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x69, 0x6e, 0x2e, 0x52, + 0x0b, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x7b, 0x0a, 0x13, + 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x5f, 0x62, 0x69, 0x64, 0x5f, 0x64, 0x69, 0x67, + 0x65, 0x73, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x4b, 0x92, 0x41, 0x48, 0x32, 0x46, + 0x48, 0x65, 0x78, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x65, 0x6e, 0x63, 0x6f, 0x64, + 0x69, 0x6e, 0x67, 0x20, 0x6f, 0x66, 0x20, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x20, 0x6f, 0x66, + 0x20, 0x74, 0x68, 0x65, 0x20, 0x62, 0x69, 0x64, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x20, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x74, 0x68, 0x65, 0x20, 0x62, + 0x69, 0x64, 0x64, 0x65, 0x72, 0x2e, 0x52, 0x11, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, + 0x42, 0x69, 0x64, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x12, 0x7d, 0x0a, 0x16, 0x72, 0x65, 0x63, + 0x65, 0x69, 0x76, 0x65, 0x64, 0x5f, 0x62, 0x69, 0x64, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, + 0x75, 0x72, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x47, 0x92, 0x41, 0x44, 0x32, 0x42, + 0x48, 0x65, 0x78, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x65, 0x6e, 0x63, 0x6f, 0x64, + 0x69, 0x6e, 0x67, 0x20, 0x6f, 0x66, 0x20, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, + 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x20, 0x74, + 0x68, 0x61, 0x74, 0x20, 0x73, 0x65, 0x6e, 0x74, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x62, 0x69, + 0x64, 0x2e, 0x52, 0x14, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x42, 0x69, 0x64, 0x53, + 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x62, 0x0a, 0x11, 0x63, 0x6f, 0x6d, 0x6d, + 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x18, 0x06, 0x20, + 0x01, 0x28, 0x09, 0x42, 0x35, 0x92, 0x41, 0x32, 0x32, 0x30, 0x48, 0x65, 0x78, 0x20, 0x73, 0x74, + 0x72, 0x69, 0x6e, 0x67, 0x20, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x20, 0x6f, 0x66, + 0x20, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x63, + 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x52, 0x10, 0x63, 0x6f, 0x6d, 0x6d, + 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x12, 0x9e, 0x01, 0x0a, + 0x14, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x69, 0x67, 0x6e, + 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x42, 0x6b, 0x92, 0x41, 0x68, + 0x32, 0x66, 0x48, 0x65, 0x78, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x65, 0x6e, 0x63, + 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x20, 0x6f, 0x66, 0x20, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, + 0x72, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, + 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x74, + 0x68, 0x65, 0x20, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x20, 0x63, 0x6f, 0x6e, 0x66, + 0x69, 0x72, 0x6d, 0x69, 0x6e, 0x67, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x74, 0x72, 0x61, 0x6e, + 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x13, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, + 0x6d, 0x65, 0x6e, 0x74, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x88, 0x01, + 0x0a, 0x10, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, + 0x73, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x42, 0x5d, 0x92, 0x41, 0x5a, 0x32, 0x58, 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, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, + 0x72, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x20, 0x74, 0x68, + 0x65, 0x20, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x73, 0x69, 0x67, + 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x2e, 0x52, 0x0f, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, + 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x64, 0x0a, 0x15, 0x64, 0x65, 0x63, 0x61, + 0x79, 0x5f, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, + 0x70, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x42, 0x30, 0x92, 0x41, 0x2d, 0x32, 0x2b, 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, 0x73, 0x74, 0x61, 0x72, 0x74, 0x73, 0x20, + 0x64, 0x65, 0x63, 0x61, 0x79, 0x69, 0x6e, 0x67, 0x2e, 0x52, 0x13, 0x64, 0x65, 0x63, 0x61, 0x79, + 0x53, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x5e, + 0x0a, 0x13, 0x64, 0x65, 0x63, 0x61, 0x79, 0x5f, 0x65, 0x6e, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, + 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x03, 0x42, 0x2e, 0x92, 0x41, 0x2b, + 0x32, 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, 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, 0xab, 0x08, 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, 0x6b, 0x0a, 0x07, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x12, 0x1c, + 0x2e, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, + 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x62, + 0x69, 0x64, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x70, 0x6f, + 0x73, 0x69, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x23, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x1d, 0x22, 0x1b, 0x2f, 0x76, 0x31, 0x2f, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x2f, + 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x2f, 0x7b, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x7d, + 0x12, 0x78, 0x0a, 0x0b, 0x41, 0x75, 0x74, 0x6f, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x12, + 0x1c, 0x2e, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x44, + 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, + 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x75, 0x74, + 0x6f, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x28, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x22, 0x22, 0x20, 0x2f, 0x76, 0x31, 0x2f, 0x62, 0x69, + 0x64, 0x64, 0x65, 0x72, 0x2f, 0x61, 0x75, 0x74, 0x6f, 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, + 0x74, 0x2f, 0x7b, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x7d, 0x12, 0x80, 0x01, 0x0a, 0x11, 0x43, + 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x41, 0x75, 0x74, 0x6f, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, + 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, 0x27, 0x2e, 0x62, + 0x69, 0x64, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x61, 0x6e, 0x63, + 0x65, 0x6c, 0x41, 0x75, 0x74, 0x6f, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x26, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x22, 0x1e, 0x2f, + 0x76, 0x31, 0x2f, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x2f, 0x63, 0x61, 0x6e, 0x63, 0x65, 0x6c, + 0x5f, 0x61, 0x75, 0x74, 0x6f, 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x12, 0x80, 0x01, + 0x0a, 0x11, 0x41, 0x75, 0x74, 0x6f, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x53, 0x74, 0x61, + 0x74, 0x75, 0x73, 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, + 0x27, 0x2e, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x41, + 0x75, 0x74, 0x6f, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x26, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, + 0x12, 0x1e, 0x2f, 0x76, 0x31, 0x2f, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x2f, 0x61, 0x75, 0x74, + 0x6f, 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x12, 0x98, 0x01, 0x0a, 0x1c, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x41, 0x6e, 0x64, 0x57, 0x69, + 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x41, 0x75, 0x74, 0x6f, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, + 0x74, 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, 0x27, 0x2e, + 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x61, 0x6e, + 0x63, 0x65, 0x6c, 0x41, 0x75, 0x74, 0x6f, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x33, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2d, 0x22, 0x2b, + 0x2f, 0x76, 0x31, 0x2f, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x2f, 0x63, 0x61, 0x6e, 0x63, 0x65, + 0x6c, 0x5f, 0x61, 0x6e, 0x64, 0x5f, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x5f, 0x61, + 0x75, 0x74, 0x6f, 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x12, 0x6c, 0x0a, 0x0a, 0x47, + 0x65, 0x74, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x12, 0x1f, 0x2e, 0x62, 0x69, 0x64, 0x64, + 0x65, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x44, 0x65, 0x70, 0x6f, + 0x73, 0x69, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x62, 0x69, 0x64, + 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, + 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1e, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x18, 0x12, 0x16, 0x2f, 0x76, 0x31, 0x2f, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x2f, 0x67, 0x65, + 0x74, 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x12, 0x6e, 0x0a, 0x0d, 0x47, 0x65, 0x74, + 0x4d, 0x69, 0x6e, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 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, 0x1d, 0x2e, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x22, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1c, 0x12, 0x1a, 0x2f, + 0x76, 0x31, 0x2f, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x2f, 0x67, 0x65, 0x74, 0x5f, 0x6d, 0x69, + 0x6e, 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x12, 0x66, 0x0a, 0x08, 0x57, 0x69, 0x74, + 0x68, 0x64, 0x72, 0x61, 0x77, 0x12, 0x1d, 0x2e, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x61, 0x70, + 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, + 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x15, 0x22, 0x13, 0x2f, 0x76, + 0x31, 0x2f, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x2f, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, + 0x77, 0x42, 0xaa, 0x02, 0x92, 0x41, 0x72, 0x12, 0x70, 0x0a, 0x0a, 0x42, 0x69, 0x64, 0x64, 0x65, + 0x72, 0x20, 0x41, 0x50, 0x49, 0x2a, 0x55, 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, 0x36, 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, 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, 0x40, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x65, 0x76, + 0x2f, 0x6d, 0x65, 0x76, 0x2d, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x2f, 0x70, 0x32, 0x70, 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 ( @@ -1068,48 +1230,56 @@ func file_bidderapi_v1_bidderapi_proto_rawDescGZIP() []byte { return file_bidderapi_v1_bidderapi_proto_rawDescData } -var file_bidderapi_v1_bidderapi_proto_msgTypes = make([]protoimpl.MessageInfo, 10) +var file_bidderapi_v1_bidderapi_proto_msgTypes = make([]protoimpl.MessageInfo, 12) var file_bidderapi_v1_bidderapi_proto_goTypes = []interface{}{ - (*DepositRequest)(nil), // 0: bidderapi.v1.DepositRequest - (*DepositResponse)(nil), // 1: bidderapi.v1.DepositResponse - (*AutoDepositResponse)(nil), // 2: bidderapi.v1.AutoDepositResponse - (*AutoDeposit)(nil), // 3: bidderapi.v1.AutoDeposit - (*EmptyMessage)(nil), // 4: bidderapi.v1.EmptyMessage - (*GetDepositRequest)(nil), // 5: bidderapi.v1.GetDepositRequest - (*WithdrawRequest)(nil), // 6: bidderapi.v1.WithdrawRequest - (*WithdrawResponse)(nil), // 7: bidderapi.v1.WithdrawResponse - (*Bid)(nil), // 8: bidderapi.v1.Bid - (*Commitment)(nil), // 9: bidderapi.v1.Commitment - (*wrapperspb.UInt64Value)(nil), // 10: google.protobuf.UInt64Value + (*DepositRequest)(nil), // 0: bidderapi.v1.DepositRequest + (*DepositResponse)(nil), // 1: bidderapi.v1.DepositResponse + (*AutoDepositResponse)(nil), // 2: bidderapi.v1.AutoDepositResponse + (*AutoDepositStatusResponse)(nil), // 3: bidderapi.v1.AutoDepositStatusResponse + (*CancelAutoDepositResponse)(nil), // 4: bidderapi.v1.CancelAutoDepositResponse + (*AutoDeposit)(nil), // 5: bidderapi.v1.AutoDeposit + (*EmptyMessage)(nil), // 6: bidderapi.v1.EmptyMessage + (*GetDepositRequest)(nil), // 7: bidderapi.v1.GetDepositRequest + (*WithdrawRequest)(nil), // 8: bidderapi.v1.WithdrawRequest + (*WithdrawResponse)(nil), // 9: bidderapi.v1.WithdrawResponse + (*Bid)(nil), // 10: bidderapi.v1.Bid + (*Commitment)(nil), // 11: bidderapi.v1.Commitment + (*wrapperspb.UInt64Value)(nil), // 12: google.protobuf.UInt64Value } var file_bidderapi_v1_bidderapi_proto_depIdxs = []int32{ - 10, // 0: bidderapi.v1.DepositRequest.window_number:type_name -> google.protobuf.UInt64Value - 10, // 1: bidderapi.v1.DepositRequest.block_number:type_name -> google.protobuf.UInt64Value - 10, // 2: bidderapi.v1.DepositResponse.window_number:type_name -> google.protobuf.UInt64Value - 3, // 3: bidderapi.v1.AutoDepositResponse.amounts_and_window_numbers:type_name -> bidderapi.v1.AutoDeposit - 10, // 4: bidderapi.v1.AutoDeposit.window_number:type_name -> google.protobuf.UInt64Value - 10, // 5: bidderapi.v1.GetDepositRequest.window_number:type_name -> google.protobuf.UInt64Value - 10, // 6: bidderapi.v1.WithdrawRequest.window_number:type_name -> google.protobuf.UInt64Value - 10, // 7: bidderapi.v1.WithdrawResponse.window_number:type_name -> google.protobuf.UInt64Value - 8, // 8: bidderapi.v1.Bidder.SendBid:input_type -> bidderapi.v1.Bid - 0, // 9: bidderapi.v1.Bidder.Deposit:input_type -> bidderapi.v1.DepositRequest - 0, // 10: bidderapi.v1.Bidder.AutoDeposit:input_type -> bidderapi.v1.DepositRequest - 4, // 11: bidderapi.v1.Bidder.CancelAutoDeposit:input_type -> bidderapi.v1.EmptyMessage - 5, // 12: bidderapi.v1.Bidder.GetDeposit:input_type -> bidderapi.v1.GetDepositRequest - 4, // 13: bidderapi.v1.Bidder.GetMinDeposit:input_type -> bidderapi.v1.EmptyMessage - 6, // 14: bidderapi.v1.Bidder.Withdraw:input_type -> bidderapi.v1.WithdrawRequest - 9, // 15: bidderapi.v1.Bidder.SendBid:output_type -> bidderapi.v1.Commitment - 1, // 16: bidderapi.v1.Bidder.Deposit:output_type -> bidderapi.v1.DepositResponse - 2, // 17: bidderapi.v1.Bidder.AutoDeposit:output_type -> bidderapi.v1.AutoDepositResponse - 4, // 18: bidderapi.v1.Bidder.CancelAutoDeposit:output_type -> bidderapi.v1.EmptyMessage - 1, // 19: bidderapi.v1.Bidder.GetDeposit:output_type -> bidderapi.v1.DepositResponse - 1, // 20: bidderapi.v1.Bidder.GetMinDeposit:output_type -> bidderapi.v1.DepositResponse - 7, // 21: bidderapi.v1.Bidder.Withdraw:output_type -> bidderapi.v1.WithdrawResponse - 15, // [15:22] is the sub-list for method output_type - 8, // [8:15] is the sub-list for method input_type - 8, // [8:8] is the sub-list for extension type_name - 8, // [8:8] is the sub-list for extension extendee - 0, // [0:8] is the sub-list for field type_name + 12, // 0: bidderapi.v1.DepositRequest.window_number:type_name -> google.protobuf.UInt64Value + 12, // 1: bidderapi.v1.DepositRequest.block_number:type_name -> google.protobuf.UInt64Value + 12, // 2: bidderapi.v1.DepositResponse.window_number:type_name -> google.protobuf.UInt64Value + 5, // 3: bidderapi.v1.AutoDepositResponse.amounts_and_window_numbers:type_name -> bidderapi.v1.AutoDeposit + 5, // 4: bidderapi.v1.AutoDepositStatusResponse.amounts_and_window_numbers:type_name -> bidderapi.v1.AutoDeposit + 12, // 5: bidderapi.v1.CancelAutoDepositResponse.window_numbers:type_name -> google.protobuf.UInt64Value + 12, // 6: bidderapi.v1.AutoDeposit.window_number:type_name -> google.protobuf.UInt64Value + 12, // 7: bidderapi.v1.GetDepositRequest.window_number:type_name -> google.protobuf.UInt64Value + 12, // 8: bidderapi.v1.WithdrawRequest.window_number:type_name -> google.protobuf.UInt64Value + 12, // 9: bidderapi.v1.WithdrawResponse.window_number:type_name -> google.protobuf.UInt64Value + 10, // 10: bidderapi.v1.Bidder.SendBid:input_type -> bidderapi.v1.Bid + 0, // 11: bidderapi.v1.Bidder.Deposit:input_type -> bidderapi.v1.DepositRequest + 0, // 12: bidderapi.v1.Bidder.AutoDeposit:input_type -> bidderapi.v1.DepositRequest + 6, // 13: bidderapi.v1.Bidder.CancelAutoDeposit:input_type -> bidderapi.v1.EmptyMessage + 6, // 14: bidderapi.v1.Bidder.AutoDepositStatus:input_type -> bidderapi.v1.EmptyMessage + 6, // 15: bidderapi.v1.Bidder.CancelAndWithdrawAutoDeposit:input_type -> bidderapi.v1.EmptyMessage + 7, // 16: bidderapi.v1.Bidder.GetDeposit:input_type -> bidderapi.v1.GetDepositRequest + 6, // 17: bidderapi.v1.Bidder.GetMinDeposit:input_type -> bidderapi.v1.EmptyMessage + 8, // 18: bidderapi.v1.Bidder.Withdraw:input_type -> bidderapi.v1.WithdrawRequest + 11, // 19: bidderapi.v1.Bidder.SendBid:output_type -> bidderapi.v1.Commitment + 1, // 20: bidderapi.v1.Bidder.Deposit:output_type -> bidderapi.v1.DepositResponse + 2, // 21: bidderapi.v1.Bidder.AutoDeposit:output_type -> bidderapi.v1.AutoDepositResponse + 4, // 22: bidderapi.v1.Bidder.CancelAutoDeposit:output_type -> bidderapi.v1.CancelAutoDepositResponse + 3, // 23: bidderapi.v1.Bidder.AutoDepositStatus:output_type -> bidderapi.v1.AutoDepositStatusResponse + 4, // 24: bidderapi.v1.Bidder.CancelAndWithdrawAutoDeposit:output_type -> bidderapi.v1.CancelAutoDepositResponse + 1, // 25: bidderapi.v1.Bidder.GetDeposit:output_type -> bidderapi.v1.DepositResponse + 1, // 26: bidderapi.v1.Bidder.GetMinDeposit:output_type -> bidderapi.v1.DepositResponse + 9, // 27: bidderapi.v1.Bidder.Withdraw:output_type -> bidderapi.v1.WithdrawResponse + 19, // [19:28] is the sub-list for method output_type + 10, // [10:19] is the sub-list for method input_type + 10, // [10:10] is the sub-list for extension type_name + 10, // [10:10] is the sub-list for extension extendee + 0, // [0:10] is the sub-list for field type_name } func init() { file_bidderapi_v1_bidderapi_proto_init() } @@ -1155,7 +1325,7 @@ func file_bidderapi_v1_bidderapi_proto_init() { } } file_bidderapi_v1_bidderapi_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AutoDeposit); i { + switch v := v.(*AutoDepositStatusResponse); i { case 0: return &v.state case 1: @@ -1167,7 +1337,7 @@ func file_bidderapi_v1_bidderapi_proto_init() { } } file_bidderapi_v1_bidderapi_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*EmptyMessage); i { + switch v := v.(*CancelAutoDepositResponse); i { case 0: return &v.state case 1: @@ -1179,7 +1349,7 @@ func file_bidderapi_v1_bidderapi_proto_init() { } } file_bidderapi_v1_bidderapi_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetDepositRequest); i { + switch v := v.(*AutoDeposit); i { case 0: return &v.state case 1: @@ -1191,7 +1361,7 @@ func file_bidderapi_v1_bidderapi_proto_init() { } } file_bidderapi_v1_bidderapi_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*WithdrawRequest); i { + switch v := v.(*EmptyMessage); i { case 0: return &v.state case 1: @@ -1203,7 +1373,7 @@ func file_bidderapi_v1_bidderapi_proto_init() { } } file_bidderapi_v1_bidderapi_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*WithdrawResponse); i { + switch v := v.(*GetDepositRequest); i { case 0: return &v.state case 1: @@ -1215,7 +1385,7 @@ func file_bidderapi_v1_bidderapi_proto_init() { } } file_bidderapi_v1_bidderapi_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Bid); i { + switch v := v.(*WithdrawRequest); i { case 0: return &v.state case 1: @@ -1227,6 +1397,30 @@ func file_bidderapi_v1_bidderapi_proto_init() { } } file_bidderapi_v1_bidderapi_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*WithdrawResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_bidderapi_v1_bidderapi_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Bid); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_bidderapi_v1_bidderapi_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Commitment); i { case 0: return &v.state @@ -1245,7 +1439,7 @@ func file_bidderapi_v1_bidderapi_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_bidderapi_v1_bidderapi_proto_rawDesc, NumEnums: 0, - NumMessages: 10, + NumMessages: 12, NumExtensions: 0, NumServices: 1, }, diff --git a/p2p/gen/go/bidderapi/v1/bidderapi.pb.gw.go b/p2p/gen/go/bidderapi/v1/bidderapi.pb.gw.go index dd5d996d9..7e11b8782 100644 --- a/p2p/gen/go/bidderapi/v1/bidderapi.pb.gw.go +++ b/p2p/gen/go/bidderapi/v1/bidderapi.pb.gw.go @@ -210,6 +210,42 @@ func local_request_Bidder_CancelAutoDeposit_0(ctx context.Context, marshaler run } +func request_Bidder_AutoDepositStatus_0(ctx context.Context, marshaler runtime.Marshaler, client BidderClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq EmptyMessage + var metadata runtime.ServerMetadata + + msg, err := client.AutoDepositStatus(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Bidder_AutoDepositStatus_0(ctx context.Context, marshaler runtime.Marshaler, server BidderServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq EmptyMessage + var metadata runtime.ServerMetadata + + msg, err := server.AutoDepositStatus(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Bidder_CancelAndWithdrawAutoDeposit_0(ctx context.Context, marshaler runtime.Marshaler, client BidderClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq EmptyMessage + var metadata runtime.ServerMetadata + + msg, err := client.CancelAndWithdrawAutoDeposit(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Bidder_CancelAndWithdrawAutoDeposit_0(ctx context.Context, marshaler runtime.Marshaler, server BidderServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq EmptyMessage + var metadata runtime.ServerMetadata + + msg, err := server.CancelAndWithdrawAutoDeposit(ctx, &protoReq) + return msg, metadata, err + +} + var ( filter_Bidder_GetDeposit_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} ) @@ -388,6 +424,56 @@ func RegisterBidderHandlerServer(ctx context.Context, mux *runtime.ServeMux, ser }) + mux.Handle("GET", pattern_Bidder_AutoDepositStatus_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/bidderapi.v1.Bidder/AutoDepositStatus", runtime.WithHTTPPathPattern("/v1/bidder/auto_deposit_status")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Bidder_AutoDepositStatus_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_Bidder_AutoDepositStatus_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_Bidder_CancelAndWithdrawAutoDeposit_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/bidderapi.v1.Bidder/CancelAndWithdrawAutoDeposit", runtime.WithHTTPPathPattern("/v1/bidder/cancel_and_withdraw_auto_deposit")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Bidder_CancelAndWithdrawAutoDeposit_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_Bidder_CancelAndWithdrawAutoDeposit_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Bidder_GetDeposit_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -592,6 +678,50 @@ func RegisterBidderHandlerClient(ctx context.Context, mux *runtime.ServeMux, cli }) + mux.Handle("GET", pattern_Bidder_AutoDepositStatus_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/bidderapi.v1.Bidder/AutoDepositStatus", runtime.WithHTTPPathPattern("/v1/bidder/auto_deposit_status")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Bidder_AutoDepositStatus_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_Bidder_AutoDepositStatus_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_Bidder_CancelAndWithdrawAutoDeposit_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/bidderapi.v1.Bidder/CancelAndWithdrawAutoDeposit", runtime.WithHTTPPathPattern("/v1/bidder/cancel_and_withdraw_auto_deposit")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Bidder_CancelAndWithdrawAutoDeposit_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_Bidder_CancelAndWithdrawAutoDeposit_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Bidder_GetDeposit_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -670,6 +800,10 @@ var ( pattern_Bidder_CancelAutoDeposit_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "bidder", "cancel_auto_deposit"}, "")) + pattern_Bidder_AutoDepositStatus_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "bidder", "auto_deposit_status"}, "")) + + pattern_Bidder_CancelAndWithdrawAutoDeposit_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "bidder", "cancel_and_withdraw_auto_deposit"}, "")) + pattern_Bidder_GetDeposit_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "bidder", "get_deposit"}, "")) pattern_Bidder_GetMinDeposit_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "bidder", "get_min_deposit"}, "")) @@ -686,6 +820,10 @@ var ( forward_Bidder_CancelAutoDeposit_0 = runtime.ForwardResponseMessage + forward_Bidder_AutoDepositStatus_0 = runtime.ForwardResponseMessage + + forward_Bidder_CancelAndWithdrawAutoDeposit_0 = runtime.ForwardResponseMessage + forward_Bidder_GetDeposit_0 = runtime.ForwardResponseMessage forward_Bidder_GetMinDeposit_0 = runtime.ForwardResponseMessage diff --git a/p2p/gen/go/bidderapi/v1/bidderapi_grpc.pb.go b/p2p/gen/go/bidderapi/v1/bidderapi_grpc.pb.go index ef5e02b38..7fdcb936c 100644 --- a/p2p/gen/go/bidderapi/v1/bidderapi_grpc.pb.go +++ b/p2p/gen/go/bidderapi/v1/bidderapi_grpc.pb.go @@ -19,13 +19,15 @@ import ( const _ = grpc.SupportPackageIsVersion8 const ( - Bidder_SendBid_FullMethodName = "/bidderapi.v1.Bidder/SendBid" - Bidder_Deposit_FullMethodName = "/bidderapi.v1.Bidder/Deposit" - Bidder_AutoDeposit_FullMethodName = "/bidderapi.v1.Bidder/AutoDeposit" - Bidder_CancelAutoDeposit_FullMethodName = "/bidderapi.v1.Bidder/CancelAutoDeposit" - Bidder_GetDeposit_FullMethodName = "/bidderapi.v1.Bidder/GetDeposit" - Bidder_GetMinDeposit_FullMethodName = "/bidderapi.v1.Bidder/GetMinDeposit" - Bidder_Withdraw_FullMethodName = "/bidderapi.v1.Bidder/Withdraw" + Bidder_SendBid_FullMethodName = "/bidderapi.v1.Bidder/SendBid" + Bidder_Deposit_FullMethodName = "/bidderapi.v1.Bidder/Deposit" + Bidder_AutoDeposit_FullMethodName = "/bidderapi.v1.Bidder/AutoDeposit" + Bidder_CancelAutoDeposit_FullMethodName = "/bidderapi.v1.Bidder/CancelAutoDeposit" + Bidder_AutoDepositStatus_FullMethodName = "/bidderapi.v1.Bidder/AutoDepositStatus" + Bidder_CancelAndWithdrawAutoDeposit_FullMethodName = "/bidderapi.v1.Bidder/CancelAndWithdrawAutoDeposit" + Bidder_GetDeposit_FullMethodName = "/bidderapi.v1.Bidder/GetDeposit" + Bidder_GetMinDeposit_FullMethodName = "/bidderapi.v1.Bidder/GetMinDeposit" + Bidder_Withdraw_FullMethodName = "/bidderapi.v1.Bidder/Withdraw" ) // BidderClient is the client API for Bidder service. @@ -47,7 +49,15 @@ type BidderClient interface { // CancelAutoDeposit // // CancelAutoDeposit is called by the bidder node to cancel the auto deposit. - CancelAutoDeposit(ctx context.Context, in *EmptyMessage, opts ...grpc.CallOption) (*EmptyMessage, error) + CancelAutoDeposit(ctx context.Context, in *EmptyMessage, opts ...grpc.CallOption) (*CancelAutoDepositResponse, error) + // AutoDepositStatus + // + // AutoDepositStatus is called by the bidder node to get the status of the auto deposit. + AutoDepositStatus(ctx context.Context, in *EmptyMessage, opts ...grpc.CallOption) (*AutoDepositStatusResponse, error) + // CancelAndWithdrawAutoDeposit + // + // CancelAndWithdrawAutoDeposit is called by the bidder node to cancel the auto deposit and withdraw the funds. + CancelAndWithdrawAutoDeposit(ctx context.Context, in *EmptyMessage, opts ...grpc.CallOption) (*CancelAutoDepositResponse, error) // GetDeposit // // GetDeposit is called by the bidder to get its deposit in the bidder registry. @@ -123,9 +133,9 @@ func (c *bidderClient) AutoDeposit(ctx context.Context, in *DepositRequest, opts return out, nil } -func (c *bidderClient) CancelAutoDeposit(ctx context.Context, in *EmptyMessage, opts ...grpc.CallOption) (*EmptyMessage, error) { +func (c *bidderClient) CancelAutoDeposit(ctx context.Context, in *EmptyMessage, opts ...grpc.CallOption) (*CancelAutoDepositResponse, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(EmptyMessage) + out := new(CancelAutoDepositResponse) err := c.cc.Invoke(ctx, Bidder_CancelAutoDeposit_FullMethodName, in, out, cOpts...) if err != nil { return nil, err @@ -133,6 +143,26 @@ func (c *bidderClient) CancelAutoDeposit(ctx context.Context, in *EmptyMessage, return out, nil } +func (c *bidderClient) AutoDepositStatus(ctx context.Context, in *EmptyMessage, opts ...grpc.CallOption) (*AutoDepositStatusResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(AutoDepositStatusResponse) + err := c.cc.Invoke(ctx, Bidder_AutoDepositStatus_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *bidderClient) CancelAndWithdrawAutoDeposit(ctx context.Context, in *EmptyMessage, opts ...grpc.CallOption) (*CancelAutoDepositResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(CancelAutoDepositResponse) + err := c.cc.Invoke(ctx, Bidder_CancelAndWithdrawAutoDeposit_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *bidderClient) GetDeposit(ctx context.Context, in *GetDepositRequest, opts ...grpc.CallOption) (*DepositResponse, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(DepositResponse) @@ -182,7 +212,15 @@ type BidderServer interface { // CancelAutoDeposit // // CancelAutoDeposit is called by the bidder node to cancel the auto deposit. - CancelAutoDeposit(context.Context, *EmptyMessage) (*EmptyMessage, error) + CancelAutoDeposit(context.Context, *EmptyMessage) (*CancelAutoDepositResponse, error) + // AutoDepositStatus + // + // AutoDepositStatus is called by the bidder node to get the status of the auto deposit. + AutoDepositStatus(context.Context, *EmptyMessage) (*AutoDepositStatusResponse, error) + // CancelAndWithdrawAutoDeposit + // + // CancelAndWithdrawAutoDeposit is called by the bidder node to cancel the auto deposit and withdraw the funds. + CancelAndWithdrawAutoDeposit(context.Context, *EmptyMessage) (*CancelAutoDepositResponse, error) // GetDeposit // // GetDeposit is called by the bidder to get its deposit in the bidder registry. @@ -211,9 +249,15 @@ func (UnimplementedBidderServer) Deposit(context.Context, *DepositRequest) (*Dep func (UnimplementedBidderServer) AutoDeposit(context.Context, *DepositRequest) (*AutoDepositResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method AutoDeposit not implemented") } -func (UnimplementedBidderServer) CancelAutoDeposit(context.Context, *EmptyMessage) (*EmptyMessage, error) { +func (UnimplementedBidderServer) CancelAutoDeposit(context.Context, *EmptyMessage) (*CancelAutoDepositResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method CancelAutoDeposit not implemented") } +func (UnimplementedBidderServer) AutoDepositStatus(context.Context, *EmptyMessage) (*AutoDepositStatusResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method AutoDepositStatus not implemented") +} +func (UnimplementedBidderServer) CancelAndWithdrawAutoDeposit(context.Context, *EmptyMessage) (*CancelAutoDepositResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CancelAndWithdrawAutoDeposit not implemented") +} func (UnimplementedBidderServer) GetDeposit(context.Context, *GetDepositRequest) (*DepositResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetDeposit not implemented") } @@ -311,6 +355,42 @@ func _Bidder_CancelAutoDeposit_Handler(srv interface{}, ctx context.Context, dec return interceptor(ctx, in, info, handler) } +func _Bidder_AutoDepositStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(EmptyMessage) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BidderServer).AutoDepositStatus(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Bidder_AutoDepositStatus_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BidderServer).AutoDepositStatus(ctx, req.(*EmptyMessage)) + } + return interceptor(ctx, in, info, handler) +} + +func _Bidder_CancelAndWithdrawAutoDeposit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(EmptyMessage) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BidderServer).CancelAndWithdrawAutoDeposit(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Bidder_CancelAndWithdrawAutoDeposit_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BidderServer).CancelAndWithdrawAutoDeposit(ctx, req.(*EmptyMessage)) + } + return interceptor(ctx, in, info, handler) +} + func _Bidder_GetDeposit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(GetDepositRequest) if err := dec(in); err != nil { @@ -384,6 +464,14 @@ var Bidder_ServiceDesc = grpc.ServiceDesc{ MethodName: "CancelAutoDeposit", Handler: _Bidder_CancelAutoDeposit_Handler, }, + { + MethodName: "AutoDepositStatus", + Handler: _Bidder_AutoDepositStatus_Handler, + }, + { + MethodName: "CancelAndWithdrawAutoDeposit", + Handler: _Bidder_CancelAndWithdrawAutoDeposit_Handler, + }, { MethodName: "GetDeposit", Handler: _Bidder_GetDeposit_Handler, diff --git a/p2p/gen/openapi/bidderapi/v1/bidderapi.swagger.yaml b/p2p/gen/openapi/bidderapi/v1/bidderapi.swagger.yaml index b21327382..db30de5ff 100644 --- a/p2p/gen/openapi/bidderapi/v1/bidderapi.swagger.yaml +++ b/p2p/gen/openapi/bidderapi/v1/bidderapi.swagger.yaml @@ -42,6 +42,20 @@ paths: required: false type: string format: uint64 + /v1/bidder/auto_deposit_status: + get: + summary: AutoDepositStatus + description: AutoDepositStatus is called by the bidder node to get the status of the auto deposit. + operationId: Bidder_AutoDepositStatus + responses: + "200": + description: A successful response. + schema: + $ref: '#/definitions/v1AutoDepositStatusResponse' + default: + description: An unexpected error response. + schema: + $ref: '#/definitions/googlerpcStatus' /v1/bidder/bid: post: summary: SendBid @@ -69,6 +83,20 @@ paths: required: true schema: $ref: '#/definitions/bidderapiv1Bid' + /v1/bidder/cancel_and_withdraw_auto_deposit: + post: + summary: CancelAndWithdrawAutoDeposit + description: CancelAndWithdrawAutoDeposit is called by the bidder node to cancel the auto deposit and withdraw the funds. + operationId: Bidder_CancelAndWithdrawAutoDeposit + responses: + "200": + description: A successful response. + schema: + $ref: '#/definitions/v1CancelAutoDepositResponse' + default: + description: An unexpected error response. + schema: + $ref: '#/definitions/googlerpcStatus' /v1/bidder/cancel_auto_deposit: post: summary: CancelAutoDeposit @@ -78,7 +106,7 @@ paths: "200": description: A successful response. schema: - $ref: '#/definitions/bidderapiv1EmptyMessage' + $ref: '#/definitions/v1CancelAutoDepositResponse' default: description: An unexpected error response. schema: @@ -217,8 +245,6 @@ definitions: - txHashes - amount - blockNumber - bidderapiv1EmptyMessage: - type: object googlerpcStatus: type: object properties: @@ -255,6 +281,42 @@ definitions: $ref: '#/definitions/bidderapiv1AutoDeposit' description: AutoDeposit deposit from the bidder registry. title: AutoDeposit response + v1AutoDepositStatusResponse: + type: object + example: + amounts_and_window_numbers: + - amount: "1000000000000000000" + window_number: 1 + - amount: "1000000000000000000" + window_number: 2 + - amount: "1000000000000000000" + window_number: 3 + isWorking: true + properties: + amountsAndWindowNumbers: + type: array + items: + type: object + $ref: '#/definitions/bidderapiv1AutoDeposit' + isWorking: + type: boolean + description: AutoDeposit deposit from the bidder registry. + title: AutoDeposit response + v1CancelAutoDepositResponse: + type: object + example: + window_numbers: + - 1 + - 2 + - 3 + properties: + windowNumbers: + type: array + items: + type: string + format: uint64 + description: CancelAutoDeposit deposit from the bidder registry. + title: CancelAutoDeposit response v1Commitment: type: object properties: diff --git a/p2p/pkg/depositmanager/autodeposit.go b/p2p/pkg/depositmanager/autodeposit.go index 6dcbb4e7a..f0ad7db8a 100644 --- a/p2p/pkg/depositmanager/autodeposit.go +++ b/p2p/pkg/depositmanager/autodeposit.go @@ -5,6 +5,8 @@ import ( "fmt" "log/slog" "math/big" + "sort" + "sync/atomic" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/core/types" @@ -12,19 +14,21 @@ import ( bidderapiv1 "github.com/primev/mev-commit/p2p/gen/go/bidderapi/v1" "github.com/primev/mev-commit/x/contracts/events" "golang.org/x/sync/errgroup" + "google.golang.org/protobuf/types/known/wrapperspb" ) type OptsGetter func(context.Context) (*bind.TransactOpts, error) type BidderRegistryContract interface { MoveDepositToWindow(opts *bind.TransactOpts, fromWindow *big.Int, toWindow *big.Int) (*types.Transaction, error) + WithdrawFromSpecificWindows(opts *bind.TransactOpts, windows []*big.Int) (*types.Transaction, error) } type AutoDepositTracker struct { deposits map[uint64]bool windowChan chan *blocktracker.BlocktrackerNewWindow eventMgr events.EventManager - isWorking bool + isWorking atomic.Bool brContract BidderRegistryContract optsGetter OptsGetter logger *slog.Logger @@ -47,19 +51,17 @@ func NewAutoDepositTracker( } } -func (adt *AutoDepositTracker) DoAutoMoveToAnotherWindow(ads []*bidderapiv1.AutoDeposit) <-chan struct{} { - if adt.isWorking { - return nil +func (adt *AutoDepositTracker) DoAutoMoveToAnotherWindow(ctx context.Context, ads []*bidderapiv1.AutoDeposit) error { + if adt.isWorking.Load() { + return fmt.Errorf("auto deposit tracker is already working") } - adt.isWorking = true + adt.isWorking.Store(true) for _, ad := range ads { adt.deposits[ad.WindowNumber.Value] = true } - doneChan := make(chan struct{}) - - eg, egCtx := errgroup.WithContext(context.Background()) + eg, egCtx := errgroup.WithContext(ctx) egCtx, cancel := context.WithCancel(egCtx) adt.cancelFunc = cancel @@ -79,8 +81,7 @@ func (adt *AutoDepositTracker) DoAutoMoveToAnotherWindow(ads []*bidderapiv1.Auto sub, err := adt.eventMgr.Subscribe(evt) if err != nil { - close(doneChan) - return doneChan + return fmt.Errorf("error subscribing to event: %w", err) } eg.Go(func() error { @@ -107,7 +108,7 @@ func (adt *AutoDepositTracker) DoAutoMoveToAnotherWindow(ads []*bidderapiv1.Auto if _, ok := adt.deposits[fromWindow.Uint64()]; !ok { continue } - toWindow := new(big.Int).Add(window.Window, big.NewInt(1)) + toWindow := new(big.Int).Add(window.Window, big.NewInt(2)) opts, err := adt.optsGetter(egCtx) if err != nil { @@ -124,19 +125,136 @@ func (adt *AutoDepositTracker) DoAutoMoveToAnotherWindow(ads []*bidderapiv1.Auto } }) + started := make(chan struct{}) go func() { - defer close(doneChan) + close(started) if err := eg.Wait(); err != nil { adt.logger.Error("error in errgroup", "err", err) } - adt.isWorking = false + adt.isWorking.Store(false) }() - - return doneChan + select { + case <-ctx.Done(): + return ctx.Err() + case <-started: + } + return nil } -func (adt *AutoDepositTracker) Stop() { +func (adt *AutoDepositTracker) Stop() (*bidderapiv1.CancelAutoDepositResponse, error) { + if !adt.isWorking.Load() { + return nil, fmt.Errorf("auto deposit tracker is not working") + } if adt.cancelFunc != nil { adt.cancelFunc() } + var windowNumbers []*wrapperspb.UInt64Value + + for i := range adt.deposits { + windowNumbers = append(windowNumbers, &wrapperspb.UInt64Value{Value: i}) + delete(adt.deposits, i) + } + adt.logger.Info("stop auto deposit tracker", "windows", windowNumbers) + return &bidderapiv1.CancelAutoDepositResponse{ + WindowNumbers: windowNumbers, + }, nil +} + +func (adt *AutoDepositTracker) IsWorking() bool { + return adt.isWorking.Load() +} + +func (adt *AutoDepositTracker) WithdrawAutoDeposit(ctx context.Context, windowNumbers []*wrapperspb.UInt64Value) error { + adt.logger.Info("withdraw auto deposit") + + if len(windowNumbers) == 0 { + return nil + } + var windows []*big.Int + for _, windowNumber := range windowNumbers { + windows = append(windows, new(big.Int).SetUint64(windowNumber.Value)) + } + + sort.Slice(windows, func(i, j int) bool { + return windows[i].Cmp(windows[j]) < 0 + }) + + lastWindowNumber := windows[len(windows)-1] + eg, egCtx := errgroup.WithContext(ctx) + egCtx, cancel := context.WithCancel(egCtx) + + evt := events.NewEventHandler( + "NewWindow", + func(update *blocktracker.BlocktrackerNewWindow) { + adt.logger.Info( + "new window event", + "window", update.Window, + ) + select { + case <-egCtx.Done(): + case adt.windowChan <- update: + } + }, + ) + + sub, err := adt.eventMgr.Subscribe(evt) + if err != nil { + cancel() + return fmt.Errorf("error subscribing to event: %w", err) + } + + eg.Go(func() error { + defer sub.Unsubscribe() + + select { + case <-egCtx.Done(): + adt.logger.Info("event subscription context done") + return nil + case err := <-sub.Err(): + return fmt.Errorf("error in event subscription: %w", err) + } + }) + + eg.Go(func() error { + for { + select { + case <-egCtx.Done(): + adt.logger.Info("context done") + return nil + case curWindow := <-adt.windowChan: + if curWindow.Window.Cmp(lastWindowNumber) > 0 { + opts, err := adt.optsGetter(egCtx) + if err != nil { + return err + } + txn, err := adt.brContract.WithdrawFromSpecificWindows(opts, windows) + if err != nil { + return err + } + adt.logger.Info("withdraw from specific windows", "hash", txn.Hash(), "windows", windows) + cancel() + return nil + } + adt.logger.Info("current window is less or equal latest deposit window, waiting...", "currentWindow", curWindow.Window, "latestDepositWindow", lastWindowNumber) + } + } + }) + + started := make(chan struct{}) + go func() { + close(started) + if err := eg.Wait(); err != nil { + adt.logger.Error("error in errgroup", "err", err) + } + }() + select { + case <-ctx.Done(): + return ctx.Err() + case <-started: + } + return nil +} + +func (adt *AutoDepositTracker) GetStatus() (map[uint64]bool, bool) { + return adt.deposits, adt.isWorking.Load() } diff --git a/p2p/pkg/depositmanager/autodeposit_test.go b/p2p/pkg/depositmanager/autodeposit_test.go new file mode 100644 index 000000000..118cc7600 --- /dev/null +++ b/p2p/pkg/depositmanager/autodeposit_test.go @@ -0,0 +1,110 @@ +package depositmanager_test + +import ( + "context" + "io" + "math/big" + "strings" + "testing" + "time" + + "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + bidderregistry "github.com/primev/mev-commit/contracts-abi/clients/BidderRegistry" + blocktracker "github.com/primev/mev-commit/contracts-abi/clients/BlockTracker" + bidderapiv1 "github.com/primev/mev-commit/p2p/gen/go/bidderapi/v1" + "github.com/primev/mev-commit/p2p/pkg/depositmanager" + "github.com/primev/mev-commit/x/contracts/events" + "github.com/primev/mev-commit/x/util" + "google.golang.org/protobuf/types/known/wrapperspb" +) + +type MockBidderRegistryContract struct { + MoveDepositToWindowFunc func(opts *bind.TransactOpts, fromWindow *big.Int, toWindow *big.Int) (*types.Transaction, error) +} + +func (m *MockBidderRegistryContract) MoveDepositToWindow(opts *bind.TransactOpts, fromWindow *big.Int, toWindow *big.Int) (*types.Transaction, error) { + return m.MoveDepositToWindowFunc(opts, fromWindow, toWindow) +} + +func (m *MockBidderRegistryContract) WithdrawFromSpecificWindows(opts *bind.TransactOpts, windows []*big.Int) (*types.Transaction, error) { + return m.WithdrawFromSpecificWindows(opts, windows) +} +func TestAutoDepositTracker(t *testing.T) { + t.Parallel() + + // Setup ABIs + brABI, err := abi.JSON(strings.NewReader(bidderregistry.BidderregistryABI)) + if err != nil { + t.Fatal(err) + } + + btABI, err := abi.JSON(strings.NewReader(blocktracker.BlocktrackerABI)) + if err != nil { + t.Fatal(err) + } + + logger := util.NewTestLogger(io.Discard) + evtMgr := events.NewListener(logger, &btABI, &brABI) + + mockContract := &MockBidderRegistryContract{ + MoveDepositToWindowFunc: func(opts *bind.TransactOpts, fromWindow *big.Int, toWindow *big.Int) (*types.Transaction, error) { + return types.NewTx(&types.LegacyTx{}), nil + }, + } + + optsGetter := func(ctx context.Context) (*bind.TransactOpts, error) { + return &bind.TransactOpts{}, nil + } + + adt := depositmanager.NewAutoDepositTracker(evtMgr, mockContract, optsGetter, logger) + + ads := []*bidderapiv1.AutoDeposit{ + {WindowNumber: &wrapperspb.UInt64Value{Value: 1}, Amount: "100"}, + {WindowNumber: &wrapperspb.UInt64Value{Value: 2}, Amount: "100"}, + {WindowNumber: &wrapperspb.UInt64Value{Value: 3}, Amount: "100"}, + } + ctx := context.Background() + err = adt.DoAutoMoveToAnotherWindow(ctx, ads) + if err != nil { + t.Fatal(err) + } + + br := &bidderregistry.BidderregistryBidderRegistered{ + Bidder: common.HexToAddress("0x123"), + DepositedAmount: big.NewInt(100), + WindowNumber: big.NewInt(1), + } + + err = publishBidderRegistered(evtMgr, &brABI, br) + if err != nil { + t.Fatal(err) + } + + publishNewWindow(evtMgr, &btABI, big.NewInt(int64(ads[0].WindowNumber.Value+1))) + publishNewWindow(evtMgr, &btABI, big.NewInt(int64(ads[0].WindowNumber.Value+2))) + + deposits, status := adt.GetStatus() + + if !status { + t.Fatalf("expected status to be true, got %v", status) + } + + // need to wait for the goroutine to process the events + time.Sleep(100 * time.Millisecond) + for _, ad := range ads { + if !deposits[ad.WindowNumber.Value+2] { + t.Fatalf("expected deposit for window %d to be true, got %v", ad.WindowNumber.Value, deposits[ad.WindowNumber.Value+2]) + } + } + adt.Stop() + + // need to wait for the goroutine to stop + time.Sleep(100 * time.Millisecond) + _, status = adt.GetStatus() + if status { + t.Fatalf("expected status to be false, got %v", status) + } +} diff --git a/p2p/pkg/rpc/bidder/service.go b/p2p/pkg/rpc/bidder/service.go index c0b93e2f5..76e0db26a 100644 --- a/p2p/pkg/rpc/bidder/service.go +++ b/p2p/pkg/rpc/bidder/service.go @@ -63,8 +63,11 @@ func NewService( } type AutoDepositTracker interface { - DoAutoMoveToAnotherWindow([]*bidderapiv1.AutoDeposit) <-chan struct{} - Stop() + DoAutoMoveToAnotherWindow(context.Context, []*bidderapiv1.AutoDeposit) error + Stop() (*bidderapiv1.CancelAutoDepositResponse, error) + WithdrawAutoDeposit(context.Context, []*wrapperspb.UInt64Value) error + IsWorking() bool + GetStatus() (map[uint64]bool, bool) } type PreconfSender interface { @@ -156,6 +159,10 @@ func (s *Service) Deposit( return nil, status.Errorf(codes.InvalidArgument, "validating deposit request: %v", err) } + if s.autoDepositTracker.IsWorking() { + return nil, status.Error(codes.FailedPrecondition, "auto deposit is already running") + } + currentWindow, err := s.blockTrackerContract.GetCurrentWindow() if err != nil { return nil, status.Errorf(codes.Internal, "getting current window: %v", err) @@ -384,8 +391,10 @@ func (s *Service) AutoDeposit( } if len(ads) > 0 { - s.autoDepositTracker.DoAutoMoveToAnotherWindow(ads) - return &bidderapiv1.AutoDepositResponse{AmountsAndWindowNumbers: ads}, nil + err := s.autoDepositTracker.DoAutoMoveToAnotherWindow(ctx, ads) + if err != nil { + return nil, status.Errorf(codes.Internal, "auto deposit: %v", err) + } } s.logger.Error( @@ -401,7 +410,57 @@ func (s *Service) AutoDeposit( func (s *Service) CancelAutoDeposit( ctx context.Context, _ *bidderapiv1.EmptyMessage, -) (*bidderapiv1.EmptyMessage, error) { - s.autoDepositTracker.Stop() - return &bidderapiv1.EmptyMessage{}, nil +) (*bidderapiv1.CancelAutoDepositResponse, error) { + cancelResponse, err := s.autoDepositTracker.Stop() + if err != nil { + return nil, status.Errorf(codes.FailedPrecondition, "cancel auto deposit: %v", err) + } + return &bidderapiv1.CancelAutoDepositResponse{ + WindowNumbers: cancelResponse.WindowNumbers, + }, nil +} + +func (s *Service) CancelAndWithdrawAutoDeposit( + ctx context.Context, + _ *bidderapiv1.EmptyMessage, +) (*bidderapiv1.CancelAutoDepositResponse, error) { + cancelResponse, err := s.autoDepositTracker.Stop() + if err != nil { + return nil, status.Errorf(codes.FailedPrecondition, "cancel auto deposit: %v", err) + } + err = s.autoDepositTracker.WithdrawAutoDeposit(ctx, cancelResponse.WindowNumbers) + if err != nil { + return nil, status.Errorf(codes.Internal, "withdrawal: %v", err) + } + return &bidderapiv1.CancelAutoDepositResponse{ + WindowNumbers: cancelResponse.WindowNumbers, + }, nil +} + +func (s *Service) AutoDepositStatus( + ctx context.Context, + _ *bidderapiv1.EmptyMessage, +) (*bidderapiv1.AutoDepositStatusResponse, error) { + deposits, isWorking := s.autoDepositTracker.GetStatus() + var autoDeposits []*bidderapiv1.AutoDeposit + for window, ok := range deposits { + if ok { + stakeAmount, err := s.registryContract.GetDeposit(&bind.CallOpts{ + From: s.owner, + Context: ctx, + }, s.owner, new(big.Int).SetUint64(window)) + if err != nil { + return nil, status.Errorf(codes.Internal, "getting deposit: %v", err) + } + autoDeposits = append(autoDeposits, &bidderapiv1.AutoDeposit{ + WindowNumber: wrapperspb.UInt64(window), + Amount: stakeAmount.String(), + }) + } + } + + return &bidderapiv1.AutoDepositStatusResponse{ + AmountsAndWindowNumbers: autoDeposits, + IsWorking: isWorking, + }, nil } diff --git a/p2p/pkg/rpc/bidder/service_test.go b/p2p/pkg/rpc/bidder/service_test.go index 9094dde2a..085c116a4 100644 --- a/p2p/pkg/rpc/bidder/service_test.go +++ b/p2p/pkg/rpc/bidder/service_test.go @@ -124,21 +124,43 @@ func (t *testRegistryContract) ParseBidderWithdrawal(_ types.Log) (*bidderregist } type testAutoDepositTracker struct { - deposits map[uint64]bool + deposits map[uint64]bool + isWorking bool } -func (t *testAutoDepositTracker) DoAutoMoveToAnotherWindow(ads []*bidderapiv1.AutoDeposit) <-chan struct{} { +func (t *testAutoDepositTracker) DoAutoMoveToAnotherWindow(ctx context.Context, ads []*bidderapiv1.AutoDeposit) error { + t.isWorking = true for _, ad := range ads { t.deposits[ad.WindowNumber.Value] = true } - doneChan := make(chan struct{}) - close(doneChan) + return nil +} + +func (t *testAutoDepositTracker) IsWorking() bool { + return t.isWorking +} + +func (t *testAutoDepositTracker) GetStatus() (map[uint64]bool, bool) { + return t.deposits, t.isWorking +} - return doneChan +func (t *testAutoDepositTracker) Stop() (*bidderapiv1.CancelAutoDepositResponse, error) { + t.isWorking = false + var windowNumbers []*wrapperspb.UInt64Value + for k := range t.deposits { + windowNumbers = append(windowNumbers, &wrapperspb.UInt64Value{Value: k}) + delete(t.deposits, k) + } + return &bidderapiv1.CancelAutoDepositResponse{ + WindowNumbers: windowNumbers, + }, nil } -func (t *testAutoDepositTracker) Stop() { +// func (t *testAutoDepositTracker) + +func (t *testAutoDepositTracker) WithdrawAutoDeposit(ctx context.Context, windowNumbers []*wrapperspb.UInt64Value) error { + return nil } type testTxWatcher struct { diff --git a/p2p/rpc/bidderapi/v1/bidderapi.proto b/p2p/rpc/bidderapi/v1/bidderapi.proto index 17675e5bf..c0ad82c08 100644 --- a/p2p/rpc/bidderapi/v1/bidderapi.proto +++ b/p2p/rpc/bidderapi/v1/bidderapi.proto @@ -45,10 +45,24 @@ service Bidder { // CancelAutoDeposit // // CancelAutoDeposit is called by the bidder node to cancel the auto deposit. - rpc CancelAutoDeposit(EmptyMessage) returns (EmptyMessage) { + rpc CancelAutoDeposit(EmptyMessage) returns (CancelAutoDepositResponse) { option (google.api.http) = {post: "/v1/bidder/cancel_auto_deposit"}; } + // AutoDepositStatus + // + // AutoDepositStatus is called by the bidder node to get the status of the auto deposit. + rpc AutoDepositStatus(EmptyMessage) returns (AutoDepositStatusResponse) { + option (google.api.http) = {get: "/v1/bidder/auto_deposit_status"}; + } + + // CancelAndWithdrawAutoDeposit + // + // CancelAndWithdrawAutoDeposit is called by the bidder node to cancel the auto deposit and withdraw the funds. + rpc CancelAndWithdrawAutoDeposit(EmptyMessage) returns (CancelAutoDepositResponse) { + option (google.api.http) = {post: "/v1/bidder/cancel_and_withdraw_auto_deposit"}; + } + // GetDeposit // // GetDeposit is called by the bidder to get its deposit in the bidder registry. @@ -129,6 +143,29 @@ message AutoDepositResponse { repeated AutoDeposit amounts_and_window_numbers = 1; }; +message AutoDepositStatusResponse { + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { + json_schema: { + title: "AutoDeposit response" + description: "AutoDeposit deposit from the bidder registry." + } + example: "{\"amounts_and_window_numbers\": [{\"amount\": \"1000000000000000000\", \"window_number\": 1}, {\"amount\": \"1000000000000000000\", \"window_number\": 2}, {\"amount\": \"1000000000000000000\", \"window_number\": 3}], \"isWorking\": true}" + }; + repeated AutoDeposit amounts_and_window_numbers = 1; + bool isWorking = 2; +}; + +message CancelAutoDepositResponse { + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { + json_schema: { + title: "CancelAutoDeposit response" + description: "CancelAutoDeposit deposit from the bidder registry." + } + example: "{\"window_numbers\": [1, 2, 3]}" + }; + repeated google.protobuf.UInt64Value window_numbers = 1; +}; + message AutoDeposit { string amount = 1; google.protobuf.UInt64Value window_number = 2; From 133aebfddfe8453f31ac0379e10c8a6ba442c7d9 Mon Sep 17 00:00:00 2001 From: Mikhail Wall Date: Thu, 27 Jun 2024 00:59:56 +0200 Subject: [PATCH 04/18] fix: merged with main --- contracts-abi/clients/BidderRegistry/BidderRegistry.go | 2 +- contracts-abi/clients/BlockTracker/BlockTracker.go | 2 +- contracts-abi/clients/Oracle/Oracle.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/contracts-abi/clients/BidderRegistry/BidderRegistry.go b/contracts-abi/clients/BidderRegistry/BidderRegistry.go index ff3df8ba9..73601061c 100644 --- a/contracts-abi/clients/BidderRegistry/BidderRegistry.go +++ b/contracts-abi/clients/BidderRegistry/BidderRegistry.go @@ -31,7 +31,7 @@ var ( // BidderregistryMetaData contains all meta data concerning the Bidderregistry contract. var BidderregistryMetaData = &bind.MetaData{ - ABI: "[{\"type\":\"constructor\",\"inputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"fallback\",\"stateMutability\":\"payable\"},{\"type\":\"receive\",\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"BidPayment\",\"inputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"bidder\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"bidAmt\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"state\",\"type\":\"uint8\",\"internalType\":\"enumIBidderRegistry.State\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"OpenBid\",\"inputs\":[{\"name\":\"commitmentDigest\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"bid\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"bidder\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"blockNumber\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"bidderRegistered\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"blockTrackerContract\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIBlockTracker\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"blocksPerWindow\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"depositForNWindows\",\"inputs\":[{\"name\":\"window\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"n\",\"type\":\"uint16\",\"internalType\":\"uint16\"}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"depositForSpecificWindow\",\"inputs\":[{\"name\":\"window\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"feePercent\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint16\",\"internalType\":\"uint16\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"feeRecipient\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"feeRecipientAmount\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getDeposit\",\"inputs\":[{\"name\":\"bidder\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"window\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getFeeRecipientAmount\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getProviderAmount\",\"inputs\":[{\"name\":\"provider\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"initialize\",\"inputs\":[{\"name\":\"_minDeposit\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_feeRecipient\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_feePercent\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"_owner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_blockTracker\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_blocksPerWindow\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"lockedFunds\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"maxBidPerBlock\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"minDeposit\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"moveDepositToWindow\",\"inputs\":[{\"name\":\"fromWindow\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"toWindow\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"owner\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"preConfirmationsContract\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"protocolFeeAmount\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"providerAmount\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"renounceOwnership\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"retrieveFunds\",\"inputs\":[{\"name\":\"windowToSettle\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"commitmentDigest\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"provider\",\"type\":\"address\",\"internalType\":\"addresspayable\"},{\"name\":\"residualBidPercentAfterDecay\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setNewFeePercent\",\"inputs\":[{\"name\":\"newFeePercent\",\"type\":\"uint16\",\"internalType\":\"uint16\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setNewFeeRecipient\",\"inputs\":[{\"name\":\"newFeeRecipient\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setPreconfirmationsContract\",\"inputs\":[{\"name\":\"contractAddress\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"transferOwnership\",\"inputs\":[{\"name\":\"newOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"unlockFunds\",\"inputs\":[{\"name\":\"window\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"bidID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"usedFunds\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"withdrawBidderAmountFromWindow\",\"inputs\":[{\"name\":\"bidder\",\"type\":\"address\",\"internalType\":\"addresspayable\"},{\"name\":\"window\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"withdrawFeeRecipientAmount\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"withdrawProtocolFee\",\"inputs\":[{\"name\":\"bidder\",\"type\":\"address\",\"internalType\":\"addresspayable\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"withdrawProviderAmount\",\"inputs\":[{\"name\":\"provider\",\"type\":\"address\",\"internalType\":\"addresspayable\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"event\",\"name\":\"BidderMovedFunds\",\"inputs\":[{\"name\":\"bidder\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"fromWindow\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"toWindow\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"amount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"BidderRegistered\",\"inputs\":[{\"name\":\"bidder\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"depositedAmount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"windowNumber\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"BidderWithdrawal\",\"inputs\":[{\"name\":\"bidder\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"window\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"amount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"FundsRetrieved\",\"inputs\":[{\"name\":\"commitmentDigest\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"bidder\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"window\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"amount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"FundsRewarded\",\"inputs\":[{\"name\":\"commitmentDigest\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"bidder\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"provider\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"window\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"amount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Initialized\",\"inputs\":[{\"name\":\"version\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OwnershipTransferred\",\"inputs\":[{\"name\":\"previousOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"newOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"InvalidInitialization\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"NotInitializing\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"OwnableInvalidOwner\",\"inputs\":[{\"name\":\"owner\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"OwnableUnauthorizedAccount\",\"inputs\":[{\"name\":\"account\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"ReentrancyGuardReentrantCall\",\"inputs\":[]}]", + ABI: "[{\"type\":\"constructor\",\"inputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"fallback\",\"stateMutability\":\"payable\"},{\"type\":\"receive\",\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"BidPayment\",\"inputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"bidder\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"bidAmt\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"state\",\"type\":\"uint8\",\"internalType\":\"enumIBidderRegistry.State\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"OpenBid\",\"inputs\":[{\"name\":\"commitmentDigest\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"bid\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"bidder\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"blockNumber\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"UPGRADE_INTERFACE_VERSION\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"bidderRegistered\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"blockTrackerContract\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIBlockTracker\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"blocksPerWindow\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"depositForNWindows\",\"inputs\":[{\"name\":\"window\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"n\",\"type\":\"uint16\",\"internalType\":\"uint16\"}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"depositForSpecificWindow\",\"inputs\":[{\"name\":\"window\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"feePercent\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint16\",\"internalType\":\"uint16\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"feeRecipient\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"feeRecipientAmount\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getDeposit\",\"inputs\":[{\"name\":\"bidder\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"window\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getFeeRecipientAmount\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getProviderAmount\",\"inputs\":[{\"name\":\"provider\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"initialize\",\"inputs\":[{\"name\":\"_minDeposit\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_feeRecipient\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_feePercent\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"_owner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_blockTracker\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_blocksPerWindow\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"lockedFunds\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"maxBidPerBlock\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"minDeposit\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"moveDepositToWindow\",\"inputs\":[{\"name\":\"fromWindow\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"toWindow\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"owner\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"preConfirmationsContract\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"protocolFeeAmount\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"providerAmount\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"proxiableUUID\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"renounceOwnership\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"retrieveFunds\",\"inputs\":[{\"name\":\"windowToSettle\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"commitmentDigest\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"provider\",\"type\":\"address\",\"internalType\":\"addresspayable\"},{\"name\":\"residualBidPercentAfterDecay\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setNewFeePercent\",\"inputs\":[{\"name\":\"newFeePercent\",\"type\":\"uint16\",\"internalType\":\"uint16\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setNewFeeRecipient\",\"inputs\":[{\"name\":\"newFeeRecipient\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setPreconfirmationsContract\",\"inputs\":[{\"name\":\"contractAddress\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"transferOwnership\",\"inputs\":[{\"name\":\"newOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"unlockFunds\",\"inputs\":[{\"name\":\"window\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"bidID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"upgradeToAndCall\",\"inputs\":[{\"name\":\"newImplementation\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"data\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"usedFunds\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"withdrawBidderAmountFromWindow\",\"inputs\":[{\"name\":\"bidder\",\"type\":\"address\",\"internalType\":\"addresspayable\"},{\"name\":\"window\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"withdrawFeeRecipientAmount\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"withdrawFromNWindows\",\"inputs\":[{\"name\":\"window\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"n\",\"type\":\"uint16\",\"internalType\":\"uint16\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"withdrawFromSpecificWindows\",\"inputs\":[{\"name\":\"windows\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"withdrawProtocolFee\",\"inputs\":[{\"name\":\"bidder\",\"type\":\"address\",\"internalType\":\"addresspayable\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"withdrawProviderAmount\",\"inputs\":[{\"name\":\"provider\",\"type\":\"address\",\"internalType\":\"addresspayable\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"event\",\"name\":\"BidderMovedFunds\",\"inputs\":[{\"name\":\"bidder\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"fromWindow\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"toWindow\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"amount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"BidderRegistered\",\"inputs\":[{\"name\":\"bidder\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"depositedAmount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"windowNumber\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"BidderWithdrawal\",\"inputs\":[{\"name\":\"bidder\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"window\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"amount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"FundsRetrieved\",\"inputs\":[{\"name\":\"commitmentDigest\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"bidder\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"window\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"amount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"FundsRewarded\",\"inputs\":[{\"name\":\"commitmentDigest\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"bidder\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"provider\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"window\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"amount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Initialized\",\"inputs\":[{\"name\":\"version\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"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\":\"Upgraded\",\"inputs\":[{\"name\":\"implementation\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"AddressEmptyCode\",\"inputs\":[{\"name\":\"target\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"ERC1967InvalidImplementation\",\"inputs\":[{\"name\":\"implementation\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"ERC1967NonPayable\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"FailedInnerCall\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidInitialization\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"NotInitializing\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"OwnableInvalidOwner\",\"inputs\":[{\"name\":\"owner\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"OwnableUnauthorizedAccount\",\"inputs\":[{\"name\":\"account\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"ReentrancyGuardReentrantCall\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"UUPSUnauthorizedCallContext\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"UUPSUnsupportedProxiableUUID\",\"inputs\":[{\"name\":\"slot\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]}]", } // BidderregistryABI is the input ABI used to generate the binding from. diff --git a/contracts-abi/clients/BlockTracker/BlockTracker.go b/contracts-abi/clients/BlockTracker/BlockTracker.go index b40663412..78b518dc0 100644 --- a/contracts-abi/clients/BlockTracker/BlockTracker.go +++ b/contracts-abi/clients/BlockTracker/BlockTracker.go @@ -31,7 +31,7 @@ var ( // BlocktrackerMetaData contains all meta data concerning the Blocktracker contract. var BlocktrackerMetaData = &bind.MetaData{ - ABI: "[{\"type\":\"constructor\",\"inputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"fallback\",\"stateMutability\":\"payable\"},{\"type\":\"receive\",\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"addBuilderAddress\",\"inputs\":[{\"name\":\"builderName\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"builderAddress\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"blockBuilderNameToAddress\",\"inputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"blockWinners\",\"inputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"blocksPerWindow\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"currentWindow\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getBlockWinner\",\"inputs\":[{\"name\":\"blockNumber\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getBlocksPerWindow\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getBuilder\",\"inputs\":[{\"name\":\"builderNameGrafiti\",\"type\":\"string\",\"internalType\":\"string\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getCurrentWindow\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"initialize\",\"inputs\":[{\"name\":\"_owner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_blocksPerWindow\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"owner\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"recordL1Block\",\"inputs\":[{\"name\":\"_blockNumber\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_winnerGraffiti\",\"type\":\"string\",\"internalType\":\"string\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"renounceOwnership\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"transferOwnership\",\"inputs\":[{\"name\":\"newOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"event\",\"name\":\"Initialized\",\"inputs\":[{\"name\":\"version\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"NewBlocksPerWindow\",\"inputs\":[{\"name\":\"blocksPerWindow\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"NewL1Block\",\"inputs\":[{\"name\":\"blockNumber\",\"type\":\"uint256\",\"indexed\":true,\"internalType\":\"uint256\"},{\"name\":\"winner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"window\",\"type\":\"uint256\",\"indexed\":true,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"NewWindow\",\"inputs\":[{\"name\":\"window\",\"type\":\"uint256\",\"indexed\":true,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OwnershipTransferred\",\"inputs\":[{\"name\":\"previousOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"newOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"InvalidInitialization\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"NotInitializing\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"OwnableInvalidOwner\",\"inputs\":[{\"name\":\"owner\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"OwnableUnauthorizedAccount\",\"inputs\":[{\"name\":\"account\",\"type\":\"address\",\"internalType\":\"address\"}]}]", + ABI: "[{\"type\":\"constructor\",\"inputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"fallback\",\"stateMutability\":\"payable\"},{\"type\":\"receive\",\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"UPGRADE_INTERFACE_VERSION\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"addBuilderAddress\",\"inputs\":[{\"name\":\"builderName\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"builderAddress\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"blockBuilderNameToAddress\",\"inputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"blockWinners\",\"inputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"blocksPerWindow\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"currentWindow\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getBlockWinner\",\"inputs\":[{\"name\":\"blockNumber\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getBlocksPerWindow\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getBuilder\",\"inputs\":[{\"name\":\"builderNameGrafiti\",\"type\":\"string\",\"internalType\":\"string\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getCurrentWindow\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"initialize\",\"inputs\":[{\"name\":\"_owner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_blocksPerWindow\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"owner\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"proxiableUUID\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"recordL1Block\",\"inputs\":[{\"name\":\"_blockNumber\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_winnerGraffiti\",\"type\":\"string\",\"internalType\":\"string\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"renounceOwnership\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"transferOwnership\",\"inputs\":[{\"name\":\"newOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"upgradeToAndCall\",\"inputs\":[{\"name\":\"newImplementation\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"data\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"event\",\"name\":\"Initialized\",\"inputs\":[{\"name\":\"version\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"NewL1Block\",\"inputs\":[{\"name\":\"blockNumber\",\"type\":\"uint256\",\"indexed\":true,\"internalType\":\"uint256\"},{\"name\":\"winner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"window\",\"type\":\"uint256\",\"indexed\":true,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"NewWindow\",\"inputs\":[{\"name\":\"window\",\"type\":\"uint256\",\"indexed\":true,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"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\":\"Upgraded\",\"inputs\":[{\"name\":\"implementation\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"AddressEmptyCode\",\"inputs\":[{\"name\":\"target\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"ERC1967InvalidImplementation\",\"inputs\":[{\"name\":\"implementation\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"ERC1967NonPayable\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"FailedInnerCall\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidInitialization\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"NotInitializing\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"OwnableInvalidOwner\",\"inputs\":[{\"name\":\"owner\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"OwnableUnauthorizedAccount\",\"inputs\":[{\"name\":\"account\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"UUPSUnauthorizedCallContext\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"UUPSUnsupportedProxiableUUID\",\"inputs\":[{\"name\":\"slot\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]}]", } // BlocktrackerABI is the input ABI used to generate the binding from. diff --git a/contracts-abi/clients/Oracle/Oracle.go b/contracts-abi/clients/Oracle/Oracle.go index 1c8bcab63..eeef144ad 100644 --- a/contracts-abi/clients/Oracle/Oracle.go +++ b/contracts-abi/clients/Oracle/Oracle.go @@ -31,7 +31,7 @@ var ( // OracleMetaData contains all meta data concerning the Oracle contract. var OracleMetaData = &bind.MetaData{ - ABI: "[{\"type\":\"constructor\",\"inputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"fallback\",\"stateMutability\":\"payable\"},{\"type\":\"receive\",\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"blockBuilderNameToAddress\",\"inputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"initialize\",\"inputs\":[{\"name\":\"_preConfContract\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_blockTrackerContract\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_owner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"owner\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"processBuilderCommitmentForBlockNumber\",\"inputs\":[{\"name\":\"commitmentIndex\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"blockNumber\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"builder\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"isSlash\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"residualBidPercentAfterDecay\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"renounceOwnership\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"transferOwnership\",\"inputs\":[{\"name\":\"newOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"event\",\"name\":\"CommitmentProcessed\",\"inputs\":[{\"name\":\"commitmentHash\",\"type\":\"bytes32\",\"indexed\":false,\"internalType\":\"bytes32\"},{\"name\":\"isSlash\",\"type\":\"bool\",\"indexed\":false,\"internalType\":\"bool\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Initialized\",\"inputs\":[{\"name\":\"version\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OwnershipTransferred\",\"inputs\":[{\"name\":\"previousOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"newOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"InvalidInitialization\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"NotInitializing\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"OwnableInvalidOwner\",\"inputs\":[{\"name\":\"owner\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"OwnableUnauthorizedAccount\",\"inputs\":[{\"name\":\"account\",\"type\":\"address\",\"internalType\":\"address\"}]}]", + ABI: "[{\"type\":\"constructor\",\"inputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"fallback\",\"stateMutability\":\"payable\"},{\"type\":\"receive\",\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"UPGRADE_INTERFACE_VERSION\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"blockBuilderNameToAddress\",\"inputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"initialize\",\"inputs\":[{\"name\":\"_preConfContract\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_blockTrackerContract\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_owner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"owner\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"processBuilderCommitmentForBlockNumber\",\"inputs\":[{\"name\":\"commitmentIndex\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"blockNumber\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"builder\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"isSlash\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"residualBidPercentAfterDecay\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"proxiableUUID\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"renounceOwnership\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"transferOwnership\",\"inputs\":[{\"name\":\"newOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"upgradeToAndCall\",\"inputs\":[{\"name\":\"newImplementation\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"data\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"event\",\"name\":\"CommitmentProcessed\",\"inputs\":[{\"name\":\"commitmentIndex\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"isSlash\",\"type\":\"bool\",\"indexed\":false,\"internalType\":\"bool\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Initialized\",\"inputs\":[{\"name\":\"version\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"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\":\"Upgraded\",\"inputs\":[{\"name\":\"implementation\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"AddressEmptyCode\",\"inputs\":[{\"name\":\"target\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"ERC1967InvalidImplementation\",\"inputs\":[{\"name\":\"implementation\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"ERC1967NonPayable\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"FailedInnerCall\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidInitialization\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"NotInitializing\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"OwnableInvalidOwner\",\"inputs\":[{\"name\":\"owner\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"OwnableUnauthorizedAccount\",\"inputs\":[{\"name\":\"account\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"UUPSUnauthorizedCallContext\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"UUPSUnsupportedProxiableUUID\",\"inputs\":[{\"name\":\"slot\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]}]", } // OracleABI is the input ABI used to generate the binding from. From 6fc8b008679860ff5208a42b90047624a1d41116 Mon Sep 17 00:00:00 2001 From: Mikhail Wall Date: Thu, 27 Jun 2024 01:05:42 +0200 Subject: [PATCH 05/18] fix: changed message --- p2p/pkg/depositmanager/autodeposit.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/p2p/pkg/depositmanager/autodeposit.go b/p2p/pkg/depositmanager/autodeposit.go index f0ad7db8a..eda45fffa 100644 --- a/p2p/pkg/depositmanager/autodeposit.go +++ b/p2p/pkg/depositmanager/autodeposit.go @@ -143,7 +143,7 @@ func (adt *AutoDepositTracker) DoAutoMoveToAnotherWindow(ctx context.Context, ad func (adt *AutoDepositTracker) Stop() (*bidderapiv1.CancelAutoDepositResponse, error) { if !adt.isWorking.Load() { - return nil, fmt.Errorf("auto deposit tracker is not working") + return nil, fmt.Errorf("auto deposit tracker is not running") } if adt.cancelFunc != nil { adt.cancelFunc() From 492ea83ec565d9c8ff531059afe8b8b01a3b8034 Mon Sep 17 00:00:00 2001 From: Mikhail Wall Date: Thu, 27 Jun 2024 15:15:20 +0200 Subject: [PATCH 06/18] chore: added logs --- p2p/pkg/rpc/bidder/service.go | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/p2p/pkg/rpc/bidder/service.go b/p2p/pkg/rpc/bidder/service.go index 76e0db26a..a9a3298dc 100644 --- a/p2p/pkg/rpc/bidder/service.go +++ b/p2p/pkg/rpc/bidder/service.go @@ -381,15 +381,17 @@ func (s *Service) AutoDeposit( var ads []*bidderapiv1.AutoDeposit for _, log := range receipt.Logs { - if registration, err := s.registryContract.ParseBidderRegistered(*log); err == nil { - s.logger.Info("deposit successful", "amount", registration.DepositedAmount, "window", registration.WindowNumber) - ads = append(ads, &bidderapiv1.AutoDeposit{ - Amount: registration.DepositedAmount.String(), - WindowNumber: wrapperspb.UInt64(registration.WindowNumber.Uint64()), - }) + registration, err := s.registryContract.ParseBidderRegistered(*log) + if err != nil { + s.logger.Error("failed to parse BidderRegistered event", "error", err, "log", log) + continue } + s.logger.Info("deposit successful", "amount", registration.DepositedAmount, "window", registration.WindowNumber) + ads = append(ads, &bidderapiv1.AutoDeposit{ + Amount: registration.DepositedAmount.String(), + WindowNumber: wrapperspb.UInt64(registration.WindowNumber.Uint64()), + }) } - if len(ads) > 0 { err := s.autoDepositTracker.DoAutoMoveToAnotherWindow(ctx, ads) if err != nil { From 6295f1f0cbe3c0cd58718f121918e867a4f6d17c Mon Sep 17 00:00:00 2001 From: Mikhail Wall Date: Thu, 27 Jun 2024 15:43:40 +0200 Subject: [PATCH 07/18] fix: fixed response --- p2p/pkg/rpc/bidder/service.go | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/p2p/pkg/rpc/bidder/service.go b/p2p/pkg/rpc/bidder/service.go index a9a3298dc..79071eb3c 100644 --- a/p2p/pkg/rpc/bidder/service.go +++ b/p2p/pkg/rpc/bidder/service.go @@ -381,22 +381,23 @@ func (s *Service) AutoDeposit( var ads []*bidderapiv1.AutoDeposit for _, log := range receipt.Logs { - registration, err := s.registryContract.ParseBidderRegistered(*log) - if err != nil { - s.logger.Error("failed to parse BidderRegistered event", "error", err, "log", log) - continue + if registration, err := s.registryContract.ParseBidderRegistered(*log); err == nil { + s.logger.Info("deposit successful", "amount", registration.DepositedAmount, "window", registration.WindowNumber) + ads = append(ads, &bidderapiv1.AutoDeposit{ + Amount: registration.DepositedAmount.String(), + WindowNumber: wrapperspb.UInt64(registration.WindowNumber.Uint64()), + }) } - s.logger.Info("deposit successful", "amount", registration.DepositedAmount, "window", registration.WindowNumber) - ads = append(ads, &bidderapiv1.AutoDeposit{ - Amount: registration.DepositedAmount.String(), - WindowNumber: wrapperspb.UInt64(registration.WindowNumber.Uint64()), - }) } + if len(ads) > 0 { err := s.autoDepositTracker.DoAutoMoveToAnotherWindow(ctx, ads) if err != nil { return nil, status.Errorf(codes.Internal, "auto deposit: %v", err) } + return &bidderapiv1.AutoDepositResponse{ + AmountsAndWindowNumbers: ads, + }, nil } s.logger.Error( From 6b40b960615e910f2c6a3c7e0ae49b0a5cea3838 Mon Sep 17 00:00:00 2001 From: Mikhail Wall Date: Thu, 27 Jun 2024 16:04:37 +0200 Subject: [PATCH 08/18] fix: changed context --- p2p/pkg/rpc/bidder/service.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/p2p/pkg/rpc/bidder/service.go b/p2p/pkg/rpc/bidder/service.go index 79071eb3c..9158c99b6 100644 --- a/p2p/pkg/rpc/bidder/service.go +++ b/p2p/pkg/rpc/bidder/service.go @@ -389,9 +389,9 @@ func (s *Service) AutoDeposit( }) } } - + if len(ads) > 0 { - err := s.autoDepositTracker.DoAutoMoveToAnotherWindow(ctx, ads) + err := s.autoDepositTracker.DoAutoMoveToAnotherWindow(context.Background(), ads) if err != nil { return nil, status.Errorf(codes.Internal, "auto deposit: %v", err) } From c05e11aa735edb89d712b926179829b2e0dfe721 Mon Sep 17 00:00:00 2001 From: Mikhail Wall Date: Thu, 27 Jun 2024 16:05:02 +0200 Subject: [PATCH 09/18] fix: changed context --- p2p/pkg/rpc/bidder/service.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/p2p/pkg/rpc/bidder/service.go b/p2p/pkg/rpc/bidder/service.go index 9158c99b6..3a59463f4 100644 --- a/p2p/pkg/rpc/bidder/service.go +++ b/p2p/pkg/rpc/bidder/service.go @@ -431,7 +431,7 @@ func (s *Service) CancelAndWithdrawAutoDeposit( if err != nil { return nil, status.Errorf(codes.FailedPrecondition, "cancel auto deposit: %v", err) } - err = s.autoDepositTracker.WithdrawAutoDeposit(ctx, cancelResponse.WindowNumbers) + err = s.autoDepositTracker.WithdrawAutoDeposit(context.Background(), cancelResponse.WindowNumbers) if err != nil { return nil, status.Errorf(codes.Internal, "withdrawal: %v", err) } From fd8c1d59a116ec1169bb0162514395a1fc590466 Mon Sep 17 00:00:00 2001 From: Mikhail Wall Date: Thu, 27 Jun 2024 16:53:34 +0200 Subject: [PATCH 10/18] fix: trying internal ctx --- p2p/pkg/depositmanager/autodeposit.go | 2 +- p2p/pkg/rpc/bidder/service.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/p2p/pkg/depositmanager/autodeposit.go b/p2p/pkg/depositmanager/autodeposit.go index eda45fffa..cd97a5732 100644 --- a/p2p/pkg/depositmanager/autodeposit.go +++ b/p2p/pkg/depositmanager/autodeposit.go @@ -180,7 +180,7 @@ func (adt *AutoDepositTracker) WithdrawAutoDeposit(ctx context.Context, windowNu }) lastWindowNumber := windows[len(windows)-1] - eg, egCtx := errgroup.WithContext(ctx) + eg, egCtx := errgroup.WithContext(context.Background()) egCtx, cancel := context.WithCancel(egCtx) evt := events.NewEventHandler( diff --git a/p2p/pkg/rpc/bidder/service.go b/p2p/pkg/rpc/bidder/service.go index 3a59463f4..56772efcd 100644 --- a/p2p/pkg/rpc/bidder/service.go +++ b/p2p/pkg/rpc/bidder/service.go @@ -391,7 +391,7 @@ func (s *Service) AutoDeposit( } if len(ads) > 0 { - err := s.autoDepositTracker.DoAutoMoveToAnotherWindow(context.Background(), ads) + err := s.autoDepositTracker.DoAutoMoveToAnotherWindow(ctx, ads) if err != nil { return nil, status.Errorf(codes.Internal, "auto deposit: %v", err) } @@ -431,7 +431,7 @@ func (s *Service) CancelAndWithdrawAutoDeposit( if err != nil { return nil, status.Errorf(codes.FailedPrecondition, "cancel auto deposit: %v", err) } - err = s.autoDepositTracker.WithdrawAutoDeposit(context.Background(), cancelResponse.WindowNumbers) + err = s.autoDepositTracker.WithdrawAutoDeposit(ctx, cancelResponse.WindowNumbers) if err != nil { return nil, status.Errorf(codes.Internal, "withdrawal: %v", err) } From f82a8acde6144ad790ea642eeb3c58b75dc24183 Mon Sep 17 00:00:00 2001 From: Mikhail Wall Date: Thu, 27 Jun 2024 17:11:27 +0200 Subject: [PATCH 11/18] fix: changed ctx --- p2p/pkg/depositmanager/autodeposit.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/p2p/pkg/depositmanager/autodeposit.go b/p2p/pkg/depositmanager/autodeposit.go index cd97a5732..275575f24 100644 --- a/p2p/pkg/depositmanager/autodeposit.go +++ b/p2p/pkg/depositmanager/autodeposit.go @@ -61,7 +61,7 @@ func (adt *AutoDepositTracker) DoAutoMoveToAnotherWindow(ctx context.Context, ad adt.deposits[ad.WindowNumber.Value] = true } - eg, egCtx := errgroup.WithContext(ctx) + eg, egCtx := errgroup.WithContext(context.Background()) egCtx, cancel := context.WithCancel(egCtx) adt.cancelFunc = cancel From 81dc8629afccda5b3e4abb80054ba8e2f2025619 Mon Sep 17 00:00:00 2001 From: Mikhail Wall Date: Thu, 27 Jun 2024 19:58:50 +0200 Subject: [PATCH 12/18] fix: logs --- p2p/pkg/depositmanager/autodeposit.go | 5 ++--- p2p/pkg/rpc/bidder/service.go | 16 +++++++++++++++- p2p/pkg/rpc/bidder/service_test.go | 2 -- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/p2p/pkg/depositmanager/autodeposit.go b/p2p/pkg/depositmanager/autodeposit.go index 275575f24..b1aa80645 100644 --- a/p2p/pkg/depositmanager/autodeposit.go +++ b/p2p/pkg/depositmanager/autodeposit.go @@ -52,9 +52,6 @@ func NewAutoDepositTracker( } func (adt *AutoDepositTracker) DoAutoMoveToAnotherWindow(ctx context.Context, ads []*bidderapiv1.AutoDeposit) error { - if adt.isWorking.Load() { - return fmt.Errorf("auto deposit tracker is already working") - } adt.isWorking.Store(true) for _, ad := range ads { @@ -81,6 +78,7 @@ func (adt *AutoDepositTracker) DoAutoMoveToAnotherWindow(ctx context.Context, ad sub, err := adt.eventMgr.Subscribe(evt) if err != nil { + adt.isWorking.Store(false) return fmt.Errorf("error subscribing to event: %w", err) } @@ -135,6 +133,7 @@ func (adt *AutoDepositTracker) DoAutoMoveToAnotherWindow(ctx context.Context, ad }() select { case <-ctx.Done(): + adt.isWorking.Store(false) return ctx.Err() case <-started: } diff --git a/p2p/pkg/rpc/bidder/service.go b/p2p/pkg/rpc/bidder/service.go index 56772efcd..7079fc912 100644 --- a/p2p/pkg/rpc/bidder/service.go +++ b/p2p/pkg/rpc/bidder/service.go @@ -160,7 +160,7 @@ func (s *Service) Deposit( } if s.autoDepositTracker.IsWorking() { - return nil, status.Error(codes.FailedPrecondition, "auto deposit is already running") + return nil, status.Error(codes.FailedPrecondition, "auto deposit is already running, stop and then deposit") } currentWindow, err := s.blockTrackerContract.GetCurrentWindow() @@ -283,6 +283,10 @@ func (s *Service) Withdraw( return nil, status.Errorf(codes.InvalidArgument, "validating withdraw request: %v", err) } + if s.autoDepositTracker.IsWorking() { + return nil, status.Error(codes.FailedPrecondition, "auto deposit is already running, stop and then withdraw") + } + var window *big.Int if r.WindowNumber == nil { window, err = s.blockTrackerContract.GetCurrentWindow() @@ -341,6 +345,9 @@ func (s *Service) AutoDeposit( if err != nil { return nil, status.Errorf(codes.InvalidArgument, "validating auto deposit request: %v", err) } + if s.autoDepositTracker.IsWorking() { + return nil, status.Error(codes.FailedPrecondition, "auto deposit is already running") + } currentWindow, err := s.blockTrackerContract.GetCurrentWindow() if err != nil { @@ -414,6 +421,10 @@ func (s *Service) CancelAutoDeposit( ctx context.Context, _ *bidderapiv1.EmptyMessage, ) (*bidderapiv1.CancelAutoDepositResponse, error) { + if !s.autoDepositTracker.IsWorking() { + return nil, status.Error(codes.FailedPrecondition, "auto deposit is not running") + } + cancelResponse, err := s.autoDepositTracker.Stop() if err != nil { return nil, status.Errorf(codes.FailedPrecondition, "cancel auto deposit: %v", err) @@ -427,6 +438,9 @@ func (s *Service) CancelAndWithdrawAutoDeposit( ctx context.Context, _ *bidderapiv1.EmptyMessage, ) (*bidderapiv1.CancelAutoDepositResponse, error) { + if !s.autoDepositTracker.IsWorking() { + return nil, status.Error(codes.FailedPrecondition, "auto deposit is not running") + } cancelResponse, err := s.autoDepositTracker.Stop() if err != nil { return nil, status.Errorf(codes.FailedPrecondition, "cancel auto deposit: %v", err) diff --git a/p2p/pkg/rpc/bidder/service_test.go b/p2p/pkg/rpc/bidder/service_test.go index 085c116a4..87305db55 100644 --- a/p2p/pkg/rpc/bidder/service_test.go +++ b/p2p/pkg/rpc/bidder/service_test.go @@ -157,8 +157,6 @@ func (t *testAutoDepositTracker) Stop() (*bidderapiv1.CancelAutoDepositResponse, }, nil } -// func (t *testAutoDepositTracker) - func (t *testAutoDepositTracker) WithdrawAutoDeposit(ctx context.Context, windowNumbers []*wrapperspb.UInt64Value) error { return nil } From 1ecd7c21f352d07ce3c3c5dfca17f2661a99715a Mon Sep 17 00:00:00 2001 From: Mikhail Wall Date: Fri, 28 Jun 2024 00:43:08 +0200 Subject: [PATCH 13/18] chore: get rid of min deposit for the bidder --- contracts-abi/abi/BidderRegistry.abi | 49 ----- .../clients/BidderRegistry/BidderRegistry.go | 204 ++---------------- contracts/contracts/BidderRegistry.sol | 33 ++- contracts/scripts/DeployScripts.s.sol | 2 +- contracts/test/BidderRegistryTest.sol | 85 +++++++- contracts/test/OracleTest.sol | 1 - contracts/test/PreConfirmationConfTest.sol | 1 - contracts/test/ProviderRegistryTest.sol | 3 +- 8 files changed, 103 insertions(+), 275 deletions(-) diff --git a/contracts-abi/abi/BidderRegistry.abi b/contracts-abi/abi/BidderRegistry.abi index 5dd67c052..c731e6982 100644 --- a/contracts-abi/abi/BidderRegistry.abi +++ b/contracts-abi/abi/BidderRegistry.abi @@ -257,11 +257,6 @@ "type": "function", "name": "initialize", "inputs": [ - { - "name": "_minDeposit", - "type": "uint256", - "internalType": "uint256" - }, { "name": "_feeRecipient", "type": "address", @@ -339,19 +334,6 @@ ], "stateMutability": "view" }, - { - "type": "function", - "name": "minDeposit", - "inputs": [], - "outputs": [ - { - "name": "", - "type": "uint256", - "internalType": "uint256" - } - ], - "stateMutability": "view" - }, { "type": "function", "name": "moveDepositToWindow", @@ -670,37 +652,6 @@ "outputs": [], "stateMutability": "nonpayable" }, - { - "type": "event", - "name": "BidderMovedFunds", - "inputs": [ - { - "name": "bidder", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "name": "fromWindow", - "type": "uint256", - "indexed": false, - "internalType": "uint256" - }, - { - "name": "toWindow", - "type": "uint256", - "indexed": false, - "internalType": "uint256" - }, - { - "name": "amount", - "type": "uint256", - "indexed": false, - "internalType": "uint256" - } - ], - "anonymous": false - }, { "type": "event", "name": "BidderRegistered", diff --git a/contracts-abi/clients/BidderRegistry/BidderRegistry.go b/contracts-abi/clients/BidderRegistry/BidderRegistry.go index 73601061c..dafa40978 100644 --- a/contracts-abi/clients/BidderRegistry/BidderRegistry.go +++ b/contracts-abi/clients/BidderRegistry/BidderRegistry.go @@ -31,7 +31,7 @@ var ( // BidderregistryMetaData contains all meta data concerning the Bidderregistry contract. var BidderregistryMetaData = &bind.MetaData{ - ABI: "[{\"type\":\"constructor\",\"inputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"fallback\",\"stateMutability\":\"payable\"},{\"type\":\"receive\",\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"BidPayment\",\"inputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"bidder\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"bidAmt\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"state\",\"type\":\"uint8\",\"internalType\":\"enumIBidderRegistry.State\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"OpenBid\",\"inputs\":[{\"name\":\"commitmentDigest\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"bid\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"bidder\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"blockNumber\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"UPGRADE_INTERFACE_VERSION\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"bidderRegistered\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"blockTrackerContract\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIBlockTracker\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"blocksPerWindow\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"depositForNWindows\",\"inputs\":[{\"name\":\"window\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"n\",\"type\":\"uint16\",\"internalType\":\"uint16\"}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"depositForSpecificWindow\",\"inputs\":[{\"name\":\"window\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"feePercent\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint16\",\"internalType\":\"uint16\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"feeRecipient\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"feeRecipientAmount\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getDeposit\",\"inputs\":[{\"name\":\"bidder\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"window\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getFeeRecipientAmount\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getProviderAmount\",\"inputs\":[{\"name\":\"provider\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"initialize\",\"inputs\":[{\"name\":\"_minDeposit\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_feeRecipient\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_feePercent\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"_owner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_blockTracker\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_blocksPerWindow\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"lockedFunds\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"maxBidPerBlock\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"minDeposit\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"moveDepositToWindow\",\"inputs\":[{\"name\":\"fromWindow\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"toWindow\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"owner\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"preConfirmationsContract\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"protocolFeeAmount\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"providerAmount\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"proxiableUUID\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"renounceOwnership\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"retrieveFunds\",\"inputs\":[{\"name\":\"windowToSettle\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"commitmentDigest\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"provider\",\"type\":\"address\",\"internalType\":\"addresspayable\"},{\"name\":\"residualBidPercentAfterDecay\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setNewFeePercent\",\"inputs\":[{\"name\":\"newFeePercent\",\"type\":\"uint16\",\"internalType\":\"uint16\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setNewFeeRecipient\",\"inputs\":[{\"name\":\"newFeeRecipient\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setPreconfirmationsContract\",\"inputs\":[{\"name\":\"contractAddress\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"transferOwnership\",\"inputs\":[{\"name\":\"newOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"unlockFunds\",\"inputs\":[{\"name\":\"window\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"bidID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"upgradeToAndCall\",\"inputs\":[{\"name\":\"newImplementation\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"data\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"usedFunds\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"withdrawBidderAmountFromWindow\",\"inputs\":[{\"name\":\"bidder\",\"type\":\"address\",\"internalType\":\"addresspayable\"},{\"name\":\"window\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"withdrawFeeRecipientAmount\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"withdrawFromNWindows\",\"inputs\":[{\"name\":\"window\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"n\",\"type\":\"uint16\",\"internalType\":\"uint16\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"withdrawFromSpecificWindows\",\"inputs\":[{\"name\":\"windows\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"withdrawProtocolFee\",\"inputs\":[{\"name\":\"bidder\",\"type\":\"address\",\"internalType\":\"addresspayable\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"withdrawProviderAmount\",\"inputs\":[{\"name\":\"provider\",\"type\":\"address\",\"internalType\":\"addresspayable\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"event\",\"name\":\"BidderMovedFunds\",\"inputs\":[{\"name\":\"bidder\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"fromWindow\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"toWindow\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"amount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"BidderRegistered\",\"inputs\":[{\"name\":\"bidder\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"depositedAmount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"windowNumber\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"BidderWithdrawal\",\"inputs\":[{\"name\":\"bidder\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"window\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"amount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"FundsRetrieved\",\"inputs\":[{\"name\":\"commitmentDigest\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"bidder\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"window\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"amount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"FundsRewarded\",\"inputs\":[{\"name\":\"commitmentDigest\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"bidder\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"provider\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"window\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"amount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Initialized\",\"inputs\":[{\"name\":\"version\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"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\":\"Upgraded\",\"inputs\":[{\"name\":\"implementation\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"AddressEmptyCode\",\"inputs\":[{\"name\":\"target\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"ERC1967InvalidImplementation\",\"inputs\":[{\"name\":\"implementation\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"ERC1967NonPayable\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"FailedInnerCall\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidInitialization\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"NotInitializing\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"OwnableInvalidOwner\",\"inputs\":[{\"name\":\"owner\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"OwnableUnauthorizedAccount\",\"inputs\":[{\"name\":\"account\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"ReentrancyGuardReentrantCall\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"UUPSUnauthorizedCallContext\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"UUPSUnsupportedProxiableUUID\",\"inputs\":[{\"name\":\"slot\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]}]", + ABI: "[{\"type\":\"constructor\",\"inputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"fallback\",\"stateMutability\":\"payable\"},{\"type\":\"receive\",\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"BidPayment\",\"inputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"bidder\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"bidAmt\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"state\",\"type\":\"uint8\",\"internalType\":\"enumIBidderRegistry.State\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"OpenBid\",\"inputs\":[{\"name\":\"commitmentDigest\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"bid\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"bidder\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"blockNumber\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"UPGRADE_INTERFACE_VERSION\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"bidderRegistered\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"blockTrackerContract\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIBlockTracker\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"blocksPerWindow\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"depositForNWindows\",\"inputs\":[{\"name\":\"window\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"n\",\"type\":\"uint16\",\"internalType\":\"uint16\"}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"depositForSpecificWindow\",\"inputs\":[{\"name\":\"window\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"feePercent\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint16\",\"internalType\":\"uint16\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"feeRecipient\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"feeRecipientAmount\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getDeposit\",\"inputs\":[{\"name\":\"bidder\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"window\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getFeeRecipientAmount\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getProviderAmount\",\"inputs\":[{\"name\":\"provider\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"initialize\",\"inputs\":[{\"name\":\"_feeRecipient\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_feePercent\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"_owner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_blockTracker\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_blocksPerWindow\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"lockedFunds\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"maxBidPerBlock\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"moveDepositToWindow\",\"inputs\":[{\"name\":\"fromWindow\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"toWindow\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"owner\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"preConfirmationsContract\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"protocolFeeAmount\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"providerAmount\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"proxiableUUID\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"renounceOwnership\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"retrieveFunds\",\"inputs\":[{\"name\":\"windowToSettle\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"commitmentDigest\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"provider\",\"type\":\"address\",\"internalType\":\"addresspayable\"},{\"name\":\"residualBidPercentAfterDecay\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setNewFeePercent\",\"inputs\":[{\"name\":\"newFeePercent\",\"type\":\"uint16\",\"internalType\":\"uint16\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setNewFeeRecipient\",\"inputs\":[{\"name\":\"newFeeRecipient\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setPreconfirmationsContract\",\"inputs\":[{\"name\":\"contractAddress\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"transferOwnership\",\"inputs\":[{\"name\":\"newOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"unlockFunds\",\"inputs\":[{\"name\":\"window\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"bidID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"upgradeToAndCall\",\"inputs\":[{\"name\":\"newImplementation\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"data\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"usedFunds\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"withdrawBidderAmountFromWindow\",\"inputs\":[{\"name\":\"bidder\",\"type\":\"address\",\"internalType\":\"addresspayable\"},{\"name\":\"window\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"withdrawFeeRecipientAmount\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"withdrawFromNWindows\",\"inputs\":[{\"name\":\"window\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"n\",\"type\":\"uint16\",\"internalType\":\"uint16\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"withdrawFromSpecificWindows\",\"inputs\":[{\"name\":\"windows\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"withdrawProtocolFee\",\"inputs\":[{\"name\":\"bidder\",\"type\":\"address\",\"internalType\":\"addresspayable\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"withdrawProviderAmount\",\"inputs\":[{\"name\":\"provider\",\"type\":\"address\",\"internalType\":\"addresspayable\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"event\",\"name\":\"BidderRegistered\",\"inputs\":[{\"name\":\"bidder\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"depositedAmount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"windowNumber\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"BidderWithdrawal\",\"inputs\":[{\"name\":\"bidder\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"window\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"amount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"FundsRetrieved\",\"inputs\":[{\"name\":\"commitmentDigest\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"bidder\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"window\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"amount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"FundsRewarded\",\"inputs\":[{\"name\":\"commitmentDigest\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"bidder\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"provider\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"window\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"amount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Initialized\",\"inputs\":[{\"name\":\"version\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"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\":\"Upgraded\",\"inputs\":[{\"name\":\"implementation\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"AddressEmptyCode\",\"inputs\":[{\"name\":\"target\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"ERC1967InvalidImplementation\",\"inputs\":[{\"name\":\"implementation\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"ERC1967NonPayable\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"FailedInnerCall\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidInitialization\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"NotInitializing\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"OwnableInvalidOwner\",\"inputs\":[{\"name\":\"owner\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"OwnableUnauthorizedAccount\",\"inputs\":[{\"name\":\"account\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"ReentrancyGuardReentrantCall\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"UUPSUnauthorizedCallContext\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"UUPSUnsupportedProxiableUUID\",\"inputs\":[{\"name\":\"slot\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]}]", } // BidderregistryABI is the input ABI used to generate the binding from. @@ -602,37 +602,6 @@ func (_Bidderregistry *BidderregistryCallerSession) MaxBidPerBlock(arg0 common.A return _Bidderregistry.Contract.MaxBidPerBlock(&_Bidderregistry.CallOpts, arg0, arg1) } -// MinDeposit is a free data retrieval call binding the contract method 0x41b3d185. -// -// Solidity: function minDeposit() view returns(uint256) -func (_Bidderregistry *BidderregistryCaller) MinDeposit(opts *bind.CallOpts) (*big.Int, error) { - var out []interface{} - err := _Bidderregistry.contract.Call(opts, &out, "minDeposit") - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// MinDeposit is a free data retrieval call binding the contract method 0x41b3d185. -// -// Solidity: function minDeposit() view returns(uint256) -func (_Bidderregistry *BidderregistrySession) MinDeposit() (*big.Int, error) { - return _Bidderregistry.Contract.MinDeposit(&_Bidderregistry.CallOpts) -} - -// MinDeposit is a free data retrieval call binding the contract method 0x41b3d185. -// -// Solidity: function minDeposit() view returns(uint256) -func (_Bidderregistry *BidderregistryCallerSession) MinDeposit() (*big.Int, error) { - return _Bidderregistry.Contract.MinDeposit(&_Bidderregistry.CallOpts) -} - // Owner is a free data retrieval call binding the contract method 0x8da5cb5b. // // Solidity: function owner() view returns(address) @@ -882,25 +851,25 @@ func (_Bidderregistry *BidderregistryTransactorSession) DepositForSpecificWindow return _Bidderregistry.Contract.DepositForSpecificWindow(&_Bidderregistry.TransactOpts, window) } -// Initialize is a paid mutator transaction binding the contract method 0x0ba1d573. +// Initialize is a paid mutator transaction binding the contract method 0x987cb9ae. // -// Solidity: function initialize(uint256 _minDeposit, address _feeRecipient, uint16 _feePercent, address _owner, address _blockTracker, uint256 _blocksPerWindow) returns() -func (_Bidderregistry *BidderregistryTransactor) Initialize(opts *bind.TransactOpts, _minDeposit *big.Int, _feeRecipient common.Address, _feePercent uint16, _owner common.Address, _blockTracker common.Address, _blocksPerWindow *big.Int) (*types.Transaction, error) { - return _Bidderregistry.contract.Transact(opts, "initialize", _minDeposit, _feeRecipient, _feePercent, _owner, _blockTracker, _blocksPerWindow) +// Solidity: function initialize(address _feeRecipient, uint16 _feePercent, address _owner, address _blockTracker, uint256 _blocksPerWindow) returns() +func (_Bidderregistry *BidderregistryTransactor) Initialize(opts *bind.TransactOpts, _feeRecipient common.Address, _feePercent uint16, _owner common.Address, _blockTracker common.Address, _blocksPerWindow *big.Int) (*types.Transaction, error) { + return _Bidderregistry.contract.Transact(opts, "initialize", _feeRecipient, _feePercent, _owner, _blockTracker, _blocksPerWindow) } -// Initialize is a paid mutator transaction binding the contract method 0x0ba1d573. +// Initialize is a paid mutator transaction binding the contract method 0x987cb9ae. // -// Solidity: function initialize(uint256 _minDeposit, address _feeRecipient, uint16 _feePercent, address _owner, address _blockTracker, uint256 _blocksPerWindow) returns() -func (_Bidderregistry *BidderregistrySession) Initialize(_minDeposit *big.Int, _feeRecipient common.Address, _feePercent uint16, _owner common.Address, _blockTracker common.Address, _blocksPerWindow *big.Int) (*types.Transaction, error) { - return _Bidderregistry.Contract.Initialize(&_Bidderregistry.TransactOpts, _minDeposit, _feeRecipient, _feePercent, _owner, _blockTracker, _blocksPerWindow) +// Solidity: function initialize(address _feeRecipient, uint16 _feePercent, address _owner, address _blockTracker, uint256 _blocksPerWindow) returns() +func (_Bidderregistry *BidderregistrySession) Initialize(_feeRecipient common.Address, _feePercent uint16, _owner common.Address, _blockTracker common.Address, _blocksPerWindow *big.Int) (*types.Transaction, error) { + return _Bidderregistry.Contract.Initialize(&_Bidderregistry.TransactOpts, _feeRecipient, _feePercent, _owner, _blockTracker, _blocksPerWindow) } -// Initialize is a paid mutator transaction binding the contract method 0x0ba1d573. +// Initialize is a paid mutator transaction binding the contract method 0x987cb9ae. // -// Solidity: function initialize(uint256 _minDeposit, address _feeRecipient, uint16 _feePercent, address _owner, address _blockTracker, uint256 _blocksPerWindow) returns() -func (_Bidderregistry *BidderregistryTransactorSession) Initialize(_minDeposit *big.Int, _feeRecipient common.Address, _feePercent uint16, _owner common.Address, _blockTracker common.Address, _blocksPerWindow *big.Int) (*types.Transaction, error) { - return _Bidderregistry.Contract.Initialize(&_Bidderregistry.TransactOpts, _minDeposit, _feeRecipient, _feePercent, _owner, _blockTracker, _blocksPerWindow) +// Solidity: function initialize(address _feeRecipient, uint16 _feePercent, address _owner, address _blockTracker, uint256 _blocksPerWindow) returns() +func (_Bidderregistry *BidderregistryTransactorSession) Initialize(_feeRecipient common.Address, _feePercent uint16, _owner common.Address, _blockTracker common.Address, _blocksPerWindow *big.Int) (*types.Transaction, error) { + return _Bidderregistry.Contract.Initialize(&_Bidderregistry.TransactOpts, _feeRecipient, _feePercent, _owner, _blockTracker, _blocksPerWindow) } // MoveDepositToWindow is a paid mutator transaction binding the contract method 0x73dac150. @@ -1260,153 +1229,6 @@ func (_Bidderregistry *BidderregistryTransactorSession) Receive() (*types.Transa return _Bidderregistry.Contract.Receive(&_Bidderregistry.TransactOpts) } -// BidderregistryBidderMovedFundsIterator is returned from FilterBidderMovedFunds and is used to iterate over the raw logs and unpacked data for BidderMovedFunds events raised by the Bidderregistry contract. -type BidderregistryBidderMovedFundsIterator struct { - Event *BidderregistryBidderMovedFunds // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *BidderregistryBidderMovedFundsIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(BidderregistryBidderMovedFunds) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(BidderregistryBidderMovedFunds) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *BidderregistryBidderMovedFundsIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *BidderregistryBidderMovedFundsIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// BidderregistryBidderMovedFunds represents a BidderMovedFunds event raised by the Bidderregistry contract. -type BidderregistryBidderMovedFunds struct { - Bidder common.Address - FromWindow *big.Int - ToWindow *big.Int - Amount *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterBidderMovedFunds is a free log retrieval operation binding the contract event 0xc6f0b69dd53688553b5b6f9f791e83055ccbd1875750b877276fe0a31dbf1812. -// -// Solidity: event BidderMovedFunds(address indexed bidder, uint256 fromWindow, uint256 toWindow, uint256 amount) -func (_Bidderregistry *BidderregistryFilterer) FilterBidderMovedFunds(opts *bind.FilterOpts, bidder []common.Address) (*BidderregistryBidderMovedFundsIterator, error) { - - var bidderRule []interface{} - for _, bidderItem := range bidder { - bidderRule = append(bidderRule, bidderItem) - } - - logs, sub, err := _Bidderregistry.contract.FilterLogs(opts, "BidderMovedFunds", bidderRule) - if err != nil { - return nil, err - } - return &BidderregistryBidderMovedFundsIterator{contract: _Bidderregistry.contract, event: "BidderMovedFunds", logs: logs, sub: sub}, nil -} - -// WatchBidderMovedFunds is a free log subscription operation binding the contract event 0xc6f0b69dd53688553b5b6f9f791e83055ccbd1875750b877276fe0a31dbf1812. -// -// Solidity: event BidderMovedFunds(address indexed bidder, uint256 fromWindow, uint256 toWindow, uint256 amount) -func (_Bidderregistry *BidderregistryFilterer) WatchBidderMovedFunds(opts *bind.WatchOpts, sink chan<- *BidderregistryBidderMovedFunds, bidder []common.Address) (event.Subscription, error) { - - var bidderRule []interface{} - for _, bidderItem := range bidder { - bidderRule = append(bidderRule, bidderItem) - } - - logs, sub, err := _Bidderregistry.contract.WatchLogs(opts, "BidderMovedFunds", bidderRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(BidderregistryBidderMovedFunds) - if err := _Bidderregistry.contract.UnpackLog(event, "BidderMovedFunds", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseBidderMovedFunds is a log parse operation binding the contract event 0xc6f0b69dd53688553b5b6f9f791e83055ccbd1875750b877276fe0a31dbf1812. -// -// Solidity: event BidderMovedFunds(address indexed bidder, uint256 fromWindow, uint256 toWindow, uint256 amount) -func (_Bidderregistry *BidderregistryFilterer) ParseBidderMovedFunds(log types.Log) (*BidderregistryBidderMovedFunds, error) { - event := new(BidderregistryBidderMovedFunds) - if err := _Bidderregistry.contract.UnpackLog(event, "BidderMovedFunds", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - // BidderregistryBidderRegisteredIterator is returned from FilterBidderRegistered and is used to iterate over the raw logs and unpacked data for BidderRegistered events raised by the Bidderregistry contract. type BidderregistryBidderRegisteredIterator struct { Event *BidderregistryBidderRegistered // Event containing the contract specifics and raw log diff --git a/contracts/contracts/BidderRegistry.sol b/contracts/contracts/BidderRegistry.sol index 8596ce678..48c6b8363 100644 --- a/contracts/contracts/BidderRegistry.sol +++ b/contracts/contracts/BidderRegistry.sol @@ -25,9 +25,6 @@ contract BidderRegistry is /// @dev Fee percent that would be taken by protocol when provider is slashed uint16 public feePercent; - /// @dev Minimum deposit required for registration - uint256 public minDeposit; - /// @dev Amount assigned to feeRecipient uint256 public feeRecipientAmount; @@ -95,14 +92,6 @@ contract BidderRegistry is uint256 amount ); - /// @dev Event emitted when a bidder moves their deposit from one window to another - event BidderMovedFunds( - address indexed bidder, - uint256 fromWindow, - uint256 toWindow, - uint256 amount - ); - /** * @dev Fallback function to revert all calls, ensuring no unintended interactions. */ @@ -122,20 +111,19 @@ contract BidderRegistry is /** * @dev Initializes the contract with a minimum deposit requirement. - * @param _minDeposit The minimum deposit required for bidder registration. * @param _feeRecipient The address that receives fee * @param _feePercent The fee percentage for protocol * @param _owner Owner of the contract, explicitly needed since contract is deployed w/ create2 factory. + * @param _blockTracker The address of the block tracker contract. + * @param _blocksPerWindow The number of blocks per window. */ function initialize( - uint256 _minDeposit, address _feeRecipient, uint16 _feePercent, address _owner, address _blockTracker, uint256 _blocksPerWindow ) external initializer { - minDeposit = _minDeposit; feeRecipient = _feeRecipient; feePercent = _feePercent; blockTrackerContract = IBlockTracker(_blockTracker); @@ -176,6 +164,7 @@ contract BidderRegistry is /** * @dev Get the amount assigned to a provider. + * @param provider The address of the provider. */ function getProviderAmount( address provider @@ -195,8 +184,6 @@ contract BidderRegistry is * @param window The window for which the deposit is being made. */ function depositForSpecificWindow(uint256 window) external payable { - require(msg.value >= minDeposit, "Insufficient deposit"); - if (!bidderRegistered[msg.sender]) { bidderRegistered[msg.sender] = true; } @@ -240,7 +227,7 @@ contract BidderRegistry is maxBidPerBlock[msg.sender][toWindow] = newLockedFunds / blocksPerWindow; emit BidderRegistered(msg.sender, newLockedFunds, toWindow); - emit BidderMovedFunds(msg.sender, fromWindow, toWindow, deposit); + emit BidderWithdrawal(msg.sender, fromWindow, deposit); } /** @@ -249,8 +236,6 @@ contract BidderRegistry is * @param n The number of windows for which the deposit is being made. */ function depositForNWindows(uint256 window, uint16 n) external payable { - require(msg.value >= minDeposit * n, "Insufficient deposit"); - if (!bidderRegistered[msg.sender]) { bidderRegistered[msg.sender] = true; } @@ -276,6 +261,11 @@ contract BidderRegistry is } } + /** + * @dev Withdraw from n windows. + * @param window The window for which the deposit is being withdrawn. + * @param n The number of windows for which the deposit is being withdrawn. + */ function withdrawFromNWindows( uint256 window, uint16 n @@ -302,6 +292,10 @@ contract BidderRegistry is require(success, "couldn't transfer to bidder"); } + /** + * @dev Withdraw from specific windows. + * @param windows The windows from which the deposit is being withdrawn. + */ function withdrawFromSpecificWindows( uint256[] calldata windows ) external nonReentrant { @@ -514,6 +508,7 @@ contract BidderRegistry is /** * @dev Withdraw funds to the bidder. * @param bidder The address of the bidder. + * @param window The window for which the funds are being withdrawn. */ function withdrawBidderAmountFromWindow( address payable bidder, diff --git a/contracts/scripts/DeployScripts.s.sol b/contracts/scripts/DeployScripts.s.sol index 47ea90fbb..d6c7737f1 100644 --- a/contracts/scripts/DeployScripts.s.sol +++ b/contracts/scripts/DeployScripts.s.sol @@ -32,7 +32,7 @@ contract DeployScript is Script { address bidderRegistryProxy = Upgrades.deployUUPSProxy( "BidderRegistry.sol", - abi.encodeCall(BidderRegistry.initialize, (minStake, feeRecipient, feePercent, msg.sender, address(blockTracker), blocksPerWindow)) + abi.encodeCall(BidderRegistry.initialize, (feeRecipient, feePercent, msg.sender, address(blockTracker), blocksPerWindow)) ); BidderRegistry bidderRegistry = BidderRegistry(payable(bidderRegistryProxy)); console.log("BidderRegistry:", address(bidderRegistry)); diff --git a/contracts/test/BidderRegistryTest.sol b/contracts/test/BidderRegistryTest.sol index 3713be633..1e5fe3d74 100644 --- a/contracts/test/BidderRegistryTest.sol +++ b/contracts/test/BidderRegistryTest.sol @@ -34,7 +34,7 @@ contract BidderRegistryTest is Test { address bidderRegistryProxy = Upgrades.deployUUPSProxy( "BidderRegistry.sol", - abi.encodeCall(BidderRegistry.initialize, (minStake, feeRecipient, feePercent, address(this), address(blockTracker), blocksPerWindow)) + abi.encodeCall(BidderRegistry.initialize, (feeRecipient, feePercent, address(this), address(blockTracker), blocksPerWindow)) ); bidderRegistry = BidderRegistry(payable(bidderRegistryProxy)); @@ -44,19 +44,12 @@ contract BidderRegistryTest is Test { } function test_VerifyInitialContractState() public view { - assertEq(bidderRegistry.minDeposit(), 1e18 wei); assertEq(bidderRegistry.feeRecipient(), feeRecipient); assertEq(bidderRegistry.feePercent(), feePercent); assertEq(bidderRegistry.preConfirmationsContract(), address(0)); assertEq(bidderRegistry.bidderRegistered(bidder), false); } - function testFail_BidderStakeAndRegisterMinStake() public { - vm.prank(bidder); - vm.expectRevert(bytes("")); - bidderRegistry.depositForSpecificWindow{value: 1 wei}(2); - } - function test_BidderStakeAndRegister() public { uint256 currentWindow = blockTracker.getCurrentWindow(); uint256 nextWindow = currentWindow + 1; @@ -400,10 +393,80 @@ contract BidderRegistryTest is Test { assertEq(isBidderRegistered, true); } - function testFail_DepositForNWindows_InsufficientDeposit() public { + function test_WithdrawFromNWindows() public { uint256 currentWindow = blockTracker.getCurrentWindow(); uint16 n = 3; + uint256 depositAmount = minStake * n; vm.startPrank(bidder); - bidderRegistry.depositForNWindows{value: (minStake * n) - 1}(currentWindow, n); -}} + vm.expectEmit(true, false, false, true); + for (uint16 i = 0; i < n; i++) { + emit BidderRegistered(bidder, depositAmount / n, currentWindow + i); + } + + bidderRegistry.depositForNWindows{value: depositAmount}(currentWindow, n); + + for (uint16 i = 0; i < n; i++) { + uint256 lockedFunds = bidderRegistry.lockedFunds(bidder, currentWindow + i); + assertEq(lockedFunds, depositAmount / n); + + uint256 maxBid = bidderRegistry.maxBidPerBlock(bidder, currentWindow + i); + assertEq(maxBid, (depositAmount / n) / blocksPerWindow); + } + + vm.stopPrank(); + uint64 blockNumber = uint64(blocksPerWindow*4 + 2); + blockTracker.recordL1Block(blockNumber, "test"); + + vm.startPrank(bidder); + bidderRegistry.withdrawFromNWindows(currentWindow, n); + + for (uint16 i = 0; i < n; i++) { + uint256 lockedFunds = bidderRegistry.lockedFunds(bidder, currentWindow + i); + assertEq(lockedFunds, 0); + + uint256 maxBid = bidderRegistry.maxBidPerBlock(bidder, currentWindow + i); + assertEq(maxBid, 0); + } + } + + function test_WithdrawFromSpecificWindows() public { + uint256 currentWindow = blockTracker.getCurrentWindow(); + uint16 n = 3; + uint256 depositAmount = minStake * n; + + vm.startPrank(bidder); + vm.expectEmit(true, false, false, true); + for (uint16 i = 0; i < n; i++) { + emit BidderRegistered(bidder, depositAmount / n, currentWindow + i); + } + + bidderRegistry.depositForNWindows{value: depositAmount}(currentWindow, n); + + for (uint16 i = 0; i < n; i++) { + uint256 lockedFunds = bidderRegistry.lockedFunds(bidder, currentWindow + i); + assertEq(lockedFunds, depositAmount / n); + + uint256 maxBid = bidderRegistry.maxBidPerBlock(bidder, currentWindow + i); + assertEq(maxBid, (depositAmount / n) / blocksPerWindow); + } + vm.stopPrank(); + uint64 blockNumber = uint64(blocksPerWindow*3 + 2); + blockTracker.recordL1Block(blockNumber, "test"); + + uint256[] memory windows = new uint256[](3); + windows[0] = currentWindow; + windows[1] = currentWindow + 1; + windows[2] = currentWindow + 2; + vm.startPrank(bidder); + bidderRegistry.withdrawFromSpecificWindows(windows); + + for (uint16 i = 0; i < n; i++) { + uint256 lockedFunds = bidderRegistry.lockedFunds(bidder, currentWindow + i); + assertEq(lockedFunds, 0); + + uint256 maxBid = bidderRegistry.maxBidPerBlock(bidder, currentWindow + i); + assertEq(maxBid, 0); + } + } +} diff --git a/contracts/test/OracleTest.sol b/contracts/test/OracleTest.sol index 0a5191b22..1404099f1 100644 --- a/contracts/test/OracleTest.sol +++ b/contracts/test/OracleTest.sol @@ -101,7 +101,6 @@ contract OracleTest is Test { abi.encodeCall( BidderRegistry.initialize, ( - minStake, feeRecipient, feePercent, address(this), diff --git a/contracts/test/PreConfirmationConfTest.sol b/contracts/test/PreConfirmationConfTest.sol index 44a4e2aed..6efb3e55d 100644 --- a/contracts/test/PreConfirmationConfTest.sol +++ b/contracts/test/PreConfirmationConfTest.sol @@ -81,7 +81,6 @@ contract TestPreConfCommitmentStore is Test { abi.encodeCall( BidderRegistry.initialize, ( - minStake, feeRecipient, feePercent, address(this), diff --git a/contracts/test/ProviderRegistryTest.sol b/contracts/test/ProviderRegistryTest.sol index ba0cdbcca..b00ff5133 100644 --- a/contracts/test/ProviderRegistryTest.sol +++ b/contracts/test/ProviderRegistryTest.sol @@ -49,8 +49,7 @@ contract ProviderRegistryTest is Test { address bidderRegistryProxy = Upgrades.deployUUPSProxy( "BidderRegistry.sol", abi.encodeCall(BidderRegistry.initialize, - (minStake, - feeRecipient, + (feeRecipient, feePercent, address(this), address(blockTracker), From 2c975ff70bcdfc1eefff00a5a3ef5d76ea072123 Mon Sep 17 00:00:00 2001 From: Mikhail Wall Date: Fri, 28 Jun 2024 02:01:14 +0200 Subject: [PATCH 14/18] chore: get rid of min deposit --- p2p/gen/go/bidderapi/v1/bidderapi.pb.go | 35 +++---- p2p/gen/go/bidderapi/v1/bidderapi.pb.gw.go | 69 ------------- p2p/gen/go/bidderapi/v1/bidderapi_grpc.pb.go | 44 --------- .../bidderapi/v1/bidderapi.swagger.yaml | 14 --- p2p/integrationtest/bidder/main.go | 9 +- p2p/integrationtest/real-bidder/main.go | 96 +------------------ p2p/pkg/depositmanager/autodeposit_test.go | 39 ++++++-- p2p/pkg/rpc/bidder/service.go | 16 ---- p2p/pkg/rpc/bidder/service_test.go | 17 +--- p2p/rpc/bidderapi/v1/bidderapi.proto | 6 -- 10 files changed, 50 insertions(+), 295 deletions(-) diff --git a/p2p/gen/go/bidderapi/v1/bidderapi.pb.go b/p2p/gen/go/bidderapi/v1/bidderapi.pb.go index 11c6a83bd..a72518569 100644 --- a/p2p/gen/go/bidderapi/v1/bidderapi.pb.go +++ b/p2p/gen/go/bidderapi/v1/bidderapi.pb.go @@ -1129,7 +1129,7 @@ var file_bidderapi_v1_bidderapi_proto_rawDesc = []byte{ 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, 0xab, 0x08, 0x0a, 0x06, 0x42, 0x69, 0x64, 0x64, 0x65, 0x72, 0x12, 0x53, + 0x61, 0x6d, 0x70, 0x32, 0xbb, 0x07, 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, @@ -1182,14 +1182,7 @@ var file_bidderapi_v1_bidderapi_proto_rawDesc = []byte{ 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x18, 0x12, 0x16, 0x2f, 0x76, 0x31, 0x2f, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x2f, 0x67, 0x65, - 0x74, 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x12, 0x6e, 0x0a, 0x0d, 0x47, 0x65, 0x74, - 0x4d, 0x69, 0x6e, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 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, 0x1d, 0x2e, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x61, - 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x22, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1c, 0x12, 0x1a, 0x2f, - 0x76, 0x31, 0x2f, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x2f, 0x67, 0x65, 0x74, 0x5f, 0x6d, 0x69, - 0x6e, 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x12, 0x66, 0x0a, 0x08, 0x57, 0x69, 0x74, + 0x74, 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x12, 0x66, 0x0a, 0x08, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x12, 0x1d, 0x2e, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, @@ -1264,19 +1257,17 @@ var file_bidderapi_v1_bidderapi_proto_depIdxs = []int32{ 6, // 14: bidderapi.v1.Bidder.AutoDepositStatus:input_type -> bidderapi.v1.EmptyMessage 6, // 15: bidderapi.v1.Bidder.CancelAndWithdrawAutoDeposit:input_type -> bidderapi.v1.EmptyMessage 7, // 16: bidderapi.v1.Bidder.GetDeposit:input_type -> bidderapi.v1.GetDepositRequest - 6, // 17: bidderapi.v1.Bidder.GetMinDeposit:input_type -> bidderapi.v1.EmptyMessage - 8, // 18: bidderapi.v1.Bidder.Withdraw:input_type -> bidderapi.v1.WithdrawRequest - 11, // 19: bidderapi.v1.Bidder.SendBid:output_type -> bidderapi.v1.Commitment - 1, // 20: bidderapi.v1.Bidder.Deposit:output_type -> bidderapi.v1.DepositResponse - 2, // 21: bidderapi.v1.Bidder.AutoDeposit:output_type -> bidderapi.v1.AutoDepositResponse - 4, // 22: bidderapi.v1.Bidder.CancelAutoDeposit:output_type -> bidderapi.v1.CancelAutoDepositResponse - 3, // 23: bidderapi.v1.Bidder.AutoDepositStatus:output_type -> bidderapi.v1.AutoDepositStatusResponse - 4, // 24: bidderapi.v1.Bidder.CancelAndWithdrawAutoDeposit:output_type -> bidderapi.v1.CancelAutoDepositResponse - 1, // 25: bidderapi.v1.Bidder.GetDeposit:output_type -> bidderapi.v1.DepositResponse - 1, // 26: bidderapi.v1.Bidder.GetMinDeposit:output_type -> bidderapi.v1.DepositResponse - 9, // 27: bidderapi.v1.Bidder.Withdraw:output_type -> bidderapi.v1.WithdrawResponse - 19, // [19:28] is the sub-list for method output_type - 10, // [10:19] is the sub-list for method input_type + 8, // 17: bidderapi.v1.Bidder.Withdraw:input_type -> bidderapi.v1.WithdrawRequest + 11, // 18: bidderapi.v1.Bidder.SendBid:output_type -> bidderapi.v1.Commitment + 1, // 19: bidderapi.v1.Bidder.Deposit:output_type -> bidderapi.v1.DepositResponse + 2, // 20: bidderapi.v1.Bidder.AutoDeposit:output_type -> bidderapi.v1.AutoDepositResponse + 4, // 21: bidderapi.v1.Bidder.CancelAutoDeposit:output_type -> bidderapi.v1.CancelAutoDepositResponse + 3, // 22: bidderapi.v1.Bidder.AutoDepositStatus:output_type -> bidderapi.v1.AutoDepositStatusResponse + 4, // 23: bidderapi.v1.Bidder.CancelAndWithdrawAutoDeposit:output_type -> bidderapi.v1.CancelAutoDepositResponse + 1, // 24: bidderapi.v1.Bidder.GetDeposit:output_type -> bidderapi.v1.DepositResponse + 9, // 25: bidderapi.v1.Bidder.Withdraw:output_type -> bidderapi.v1.WithdrawResponse + 18, // [18:26] is the sub-list for method output_type + 10, // [10:18] is the sub-list for method input_type 10, // [10:10] is the sub-list for extension type_name 10, // [10:10] is the sub-list for extension extendee 0, // [0:10] is the sub-list for field type_name diff --git a/p2p/gen/go/bidderapi/v1/bidderapi.pb.gw.go b/p2p/gen/go/bidderapi/v1/bidderapi.pb.gw.go index 7e11b8782..0073f6266 100644 --- a/p2p/gen/go/bidderapi/v1/bidderapi.pb.gw.go +++ b/p2p/gen/go/bidderapi/v1/bidderapi.pb.gw.go @@ -282,24 +282,6 @@ func local_request_Bidder_GetDeposit_0(ctx context.Context, marshaler runtime.Ma } -func request_Bidder_GetMinDeposit_0(ctx context.Context, marshaler runtime.Marshaler, client BidderClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq EmptyMessage - var metadata runtime.ServerMetadata - - msg, err := client.GetMinDeposit(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Bidder_GetMinDeposit_0(ctx context.Context, marshaler runtime.Marshaler, server BidderServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq EmptyMessage - var metadata runtime.ServerMetadata - - msg, err := server.GetMinDeposit(ctx, &protoReq) - return msg, metadata, err - -} - var ( filter_Bidder_Withdraw_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} ) @@ -499,31 +481,6 @@ func RegisterBidderHandlerServer(ctx context.Context, mux *runtime.ServeMux, ser }) - mux.Handle("GET", pattern_Bidder_GetMinDeposit_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/bidderapi.v1.Bidder/GetMinDeposit", runtime.WithHTTPPathPattern("/v1/bidder/get_min_deposit")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Bidder_GetMinDeposit_0(annotatedContext, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_Bidder_GetMinDeposit_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - mux.Handle("POST", pattern_Bidder_Withdraw_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -744,28 +701,6 @@ func RegisterBidderHandlerClient(ctx context.Context, mux *runtime.ServeMux, cli }) - mux.Handle("GET", pattern_Bidder_GetMinDeposit_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/bidderapi.v1.Bidder/GetMinDeposit", runtime.WithHTTPPathPattern("/v1/bidder/get_min_deposit")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Bidder_GetMinDeposit_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_Bidder_GetMinDeposit_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - mux.Handle("POST", pattern_Bidder_Withdraw_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -806,8 +741,6 @@ var ( pattern_Bidder_GetDeposit_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "bidder", "get_deposit"}, "")) - pattern_Bidder_GetMinDeposit_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "bidder", "get_min_deposit"}, "")) - pattern_Bidder_Withdraw_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "bidder", "withdraw"}, "")) ) @@ -826,7 +759,5 @@ var ( forward_Bidder_GetDeposit_0 = runtime.ForwardResponseMessage - forward_Bidder_GetMinDeposit_0 = runtime.ForwardResponseMessage - forward_Bidder_Withdraw_0 = runtime.ForwardResponseMessage ) diff --git a/p2p/gen/go/bidderapi/v1/bidderapi_grpc.pb.go b/p2p/gen/go/bidderapi/v1/bidderapi_grpc.pb.go index 7fdcb936c..05717ac50 100644 --- a/p2p/gen/go/bidderapi/v1/bidderapi_grpc.pb.go +++ b/p2p/gen/go/bidderapi/v1/bidderapi_grpc.pb.go @@ -26,7 +26,6 @@ const ( Bidder_AutoDepositStatus_FullMethodName = "/bidderapi.v1.Bidder/AutoDepositStatus" Bidder_CancelAndWithdrawAutoDeposit_FullMethodName = "/bidderapi.v1.Bidder/CancelAndWithdrawAutoDeposit" Bidder_GetDeposit_FullMethodName = "/bidderapi.v1.Bidder/GetDeposit" - Bidder_GetMinDeposit_FullMethodName = "/bidderapi.v1.Bidder/GetMinDeposit" Bidder_Withdraw_FullMethodName = "/bidderapi.v1.Bidder/Withdraw" ) @@ -62,10 +61,6 @@ type BidderClient interface { // // GetDeposit is called by the bidder to get its deposit in the bidder registry. GetDeposit(ctx context.Context, in *GetDepositRequest, opts ...grpc.CallOption) (*DepositResponse, error) - // GetMinDeposit - // - // GetMinDeposit is called by the bidder to get the minimum deposit required in the bidder registry to make bids. - GetMinDeposit(ctx context.Context, in *EmptyMessage, opts ...grpc.CallOption) (*DepositResponse, error) // Withdraw // // Withdraw is called by the bidder to withdraw deposit from the bidder registry. @@ -173,16 +168,6 @@ func (c *bidderClient) GetDeposit(ctx context.Context, in *GetDepositRequest, op return out, nil } -func (c *bidderClient) GetMinDeposit(ctx context.Context, in *EmptyMessage, opts ...grpc.CallOption) (*DepositResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(DepositResponse) - err := c.cc.Invoke(ctx, Bidder_GetMinDeposit_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - func (c *bidderClient) Withdraw(ctx context.Context, in *WithdrawRequest, opts ...grpc.CallOption) (*WithdrawResponse, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(WithdrawResponse) @@ -225,10 +210,6 @@ type BidderServer interface { // // GetDeposit is called by the bidder to get its deposit in the bidder registry. GetDeposit(context.Context, *GetDepositRequest) (*DepositResponse, error) - // GetMinDeposit - // - // GetMinDeposit is called by the bidder to get the minimum deposit required in the bidder registry to make bids. - GetMinDeposit(context.Context, *EmptyMessage) (*DepositResponse, error) // Withdraw // // Withdraw is called by the bidder to withdraw deposit from the bidder registry. @@ -261,9 +242,6 @@ func (UnimplementedBidderServer) CancelAndWithdrawAutoDeposit(context.Context, * func (UnimplementedBidderServer) GetDeposit(context.Context, *GetDepositRequest) (*DepositResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetDeposit not implemented") } -func (UnimplementedBidderServer) GetMinDeposit(context.Context, *EmptyMessage) (*DepositResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetMinDeposit not implemented") -} func (UnimplementedBidderServer) Withdraw(context.Context, *WithdrawRequest) (*WithdrawResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Withdraw not implemented") } @@ -409,24 +387,6 @@ func _Bidder_GetDeposit_Handler(srv interface{}, ctx context.Context, dec func(i return interceptor(ctx, in, info, handler) } -func _Bidder_GetMinDeposit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(EmptyMessage) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(BidderServer).GetMinDeposit(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Bidder_GetMinDeposit_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(BidderServer).GetMinDeposit(ctx, req.(*EmptyMessage)) - } - return interceptor(ctx, in, info, handler) -} - func _Bidder_Withdraw_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(WithdrawRequest) if err := dec(in); err != nil { @@ -476,10 +436,6 @@ var Bidder_ServiceDesc = grpc.ServiceDesc{ MethodName: "GetDeposit", Handler: _Bidder_GetDeposit_Handler, }, - { - MethodName: "GetMinDeposit", - Handler: _Bidder_GetMinDeposit_Handler, - }, { MethodName: "Withdraw", Handler: _Bidder_Withdraw_Handler, diff --git a/p2p/gen/openapi/bidderapi/v1/bidderapi.swagger.yaml b/p2p/gen/openapi/bidderapi/v1/bidderapi.swagger.yaml index db30de5ff..976bbc35d 100644 --- a/p2p/gen/openapi/bidderapi/v1/bidderapi.swagger.yaml +++ b/p2p/gen/openapi/bidderapi/v1/bidderapi.swagger.yaml @@ -164,20 +164,6 @@ paths: required: false type: string format: uint64 - /v1/bidder/get_min_deposit: - get: - summary: GetMinDeposit - description: GetMinDeposit is called by the bidder to get the minimum deposit required in the bidder registry to make bids. - operationId: Bidder_GetMinDeposit - responses: - "200": - description: A successful response. - schema: - $ref: '#/definitions/v1DepositResponse' - default: - description: An unexpected error response. - schema: - $ref: '#/definitions/googlerpcStatus' /v1/bidder/withdraw: post: summary: Withdraw diff --git a/p2p/integrationtest/bidder/main.go b/p2p/integrationtest/bidder/main.go index 11974e7e3..2265db30e 100644 --- a/p2p/integrationtest/bidder/main.go +++ b/p2p/integrationtest/bidder/main.go @@ -229,19 +229,14 @@ func checkOrDeposit( logger.Info("deposited", "amount", deposit.Amount) - minDeposit, err := bidderClient.GetMinDeposit(context.Background(), &pb.EmptyMessage{}) - if err != nil { - logger.Error("failed to get min deposit", "error", err) - return err - } - depositAmt, set := big.NewInt(0).SetString(deposit.Amount, 10) if !set { logger.Error("failed to parse deposit amount") return errors.New("failed to parse deposit amount") } - minDepositAmt, set := big.NewInt(0).SetString(minDeposit.Amount, 10) + // set as 1 eth + minDepositAmt, set := big.NewInt(0).SetString("1000000000000000000", 10) if !set { logger.Error("failed to parse min deposit amount") return errors.New("failed to parse min deposit amount") diff --git a/p2p/integrationtest/real-bidder/main.go b/p2p/integrationtest/real-bidder/main.go index 458e8fd17..bb93bfd53 100644 --- a/p2p/integrationtest/real-bidder/main.go +++ b/p2p/integrationtest/real-bidder/main.go @@ -25,7 +25,6 @@ import ( "github.com/prometheus/client_golang/prometheus/promhttp" "google.golang.org/grpc" "google.golang.org/grpc/credentials" - "google.golang.org/protobuf/types/known/wrapperspb" ) var ( @@ -148,41 +147,8 @@ func main() { wg := sync.WaitGroup{} - // wg.Add(1) - // go func() { - // ticker := time.NewTicker(10 * time.Minute) - // defer ticker.Stop() - - // minDepositResp, err := bidderClient.GetMinDeposit(context.Background(), &pb.EmptyMessage{}) - // if err != nil { - // logger.Error("failed to get min deposit", "err", err) - // return - // } - - // minDeposit, set := big.NewInt(0).SetString(minDepositResp.Amount, 10) - // if !set { - // logger.Error("failed to parse min deposit amount") - // return - // } - - // minDepositAmt := new(big.Int).Mul(minDeposit, big.NewInt(10)) - - // for { - // err = checkOrDeposit(bidderClient, logger, minDepositAmt) - // if err != nil { - // logger.Error("failed to check or stake", "err", err) - // } - // <-ticker.C - // } - // }() - - minDepositResp, err := bidderClient.GetMinDeposit(context.Background(), &pb.EmptyMessage{}) - if err != nil { - logger.Error("failed to get min deposit", "err", err) - return - } - - minDeposit, set := big.NewInt(0).SetString(minDepositResp.Amount, 10) + // set as 1 eth + minDeposit, set := big.NewInt(0).SetString("1000000000000000000", 10) if !set { logger.Error("failed to parse min deposit amount") return @@ -304,64 +270,6 @@ func RetreivedBlock(rpcClient *ethclient.Client) ([]string, int64, error) { return blockTxns, int64(blkNum), nil } -func checkOrDeposit( - bidderClient pb.BidderClient, - logger *slog.Logger, - minDeposit *big.Int, -) error { - deposit, err := bidderClient.GetDeposit(context.Background(), &pb.GetDepositRequest{}) - if err != nil { - logger.Error("failed to get deposit", "err", err) - return err - } - - for i := deposit.WindowNumber.Value; i < deposit.WindowNumber.Value+64; i++ { - if _, ok := deposits[i]; !ok { - deposit, err = bidderClient.GetDeposit(context.Background(), &pb.GetDepositRequest{ - WindowNumber: wrapperspb.UInt64(i), - }) - if err != nil { - logger.Error("failed to get deposit", "err", err) - return err - } - depositAmount, set := big.NewInt(0).SetString(deposit.Amount, 10) - if !set { - logger.Error("failed to parse deposit amount") - return errors.New("failed to parse deposit amount") - } - - if depositAmount.Cmp(minDeposit) < 0 { - newDeposit, err := bidderClient.Deposit(context.Background(), &pb.DepositRequest{ - Amount: new(big.Int).Sub(minDeposit, depositAmount).String(), - WindowNumber: wrapperspb.UInt64(i), - }) - if err != nil { - logger.Error("failed to deposit", "err", err) - return err - } - logger.Info("deposit", "amount", newDeposit.Amount, "window", newDeposit.WindowNumber.Value) - deposits[newDeposit.WindowNumber.Value] = struct{}{} - } - } - } - - for window := range deposits { - if window < deposit.WindowNumber.Value-3 { - resp, err := bidderClient.Withdraw(context.Background(), &pb.WithdrawRequest{ - WindowNumber: wrapperspb.UInt64(window), - }) - if err != nil { - logger.Error("failed to withdraw", "err", err) - return err - } - logger.Info("withdraw", "amount", resp.Amount, "window", resp.WindowNumber) - delete(deposits, window) - } - } - - return nil -} - func sendBid( bidderClient pb.BidderClient, logger *slog.Logger, diff --git a/p2p/pkg/depositmanager/autodeposit_test.go b/p2p/pkg/depositmanager/autodeposit_test.go index 118cc7600..a93742bb4 100644 --- a/p2p/pkg/depositmanager/autodeposit_test.go +++ b/p2p/pkg/depositmanager/autodeposit_test.go @@ -23,6 +23,8 @@ import ( type MockBidderRegistryContract struct { MoveDepositToWindowFunc func(opts *bind.TransactOpts, fromWindow *big.Int, toWindow *big.Int) (*types.Transaction, error) + WithdrawFromSpecificWindowsFunc func(opts *bind.TransactOpts, windows []*big.Int) (*types.Transaction, error) + WithdrawFromSpecificWindowsCalled bool } func (m *MockBidderRegistryContract) MoveDepositToWindow(opts *bind.TransactOpts, fromWindow *big.Int, toWindow *big.Int) (*types.Transaction, error) { @@ -30,8 +32,9 @@ func (m *MockBidderRegistryContract) MoveDepositToWindow(opts *bind.TransactOpts } func (m *MockBidderRegistryContract) WithdrawFromSpecificWindows(opts *bind.TransactOpts, windows []*big.Int) (*types.Transaction, error) { - return m.WithdrawFromSpecificWindows(opts, windows) + return m.WithdrawFromSpecificWindowsFunc(opts, windows) } + func TestAutoDepositTracker(t *testing.T) { t.Parallel() @@ -49,10 +52,15 @@ func TestAutoDepositTracker(t *testing.T) { logger := util.NewTestLogger(io.Discard) evtMgr := events.NewListener(logger, &btABI, &brABI) - mockContract := &MockBidderRegistryContract{ - MoveDepositToWindowFunc: func(opts *bind.TransactOpts, fromWindow *big.Int, toWindow *big.Int) (*types.Transaction, error) { - return types.NewTx(&types.LegacyTx{}), nil - }, + mockContract := &MockBidderRegistryContract{} + + // Assign the mock functions + mockContract.MoveDepositToWindowFunc = func(opts *bind.TransactOpts, fromWindow *big.Int, toWindow *big.Int) (*types.Transaction, error) { + return types.NewTx(&types.LegacyTx{}), nil + } + mockContract.WithdrawFromSpecificWindowsFunc = func(opts *bind.TransactOpts, windows []*big.Int) (*types.Transaction, error) { + mockContract.WithdrawFromSpecificWindowsCalled = true + return types.NewTx(&types.LegacyTx{}), nil } optsGetter := func(ctx context.Context) (*bind.TransactOpts, error) { @@ -99,12 +107,29 @@ func TestAutoDepositTracker(t *testing.T) { t.Fatalf("expected deposit for window %d to be true, got %v", ad.WindowNumber.Value, deposits[ad.WindowNumber.Value+2]) } } - adt.Stop() - + cancelResponse, err := adt.Stop() + if err != nil { + t.Fatal(err) + } // need to wait for the goroutine to stop time.Sleep(100 * time.Millisecond) _, status = adt.GetStatus() if status { t.Fatalf("expected status to be false, got %v", status) } + + ctx = context.Background() + err = adt.WithdrawAutoDeposit(ctx, cancelResponse.WindowNumbers) + if err != nil { + t.Fatal(err) + } + + publishNewWindow(evtMgr, &btABI, big.NewInt(int64(cancelResponse.WindowNumbers[2].Value + 3))) + + // need to wait for the goroutine to process the events + time.Sleep(100 * time.Millisecond) + + if !mockContract.WithdrawFromSpecificWindowsCalled { + t.Fatalf("expected WithdrawFromSpecificWindows to be called") + } } diff --git a/p2p/pkg/rpc/bidder/service.go b/p2p/pkg/rpc/bidder/service.go index 7079fc912..5396a941f 100644 --- a/p2p/pkg/rpc/bidder/service.go +++ b/p2p/pkg/rpc/bidder/service.go @@ -79,7 +79,6 @@ type BidderRegistryContract interface { DepositForNWindows(*bind.TransactOpts, *big.Int, uint16) (*types.Transaction, error) WithdrawBidderAmountFromWindow(*bind.TransactOpts, common.Address, *big.Int) (*types.Transaction, error) GetDeposit(*bind.CallOpts, common.Address, *big.Int) (*big.Int, error) - MinDeposit(*bind.CallOpts) (*big.Int, error) ParseBidderRegistered(types.Log) (*bidderregistry.BidderregistryBidderRegistered, error) ParseBidderWithdrawal(types.Log) (*bidderregistry.BidderregistryBidderWithdrawal, error) } @@ -259,21 +258,6 @@ func (s *Service) GetDeposit( return &bidderapiv1.DepositResponse{Amount: stakeAmount.String(), WindowNumber: wrapperspb.UInt64(window.Uint64())}, nil } -func (s *Service) GetMinDeposit( - ctx context.Context, - _ *bidderapiv1.EmptyMessage, -) (*bidderapiv1.DepositResponse, error) { - stakeAmount, err := s.registryContract.MinDeposit(&bind.CallOpts{ - From: s.owner, - Context: ctx, - }) - if err != nil { - return nil, status.Errorf(codes.Internal, "getting min deposit: %v", err) - } - - return &bidderapiv1.DepositResponse{Amount: stakeAmount.String()}, nil -} - func (s *Service) Withdraw( ctx context.Context, r *bidderapiv1.WithdrawRequest, diff --git a/p2p/pkg/rpc/bidder/service_test.go b/p2p/pkg/rpc/bidder/service_test.go index 87305db55..5c5287703 100644 --- a/p2p/pkg/rpc/bidder/service_test.go +++ b/p2p/pkg/rpc/bidder/service_test.go @@ -80,7 +80,6 @@ func (s *testSender) SendBid( type testRegistryContract struct { deposit *big.Int - minDeposit *big.Int } func (t *testRegistryContract) DepositForSpecificWindow(opts *bind.TransactOpts, _ *big.Int) (*types.Transaction, error) { @@ -105,10 +104,6 @@ func (t *testRegistryContract) GetDeposit(_ *bind.CallOpts, _ common.Address, _ return t.deposit, nil } -func (t *testRegistryContract) MinDeposit(_ *bind.CallOpts) (*big.Int, error) { - return t.minDeposit, nil -} - func (t *testRegistryContract) ParseBidderRegistered(_ types.Log) (*bidderregistry.BidderregistryBidderRegistered, error) { return &bidderregistry.BidderregistryBidderRegistered{ DepositedAmount: t.deposit, @@ -202,7 +197,7 @@ func startServer(t *testing.T) bidderapiv1.BidderClient { } owner := common.HexToAddress("0x00001") - registryContract := &testRegistryContract{minDeposit: big.NewInt(100000000000000000)} + registryContract := &testRegistryContract{} sender := &testSender{noOfPreconfs: 2} blockTrackerContract := &testBlockTrackerContract{blocksPerWindow: 64, blockNumberToWinner: make(map[uint64]common.Address)} testAutoDepositTracker := &testAutoDepositTracker{deposits: make(map[uint64]bool)} @@ -312,16 +307,6 @@ func TestDepositHandling(t *testing.T) { } }) - t.Run("get min deposit", func(t *testing.T) { - deposit, err := client.GetMinDeposit(context.Background(), &bidderapiv1.EmptyMessage{}) - if err != nil { - t.Fatalf("error getting min deposit: %v", err) - } - if deposit.Amount != "100000000000000000" { - t.Fatalf("expected amount to be 100000000000000000, got %v", deposit.Amount) - } - }) - t.Run("withdraw", func(t *testing.T) { resp, err := client.Withdraw(context.Background(), &bidderapiv1.WithdrawRequest{WindowNumber: wrapperspb.UInt64(1)}) if err != nil { diff --git a/p2p/rpc/bidderapi/v1/bidderapi.proto b/p2p/rpc/bidderapi/v1/bidderapi.proto index c0ad82c08..2090a2e09 100644 --- a/p2p/rpc/bidderapi/v1/bidderapi.proto +++ b/p2p/rpc/bidderapi/v1/bidderapi.proto @@ -71,12 +71,6 @@ service Bidder { get: "/v1/bidder/get_deposit" }; } - // GetMinDeposit - // - // GetMinDeposit is called by the bidder to get the minimum deposit required in the bidder registry to make bids. - rpc GetMinDeposit(EmptyMessage) returns (DepositResponse) { - option (google.api.http) = {get: "/v1/bidder/get_min_deposit"}; - } // Withdraw // // Withdraw is called by the bidder to withdraw deposit from the bidder registry. From da9c97b3d4308a8a3ed84d81fe97634694d40500 Mon Sep 17 00:00:00 2001 From: Mikhail Wall Date: Fri, 28 Jun 2024 02:30:33 +0200 Subject: [PATCH 15/18] fix: deleted unused map --- p2p/integrationtest/real-bidder/main.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/p2p/integrationtest/real-bidder/main.go b/p2p/integrationtest/real-bidder/main.go index bb93bfd53..daf0b24b0 100644 --- a/p2p/integrationtest/real-bidder/main.go +++ b/p2p/integrationtest/real-bidder/main.go @@ -89,8 +89,6 @@ var ( ) ) -var deposits = map[uint64]struct{}{} - func main() { flag.Parse() From 586a9ac8c68fbad1d5b6b9fb5405d67fbe8a48db Mon Sep 17 00:00:00 2001 From: Mikhail Wall Date: Fri, 28 Jun 2024 15:40:15 +0200 Subject: [PATCH 16/18] fix: fixed race issue --- p2p/pkg/depositmanager/autodeposit.go | 32 +++++++++++++--------- p2p/pkg/depositmanager/autodeposit_test.go | 16 ++++++----- 2 files changed, 28 insertions(+), 20 deletions(-) diff --git a/p2p/pkg/depositmanager/autodeposit.go b/p2p/pkg/depositmanager/autodeposit.go index b1aa80645..3290d6af1 100644 --- a/p2p/pkg/depositmanager/autodeposit.go +++ b/p2p/pkg/depositmanager/autodeposit.go @@ -6,6 +6,7 @@ import ( "log/slog" "math/big" "sort" + "sync" "sync/atomic" "github.com/ethereum/go-ethereum/accounts/abi/bind" @@ -25,7 +26,7 @@ type BidderRegistryContract interface { } type AutoDepositTracker struct { - deposits map[uint64]bool + deposits sync.Map windowChan chan *blocktracker.BlocktrackerNewWindow eventMgr events.EventManager isWorking atomic.Bool @@ -42,7 +43,6 @@ func NewAutoDepositTracker( logger *slog.Logger, ) *AutoDepositTracker { return &AutoDepositTracker{ - deposits: make(map[uint64]bool), eventMgr: evtMgr, brContract: brContract, optsGetter: optsGetter, @@ -55,7 +55,7 @@ func (adt *AutoDepositTracker) DoAutoMoveToAnotherWindow(ctx context.Context, ad adt.isWorking.Store(true) for _, ad := range ads { - adt.deposits[ad.WindowNumber.Value] = true + adt.deposits.Store(ad.WindowNumber.Value, true) } eg, egCtx := errgroup.WithContext(context.Background()) @@ -101,9 +101,8 @@ func (adt *AutoDepositTracker) DoAutoMoveToAnotherWindow(ctx context.Context, ad adt.logger.Info("context done") return nil case window := <-adt.windowChan: - // logic for 3 windows for deposit fromWindow := new(big.Int).Sub(window.Window, big.NewInt(1)) - if _, ok := adt.deposits[fromWindow.Uint64()]; !ok { + if _, ok := adt.deposits.Load(fromWindow.Uint64()); !ok { continue } toWindow := new(big.Int).Add(window.Window, big.NewInt(2)) @@ -117,8 +116,8 @@ func (adt *AutoDepositTracker) DoAutoMoveToAnotherWindow(ctx context.Context, ad return err } adt.logger.Info("move deposit to window", "hash", txn.Hash(), "from", fromWindow, "to", toWindow) - delete(adt.deposits, fromWindow.Uint64()) - adt.deposits[toWindow.Uint64()] = true + adt.deposits.Delete(fromWindow.Uint64()) + adt.deposits.Store(toWindow.Uint64(), true) } } }) @@ -149,10 +148,12 @@ func (adt *AutoDepositTracker) Stop() (*bidderapiv1.CancelAutoDepositResponse, e } var windowNumbers []*wrapperspb.UInt64Value - for i := range adt.deposits { - windowNumbers = append(windowNumbers, &wrapperspb.UInt64Value{Value: i}) - delete(adt.deposits, i) - } + adt.deposits.Range(func(key, value interface{}) bool { + windowNumbers = append(windowNumbers, &wrapperspb.UInt64Value{Value: key.(uint64)}) + adt.deposits.Delete(key) + return true + }) + adt.logger.Info("stop auto deposit tracker", "windows", windowNumbers) return &bidderapiv1.CancelAutoDepositResponse{ WindowNumbers: windowNumbers, @@ -255,5 +256,10 @@ func (adt *AutoDepositTracker) WithdrawAutoDeposit(ctx context.Context, windowNu } func (adt *AutoDepositTracker) GetStatus() (map[uint64]bool, bool) { - return adt.deposits, adt.isWorking.Load() -} + deposits := make(map[uint64]bool) + adt.deposits.Range(func(key, value interface{}) bool { + deposits[key.(uint64)] = value.(bool) + return true + }) + return deposits, adt.isWorking.Load() +} \ No newline at end of file diff --git a/p2p/pkg/depositmanager/autodeposit_test.go b/p2p/pkg/depositmanager/autodeposit_test.go index a93742bb4..01f0e225d 100644 --- a/p2p/pkg/depositmanager/autodeposit_test.go +++ b/p2p/pkg/depositmanager/autodeposit_test.go @@ -5,6 +5,7 @@ import ( "io" "math/big" "strings" + "sync/atomic" "testing" "time" @@ -22,9 +23,9 @@ import ( ) type MockBidderRegistryContract struct { - MoveDepositToWindowFunc func(opts *bind.TransactOpts, fromWindow *big.Int, toWindow *big.Int) (*types.Transaction, error) - WithdrawFromSpecificWindowsFunc func(opts *bind.TransactOpts, windows []*big.Int) (*types.Transaction, error) - WithdrawFromSpecificWindowsCalled bool + MoveDepositToWindowFunc func(opts *bind.TransactOpts, fromWindow *big.Int, toWindow *big.Int) (*types.Transaction, error) + WithdrawFromSpecificWindowsFunc func(opts *bind.TransactOpts, windows []*big.Int) (*types.Transaction, error) + WithdrawFromSpecificWindowsCalled atomic.Bool } func (m *MockBidderRegistryContract) MoveDepositToWindow(opts *bind.TransactOpts, fromWindow *big.Int, toWindow *big.Int) (*types.Transaction, error) { @@ -59,7 +60,7 @@ func TestAutoDepositTracker(t *testing.T) { return types.NewTx(&types.LegacyTx{}), nil } mockContract.WithdrawFromSpecificWindowsFunc = func(opts *bind.TransactOpts, windows []*big.Int) (*types.Transaction, error) { - mockContract.WithdrawFromSpecificWindowsCalled = true + mockContract.WithdrawFromSpecificWindowsCalled.Store(true) return types.NewTx(&types.LegacyTx{}), nil } @@ -94,6 +95,8 @@ func TestAutoDepositTracker(t *testing.T) { publishNewWindow(evtMgr, &btABI, big.NewInt(int64(ads[0].WindowNumber.Value+1))) publishNewWindow(evtMgr, &btABI, big.NewInt(int64(ads[0].WindowNumber.Value+2))) + time.Sleep(100 * time.Millisecond) + deposits, status := adt.GetStatus() if !status { @@ -101,7 +104,6 @@ func TestAutoDepositTracker(t *testing.T) { } // need to wait for the goroutine to process the events - time.Sleep(100 * time.Millisecond) for _, ad := range ads { if !deposits[ad.WindowNumber.Value+2] { t.Fatalf("expected deposit for window %d to be true, got %v", ad.WindowNumber.Value, deposits[ad.WindowNumber.Value+2]) @@ -124,12 +126,12 @@ func TestAutoDepositTracker(t *testing.T) { t.Fatal(err) } - publishNewWindow(evtMgr, &btABI, big.NewInt(int64(cancelResponse.WindowNumbers[2].Value + 3))) + publishNewWindow(evtMgr, &btABI, big.NewInt(int64(cancelResponse.WindowNumbers[2].Value+3))) // need to wait for the goroutine to process the events time.Sleep(100 * time.Millisecond) - if !mockContract.WithdrawFromSpecificWindowsCalled { + if !mockContract.WithdrawFromSpecificWindowsCalled.Load() { t.Fatalf("expected WithdrawFromSpecificWindows to be called") } } From c49dda62903c85dbe46f3e8e323d6a23b8a138a2 Mon Sep 17 00:00:00 2001 From: Mikhail Wall Date: Fri, 28 Jun 2024 19:43:53 +0200 Subject: [PATCH 17/18] chore: added withdraw from specific windows function --- p2p/gen/go/bidderapi/v1/bidderapi.pb.go | 701 ++++++++++-------- p2p/gen/go/bidderapi/v1/bidderapi.pb.gw.go | 87 +++ p2p/gen/go/bidderapi/v1/bidderapi_grpc.pb.go | 44 ++ .../bidderapi/v1/bidderapi.swagger.yaml | 24 + p2p/pkg/rpc/bidder/service.go | 65 ++ p2p/pkg/rpc/bidder/service_test.go | 4 + p2p/rpc/bidderapi/v1/bidderapi.proto | 26 + 7 files changed, 650 insertions(+), 301 deletions(-) diff --git a/p2p/gen/go/bidderapi/v1/bidderapi.pb.go b/p2p/gen/go/bidderapi/v1/bidderapi.pb.go index a72518569..fdbb23940 100644 --- a/p2p/gen/go/bidderapi/v1/bidderapi.pb.go +++ b/p2p/gen/go/bidderapi/v1/bidderapi.pb.go @@ -533,6 +533,53 @@ func (x *WithdrawResponse) GetWindowNumber() *wrapperspb.UInt64Value { return nil } +type WithdrawFromSpecificWindowsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + WindowNumbers []*wrapperspb.UInt64Value `protobuf:"bytes,1,rep,name=window_numbers,json=windowNumbers,proto3" json:"window_numbers,omitempty"` +} + +func (x *WithdrawFromSpecificWindowsRequest) Reset() { + *x = WithdrawFromSpecificWindowsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_bidderapi_v1_bidderapi_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *WithdrawFromSpecificWindowsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*WithdrawFromSpecificWindowsRequest) ProtoMessage() {} + +func (x *WithdrawFromSpecificWindowsRequest) ProtoReflect() protoreflect.Message { + mi := &file_bidderapi_v1_bidderapi_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use WithdrawFromSpecificWindowsRequest.ProtoReflect.Descriptor instead. +func (*WithdrawFromSpecificWindowsRequest) Descriptor() ([]byte, []int) { + return file_bidderapi_v1_bidderapi_proto_rawDescGZIP(), []int{10} +} + +func (x *WithdrawFromSpecificWindowsRequest) GetWindowNumbers() []*wrapperspb.UInt64Value { + if x != nil { + return x.WindowNumbers + } + return nil +} + type Bid struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -548,7 +595,7 @@ type Bid struct { func (x *Bid) Reset() { *x = Bid{} if protoimpl.UnsafeEnabled { - mi := &file_bidderapi_v1_bidderapi_proto_msgTypes[10] + mi := &file_bidderapi_v1_bidderapi_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -561,7 +608,7 @@ func (x *Bid) String() string { func (*Bid) ProtoMessage() {} func (x *Bid) ProtoReflect() protoreflect.Message { - mi := &file_bidderapi_v1_bidderapi_proto_msgTypes[10] + mi := &file_bidderapi_v1_bidderapi_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -574,7 +621,7 @@ func (x *Bid) ProtoReflect() protoreflect.Message { // Deprecated: Use Bid.ProtoReflect.Descriptor instead. func (*Bid) Descriptor() ([]byte, []int) { - return file_bidderapi_v1_bidderapi_proto_rawDescGZIP(), []int{10} + return file_bidderapi_v1_bidderapi_proto_rawDescGZIP(), []int{11} } func (x *Bid) GetTxHashes() []string { @@ -633,7 +680,7 @@ type Commitment struct { func (x *Commitment) Reset() { *x = Commitment{} if protoimpl.UnsafeEnabled { - mi := &file_bidderapi_v1_bidderapi_proto_msgTypes[11] + mi := &file_bidderapi_v1_bidderapi_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -646,7 +693,7 @@ func (x *Commitment) String() string { func (*Commitment) ProtoMessage() {} func (x *Commitment) ProtoReflect() protoreflect.Message { - mi := &file_bidderapi_v1_bidderapi_proto_msgTypes[11] + mi := &file_bidderapi_v1_bidderapi_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -659,7 +706,7 @@ func (x *Commitment) ProtoReflect() protoreflect.Message { // Deprecated: Use Commitment.ProtoReflect.Descriptor instead. func (*Commitment) Descriptor() ([]byte, []int) { - return file_bidderapi_v1_bidderapi_proto_rawDescGZIP(), []int{11} + return file_bidderapi_v1_bidderapi_proto_rawDescGZIP(), []int{12} } func (x *Commitment) GetTxHashes() []string { @@ -952,263 +999,299 @@ var file_bidderapi_v1_bidderapi_proto_rawDesc = []byte{ 0x72, 0x79, 0x2e, 0x32, 0x36, 0x7b, 0x22, 0x61, 0x6d, 0x6f, 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, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x5f, 0x6e, - 0x75, 0x6d, 0x62, 0x65, 0x72, 0x22, 0x3a, 0x20, 0x31, 0x20, 0x7d, 0x22, 0xa6, 0x0b, 0x0a, 0x03, - 0x42, 0x69, 0x64, 0x12, 0xa3, 0x02, 0x0a, 0x09, 0x74, 0x78, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x65, - 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x42, 0x85, 0x02, 0x92, 0x41, 0x78, 0x32, 0x64, 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, 0x65, 0x73, - 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 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, 0xba, 0x48, 0x86, 0x01, 0xba, 0x01, 0x82, 0x01, 0x0a, 0x09, 0x74, - 0x78, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x65, 0x73, 0x12, 0x36, 0x74, 0x78, 0x5f, 0x68, 0x61, 0x73, - 0x68, 0x65, 0x73, 0x20, 0x6d, 0x75, 0x73, 0x74, 0x20, 0x62, 0x65, 0x20, 0x61, 0x20, 0x76, 0x61, - 0x6c, 0x69, 0x64, 0x20, 0x61, 0x72, 0x72, 0x61, 0x79, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x72, 0x61, - 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x68, 0x61, 0x73, 0x68, 0x65, 0x73, 0x2e, - 0x1a, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x61, 0x6c, 0x6c, 0x28, 0x72, 0x2c, 0x20, 0x72, 0x2e, - 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x73, 0x28, 0x27, 0x5e, 0x5b, 0x61, 0x2d, 0x66, 0x41, 0x2d, - 0x46, 0x30, 0x2d, 0x39, 0x5d, 0x7b, 0x36, 0x34, 0x7d, 0x24, 0x27, 0x29, 0x29, 0x20, 0x26, 0x26, - 0x20, 0x73, 0x69, 0x7a, 0x65, 0x28, 0x74, 0x68, 0x69, 0x73, 0x29, 0x20, 0x3e, 0x20, 0x30, 0x52, - 0x08, 0x74, 0x78, 0x48, 0x61, 0x73, 0x68, 0x65, 0x73, 0x12, 0xed, 0x01, 0x0a, 0x06, 0x61, 0x6d, - 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0xd4, 0x01, 0x92, 0x41, 0x76, - 0x32, 0x6b, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x45, 0x54, 0x48, 0x20, - 0x74, 0x68, 0x61, 0x74, 0x20, 0x74, 0x68, 0x65, 0x20, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x20, - 0x69, 0x73, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x69, 0x6e, 0x67, 0x20, 0x74, 0x6f, 0x20, 0x70, 0x61, - 0x79, 0x20, 0x74, 0x6f, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, - 0x72, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x69, 0x6e, 0x67, 0x20, - 0x74, 0x68, 0x65, 0x20, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, - 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x8a, 0x01, 0x06, - 0x5b, 0x30, 0x2d, 0x39, 0x5d, 0x2b, 0xba, 0x48, 0x58, 0xba, 0x01, 0x55, 0x0a, 0x06, 0x61, 0x6d, - 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1f, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x20, 0x6d, 0x75, 0x73, - 0x74, 0x20, 0x62, 0x65, 0x20, 0x61, 0x20, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x20, 0x69, 0x6e, 0x74, - 0x65, 0x67, 0x65, 0x72, 0x2e, 0x1a, 0x2a, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6d, 0x61, 0x74, 0x63, - 0x68, 0x65, 0x73, 0x28, 0x27, 0x5e, 0x5b, 0x30, 0x2d, 0x39, 0x5d, 0x2b, 0x24, 0x27, 0x29, 0x20, - 0x26, 0x26, 0x20, 0x75, 0x69, 0x6e, 0x74, 0x28, 0x74, 0x68, 0x69, 0x73, 0x29, 0x20, 0x3e, 0x20, - 0x30, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0xb9, 0x01, 0x0a, 0x0c, 0x62, 0x6c, - 0x6f, 0x63, 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, - 0x42, 0x95, 0x01, 0x92, 0x41, 0x47, 0x32, 0x45, 0x4d, 0x61, 0x78, 0x20, 0x62, 0x6c, 0x6f, 0x63, - 0x6b, 0x20, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 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, 0x74, 0x68, 0x65, 0x20, 0x74, 0x72, - 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x69, 0x6e, 0x2e, 0xba, 0x48, 0x48, - 0xba, 0x01, 0x45, 0x0a, 0x0c, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, - 0x72, 0x12, 0x25, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x20, + 0x75, 0x6d, 0x62, 0x65, 0x72, 0x22, 0x3a, 0x20, 0x31, 0x20, 0x7d, 0x22, 0x97, 0x03, 0x0a, 0x22, + 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x46, 0x72, 0x6f, 0x6d, 0x53, 0x70, 0x65, 0x63, + 0x69, 0x66, 0x69, 0x63, 0x57, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0xeb, 0x01, 0x0a, 0x0e, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x5f, 0x6e, 0x75, + 0x6d, 0x62, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, 0x49, + 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42, 0xa5, 0x01, 0x92, 0x41, 0x2a, 0x32, + 0x28, 0x57, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x20, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x20, + 0x66, 0x6f, 0x72, 0x20, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x69, 0x6e, 0x67, 0x20, + 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x73, 0x2e, 0xba, 0x48, 0x75, 0xba, 0x01, 0x72, 0x0a, + 0x0e, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x12, + 0x3a, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x20, 0x6d, 0x75, 0x73, 0x74, 0x20, 0x62, 0x65, 0x20, 0x61, 0x20, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x20, - 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x2e, 0x1a, 0x0e, 0x75, 0x69, 0x6e, 0x74, 0x28, 0x74, - 0x68, 0x69, 0x73, 0x29, 0x20, 0x3e, 0x20, 0x30, 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, - 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0xc2, 0x01, 0x0a, 0x15, 0x64, 0x65, 0x63, 0x61, 0x79, 0x5f, - 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x03, 0x42, 0x8d, 0x01, 0x92, 0x41, 0x2d, 0x32, 0x2b, 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, 0x73, 0x74, 0x61, 0x72, 0x74, 0x73, 0x20, 0x64, - 0x65, 0x63, 0x61, 0x79, 0x69, 0x6e, 0x67, 0x2e, 0xba, 0x48, 0x5a, 0xba, 0x01, 0x57, 0x0a, 0x15, - 0x64, 0x65, 0x63, 0x61, 0x79, 0x5f, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, - 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x2e, 0x64, 0x65, 0x63, 0x61, 0x79, 0x5f, 0x73, 0x74, 0x61, - 0x72, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x20, 0x6d, 0x75, 0x73, - 0x74, 0x20, 0x62, 0x65, 0x20, 0x61, 0x20, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x20, 0x69, 0x6e, 0x74, - 0x65, 0x67, 0x65, 0x72, 0x2e, 0x1a, 0x0e, 0x75, 0x69, 0x6e, 0x74, 0x28, 0x74, 0x68, 0x69, 0x73, - 0x29, 0x20, 0x3e, 0x20, 0x30, 0x52, 0x13, 0x64, 0x65, 0x63, 0x61, 0x79, 0x53, 0x74, 0x61, 0x72, - 0x74, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0xb8, 0x01, 0x0a, 0x13, 0x64, - 0x65, 0x63, 0x61, 0x79, 0x5f, 0x65, 0x6e, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, - 0x6d, 0x70, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x42, 0x87, 0x01, 0x92, 0x41, 0x2b, 0x32, 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, 0xba, 0x48, 0x56, 0xba, 0x01, 0x53, 0x0a, - 0x13, 0x64, 0x65, 0x63, 0x61, 0x79, 0x5f, 0x65, 0x6e, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x73, - 0x74, 0x61, 0x6d, 0x70, 0x12, 0x2c, 0x64, 0x65, 0x63, 0x61, 0x79, 0x5f, 0x65, 0x6e, 0x64, 0x5f, - 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x20, 0x6d, 0x75, 0x73, 0x74, 0x20, 0x62, + 0x61, 0x72, 0x72, 0x61, 0x79, 0x20, 0x6f, 0x66, 0x20, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x76, + 0x65, 0x20, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x73, 0x2e, 0x1a, 0x24, 0x74, 0x68, 0x69, + 0x73, 0x2e, 0x61, 0x6c, 0x6c, 0x28, 0x72, 0x2c, 0x20, 0x72, 0x20, 0x3e, 0x20, 0x30, 0x29, 0x20, + 0x26, 0x26, 0x20, 0x73, 0x69, 0x7a, 0x65, 0x28, 0x74, 0x68, 0x69, 0x73, 0x29, 0x20, 0x3e, 0x20, + 0x30, 0x52, 0x0d, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x73, + 0x3a, 0x82, 0x01, 0x92, 0x41, 0x7f, 0x0a, 0x5e, 0x2a, 0x1f, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, + 0x61, 0x77, 0x20, 0x66, 0x72, 0x6f, 0x6d, 0x20, 0x4e, 0x20, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, + 0x73, 0x20, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x32, 0x2a, 0x57, 0x69, 0x74, 0x68, 0x64, + 0x72, 0x61, 0x77, 0x20, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x20, 0x66, 0x72, 0x6f, 0x6d, + 0x20, 0x74, 0x68, 0x65, 0x20, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x20, 0x72, 0x65, 0x67, 0x69, + 0x73, 0x74, 0x72, 0x79, 0x2e, 0xd2, 0x01, 0x0e, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x5f, 0x6e, + 0x75, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x32, 0x1d, 0x7b, 0x22, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, + 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x22, 0x3a, 0x20, 0x5b, 0x31, 0x2c, 0x20, 0x32, + 0x2c, 0x20, 0x33, 0x5d, 0x7d, 0x22, 0xa6, 0x0b, 0x0a, 0x03, 0x42, 0x69, 0x64, 0x12, 0xa3, 0x02, + 0x0a, 0x09, 0x74, 0x78, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x09, 0x42, 0x85, 0x02, 0x92, 0x41, 0x78, 0x32, 0x64, 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, 0x65, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, + 0x65, 0x20, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 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, 0xba, + 0x48, 0x86, 0x01, 0xba, 0x01, 0x82, 0x01, 0x0a, 0x09, 0x74, 0x78, 0x5f, 0x68, 0x61, 0x73, 0x68, + 0x65, 0x73, 0x12, 0x36, 0x74, 0x78, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x65, 0x73, 0x20, 0x6d, 0x75, + 0x73, 0x74, 0x20, 0x62, 0x65, 0x20, 0x61, 0x20, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x20, 0x61, 0x72, + 0x72, 0x61, 0x79, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x20, 0x68, 0x61, 0x73, 0x68, 0x65, 0x73, 0x2e, 0x1a, 0x3d, 0x74, 0x68, 0x69, 0x73, + 0x2e, 0x61, 0x6c, 0x6c, 0x28, 0x72, 0x2c, 0x20, 0x72, 0x2e, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, + 0x73, 0x28, 0x27, 0x5e, 0x5b, 0x61, 0x2d, 0x66, 0x41, 0x2d, 0x46, 0x30, 0x2d, 0x39, 0x5d, 0x7b, + 0x36, 0x34, 0x7d, 0x24, 0x27, 0x29, 0x29, 0x20, 0x26, 0x26, 0x20, 0x73, 0x69, 0x7a, 0x65, 0x28, + 0x74, 0x68, 0x69, 0x73, 0x29, 0x20, 0x3e, 0x20, 0x30, 0x52, 0x08, 0x74, 0x78, 0x48, 0x61, 0x73, + 0x68, 0x65, 0x73, 0x12, 0xed, 0x01, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x42, 0xd4, 0x01, 0x92, 0x41, 0x76, 0x32, 0x6b, 0x41, 0x6d, 0x6f, 0x75, + 0x6e, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x45, 0x54, 0x48, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x74, + 0x68, 0x65, 0x20, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x20, 0x69, 0x73, 0x20, 0x77, 0x69, 0x6c, + 0x6c, 0x69, 0x6e, 0x67, 0x20, 0x74, 0x6f, 0x20, 0x70, 0x61, 0x79, 0x20, 0x74, 0x6f, 0x20, 0x74, + 0x68, 0x65, 0x20, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x20, 0x66, 0x6f, 0x72, 0x20, + 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x69, 0x6e, 0x67, 0x20, 0x74, 0x68, 0x65, 0x20, 0x74, 0x72, + 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, + 0x20, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x8a, 0x01, 0x06, 0x5b, 0x30, 0x2d, 0x39, 0x5d, 0x2b, + 0xba, 0x48, 0x58, 0xba, 0x01, 0x55, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1f, + 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x20, 0x6d, 0x75, 0x73, 0x74, 0x20, 0x62, 0x65, 0x20, 0x61, + 0x20, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x20, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x2e, 0x1a, + 0x2a, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x73, 0x28, 0x27, 0x5e, + 0x5b, 0x30, 0x2d, 0x39, 0x5d, 0x2b, 0x24, 0x27, 0x29, 0x20, 0x26, 0x26, 0x20, 0x75, 0x69, 0x6e, + 0x74, 0x28, 0x74, 0x68, 0x69, 0x73, 0x29, 0x20, 0x3e, 0x20, 0x30, 0x52, 0x06, 0x61, 0x6d, 0x6f, + 0x75, 0x6e, 0x74, 0x12, 0xb9, 0x01, 0x0a, 0x0c, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x6e, 0x75, + 0x6d, 0x62, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x42, 0x95, 0x01, 0x92, 0x41, 0x47, + 0x32, 0x45, 0x4d, 0x61, 0x78, 0x20, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x20, 0x6e, 0x75, 0x6d, 0x62, + 0x65, 0x72, 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, 0x74, 0x68, 0x65, 0x20, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x20, 0x69, 0x6e, 0x2e, 0xba, 0x48, 0x48, 0xba, 0x01, 0x45, 0x0a, 0x0c, 0x62, + 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x25, 0x62, 0x6c, 0x6f, + 0x63, 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x20, 0x6d, 0x75, 0x73, 0x74, 0x20, 0x62, 0x65, 0x20, 0x61, 0x20, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x20, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x2e, 0x1a, 0x0e, 0x75, 0x69, 0x6e, 0x74, 0x28, 0x74, 0x68, 0x69, 0x73, 0x29, 0x20, 0x3e, - 0x20, 0x30, 0x52, 0x11, 0x64, 0x65, 0x63, 0x61, 0x79, 0x45, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, - 0x73, 0x74, 0x61, 0x6d, 0x70, 0x3a, 0xcc, 0x02, 0x92, 0x41, 0xc8, 0x02, 0x0a, 0x73, 0x2a, 0x0b, - 0x42, 0x69, 0x64, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x32, 0x40, 0x55, 0x6e, 0x73, - 0x69, 0x67, 0x6e, 0x65, 0x64, 0x20, 0x62, 0x69, 0x64, 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, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x20, 0x6d, 0x65, 0x76, - 0x2d, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x20, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0xd2, 0x01, 0x09, - 0x74, 0x78, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x65, 0x73, 0xd2, 0x01, 0x06, 0x61, 0x6d, 0x6f, 0x75, - 0x6e, 0x74, 0xd2, 0x01, 0x0c, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, - 0x72, 0x32, 0xd0, 0x01, 0x7b, 0x22, 0x74, 0x78, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x65, 0x73, 0x22, - 0x3a, 0x20, 0x5b, 0x22, 0x66, 0x65, 0x34, 0x63, 0x62, 0x34, 0x37, 0x64, 0x62, 0x33, 0x36, 0x33, - 0x30, 0x35, 0x35, 0x31, 0x62, 0x65, 0x65, 0x64, 0x66, 0x62, 0x64, 0x30, 0x32, 0x61, 0x37, 0x31, - 0x65, 0x63, 0x63, 0x36, 0x39, 0x66, 0x64, 0x35, 0x39, 0x37, 0x35, 0x38, 0x65, 0x32, 0x62, 0x61, - 0x36, 0x39, 0x39, 0x36, 0x30, 0x36, 0x65, 0x32, 0x64, 0x35, 0x63, 0x37, 0x34, 0x32, 0x38, 0x34, - 0x66, 0x66, 0x61, 0x37, 0x22, 0x2c, 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, 0x5d, 0x2c, 0x20, 0x22, 0x61, 0x6d, 0x6f, - 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, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x22, 0x3a, 0x20, 0x31, 0x32, 0x33, - 0x34, 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, 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, 0x08, 0x74, 0x78, 0x48, 0x61, 0x73, 0x68, 0x65, 0x73, 0x12, 0x8f, 0x01, 0x0a, 0x0a, - 0x62, 0x69, 0x64, 0x5f, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x42, 0x70, 0x92, 0x41, 0x6d, 0x32, 0x6b, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x20, 0x6f, 0x66, - 0x20, 0x45, 0x54, 0x48, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x74, 0x68, 0x65, 0x20, 0x62, 0x69, - 0x64, 0x64, 0x65, 0x72, 0x20, 0x68, 0x61, 0x73, 0x20, 0x61, 0x67, 0x72, 0x65, 0x65, 0x64, 0x20, - 0x74, 0x6f, 0x20, 0x70, 0x61, 0x79, 0x20, 0x74, 0x6f, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x72, - 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x69, 0x6e, 0x63, 0x6c, 0x75, - 0x64, 0x69, 0x6e, 0x67, 0x20, 0x74, 0x68, 0x65, 0x20, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, - 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x62, 0x6c, 0x6f, 0x63, - 0x6b, 0x2e, 0x52, 0x09, 0x62, 0x69, 0x64, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x6d, 0x0a, - 0x0c, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x03, 0x42, 0x4a, 0x92, 0x41, 0x47, 0x32, 0x45, 0x4d, 0x61, 0x78, 0x20, 0x62, 0x6c, - 0x6f, 0x63, 0x6b, 0x20, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, + 0x20, 0x30, 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, + 0xc2, 0x01, 0x0a, 0x15, 0x64, 0x65, 0x63, 0x61, 0x79, 0x5f, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, + 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x42, + 0x8d, 0x01, 0x92, 0x41, 0x2d, 0x32, 0x2b, 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, 0x73, 0x74, 0x61, 0x72, 0x74, 0x73, 0x20, 0x64, 0x65, 0x63, 0x61, 0x79, 0x69, 0x6e, + 0x67, 0x2e, 0xba, 0x48, 0x5a, 0xba, 0x01, 0x57, 0x0a, 0x15, 0x64, 0x65, 0x63, 0x61, 0x79, 0x5f, + 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, + 0x2e, 0x64, 0x65, 0x63, 0x61, 0x79, 0x5f, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x74, 0x69, 0x6d, + 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x20, 0x6d, 0x75, 0x73, 0x74, 0x20, 0x62, 0x65, 0x20, 0x61, + 0x20, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x20, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x2e, 0x1a, + 0x0e, 0x75, 0x69, 0x6e, 0x74, 0x28, 0x74, 0x68, 0x69, 0x73, 0x29, 0x20, 0x3e, 0x20, 0x30, 0x52, + 0x13, 0x64, 0x65, 0x63, 0x61, 0x79, 0x53, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x73, + 0x74, 0x61, 0x6d, 0x70, 0x12, 0xb8, 0x01, 0x0a, 0x13, 0x64, 0x65, 0x63, 0x61, 0x79, 0x5f, 0x65, + 0x6e, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x03, 0x42, 0x87, 0x01, 0x92, 0x41, 0x2b, 0x32, 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, 0xba, 0x48, 0x56, 0xba, 0x01, 0x53, 0x0a, 0x13, 0x64, 0x65, 0x63, 0x61, 0x79, + 0x5f, 0x65, 0x6e, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x2c, + 0x64, 0x65, 0x63, 0x61, 0x79, 0x5f, 0x65, 0x6e, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, + 0x61, 0x6d, 0x70, 0x20, 0x6d, 0x75, 0x73, 0x74, 0x20, 0x62, 0x65, 0x20, 0x61, 0x20, 0x76, 0x61, + 0x6c, 0x69, 0x64, 0x20, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x2e, 0x1a, 0x0e, 0x75, 0x69, + 0x6e, 0x74, 0x28, 0x74, 0x68, 0x69, 0x73, 0x29, 0x20, 0x3e, 0x20, 0x30, 0x52, 0x11, 0x64, 0x65, + 0x63, 0x61, 0x79, 0x45, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x3a, + 0xcc, 0x02, 0x92, 0x41, 0xc8, 0x02, 0x0a, 0x73, 0x2a, 0x0b, 0x42, 0x69, 0x64, 0x20, 0x6d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x32, 0x40, 0x55, 0x6e, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x20, + 0x62, 0x69, 0x64, 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, + 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x20, 0x6d, 0x65, 0x76, 0x2d, 0x63, 0x6f, 0x6d, 0x6d, 0x69, + 0x74, 0x20, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0xd2, 0x01, 0x09, 0x74, 0x78, 0x5f, 0x68, 0x61, 0x73, + 0x68, 0x65, 0x73, 0xd2, 0x01, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0xd2, 0x01, 0x0c, 0x62, + 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x32, 0xd0, 0x01, 0x7b, 0x22, + 0x74, 0x78, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x65, 0x73, 0x22, 0x3a, 0x20, 0x5b, 0x22, 0x66, 0x65, + 0x34, 0x63, 0x62, 0x34, 0x37, 0x64, 0x62, 0x33, 0x36, 0x33, 0x30, 0x35, 0x35, 0x31, 0x62, 0x65, + 0x65, 0x64, 0x66, 0x62, 0x64, 0x30, 0x32, 0x61, 0x37, 0x31, 0x65, 0x63, 0x63, 0x36, 0x39, 0x66, + 0x64, 0x35, 0x39, 0x37, 0x35, 0x38, 0x65, 0x32, 0x62, 0x61, 0x36, 0x39, 0x39, 0x36, 0x30, 0x36, + 0x65, 0x32, 0x64, 0x35, 0x63, 0x37, 0x34, 0x32, 0x38, 0x34, 0x66, 0x66, 0x61, 0x37, 0x22, 0x2c, + 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, 0x5d, 0x2c, 0x20, 0x22, 0x61, 0x6d, 0x6f, 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, 0x5f, 0x6e, 0x75, + 0x6d, 0x62, 0x65, 0x72, 0x22, 0x3a, 0x20, 0x31, 0x32, 0x33, 0x34, 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, 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, 0x74, 0x68, 0x65, 0x20, - 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x69, 0x6e, 0x2e, 0x52, - 0x0b, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x7b, 0x0a, 0x13, - 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x5f, 0x62, 0x69, 0x64, 0x5f, 0x64, 0x69, 0x67, - 0x65, 0x73, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x4b, 0x92, 0x41, 0x48, 0x32, 0x46, - 0x48, 0x65, 0x78, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x65, 0x6e, 0x63, 0x6f, 0x64, - 0x69, 0x6e, 0x67, 0x20, 0x6f, 0x66, 0x20, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x20, 0x6f, 0x66, - 0x20, 0x74, 0x68, 0x65, 0x20, 0x62, 0x69, 0x64, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, - 0x20, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x74, 0x68, 0x65, 0x20, 0x62, - 0x69, 0x64, 0x64, 0x65, 0x72, 0x2e, 0x52, 0x11, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, - 0x42, 0x69, 0x64, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x12, 0x7d, 0x0a, 0x16, 0x72, 0x65, 0x63, - 0x65, 0x69, 0x76, 0x65, 0x64, 0x5f, 0x62, 0x69, 0x64, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, - 0x75, 0x72, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x47, 0x92, 0x41, 0x44, 0x32, 0x42, - 0x48, 0x65, 0x78, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x65, 0x6e, 0x63, 0x6f, 0x64, - 0x69, 0x6e, 0x67, 0x20, 0x6f, 0x66, 0x20, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, - 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x20, 0x74, - 0x68, 0x61, 0x74, 0x20, 0x73, 0x65, 0x6e, 0x74, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x62, 0x69, - 0x64, 0x2e, 0x52, 0x14, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x42, 0x69, 0x64, 0x53, - 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x62, 0x0a, 0x11, 0x63, 0x6f, 0x6d, 0x6d, - 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x18, 0x06, 0x20, - 0x01, 0x28, 0x09, 0x42, 0x35, 0x92, 0x41, 0x32, 0x32, 0x30, 0x48, 0x65, 0x78, 0x20, 0x73, 0x74, + 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, 0x08, 0x74, 0x78, 0x48, + 0x61, 0x73, 0x68, 0x65, 0x73, 0x12, 0x8f, 0x01, 0x0a, 0x0a, 0x62, 0x69, 0x64, 0x5f, 0x61, 0x6d, + 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x70, 0x92, 0x41, 0x6d, 0x32, + 0x6b, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x45, 0x54, 0x48, 0x20, 0x74, + 0x68, 0x61, 0x74, 0x20, 0x74, 0x68, 0x65, 0x20, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x20, 0x68, + 0x61, 0x73, 0x20, 0x61, 0x67, 0x72, 0x65, 0x65, 0x64, 0x20, 0x74, 0x6f, 0x20, 0x70, 0x61, 0x79, + 0x20, 0x74, 0x6f, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, + 0x20, 0x66, 0x6f, 0x72, 0x20, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x69, 0x6e, 0x67, 0x20, 0x74, + 0x68, 0x65, 0x20, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x69, + 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x52, 0x09, 0x62, 0x69, + 0x64, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x6d, 0x0a, 0x0c, 0x62, 0x6c, 0x6f, 0x63, 0x6b, + 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x42, 0x4a, 0x92, + 0x41, 0x47, 0x32, 0x45, 0x4d, 0x61, 0x78, 0x20, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x20, 0x6e, 0x75, + 0x6d, 0x62, 0x65, 0x72, 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, 0x74, 0x68, 0x65, 0x20, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x69, 0x6e, 0x2e, 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x63, 0x6b, + 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x7b, 0x0a, 0x13, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, + 0x65, 0x64, 0x5f, 0x62, 0x69, 0x64, 0x5f, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x09, 0x42, 0x4b, 0x92, 0x41, 0x48, 0x32, 0x46, 0x48, 0x65, 0x78, 0x20, 0x73, 0x74, + 0x72, 0x69, 0x6e, 0x67, 0x20, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x20, 0x6f, 0x66, + 0x20, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x62, + 0x69, 0x64, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x73, 0x69, 0x67, 0x6e, 0x65, + 0x64, 0x20, 0x62, 0x79, 0x20, 0x74, 0x68, 0x65, 0x20, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x2e, + 0x52, 0x11, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x42, 0x69, 0x64, 0x44, 0x69, 0x67, + 0x65, 0x73, 0x74, 0x12, 0x7d, 0x0a, 0x16, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x5f, + 0x62, 0x69, 0x64, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x09, 0x42, 0x47, 0x92, 0x41, 0x44, 0x32, 0x42, 0x48, 0x65, 0x78, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x20, 0x6f, 0x66, - 0x20, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x63, - 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x52, 0x10, 0x63, 0x6f, 0x6d, 0x6d, - 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x12, 0x9e, 0x01, 0x0a, - 0x14, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x69, 0x67, 0x6e, - 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x42, 0x6b, 0x92, 0x41, 0x68, - 0x32, 0x66, 0x48, 0x65, 0x78, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x65, 0x6e, 0x63, - 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x20, 0x6f, 0x66, 0x20, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, - 0x72, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, - 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x74, - 0x68, 0x65, 0x20, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x20, 0x63, 0x6f, 0x6e, 0x66, - 0x69, 0x72, 0x6d, 0x69, 0x6e, 0x67, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x74, 0x72, 0x61, 0x6e, - 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x13, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, - 0x6d, 0x65, 0x6e, 0x74, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x88, 0x01, - 0x0a, 0x10, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, - 0x73, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x42, 0x5d, 0x92, 0x41, 0x5a, 0x32, 0x58, 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, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, - 0x73, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, - 0x72, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x20, 0x74, 0x68, - 0x65, 0x20, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x73, 0x69, 0x67, - 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x2e, 0x52, 0x0f, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, - 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x64, 0x0a, 0x15, 0x64, 0x65, 0x63, 0x61, - 0x79, 0x5f, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, - 0x70, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x42, 0x30, 0x92, 0x41, 0x2d, 0x32, 0x2b, 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, 0x73, 0x74, 0x61, 0x72, 0x74, 0x73, 0x20, - 0x64, 0x65, 0x63, 0x61, 0x79, 0x69, 0x6e, 0x67, 0x2e, 0x52, 0x13, 0x64, 0x65, 0x63, 0x61, 0x79, - 0x53, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x5e, - 0x0a, 0x13, 0x64, 0x65, 0x63, 0x61, 0x79, 0x5f, 0x65, 0x6e, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, - 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x03, 0x42, 0x2e, 0x92, 0x41, 0x2b, - 0x32, 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, 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, 0xbb, 0x07, 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, 0x6b, 0x0a, 0x07, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x12, 0x1c, - 0x2e, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, + 0x20, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, + 0x65, 0x20, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x73, 0x65, + 0x6e, 0x74, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x62, 0x69, 0x64, 0x2e, 0x52, 0x14, 0x72, 0x65, + 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x42, 0x69, 0x64, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, + 0x72, 0x65, 0x12, 0x62, 0x0a, 0x11, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, + 0x5f, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x42, 0x35, 0x92, + 0x41, 0x32, 0x32, 0x30, 0x48, 0x65, 0x78, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x65, + 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x20, 0x6f, 0x66, 0x20, 0x64, 0x69, 0x67, 0x65, 0x73, + 0x74, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, + 0x65, 0x6e, 0x74, 0x2e, 0x52, 0x10, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, + 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x12, 0x9e, 0x01, 0x0a, 0x14, 0x63, 0x6f, 0x6d, 0x6d, 0x69, + 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, + 0x07, 0x20, 0x01, 0x28, 0x09, 0x42, 0x6b, 0x92, 0x41, 0x68, 0x32, 0x66, 0x48, 0x65, 0x78, 0x20, + 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x20, + 0x6f, 0x66, 0x20, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x20, 0x6f, 0x66, 0x20, + 0x74, 0x68, 0x65, 0x20, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x73, + 0x69, 0x67, 0x6e, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x72, 0x6f, + 0x76, 0x69, 0x64, 0x65, 0x72, 0x20, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x69, 0x6e, 0x67, + 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x2e, 0x52, 0x13, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x53, 0x69, + 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x88, 0x01, 0x0a, 0x10, 0x70, 0x72, 0x6f, 0x76, + 0x69, 0x64, 0x65, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x08, 0x20, 0x01, + 0x28, 0x09, 0x42, 0x5d, 0x92, 0x41, 0x5a, 0x32, 0x58, 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, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x74, + 0x68, 0x65, 0x20, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x20, 0x74, 0x68, 0x61, 0x74, + 0x20, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x20, 0x74, 0x68, 0x65, 0x20, 0x63, 0x6f, 0x6d, 0x6d, + 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, + 0x2e, 0x52, 0x0f, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, + 0x73, 0x73, 0x12, 0x64, 0x0a, 0x15, 0x64, 0x65, 0x63, 0x61, 0x79, 0x5f, 0x73, 0x74, 0x61, 0x72, + 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x09, 0x20, 0x01, 0x28, + 0x03, 0x42, 0x30, 0x92, 0x41, 0x2d, 0x32, 0x2b, 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, 0x73, 0x74, 0x61, 0x72, 0x74, 0x73, 0x20, 0x64, 0x65, 0x63, 0x61, 0x79, 0x69, + 0x6e, 0x67, 0x2e, 0x52, 0x13, 0x64, 0x65, 0x63, 0x61, 0x79, 0x53, 0x74, 0x61, 0x72, 0x74, 0x54, + 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x5e, 0x0a, 0x13, 0x64, 0x65, 0x63, 0x61, + 0x79, 0x5f, 0x65, 0x6e, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, + 0x0a, 0x20, 0x01, 0x28, 0x03, 0x42, 0x2e, 0x92, 0x41, 0x2b, 0x32, 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, 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, 0xe3, 0x08, + 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, 0x6b, 0x0a, + 0x07, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x12, 0x1c, 0x2e, 0x62, 0x69, 0x64, 0x64, 0x65, + 0x72, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x23, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x22, 0x1b, 0x2f, + 0x76, 0x31, 0x2f, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x2f, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, + 0x74, 0x2f, 0x7b, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x7d, 0x12, 0x78, 0x0a, 0x0b, 0x41, 0x75, + 0x74, 0x6f, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x12, 0x1c, 0x2e, 0x62, 0x69, 0x64, 0x64, + 0x65, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, + 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x75, 0x74, 0x6f, 0x44, 0x65, 0x70, 0x6f, 0x73, + 0x69, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x28, 0x82, 0xd3, 0xe4, 0x93, + 0x02, 0x22, 0x22, 0x20, 0x2f, 0x76, 0x31, 0x2f, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x2f, 0x61, + 0x75, 0x74, 0x6f, 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x2f, 0x7b, 0x61, 0x6d, 0x6f, + 0x75, 0x6e, 0x74, 0x7d, 0x12, 0x80, 0x01, 0x0a, 0x11, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x41, + 0x75, 0x74, 0x6f, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 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, 0x27, 0x2e, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x41, 0x75, 0x74, 0x6f, + 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x26, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x22, 0x1e, 0x2f, 0x76, 0x31, 0x2f, 0x62, 0x69, 0x64, + 0x64, 0x65, 0x72, 0x2f, 0x63, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x5f, 0x61, 0x75, 0x74, 0x6f, 0x5f, + 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x12, 0x80, 0x01, 0x0a, 0x11, 0x41, 0x75, 0x74, 0x6f, + 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 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, 0x27, 0x2e, 0x62, 0x69, 0x64, 0x64, + 0x65, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x75, 0x74, 0x6f, 0x44, 0x65, 0x70, + 0x6f, 0x73, 0x69, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x26, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x12, 0x1e, 0x2f, 0x76, 0x31, 0x2f, + 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x2f, 0x61, 0x75, 0x74, 0x6f, 0x5f, 0x64, 0x65, 0x70, 0x6f, + 0x73, 0x69, 0x74, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x98, 0x01, 0x0a, 0x1c, 0x43, + 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x41, 0x6e, 0x64, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, + 0x41, 0x75, 0x74, 0x6f, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 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, 0x27, 0x2e, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, + 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x41, 0x75, 0x74, + 0x6f, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x33, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2d, 0x22, 0x2b, 0x2f, 0x76, 0x31, 0x2f, 0x62, 0x69, + 0x64, 0x64, 0x65, 0x72, 0x2f, 0x63, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x5f, 0x61, 0x6e, 0x64, 0x5f, + 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x5f, 0x61, 0x75, 0x74, 0x6f, 0x5f, 0x64, 0x65, + 0x70, 0x6f, 0x73, 0x69, 0x74, 0x12, 0xa5, 0x01, 0x0a, 0x1b, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, + 0x61, 0x77, 0x46, 0x72, 0x6f, 0x6d, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x57, 0x69, + 0x6e, 0x64, 0x6f, 0x77, 0x73, 0x12, 0x30, 0x2e, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x61, 0x70, + 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x46, 0x72, 0x6f, + 0x6d, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x57, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x73, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, + 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x75, 0x74, 0x6f, 0x44, 0x65, 0x70, 0x6f, 0x73, + 0x69, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x31, 0x82, 0xd3, 0xe4, 0x93, + 0x02, 0x2b, 0x22, 0x29, 0x2f, 0x76, 0x31, 0x2f, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x2f, 0x77, + 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x5f, 0x66, 0x72, 0x6f, 0x6d, 0x5f, 0x73, 0x70, 0x65, + 0x63, 0x69, 0x66, 0x69, 0x63, 0x5f, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x73, 0x12, 0x6c, 0x0a, + 0x0a, 0x47, 0x65, 0x74, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x12, 0x1f, 0x2e, 0x62, 0x69, + 0x64, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x70, 0x6f, - 0x73, 0x69, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x23, 0x82, 0xd3, 0xe4, - 0x93, 0x02, 0x1d, 0x22, 0x1b, 0x2f, 0x76, 0x31, 0x2f, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x2f, - 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x2f, 0x7b, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x7d, - 0x12, 0x78, 0x0a, 0x0b, 0x41, 0x75, 0x74, 0x6f, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x12, - 0x1c, 0x2e, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x44, - 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, - 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x75, 0x74, - 0x6f, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x28, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x22, 0x22, 0x20, 0x2f, 0x76, 0x31, 0x2f, 0x62, 0x69, - 0x64, 0x64, 0x65, 0x72, 0x2f, 0x61, 0x75, 0x74, 0x6f, 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, - 0x74, 0x2f, 0x7b, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x7d, 0x12, 0x80, 0x01, 0x0a, 0x11, 0x43, - 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x41, 0x75, 0x74, 0x6f, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, - 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, 0x27, 0x2e, 0x62, - 0x69, 0x64, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x61, 0x6e, 0x63, - 0x65, 0x6c, 0x41, 0x75, 0x74, 0x6f, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x26, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x22, 0x1e, 0x2f, - 0x76, 0x31, 0x2f, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x2f, 0x63, 0x61, 0x6e, 0x63, 0x65, 0x6c, - 0x5f, 0x61, 0x75, 0x74, 0x6f, 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x12, 0x80, 0x01, - 0x0a, 0x11, 0x41, 0x75, 0x74, 0x6f, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x53, 0x74, 0x61, - 0x74, 0x75, 0x73, 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, - 0x27, 0x2e, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x41, - 0x75, 0x74, 0x6f, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x26, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, - 0x12, 0x1e, 0x2f, 0x76, 0x31, 0x2f, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x2f, 0x61, 0x75, 0x74, - 0x6f, 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x12, 0x98, 0x01, 0x0a, 0x1c, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x41, 0x6e, 0x64, 0x57, 0x69, - 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x41, 0x75, 0x74, 0x6f, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, - 0x74, 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, 0x27, 0x2e, - 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x61, 0x6e, - 0x63, 0x65, 0x6c, 0x41, 0x75, 0x74, 0x6f, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x33, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2d, 0x22, 0x2b, - 0x2f, 0x76, 0x31, 0x2f, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x2f, 0x63, 0x61, 0x6e, 0x63, 0x65, - 0x6c, 0x5f, 0x61, 0x6e, 0x64, 0x5f, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x5f, 0x61, - 0x75, 0x74, 0x6f, 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x12, 0x6c, 0x0a, 0x0a, 0x47, - 0x65, 0x74, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x12, 0x1f, 0x2e, 0x62, 0x69, 0x64, 0x64, - 0x65, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x44, 0x65, 0x70, 0x6f, - 0x73, 0x69, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x62, 0x69, 0x64, - 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, - 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1e, 0x82, 0xd3, 0xe4, 0x93, 0x02, - 0x18, 0x12, 0x16, 0x2f, 0x76, 0x31, 0x2f, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x2f, 0x67, 0x65, - 0x74, 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x12, 0x66, 0x0a, 0x08, 0x57, 0x69, 0x74, - 0x68, 0x64, 0x72, 0x61, 0x77, 0x12, 0x1d, 0x2e, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x61, 0x70, - 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, - 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x15, 0x22, 0x13, 0x2f, 0x76, - 0x31, 0x2f, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x2f, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, - 0x77, 0x42, 0xaa, 0x02, 0x92, 0x41, 0x72, 0x12, 0x70, 0x0a, 0x0a, 0x42, 0x69, 0x64, 0x64, 0x65, - 0x72, 0x20, 0x41, 0x50, 0x49, 0x2a, 0x55, 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, 0x36, 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, 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, 0x40, 0x67, - 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x65, 0x76, - 0x2f, 0x6d, 0x65, 0x76, 0x2d, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x2f, 0x70, 0x32, 0x70, 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, + 0x73, 0x69, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1e, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x18, 0x12, 0x16, 0x2f, 0x76, 0x31, 0x2f, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x2f, + 0x67, 0x65, 0x74, 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x12, 0x66, 0x0a, 0x08, 0x57, + 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x12, 0x1d, 0x2e, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, + 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x15, 0x22, 0x13, + 0x2f, 0x76, 0x31, 0x2f, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x2f, 0x77, 0x69, 0x74, 0x68, 0x64, + 0x72, 0x61, 0x77, 0x42, 0xaa, 0x02, 0x92, 0x41, 0x72, 0x12, 0x70, 0x0a, 0x0a, 0x42, 0x69, 0x64, + 0x64, 0x65, 0x72, 0x20, 0x41, 0x50, 0x49, 0x2a, 0x55, 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, 0x36, 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, 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, + 0x40, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x69, 0x6d, + 0x65, 0x76, 0x2f, 0x6d, 0x65, 0x76, 0x2d, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x2f, 0x70, 0x32, + 0x70, 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 ( @@ -1223,54 +1306,58 @@ func file_bidderapi_v1_bidderapi_proto_rawDescGZIP() []byte { return file_bidderapi_v1_bidderapi_proto_rawDescData } -var file_bidderapi_v1_bidderapi_proto_msgTypes = make([]protoimpl.MessageInfo, 12) +var file_bidderapi_v1_bidderapi_proto_msgTypes = make([]protoimpl.MessageInfo, 13) var file_bidderapi_v1_bidderapi_proto_goTypes = []interface{}{ - (*DepositRequest)(nil), // 0: bidderapi.v1.DepositRequest - (*DepositResponse)(nil), // 1: bidderapi.v1.DepositResponse - (*AutoDepositResponse)(nil), // 2: bidderapi.v1.AutoDepositResponse - (*AutoDepositStatusResponse)(nil), // 3: bidderapi.v1.AutoDepositStatusResponse - (*CancelAutoDepositResponse)(nil), // 4: bidderapi.v1.CancelAutoDepositResponse - (*AutoDeposit)(nil), // 5: bidderapi.v1.AutoDeposit - (*EmptyMessage)(nil), // 6: bidderapi.v1.EmptyMessage - (*GetDepositRequest)(nil), // 7: bidderapi.v1.GetDepositRequest - (*WithdrawRequest)(nil), // 8: bidderapi.v1.WithdrawRequest - (*WithdrawResponse)(nil), // 9: bidderapi.v1.WithdrawResponse - (*Bid)(nil), // 10: bidderapi.v1.Bid - (*Commitment)(nil), // 11: bidderapi.v1.Commitment - (*wrapperspb.UInt64Value)(nil), // 12: google.protobuf.UInt64Value + (*DepositRequest)(nil), // 0: bidderapi.v1.DepositRequest + (*DepositResponse)(nil), // 1: bidderapi.v1.DepositResponse + (*AutoDepositResponse)(nil), // 2: bidderapi.v1.AutoDepositResponse + (*AutoDepositStatusResponse)(nil), // 3: bidderapi.v1.AutoDepositStatusResponse + (*CancelAutoDepositResponse)(nil), // 4: bidderapi.v1.CancelAutoDepositResponse + (*AutoDeposit)(nil), // 5: bidderapi.v1.AutoDeposit + (*EmptyMessage)(nil), // 6: bidderapi.v1.EmptyMessage + (*GetDepositRequest)(nil), // 7: bidderapi.v1.GetDepositRequest + (*WithdrawRequest)(nil), // 8: bidderapi.v1.WithdrawRequest + (*WithdrawResponse)(nil), // 9: bidderapi.v1.WithdrawResponse + (*WithdrawFromSpecificWindowsRequest)(nil), // 10: bidderapi.v1.WithdrawFromSpecificWindowsRequest + (*Bid)(nil), // 11: bidderapi.v1.Bid + (*Commitment)(nil), // 12: bidderapi.v1.Commitment + (*wrapperspb.UInt64Value)(nil), // 13: google.protobuf.UInt64Value } var file_bidderapi_v1_bidderapi_proto_depIdxs = []int32{ - 12, // 0: bidderapi.v1.DepositRequest.window_number:type_name -> google.protobuf.UInt64Value - 12, // 1: bidderapi.v1.DepositRequest.block_number:type_name -> google.protobuf.UInt64Value - 12, // 2: bidderapi.v1.DepositResponse.window_number:type_name -> google.protobuf.UInt64Value + 13, // 0: bidderapi.v1.DepositRequest.window_number:type_name -> google.protobuf.UInt64Value + 13, // 1: bidderapi.v1.DepositRequest.block_number:type_name -> google.protobuf.UInt64Value + 13, // 2: bidderapi.v1.DepositResponse.window_number:type_name -> google.protobuf.UInt64Value 5, // 3: bidderapi.v1.AutoDepositResponse.amounts_and_window_numbers:type_name -> bidderapi.v1.AutoDeposit 5, // 4: bidderapi.v1.AutoDepositStatusResponse.amounts_and_window_numbers:type_name -> bidderapi.v1.AutoDeposit - 12, // 5: bidderapi.v1.CancelAutoDepositResponse.window_numbers:type_name -> google.protobuf.UInt64Value - 12, // 6: bidderapi.v1.AutoDeposit.window_number:type_name -> google.protobuf.UInt64Value - 12, // 7: bidderapi.v1.GetDepositRequest.window_number:type_name -> google.protobuf.UInt64Value - 12, // 8: bidderapi.v1.WithdrawRequest.window_number:type_name -> google.protobuf.UInt64Value - 12, // 9: bidderapi.v1.WithdrawResponse.window_number:type_name -> google.protobuf.UInt64Value - 10, // 10: bidderapi.v1.Bidder.SendBid:input_type -> bidderapi.v1.Bid - 0, // 11: bidderapi.v1.Bidder.Deposit:input_type -> bidderapi.v1.DepositRequest - 0, // 12: bidderapi.v1.Bidder.AutoDeposit:input_type -> bidderapi.v1.DepositRequest - 6, // 13: bidderapi.v1.Bidder.CancelAutoDeposit:input_type -> bidderapi.v1.EmptyMessage - 6, // 14: bidderapi.v1.Bidder.AutoDepositStatus:input_type -> bidderapi.v1.EmptyMessage - 6, // 15: bidderapi.v1.Bidder.CancelAndWithdrawAutoDeposit:input_type -> bidderapi.v1.EmptyMessage - 7, // 16: bidderapi.v1.Bidder.GetDeposit:input_type -> bidderapi.v1.GetDepositRequest - 8, // 17: bidderapi.v1.Bidder.Withdraw:input_type -> bidderapi.v1.WithdrawRequest - 11, // 18: bidderapi.v1.Bidder.SendBid:output_type -> bidderapi.v1.Commitment - 1, // 19: bidderapi.v1.Bidder.Deposit:output_type -> bidderapi.v1.DepositResponse - 2, // 20: bidderapi.v1.Bidder.AutoDeposit:output_type -> bidderapi.v1.AutoDepositResponse - 4, // 21: bidderapi.v1.Bidder.CancelAutoDeposit:output_type -> bidderapi.v1.CancelAutoDepositResponse - 3, // 22: bidderapi.v1.Bidder.AutoDepositStatus:output_type -> bidderapi.v1.AutoDepositStatusResponse - 4, // 23: bidderapi.v1.Bidder.CancelAndWithdrawAutoDeposit:output_type -> bidderapi.v1.CancelAutoDepositResponse - 1, // 24: bidderapi.v1.Bidder.GetDeposit:output_type -> bidderapi.v1.DepositResponse - 9, // 25: bidderapi.v1.Bidder.Withdraw:output_type -> bidderapi.v1.WithdrawResponse - 18, // [18:26] is the sub-list for method output_type - 10, // [10:18] is the sub-list for method input_type - 10, // [10:10] is the sub-list for extension type_name - 10, // [10:10] is the sub-list for extension extendee - 0, // [0:10] is the sub-list for field type_name + 13, // 5: bidderapi.v1.CancelAutoDepositResponse.window_numbers:type_name -> google.protobuf.UInt64Value + 13, // 6: bidderapi.v1.AutoDeposit.window_number:type_name -> google.protobuf.UInt64Value + 13, // 7: bidderapi.v1.GetDepositRequest.window_number:type_name -> google.protobuf.UInt64Value + 13, // 8: bidderapi.v1.WithdrawRequest.window_number:type_name -> google.protobuf.UInt64Value + 13, // 9: bidderapi.v1.WithdrawResponse.window_number:type_name -> google.protobuf.UInt64Value + 13, // 10: bidderapi.v1.WithdrawFromSpecificWindowsRequest.window_numbers:type_name -> google.protobuf.UInt64Value + 11, // 11: bidderapi.v1.Bidder.SendBid:input_type -> bidderapi.v1.Bid + 0, // 12: bidderapi.v1.Bidder.Deposit:input_type -> bidderapi.v1.DepositRequest + 0, // 13: bidderapi.v1.Bidder.AutoDeposit:input_type -> bidderapi.v1.DepositRequest + 6, // 14: bidderapi.v1.Bidder.CancelAutoDeposit:input_type -> bidderapi.v1.EmptyMessage + 6, // 15: bidderapi.v1.Bidder.AutoDepositStatus:input_type -> bidderapi.v1.EmptyMessage + 6, // 16: bidderapi.v1.Bidder.CancelAndWithdrawAutoDeposit:input_type -> bidderapi.v1.EmptyMessage + 10, // 17: bidderapi.v1.Bidder.WithdrawFromSpecificWindows:input_type -> bidderapi.v1.WithdrawFromSpecificWindowsRequest + 7, // 18: bidderapi.v1.Bidder.GetDeposit:input_type -> bidderapi.v1.GetDepositRequest + 8, // 19: bidderapi.v1.Bidder.Withdraw:input_type -> bidderapi.v1.WithdrawRequest + 12, // 20: bidderapi.v1.Bidder.SendBid:output_type -> bidderapi.v1.Commitment + 1, // 21: bidderapi.v1.Bidder.Deposit:output_type -> bidderapi.v1.DepositResponse + 2, // 22: bidderapi.v1.Bidder.AutoDeposit:output_type -> bidderapi.v1.AutoDepositResponse + 4, // 23: bidderapi.v1.Bidder.CancelAutoDeposit:output_type -> bidderapi.v1.CancelAutoDepositResponse + 3, // 24: bidderapi.v1.Bidder.AutoDepositStatus:output_type -> bidderapi.v1.AutoDepositStatusResponse + 4, // 25: bidderapi.v1.Bidder.CancelAndWithdrawAutoDeposit:output_type -> bidderapi.v1.CancelAutoDepositResponse + 2, // 26: bidderapi.v1.Bidder.WithdrawFromSpecificWindows:output_type -> bidderapi.v1.AutoDepositResponse + 1, // 27: bidderapi.v1.Bidder.GetDeposit:output_type -> bidderapi.v1.DepositResponse + 9, // 28: bidderapi.v1.Bidder.Withdraw:output_type -> bidderapi.v1.WithdrawResponse + 20, // [20:29] is the sub-list for method output_type + 11, // [11:20] is the sub-list for method input_type + 11, // [11:11] is the sub-list for extension type_name + 11, // [11:11] is the sub-list for extension extendee + 0, // [0:11] is the sub-list for field type_name } func init() { file_bidderapi_v1_bidderapi_proto_init() } @@ -1400,7 +1487,7 @@ func file_bidderapi_v1_bidderapi_proto_init() { } } file_bidderapi_v1_bidderapi_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Bid); i { + switch v := v.(*WithdrawFromSpecificWindowsRequest); i { case 0: return &v.state case 1: @@ -1412,6 +1499,18 @@ func file_bidderapi_v1_bidderapi_proto_init() { } } file_bidderapi_v1_bidderapi_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Bid); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_bidderapi_v1_bidderapi_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Commitment); i { case 0: return &v.state @@ -1430,7 +1529,7 @@ func file_bidderapi_v1_bidderapi_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_bidderapi_v1_bidderapi_proto_rawDesc, NumEnums: 0, - NumMessages: 12, + NumMessages: 13, NumExtensions: 0, NumServices: 1, }, diff --git a/p2p/gen/go/bidderapi/v1/bidderapi.pb.gw.go b/p2p/gen/go/bidderapi/v1/bidderapi.pb.gw.go index 0073f6266..5ca57f483 100644 --- a/p2p/gen/go/bidderapi/v1/bidderapi.pb.gw.go +++ b/p2p/gen/go/bidderapi/v1/bidderapi.pb.gw.go @@ -246,6 +246,42 @@ func local_request_Bidder_CancelAndWithdrawAutoDeposit_0(ctx context.Context, ma } +var ( + filter_Bidder_WithdrawFromSpecificWindows_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Bidder_WithdrawFromSpecificWindows_0(ctx context.Context, marshaler runtime.Marshaler, client BidderClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq WithdrawFromSpecificWindowsRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Bidder_WithdrawFromSpecificWindows_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.WithdrawFromSpecificWindows(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Bidder_WithdrawFromSpecificWindows_0(ctx context.Context, marshaler runtime.Marshaler, server BidderServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq WithdrawFromSpecificWindowsRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Bidder_WithdrawFromSpecificWindows_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.WithdrawFromSpecificWindows(ctx, &protoReq) + return msg, metadata, err + +} + var ( filter_Bidder_GetDeposit_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} ) @@ -456,6 +492,31 @@ func RegisterBidderHandlerServer(ctx context.Context, mux *runtime.ServeMux, ser }) + mux.Handle("POST", pattern_Bidder_WithdrawFromSpecificWindows_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/bidderapi.v1.Bidder/WithdrawFromSpecificWindows", runtime.WithHTTPPathPattern("/v1/bidder/withdraw_from_specific_windows")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Bidder_WithdrawFromSpecificWindows_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_Bidder_WithdrawFromSpecificWindows_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Bidder_GetDeposit_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -679,6 +740,28 @@ func RegisterBidderHandlerClient(ctx context.Context, mux *runtime.ServeMux, cli }) + mux.Handle("POST", pattern_Bidder_WithdrawFromSpecificWindows_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/bidderapi.v1.Bidder/WithdrawFromSpecificWindows", runtime.WithHTTPPathPattern("/v1/bidder/withdraw_from_specific_windows")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Bidder_WithdrawFromSpecificWindows_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_Bidder_WithdrawFromSpecificWindows_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Bidder_GetDeposit_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -739,6 +822,8 @@ var ( pattern_Bidder_CancelAndWithdrawAutoDeposit_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "bidder", "cancel_and_withdraw_auto_deposit"}, "")) + pattern_Bidder_WithdrawFromSpecificWindows_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "bidder", "withdraw_from_specific_windows"}, "")) + pattern_Bidder_GetDeposit_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "bidder", "get_deposit"}, "")) pattern_Bidder_Withdraw_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "bidder", "withdraw"}, "")) @@ -757,6 +842,8 @@ var ( forward_Bidder_CancelAndWithdrawAutoDeposit_0 = runtime.ForwardResponseMessage + forward_Bidder_WithdrawFromSpecificWindows_0 = runtime.ForwardResponseMessage + forward_Bidder_GetDeposit_0 = runtime.ForwardResponseMessage forward_Bidder_Withdraw_0 = runtime.ForwardResponseMessage diff --git a/p2p/gen/go/bidderapi/v1/bidderapi_grpc.pb.go b/p2p/gen/go/bidderapi/v1/bidderapi_grpc.pb.go index 05717ac50..31db88bed 100644 --- a/p2p/gen/go/bidderapi/v1/bidderapi_grpc.pb.go +++ b/p2p/gen/go/bidderapi/v1/bidderapi_grpc.pb.go @@ -25,6 +25,7 @@ const ( Bidder_CancelAutoDeposit_FullMethodName = "/bidderapi.v1.Bidder/CancelAutoDeposit" Bidder_AutoDepositStatus_FullMethodName = "/bidderapi.v1.Bidder/AutoDepositStatus" Bidder_CancelAndWithdrawAutoDeposit_FullMethodName = "/bidderapi.v1.Bidder/CancelAndWithdrawAutoDeposit" + Bidder_WithdrawFromSpecificWindows_FullMethodName = "/bidderapi.v1.Bidder/WithdrawFromSpecificWindows" Bidder_GetDeposit_FullMethodName = "/bidderapi.v1.Bidder/GetDeposit" Bidder_Withdraw_FullMethodName = "/bidderapi.v1.Bidder/Withdraw" ) @@ -57,6 +58,10 @@ type BidderClient interface { // // CancelAndWithdrawAutoDeposit is called by the bidder node to cancel the auto deposit and withdraw the funds. CancelAndWithdrawAutoDeposit(ctx context.Context, in *EmptyMessage, opts ...grpc.CallOption) (*CancelAutoDepositResponse, error) + // WithdrawFromSpecificWindows + // + // WithdrawFromSpecificWindows is called by the bidder node to withdraw funds from specific windows. + WithdrawFromSpecificWindows(ctx context.Context, in *WithdrawFromSpecificWindowsRequest, opts ...grpc.CallOption) (*AutoDepositResponse, error) // GetDeposit // // GetDeposit is called by the bidder to get its deposit in the bidder registry. @@ -158,6 +163,16 @@ func (c *bidderClient) CancelAndWithdrawAutoDeposit(ctx context.Context, in *Emp return out, nil } +func (c *bidderClient) WithdrawFromSpecificWindows(ctx context.Context, in *WithdrawFromSpecificWindowsRequest, opts ...grpc.CallOption) (*AutoDepositResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(AutoDepositResponse) + err := c.cc.Invoke(ctx, Bidder_WithdrawFromSpecificWindows_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *bidderClient) GetDeposit(ctx context.Context, in *GetDepositRequest, opts ...grpc.CallOption) (*DepositResponse, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(DepositResponse) @@ -206,6 +221,10 @@ type BidderServer interface { // // CancelAndWithdrawAutoDeposit is called by the bidder node to cancel the auto deposit and withdraw the funds. CancelAndWithdrawAutoDeposit(context.Context, *EmptyMessage) (*CancelAutoDepositResponse, error) + // WithdrawFromSpecificWindows + // + // WithdrawFromSpecificWindows is called by the bidder node to withdraw funds from specific windows. + WithdrawFromSpecificWindows(context.Context, *WithdrawFromSpecificWindowsRequest) (*AutoDepositResponse, error) // GetDeposit // // GetDeposit is called by the bidder to get its deposit in the bidder registry. @@ -239,6 +258,9 @@ func (UnimplementedBidderServer) AutoDepositStatus(context.Context, *EmptyMessag func (UnimplementedBidderServer) CancelAndWithdrawAutoDeposit(context.Context, *EmptyMessage) (*CancelAutoDepositResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method CancelAndWithdrawAutoDeposit not implemented") } +func (UnimplementedBidderServer) WithdrawFromSpecificWindows(context.Context, *WithdrawFromSpecificWindowsRequest) (*AutoDepositResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method WithdrawFromSpecificWindows not implemented") +} func (UnimplementedBidderServer) GetDeposit(context.Context, *GetDepositRequest) (*DepositResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetDeposit not implemented") } @@ -369,6 +391,24 @@ func _Bidder_CancelAndWithdrawAutoDeposit_Handler(srv interface{}, ctx context.C return interceptor(ctx, in, info, handler) } +func _Bidder_WithdrawFromSpecificWindows_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(WithdrawFromSpecificWindowsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BidderServer).WithdrawFromSpecificWindows(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Bidder_WithdrawFromSpecificWindows_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BidderServer).WithdrawFromSpecificWindows(ctx, req.(*WithdrawFromSpecificWindowsRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _Bidder_GetDeposit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(GetDepositRequest) if err := dec(in); err != nil { @@ -432,6 +472,10 @@ var Bidder_ServiceDesc = grpc.ServiceDesc{ MethodName: "CancelAndWithdrawAutoDeposit", Handler: _Bidder_CancelAndWithdrawAutoDeposit_Handler, }, + { + MethodName: "WithdrawFromSpecificWindows", + Handler: _Bidder_WithdrawFromSpecificWindows_Handler, + }, { MethodName: "GetDeposit", Handler: _Bidder_GetDeposit_Handler, diff --git a/p2p/gen/openapi/bidderapi/v1/bidderapi.swagger.yaml b/p2p/gen/openapi/bidderapi/v1/bidderapi.swagger.yaml index 976bbc35d..b36914f94 100644 --- a/p2p/gen/openapi/bidderapi/v1/bidderapi.swagger.yaml +++ b/p2p/gen/openapi/bidderapi/v1/bidderapi.swagger.yaml @@ -185,6 +185,30 @@ paths: required: false type: string format: uint64 + /v1/bidder/withdraw_from_specific_windows: + post: + summary: WithdrawFromSpecificWindows + description: WithdrawFromSpecificWindows is called by the bidder node to withdraw funds from specific windows. + operationId: Bidder_WithdrawFromSpecificWindows + responses: + "200": + description: A successful response. + schema: + $ref: '#/definitions/v1AutoDepositResponse' + default: + description: An unexpected error response. + schema: + $ref: '#/definitions/googlerpcStatus' + parameters: + - name: windowNumbers + description: Window numbers for withdrawing deposits. + in: query + required: true + type: array + items: + type: string + format: uint64 + collectionFormat: multi definitions: bidderapiv1AutoDeposit: type: object diff --git a/p2p/pkg/rpc/bidder/service.go b/p2p/pkg/rpc/bidder/service.go index 5396a941f..b019d792f 100644 --- a/p2p/pkg/rpc/bidder/service.go +++ b/p2p/pkg/rpc/bidder/service.go @@ -79,6 +79,7 @@ type BidderRegistryContract interface { DepositForNWindows(*bind.TransactOpts, *big.Int, uint16) (*types.Transaction, error) WithdrawBidderAmountFromWindow(*bind.TransactOpts, common.Address, *big.Int) (*types.Transaction, error) GetDeposit(*bind.CallOpts, common.Address, *big.Int) (*big.Int, error) + WithdrawFromSpecificWindows(*bind.TransactOpts, []*big.Int) (*types.Transaction, error) ParseBidderRegistered(types.Log) (*bidderregistry.BidderregistryBidderRegistered, error) ParseBidderWithdrawal(types.Log) (*bidderregistry.BidderregistryBidderWithdrawal, error) } @@ -438,6 +439,70 @@ func (s *Service) CancelAndWithdrawAutoDeposit( }, nil } +func (s *Service) WithdrawFromSpecificWindows( + ctx context.Context, + r *bidderapiv1.WithdrawFromSpecificWindowsRequest, +) (*bidderapiv1.AutoDepositResponse, error) { + err := s.validator.Validate(r) + if err != nil { + return nil, status.Errorf(codes.InvalidArgument, "validating withdraw from n windows request: %v", err) + } + + if s.autoDepositTracker.IsWorking() { + return nil, status.Error(codes.FailedPrecondition, "auto deposit is already running, stop and then withdraw") + } + + opts, err := s.optsGetter(ctx) + if err != nil { + return nil, status.Errorf(codes.Internal, "getting transact opts: %v", err) + } + + windows := make([]*big.Int, len(r.WindowNumbers)) + for i, w := range r.WindowNumbers { + windows[i] = new(big.Int).SetUint64(w.Value) + } + + tx, err := s.registryContract.WithdrawFromSpecificWindows(opts, windows) + if err != nil { + return nil, status.Errorf(codes.Internal, "withdrawing deposit: %v", err) + } + + receipt, err := s.watcher.WaitForReceipt(ctx, tx) + if err != nil { + return nil, status.Errorf(codes.Internal, "waiting for receipt: %v", err) + } + + if receipt.Status != types.ReceiptStatusSuccessful { + return nil, status.Errorf(codes.Internal, "receipt status: %v", receipt.Status) + } + + var amountsAndWindows []*bidderapiv1.AutoDeposit + for _, log := range receipt.Logs { + if withdrawal, err := s.registryContract.ParseBidderWithdrawal(*log); err == nil { + s.logger.Info("withdrawal successful", "amount", withdrawal.Amount.String(), "window", withdrawal.Window.String()) + amountsAndWindows = append(amountsAndWindows, &bidderapiv1.AutoDeposit{ + Amount: withdrawal.Amount.String(), + WindowNumber: wrapperspb.UInt64(withdrawal.Window.Uint64()), + }) + } + } + + if len(amountsAndWindows) > 0 { + return &bidderapiv1.AutoDepositResponse{ + AmountsAndWindowNumbers: amountsAndWindows, + }, nil + } + + s.logger.Error( + "withdraw successful but missing log", + "txHash", receipt.TxHash.Hex(), + "window", r.WindowNumbers, + "logs", receipt.Logs, + ) + + return nil, status.Errorf(codes.Internal, "missing log for withdrawal") +} + func (s *Service) AutoDepositStatus( ctx context.Context, _ *bidderapiv1.EmptyMessage, diff --git a/p2p/pkg/rpc/bidder/service_test.go b/p2p/pkg/rpc/bidder/service_test.go index 5c5287703..898f6e38c 100644 --- a/p2p/pkg/rpc/bidder/service_test.go +++ b/p2p/pkg/rpc/bidder/service_test.go @@ -118,6 +118,10 @@ func (t *testRegistryContract) ParseBidderWithdrawal(_ types.Log) (*bidderregist }, nil } +func (t *testRegistryContract) WithdrawFromSpecificWindows(opts *bind.TransactOpts, windows []*big.Int) (*types.Transaction, error) { + return types.NewTransaction(3, common.Address{}, nil, 0, nil, nil), nil +} + type testAutoDepositTracker struct { deposits map[uint64]bool isWorking bool diff --git a/p2p/rpc/bidderapi/v1/bidderapi.proto b/p2p/rpc/bidderapi/v1/bidderapi.proto index 2090a2e09..f69048766 100644 --- a/p2p/rpc/bidderapi/v1/bidderapi.proto +++ b/p2p/rpc/bidderapi/v1/bidderapi.proto @@ -63,6 +63,13 @@ service Bidder { option (google.api.http) = {post: "/v1/bidder/cancel_and_withdraw_auto_deposit"}; } + // WithdrawFromSpecificWindows + // + // WithdrawFromSpecificWindows is called by the bidder node to withdraw funds from specific windows. + rpc WithdrawFromSpecificWindows(WithdrawFromSpecificWindowsRequest) returns (AutoDepositResponse) { + option (google.api.http) = {post: "/v1/bidder/withdraw_from_specific_windows"}; + } + // GetDeposit // // GetDeposit is called by the bidder to get its deposit in the bidder registry. @@ -207,6 +214,25 @@ message WithdrawResponse { google.protobuf.UInt64Value window_number = 2; }; +message WithdrawFromSpecificWindowsRequest { + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { + json_schema: { + title: "Withdraw from N windows request" + description: "Withdraw deposit from the bidder registry." + required: ["window_numbers"] + } + example: "{\"window_numbers\": [1, 2, 3]}" + }; + repeated google.protobuf.UInt64Value window_numbers = 1 [ + (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + description: "Window numbers for withdrawing deposits." + }, (buf.validate.field).cel = { + id: "window_numbers", + message: "window_numbers must be a valid array of positive integers.", + expression: "this.all(r, r > 0) && size(this) > 0" + }]; +}; + message Bid { option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { json_schema: { From 1cff292ed4fa0f9857302b7dc67e6c10ab733903 Mon Sep 17 00:00:00 2001 From: Mikhail Wall Date: Mon, 8 Jul 2024 18:59:18 +0200 Subject: [PATCH 18/18] fix: fixed pr comments --- p2p/pkg/depositmanager/autodeposit.go | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/p2p/pkg/depositmanager/autodeposit.go b/p2p/pkg/depositmanager/autodeposit.go index 3290d6af1..ac8f49e79 100644 --- a/p2p/pkg/depositmanager/autodeposit.go +++ b/p2p/pkg/depositmanager/autodeposit.go @@ -33,6 +33,7 @@ type AutoDepositTracker struct { brContract BidderRegistryContract optsGetter OptsGetter logger *slog.Logger + mu sync.Mutex cancelFunc context.CancelFunc } @@ -52,7 +53,12 @@ func NewAutoDepositTracker( } func (adt *AutoDepositTracker) DoAutoMoveToAnotherWindow(ctx context.Context, ads []*bidderapiv1.AutoDeposit) error { - adt.isWorking.Store(true) + adt.mu.Lock() + defer adt.mu.Unlock() + + if !adt.isWorking.CompareAndSwap(false, true) { + return fmt.Errorf("auto deposit tracker is already working") + } for _, ad := range ads { adt.deposits.Store(ad.WindowNumber.Value, true) @@ -85,16 +91,6 @@ func (adt *AutoDepositTracker) DoAutoMoveToAnotherWindow(ctx context.Context, ad eg.Go(func() error { defer sub.Unsubscribe() - select { - case <-egCtx.Done(): - adt.logger.Info("event subscription context done") - return nil - case err := <-sub.Err(): - return fmt.Errorf("error in event subscription: %w", err) - } - }) - - eg.Go(func() error { for { select { case <-egCtx.Done(): @@ -118,6 +114,8 @@ func (adt *AutoDepositTracker) DoAutoMoveToAnotherWindow(ctx context.Context, ad adt.logger.Info("move deposit to window", "hash", txn.Hash(), "from", fromWindow, "to", toWindow) adt.deposits.Delete(fromWindow.Uint64()) adt.deposits.Store(toWindow.Uint64(), true) + case err := <-sub.Err(): + return fmt.Errorf("error in event subscription: %w", err) } } }) @@ -140,6 +138,9 @@ func (adt *AutoDepositTracker) DoAutoMoveToAnotherWindow(ctx context.Context, ad } func (adt *AutoDepositTracker) Stop() (*bidderapiv1.CancelAutoDepositResponse, error) { + adt.mu.Lock() + defer adt.mu.Unlock() + if !adt.isWorking.Load() { return nil, fmt.Errorf("auto deposit tracker is not running") } @@ -262,4 +263,4 @@ func (adt *AutoDepositTracker) GetStatus() (map[uint64]bool, bool) { return true }) return deposits, adt.isWorking.Load() -} \ No newline at end of file +}