diff --git a/contracts-abi/abi/BidderRegistry.abi b/contracts-abi/abi/BidderRegistry.abi index 82fcc757d..c731e6982 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", @@ -239,11 +257,6 @@ "type": "function", "name": "initialize", "inputs": [ - { - "name": "_minDeposit", - "type": "uint256", - "internalType": "uint256" - }, { "name": "_feeRecipient", "type": "address", @@ -323,16 +336,21 @@ }, { "type": "function", - "name": "minDeposit", - "inputs": [], - "outputs": [ + "name": "moveDepositToWindow", + "inputs": [ { - "name": "", + "name": "fromWindow", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "toWindow", "type": "uint256", "internalType": "uint256" } ], - "stateMutability": "view" + "outputs": [], + "stateMutability": "nonpayable" }, { "type": "function", @@ -577,6 +595,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/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..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\":\"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\":\"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) @@ -840,6 +809,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() @@ -861,25 +851,46 @@ 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. +// +// 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. @@ -1092,6 +1103,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-abi/clients/BlockTracker/BlockTracker.go b/contracts-abi/clients/BlockTracker/BlockTracker.go index 460a5e8cd..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\":\"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\":\"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. @@ -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..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\":\"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\":\"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. @@ -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..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; @@ -114,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); @@ -168,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 @@ -187,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; } @@ -202,9 +197,137 @@ 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; + 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 BidderWithdrawal(msg.sender, fromWindow, 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 { + 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 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 + ) 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"); + } + + /** + * @dev Withdraw from specific windows. + * @param windows The windows from which the deposit is being withdrawn. + */ + 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. + * @param window The window for which the deposit is being checked. * @return The deposited amount for the bidder. */ function getDeposit( @@ -217,8 +340,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 +392,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( @@ -382,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, @@ -401,6 +528,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/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/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 73d192567..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; @@ -337,4 +330,143 @@ 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 test_WithdrawFromNWindows() 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*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 77cee6204..1404099f1 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, @@ -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), 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..fdbb23940 100644 --- a/p2p/gen/go/bidderapi/v1/bidderapi.pb.go +++ b/p2p/gen/go/bidderapi/v1/bidderapi.pb.go @@ -142,6 +142,210 @@ 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 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 + 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[5] + 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[5] + 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{5} +} + +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 +355,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[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -164,7 +368,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[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -177,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{2} + return file_bidderapi_v1_bidderapi_proto_rawDescGZIP(), []int{6} } type GetDepositRequest struct { @@ -191,7 +395,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[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -204,7 +408,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[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -217,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{3} + return file_bidderapi_v1_bidderapi_proto_rawDescGZIP(), []int{7} } func (x *GetDepositRequest) GetWindowNumber() *wrapperspb.UInt64Value { @@ -238,7 +442,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[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -251,7 +455,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[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -264,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{4} + return file_bidderapi_v1_bidderapi_proto_rawDescGZIP(), []int{8} } func (x *WithdrawRequest) GetWindowNumber() *wrapperspb.UInt64Value { @@ -286,7 +490,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[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -299,7 +503,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[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -312,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{5} + return file_bidderapi_v1_bidderapi_proto_rawDescGZIP(), []int{9} } func (x *WithdrawResponse) GetAmount() string { @@ -329,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 @@ -344,7 +595,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[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -357,7 +608,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[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -370,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{6} + return file_bidderapi_v1_bidderapi_proto_rawDescGZIP(), []int{11} } func (x *Bid) GetTxHashes() []string { @@ -429,7 +680,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[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -442,7 +693,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[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -455,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{7} + return file_bidderapi_v1_bidderapi_proto_rawDescGZIP(), []int{12} } func (x *Commitment) GetTxHashes() []string { @@ -619,295 +870,428 @@ 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, - 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, + 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, 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, - 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, 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, + 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, 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, + 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, - 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, + 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, 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, + 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, 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, - 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, 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, + 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, 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, 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, + 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, 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 ( @@ -922,40 +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, 8) +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 - (*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 + (*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{ - 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 + 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 + 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() } @@ -989,7 +1391,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 +1403,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.(*AutoDepositStatusResponse); i { case 0: return &v.state case 1: @@ -1013,7 +1415,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.(*CancelAutoDepositResponse); i { case 0: return &v.state case 1: @@ -1025,7 +1427,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.(*AutoDeposit); i { case 0: return &v.state case 1: @@ -1037,7 +1439,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.(*EmptyMessage); i { case 0: return &v.state case 1: @@ -1049,6 +1451,66 @@ func file_bidderapi_v1_bidderapi_proto_init() { } } file_bidderapi_v1_bidderapi_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetDepositRequest); 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.(*WithdrawRequest); 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.(*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.(*WithdrawFromSpecificWindowsRequest); 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.(*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 @@ -1067,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: 8, + 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 32da4ca38..5ca57f483 100644 --- a/p2p/gen/go/bidderapi/v1/bidderapi.pb.gw.go +++ b/p2p/gen/go/bidderapi/v1/bidderapi.pb.gw.go @@ -123,55 +123,197 @@ func local_request_Bidder_Deposit_0(ctx context.Context, marshaler runtime.Marsh } var ( - filter_Bidder_GetDeposit_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} + 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_GetDeposit_0(ctx context.Context, marshaler runtime.Marshaler, client BidderClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetDepositRequest +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_GetDeposit_0); err != nil { + 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.GetDeposit(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + msg, err := client.AutoDeposit(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err } -func local_request_Bidder_GetDeposit_0(ctx context.Context, marshaler runtime.Marshaler, server BidderServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetDepositRequest +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_GetDeposit_0); err != nil { + 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.GetDeposit(ctx, &protoReq) + 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 + +} + +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_GetMinDeposit_0(ctx context.Context, marshaler runtime.Marshaler, client BidderClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { +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.GetMinDeposit(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + msg, err := client.CancelAndWithdrawAutoDeposit(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) { +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.GetMinDeposit(ctx, &protoReq) + msg, err := server.CancelAndWithdrawAutoDeposit(ctx, &protoReq) + return msg, metadata, err + +} + +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)} +) + +func request_Bidder_GetDeposit_0(ctx context.Context, marshaler runtime.Marshaler, client BidderClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetDepositRequest + 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_GetDeposit_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.GetDeposit(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Bidder_GetDeposit_0(ctx context.Context, marshaler runtime.Marshaler, server BidderServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetDepositRequest + 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_GetDeposit_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.GetDeposit(ctx, &protoReq) return msg, metadata, err } @@ -250,7 +392,7 @@ func RegisterBidderHandlerServer(ctx context.Context, mux *runtime.ServeMux, ser }) - mux.Handle("GET", pattern_Bidder_GetDeposit_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + 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 @@ -258,12 +400,12 @@ func RegisterBidderHandlerServer(ctx context.Context, mux *runtime.ServeMux, ser inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/bidderapi.v1.Bidder/GetDeposit", runtime.WithHTTPPathPattern("/v1/bidder/get_deposit")) + 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_GetDeposit_0(annotatedContext, inboundMarshaler, server, req, pathParams) + 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 { @@ -271,11 +413,111 @@ func RegisterBidderHandlerServer(ctx context.Context, mux *runtime.ServeMux, ser return } - forward_Bidder_GetDeposit_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + 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_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("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_GetMinDeposit_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + 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() var stream runtime.ServerTransportStream @@ -283,12 +525,12 @@ func RegisterBidderHandlerServer(ctx context.Context, mux *runtime.ServeMux, ser 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")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/bidderapi.v1.Bidder/GetDeposit", runtime.WithHTTPPathPattern("/v1/bidder/get_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) + resp, md, err := local_request_Bidder_GetDeposit_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 { @@ -296,7 +538,7 @@ func RegisterBidderHandlerServer(ctx context.Context, mux *runtime.ServeMux, ser return } - forward_Bidder_GetMinDeposit_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Bidder_GetDeposit_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) @@ -410,47 +652,135 @@ func RegisterBidderHandlerClient(ctx context.Context, mux *runtime.ServeMux, cli }) - mux.Handle("GET", pattern_Bidder_GetDeposit_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + 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/GetDeposit", runtime.WithHTTPPathPattern("/v1/bidder/get_deposit")) + 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_GetDeposit_0(annotatedContext, inboundMarshaler, client, req, pathParams) + 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_GetDeposit_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + 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_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("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_GetMinDeposit_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + 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() 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")) + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/bidderapi.v1.Bidder/GetDeposit", runtime.WithHTTPPathPattern("/v1/bidder/get_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) + resp, md, err := request_Bidder_GetDeposit_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()...) + forward_Bidder_GetDeposit_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) @@ -484,9 +814,17 @@ 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_GetDeposit_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "bidder", "get_deposit"}, "")) + 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_GetMinDeposit_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "bidder", "get_min_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_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"}, "")) ) @@ -496,9 +834,17 @@ var ( forward_Bidder_Deposit_0 = runtime.ForwardResponseMessage - forward_Bidder_GetDeposit_0 = runtime.ForwardResponseMessage + forward_Bidder_AutoDeposit_0 = runtime.ForwardResponseMessage - forward_Bidder_GetMinDeposit_0 = runtime.ForwardResponseMessage + forward_Bidder_CancelAutoDeposit_0 = runtime.ForwardResponseMessage + + forward_Bidder_AutoDepositStatus_0 = runtime.ForwardResponseMessage + + 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 6af2bd228..31db88bed 100644 --- a/p2p/gen/go/bidderapi/v1/bidderapi_grpc.pb.go +++ b/p2p/gen/go/bidderapi/v1/bidderapi_grpc.pb.go @@ -19,11 +19,15 @@ 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_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" ) // BidderClient is the client API for Bidder service. @@ -38,14 +42,30 @@ 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) (*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) + // 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. 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. @@ -103,20 +123,60 @@ func (c *bidderClient) Deposit(ctx context.Context, in *DepositRequest, opts ... return out, nil } -func (c *bidderClient) GetDeposit(ctx context.Context, in *GetDepositRequest, opts ...grpc.CallOption) (*DepositResponse, error) { +func (c *bidderClient) AutoDeposit(ctx context.Context, in *DepositRequest, opts ...grpc.CallOption) (*AutoDepositResponse, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(DepositResponse) - err := c.cc.Invoke(ctx, Bidder_GetDeposit_FullMethodName, in, out, cOpts...) + 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) (*CancelAutoDepositResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(CancelAutoDepositResponse) + err := c.cc.Invoke(ctx, Bidder_CancelAutoDeposit_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + 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) 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) GetMinDeposit(ctx context.Context, in *EmptyMessage, opts ...grpc.CallOption) (*DepositResponse, error) { +func (c *bidderClient) GetDeposit(ctx context.Context, in *GetDepositRequest, 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...) + err := c.cc.Invoke(ctx, Bidder_GetDeposit_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -145,14 +205,30 @@ 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) (*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) + // 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. 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. @@ -170,12 +246,24 @@ 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) (*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) 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") } -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") } @@ -231,38 +319,110 @@ func _Bidder_Deposit_Handler(srv interface{}, ctx context.Context, dec func(inte 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) +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).GetDeposit(ctx, in) + return srv.(BidderServer).AutoDeposit(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: Bidder_GetDeposit_FullMethodName, + FullMethod: Bidder_AutoDeposit_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(BidderServer).GetDeposit(ctx, req.(*GetDepositRequest)) + 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_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_GetMinDeposit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +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).GetMinDeposit(ctx, in) + 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_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 { + return nil, err + } + if interceptor == nil { + return srv.(BidderServer).GetDeposit(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: Bidder_GetMinDeposit_FullMethodName, + FullMethod: Bidder_GetDeposit_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(BidderServer).GetMinDeposit(ctx, req.(*EmptyMessage)) + return srv.(BidderServer).GetDeposit(ctx, req.(*GetDepositRequest)) } return interceptor(ctx, in, info, handler) } @@ -297,12 +457,28 @@ var Bidder_ServiceDesc = grpc.ServiceDesc{ Handler: _Bidder_Deposit_Handler, }, { - MethodName: "GetDeposit", - Handler: _Bidder_GetDeposit_Handler, + MethodName: "AutoDeposit", + Handler: _Bidder_AutoDeposit_Handler, + }, + { + MethodName: "CancelAutoDeposit", + Handler: _Bidder_CancelAutoDeposit_Handler, }, { - MethodName: "GetMinDeposit", - Handler: _Bidder_GetMinDeposit_Handler, + MethodName: "AutoDepositStatus", + Handler: _Bidder_AutoDepositStatus_Handler, + }, + { + MethodName: "CancelAndWithdrawAutoDeposit", + Handler: _Bidder_CancelAndWithdrawAutoDeposit_Handler, + }, + { + MethodName: "WithdrawFromSpecificWindows", + Handler: _Bidder_WithdrawFromSpecificWindows_Handler, + }, + { + MethodName: "GetDeposit", + Handler: _Bidder_GetDeposit_Handler, }, { MethodName: "Withdraw", diff --git a/p2p/gen/openapi/bidderapi/v1/bidderapi.swagger.yaml b/p2p/gen/openapi/bidderapi/v1/bidderapi.swagger.yaml index 0fbdabdbd..b36914f94 100644 --- a/p2p/gen/openapi/bidderapi/v1/bidderapi.swagger.yaml +++ b/p2p/gen/openapi/bidderapi/v1/bidderapi.swagger.yaml @@ -10,6 +10,52 @@ 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/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 @@ -37,6 +83,34 @@ 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 + 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/v1CancelAutoDepositResponse' + default: + description: An unexpected error response. + schema: + $ref: '#/definitions/googlerpcStatus' /v1/bidder/deposit/{amount}: post: summary: Deposit @@ -90,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 @@ -125,7 +185,39 @@ 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 + properties: + amount: + type: string + windowNumber: + type: string + format: uint64 bidderapiv1Bid: type: object example: @@ -182,6 +274,59 @@ 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 + 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/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 7d00a1709..daf0b24b0 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 ( @@ -90,8 +89,6 @@ var ( ) ) -var deposits = map[uint64]struct{}{} - func main() { flag.Parse() @@ -148,34 +145,27 @@ 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 - } + // set as 1 eth + minDeposit, set := big.NewInt(0).SetString("1000000000000000000", 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 @@ -278,64 +268,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.go b/p2p/pkg/depositmanager/autodeposit.go new file mode 100644 index 000000000..ac8f49e79 --- /dev/null +++ b/p2p/pkg/depositmanager/autodeposit.go @@ -0,0 +1,266 @@ +package depositmanager + +import ( + "context" + "fmt" + "log/slog" + "math/big" + "sort" + "sync" + "sync/atomic" + + "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" + "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 sync.Map + windowChan chan *blocktracker.BlocktrackerNewWindow + eventMgr events.EventManager + isWorking atomic.Bool + brContract BidderRegistryContract + optsGetter OptsGetter + logger *slog.Logger + mu sync.Mutex + cancelFunc context.CancelFunc +} + +func NewAutoDepositTracker( + evtMgr events.EventManager, + brContract BidderRegistryContract, + optsGetter OptsGetter, + logger *slog.Logger, +) *AutoDepositTracker { + return &AutoDepositTracker{ + eventMgr: evtMgr, + brContract: brContract, + optsGetter: optsGetter, + windowChan: make(chan *blocktracker.BlocktrackerNewWindow, 1), + logger: logger, + } +} + +func (adt *AutoDepositTracker) DoAutoMoveToAnotherWindow(ctx context.Context, ads []*bidderapiv1.AutoDeposit) error { + 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) + } + + 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 { + adt.isWorking.Store(false) + return fmt.Errorf("error subscribing to event: %w", err) + } + + eg.Go(func() error { + defer sub.Unsubscribe() + + for { + select { + case <-egCtx.Done(): + adt.logger.Info("context done") + return nil + case window := <-adt.windowChan: + fromWindow := new(big.Int).Sub(window.Window, big.NewInt(1)) + if _, ok := adt.deposits.Load(fromWindow.Uint64()); !ok { + continue + } + toWindow := new(big.Int).Add(window.Window, big.NewInt(2)) + + 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) + adt.deposits.Delete(fromWindow.Uint64()) + adt.deposits.Store(toWindow.Uint64(), true) + case err := <-sub.Err(): + return fmt.Errorf("error in event subscription: %w", err) + } + } + }) + + started := make(chan struct{}) + go func() { + close(started) + if err := eg.Wait(); err != nil { + adt.logger.Error("error in errgroup", "err", err) + } + adt.isWorking.Store(false) + }() + select { + case <-ctx.Done(): + adt.isWorking.Store(false) + return ctx.Err() + case <-started: + } + return nil +} + +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") + } + if adt.cancelFunc != nil { + adt.cancelFunc() + } + var windowNumbers []*wrapperspb.UInt64Value + + 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, + }, 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(context.Background()) + 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) { + 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() +} diff --git a/p2p/pkg/depositmanager/autodeposit_test.go b/p2p/pkg/depositmanager/autodeposit_test.go new file mode 100644 index 000000000..01f0e225d --- /dev/null +++ b/p2p/pkg/depositmanager/autodeposit_test.go @@ -0,0 +1,137 @@ +package depositmanager_test + +import ( + "context" + "io" + "math/big" + "strings" + "sync/atomic" + "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) + 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) { + return m.MoveDepositToWindowFunc(opts, fromWindow, toWindow) +} + +func (m *MockBidderRegistryContract) WithdrawFromSpecificWindows(opts *bind.TransactOpts, windows []*big.Int) (*types.Transaction, error) { + return m.WithdrawFromSpecificWindowsFunc(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{} + + // 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.Store(true) + 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))) + + time.Sleep(100 * time.Millisecond) + + 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 + 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]) + } + } + 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.Load() { + t.Fatalf("expected WithdrawFromSpecificWindows to be called") + } +} 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..b019d792f 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,19 +57,29 @@ func NewService( optsGetter: optsGetter, logger: logger, metrics: newMetrics(), + autoDepositTracker: autoDepositTracker, validator: validator, } } +type AutoDepositTracker interface { + 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 { 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) + WithdrawFromSpecificWindows(*bind.TransactOpts, []*big.Int) (*types.Transaction, error) ParseBidderRegistered(types.Log) (*bidderregistry.BidderregistryBidderRegistered, error) ParseBidderWithdrawal(types.Log) (*bidderregistry.BidderregistryBidderWithdrawal, error) } @@ -147,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, stop and then deposit") + } + currentWindow, err := s.blockTrackerContract.GetCurrentWindow() if err != nil { return nil, status.Errorf(codes.Internal, "getting current window: %v", err) @@ -243,21 +259,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, @@ -267,6 +268,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() @@ -316,3 +321,212 @@ 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) + } + 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) + } + + 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 { + 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( + "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) 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) + } + return &bidderapiv1.CancelAutoDepositResponse{ + WindowNumbers: cancelResponse.WindowNumbers, + }, nil +} + +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) + } + 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) 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, +) (*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 710c2e4cc..898f6e38c 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) { @@ -88,6 +87,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, @@ -100,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, @@ -118,6 +118,48 @@ 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 +} + +func (t *testAutoDepositTracker) DoAutoMoveToAnotherWindow(ctx context.Context, ads []*bidderapiv1.AutoDeposit) error { + t.isWorking = true + for _, ad := range ads { + t.deposits[ad.WindowNumber.Value] = true + } + + return nil +} + +func (t *testAutoDepositTracker) IsWorking() bool { + return t.isWorking +} + +func (t *testAutoDepositTracker) GetStatus() (map[uint64]bool, bool) { + return t.deposits, t.isWorking +} + +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) WithdrawAutoDeposit(ctx context.Context, windowNumbers []*wrapperspb.UInt64Value) error { + return nil +} + type testTxWatcher struct { nonce int } @@ -159,9 +201,10 @@ 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)} srvImpl := bidderapi.NewService( owner, blockTrackerContract.blocksPerWindow, @@ -176,6 +219,7 @@ func startServer(t *testing.T) bidderapiv1.BidderClient { Context: ctx, }, nil }, + testAutoDepositTracker, logger, ) @@ -267,16 +311,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 77391c04c..f69048766 100644 --- a/p2p/rpc/bidderapi/v1/bidderapi.proto +++ b/p2p/rpc/bidderapi/v1/bidderapi.proto @@ -34,6 +34,42 @@ 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 (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"}; + } + + // 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. @@ -42,12 +78,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. @@ -103,6 +133,44 @@ 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 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; +} message EmptyMessage {}; message GetDepositRequest { @@ -146,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: {