From f2535205bbc52b6ace826171e5962c9d8e973276 Mon Sep 17 00:00:00 2001 From: Kartik Chopra Date: Thu, 20 Jun 2024 15:17:56 +0200 Subject: [PATCH 01/41] feat: adds more txn metadata to block cache --- oracle/pkg/updater/updater.go | 1 + oracle/pkg/updater/updater_test.go | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/oracle/pkg/updater/updater.go b/oracle/pkg/updater/updater.go index 1f1ae92e5..d00e03f23 100644 --- a/oracle/pkg/updater/updater.go +++ b/oracle/pkg/updater/updater.go @@ -92,6 +92,7 @@ type Oracle interface { type EVMClient interface { BlockByNumber(ctx context.Context, number *big.Int) (*types.Block, error) + TransactionReceipt(ctx context.Context, txHash common.Hash) (*types.Receipt, error) } type Updater struct { diff --git a/oracle/pkg/updater/updater_test.go b/oracle/pkg/updater/updater_test.go index 12176098d..21475d1d6 100644 --- a/oracle/pkg/updater/updater_test.go +++ b/oracle/pkg/updater/updater_test.go @@ -1127,6 +1127,10 @@ func (t *testEVMClient) BlockByNumber(ctx context.Context, blkNum *big.Int) (*ty return blk, nil } +func (t *testEVMClient) TransactionReceipt(ctx context.Context, txHash common.Hash) (*types.Receipt, error) { + return &types.Receipt{Status: 1}, nil +} + type processedCommitment struct { commitmentIdx [32]byte blockNum *big.Int From b671c6472bee277d750e0cb6c1a27d2d56211c86 Mon Sep 17 00:00:00 2001 From: Kartik Chopra Date: Thu, 20 Jun 2024 15:32:52 +0200 Subject: [PATCH 02/41] feat: request receipts concurrently --- oracle/pkg/updater/updater.go | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/oracle/pkg/updater/updater.go b/oracle/pkg/updater/updater.go index d00e03f23..ff57ebae2 100644 --- a/oracle/pkg/updater/updater.go +++ b/oracle/pkg/updater/updater.go @@ -481,7 +481,30 @@ func (u *Updater) getL1Txns(ctx context.Context, blockNum uint64) (map[string]Tx return nil, fmt.Errorf("failed to get block by number: %w", err) } +<<<<<<< HEAD u.logger.Info("retrieved block", "blockNum", blockNum, "blockHash", block.Hash().Hex()) +======= + txnsInBlock := make(map[string]TxMetadata) + var wg sync.WaitGroup + var mu sync.Mutex + for posInBlock, tx := range blk.Transactions() { + wg.Add(1) + go func(posInBlock int, tx *types.Transaction) { + defer wg.Done() + receipt, err := u.l1Client.TransactionReceipt(ctx, tx.Hash()) + if err != nil { + u.logger.Error("failed to get transaction receipt", "txHash", tx.Hash().Hex(), "error", err) + return + } + txSucceeded := receipt.Status == 1 + mu.Lock() + txnsInBlock[strings.TrimPrefix(tx.Hash().Hex(), "0x")] = TxMetadata{PosInBlock: posInBlock, Succeeded: txSucceeded} + mu.Unlock() + }(posInBlock, tx) + } + wg.Wait() + _ = u.l1BlockCache.Add(blockNum, txnsInBlock) +>>>>>>> e18f314 (feat: request receipts concurrently) var txnReceipts sync.Map eg, ctx := errgroup.WithContext(ctx) From 3b310d68b7689a549c936e0e936ba1ff60895d80 Mon Sep 17 00:00:00 2001 From: Kartik Chopra Date: Thu, 20 Jun 2024 15:38:06 +0200 Subject: [PATCH 03/41] feat: cleanup code --- oracle/pkg/updater/updater.go | 38 ++++++++++++++++++++++++----------- 1 file changed, 26 insertions(+), 12 deletions(-) diff --git a/oracle/pkg/updater/updater.go b/oracle/pkg/updater/updater.go index ff57ebae2..5509e5e95 100644 --- a/oracle/pkg/updater/updater.go +++ b/oracle/pkg/updater/updater.go @@ -464,6 +464,7 @@ func (u *Updater) addSettlement( return nil } + func (u *Updater) getL1Txns(ctx context.Context, blockNum uint64) (map[string]TxMetadata, error) { txns, ok := u.l1BlockCache.Get(blockNum) if ok { @@ -487,22 +488,35 @@ func (u *Updater) getL1Txns(ctx context.Context, blockNum uint64) (map[string]Tx txnsInBlock := make(map[string]TxMetadata) var wg sync.WaitGroup var mu sync.Mutex - for posInBlock, tx := range blk.Transactions() { - wg.Add(1) - go func(posInBlock int, tx *types.Transaction) { - defer wg.Done() - receipt, err := u.l1Client.TransactionReceipt(ctx, tx.Hash()) - if err != nil { - u.logger.Error("failed to get transaction receipt", "txHash", tx.Hash().Hex(), "error", err) - return - } - txSucceeded := receipt.Status == 1 + var receiptErr error + + processTransactionMetadata := func(posInBlock int, tx *types.Transaction) { + defer wg.Done() + receipt, err := u.l1Client.TransactionReceipt(ctx, tx.Hash()) + if err != nil { + u.logger.Error("failed to get transaction receipt", "txHash", tx.Hash().Hex(), "error", err) mu.Lock() - txnsInBlock[strings.TrimPrefix(tx.Hash().Hex(), "0x")] = TxMetadata{PosInBlock: posInBlock, Succeeded: txSucceeded} + receiptErr = err mu.Unlock() - }(posInBlock, tx) + return + } + txSucceeded := receipt.Status == 1 + mu.Lock() + txnsInBlock[strings.TrimPrefix(tx.Hash().Hex(), "0x")] = TxMetadata{PosInBlock: posInBlock, Succeeded: txSucceeded} + mu.Unlock() } + + for posInBlock, tx := range block.Transactions() { + wg.Add(1) + go processTransactionMetadata(posInBlock, tx) + } + wg.Wait() + + if receiptErr != nil { + return nil, receiptErr + } + _ = u.l1BlockCache.Add(blockNum, txnsInBlock) >>>>>>> e18f314 (feat: request receipts concurrently) From a6714d27136a14367744426ec58992dc272ff8da Mon Sep 17 00:00:00 2001 From: Kartik Chopra Date: Thu, 20 Jun 2024 16:25:15 +0200 Subject: [PATCH 04/41] feat: adds txn receipts to tests --- oracle/pkg/updater/updater_test.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/oracle/pkg/updater/updater_test.go b/oracle/pkg/updater/updater_test.go index 21475d1d6..a8ee23820 100644 --- a/oracle/pkg/updater/updater_test.go +++ b/oracle/pkg/updater/updater_test.go @@ -1128,7 +1128,11 @@ func (t *testEVMClient) BlockByNumber(ctx context.Context, blkNum *big.Int) (*ty } func (t *testEVMClient) TransactionReceipt(ctx context.Context, txHash common.Hash) (*types.Receipt, error) { - return &types.Receipt{Status: 1}, nil + receipt, found := t.receipts[txHash.Hex()] + if !found { + return nil, fmt.Errorf("receipt for transaction hash %s not found", txHash.Hex()) + } + return receipt, nil } type processedCommitment struct { From eddc24fe89032b8706f9cdea8449e76229d078de Mon Sep 17 00:00:00 2001 From: Kartik Chopra Date: Thu, 20 Jun 2024 16:43:52 +0200 Subject: [PATCH 05/41] feat: adds a revert check in tests --- oracle/pkg/updater/updater_test.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/oracle/pkg/updater/updater_test.go b/oracle/pkg/updater/updater_test.go index a8ee23820..41953d30e 100644 --- a/oracle/pkg/updater/updater_test.go +++ b/oracle/pkg/updater/updater_test.go @@ -360,7 +360,11 @@ func TestUpdaterRevertedTxns(t *testing.T) { signer := types.NewLondonSigner(big.NewInt(5)) var txns []*types.Transaction +<<<<<<< HEAD for i := range 10 { +======= + for i := 0; i < 10; i++ { +>>>>>>> 1ad9a07 (feat: adds a revert check in tests) txns = append(txns, types.MustSignNewTx(key, signer, &types.DynamicFeeTx{ Nonce: uint64(i + 1), Gas: 1000000, @@ -408,7 +412,11 @@ func TestUpdaterRevertedTxns(t *testing.T) { } // constructing bundles +<<<<<<< HEAD for i := range 10 { +======= + for i := 0; i < 10; i++ { +>>>>>>> 1ad9a07 (feat: adds a revert check in tests) idxBytes := getIdxBytes(int64(i + 10)) bundle := strings.TrimPrefix(txns[i].Hash().Hex(), "0x") @@ -486,12 +494,15 @@ func TestUpdaterRevertedTxns(t *testing.T) { oracle := &testOracle{ commitments: make(chan processedCommitment, 1), } +<<<<<<< HEAD testBatcher := &testBatcher{ failedReceipts: make(map[common.Hash]bool), } for _, txn := range txns { testBatcher.failedReceipts[txn.Hash()] = true } +======= +>>>>>>> 1ad9a07 (feat: adds a revert check in tests) updtr, err := updater.NewUpdater( slog.New(slog.NewTextHandler(io.Discard, nil)), @@ -499,7 +510,10 @@ func TestUpdaterRevertedTxns(t *testing.T) { register, evtMgr, oracle, +<<<<<<< HEAD testBatcher, +======= +>>>>>>> 1ad9a07 (feat: adds a revert check in tests) ) if err != nil { t.Fatal(err) From 43332854dfa60337cd18b3b51791d8482127beed Mon Sep 17 00:00:00 2001 From: Kartik Chopra Date: Mon, 24 Jun 2024 16:04:32 -0400 Subject: [PATCH 06/41] feat: reorganizes the oracle check for revertable txns --- oracle/pkg/updater/updater.go | 52 +++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/oracle/pkg/updater/updater.go b/oracle/pkg/updater/updater.go index 5509e5e95..f74031900 100644 --- a/oracle/pkg/updater/updater.go +++ b/oracle/pkg/updater/updater.go @@ -337,9 +337,15 @@ func (u *Updater) handleOpenedCommitment( ) commitmentTxnHashes := strings.Split(update.TxnHash, ",") + revertableTxnHashes := make(map[string]struct{}) + // We want to temporarily emulate a skip list of transactions that can be either removed or not succeed and still have a valid commitment. + // There are three states: the txn is present and successful, the txn is present but reverted, or the txn is missing entirely. + // We can operate on this with a set inclusion check for revertable txns and a separate check for missing txns. // Ensure Bundle is atomic and present in the block + expectedPos := txns[commitmentTxnHashes[0]].PosInBlock for i := 0; i < len(commitmentTxnHashes); i++ { txnDetails, found := txns[commitmentTxnHashes[i]] +<<<<<<< HEAD if !found || txnDetails.PosInBlock != (txns[commitmentTxnHashes[0]].PosInBlock)+i || !txnDetails.Succeeded { u.logger.Info( "bundle does not satsify commited requirements", @@ -361,7 +367,53 @@ func (u *Updater) handleOpenedCommitment( decayPercentage, winner.Window, ) +======= + if !found { + // NOTE(@ckartik): we can also add droppable here in case that's needed. + if _, revertable := revertableTxnHashes[commitmentTxnHashes[i]]; !revertable { + u.logger.Info( + "bundle is not atomic: transaction missing", + "commitmentIdx", common.Bytes2Hex(update.CommitmentIndex[:]), + "txnHash", commitmentTxnHashes[i], + "blockNumber", update.BlockNumber, + ) + return u.settle(ctx, update, SettlementTypeSlash, decayPercentage, winner.Window) + } + continue // Skip this transaction as it's revertable and missing +>>>>>>> c3cfccb (feat: reorganizes the oracle check for revertable txns) + } + if txnDetails.PosInBlock != expectedPos { + u.logger.Info( + "bundle is not atomic: incorrect position", + "commitmentIdx", common.Bytes2Hex(update.CommitmentIndex[:]), + "txnHash", commitmentTxnHashes[i], + "blockNumber", update.BlockNumber, + "actualPos", txnDetails.PosInBlock, + "expectedPos", expectedPos, + ) + return u.settle(ctx, update, SettlementTypeSlash, decayPercentage, winner.Window) + } + if !txnDetails.Succeeded && revertableTxnHashes[commitmentTxnHashes[i]] == struct{}{} { + u.logger.Info( + "revertable transaction failed", + "commitmentIdx", common.Bytes2Hex(update.CommitmentIndex[:]), + "txnHash", commitmentTxnHashes[i], + "blockNumber", update.BlockNumber, + ) + // This is allowed, so we continue to the next transaction + expectedPos++ // Increment expected position for the next transaction + continue + } + if !txnDetails.Succeeded { + u.logger.Info( + "non-revertable transaction failed", + "commitmentIdx", common.Bytes2Hex(update.CommitmentIndex[:]), + "txnHash", commitmentTxnHashes[i], + "blockNumber", update.BlockNumber, + ) + return u.settle(ctx, update, SettlementTypeSlash, decayPercentage, winner.Window) } + expectedPos++ // Increment expected position for the next transaction } return u.settle( From a86257e2c6232d96a048a0d4fc4e21b2fa10087d Mon Sep 17 00:00:00 2001 From: Kartik Chopra Date: Mon, 24 Jun 2024 16:05:11 -0400 Subject: [PATCH 07/41] feat: adds a todo --- oracle/pkg/updater/updater.go | 1 + 1 file changed, 1 insertion(+) diff --git a/oracle/pkg/updater/updater.go b/oracle/pkg/updater/updater.go index f74031900..a68f1e30c 100644 --- a/oracle/pkg/updater/updater.go +++ b/oracle/pkg/updater/updater.go @@ -337,6 +337,7 @@ func (u *Updater) handleOpenedCommitment( ) commitmentTxnHashes := strings.Split(update.TxnHash, ",") + // TODO(@ckartik): replace this with a set of revertable txns from the bidder revertableTxnHashes := make(map[string]struct{}) // We want to temporarily emulate a skip list of transactions that can be either removed or not succeed and still have a valid commitment. // There are three states: the txn is present and successful, the txn is present but reverted, or the txn is missing entirely. From 2aadb4bf7e1b5632559c894793df353af4acfa9c Mon Sep 17 00:00:00 2001 From: Kartik Chopra Date: Tue, 25 Jun 2024 13:31:53 -0400 Subject: [PATCH 08/41] feat: adds revertinglist to protobuf --- p2p/gen/go/bidderapi/v1/bidderapi.pb.go | 365 ++++++++++-------- .../bidderapi/v1/bidderapi.swagger.yaml | 10 + .../openapi/debugapi/v1/debugapi.swagger.yaml | 2 +- p2p/rpc/bidderapi/v1/bidderapi.proto | 10 + 4 files changed, 224 insertions(+), 163 deletions(-) diff --git a/p2p/gen/go/bidderapi/v1/bidderapi.pb.go b/p2p/gen/go/bidderapi/v1/bidderapi.pb.go index 796b344da..a34e702c3 100644 --- a/p2p/gen/go/bidderapi/v1/bidderapi.pb.go +++ b/p2p/gen/go/bidderapi/v1/bidderapi.pb.go @@ -339,6 +339,7 @@ type Bid struct { BlockNumber int64 `protobuf:"varint,3,opt,name=block_number,json=blockNumber,proto3" json:"block_number,omitempty"` DecayStartTimestamp int64 `protobuf:"varint,4,opt,name=decay_start_timestamp,json=decayStartTimestamp,proto3" json:"decay_start_timestamp,omitempty"` DecayEndTimestamp int64 `protobuf:"varint,5,opt,name=decay_end_timestamp,json=decayEndTimestamp,proto3" json:"decay_end_timestamp,omitempty"` + RevertingTxHashes []string `protobuf:"bytes,6,rep,name=reverting_tx_hashes,json=revertingTxHashes,proto3" json:"reverting_tx_hashes,omitempty"` } func (x *Bid) Reset() { @@ -408,6 +409,13 @@ func (x *Bid) GetDecayEndTimestamp() int64 { return 0 } +func (x *Bid) GetRevertingTxHashes() []string { + if x != nil { + return x.RevertingTxHashes + } + return nil +} + type Commitment struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -424,6 +432,7 @@ type Commitment struct { DecayStartTimestamp int64 `protobuf:"varint,9,opt,name=decay_start_timestamp,json=decayStartTimestamp,proto3" json:"decay_start_timestamp,omitempty"` DecayEndTimestamp int64 `protobuf:"varint,10,opt,name=decay_end_timestamp,json=decayEndTimestamp,proto3" json:"decay_end_timestamp,omitempty"` DispatchTimestamp int64 `protobuf:"varint,11,opt,name=dispatch_timestamp,json=dispatchTimestamp,proto3" json:"dispatch_timestamp,omitempty"` + RevertingTxHashes []string `protobuf:"bytes,12,rep,name=reverting_tx_hashes,json=revertingTxHashes,proto3" json:"reverting_tx_hashes,omitempty"` } func (x *Commitment) Reset() { @@ -535,6 +544,13 @@ func (x *Commitment) GetDispatchTimestamp() int64 { return 0 } +func (x *Commitment) GetRevertingTxHashes() []string { + if x != nil { + return x.RevertingTxHashes + } + return nil +} + var File_bidderapi_v1_bidderapi_proto protoreflect.FileDescriptor var file_bidderapi_v1_bidderapi_proto_rawDesc = []byte{ @@ -678,7 +694,7 @@ var file_bidderapi_v1_bidderapi_proto_rawDesc = []byte{ 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, + 0x20, 0x31, 0x20, 0x7d, 0x22, 0xc3, 0x0d, 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, @@ -747,167 +763,192 @@ var file_bidderapi_v1_bidderapi_proto_rawDesc = []byte{ 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, 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, - 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, + 0x61, 0x79, 0x45, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x9a, + 0x02, 0x0a, 0x13, 0x72, 0x65, 0x76, 0x65, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x74, 0x78, 0x5f, + 0x68, 0x61, 0x73, 0x68, 0x65, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x42, 0xe9, 0x01, 0x92, + 0x41, 0x49, 0x32, 0x47, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x61, 0x72, 0x72, + 0x61, 0x79, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x78, 0x20, 0x68, 0x61, 0x73, 0x68, 0x65, 0x73, 0x20, + 0x74, 0x68, 0x61, 0x74, 0x20, 0x61, 0x72, 0x65, 0x20, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, + 0x20, 0x74, 0x6f, 0x20, 0x72, 0x65, 0x76, 0x65, 0x72, 0x74, 0x20, 0x6f, 0x72, 0x20, 0x62, 0x65, + 0x20, 0x64, 0x69, 0x73, 0x63, 0x61, 0x72, 0x64, 0x65, 0x64, 0x2e, 0xba, 0x48, 0x99, 0x01, 0xba, + 0x01, 0x95, 0x01, 0x0a, 0x13, 0x72, 0x65, 0x76, 0x65, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x74, + 0x78, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x65, 0x73, 0x12, 0x41, 0x72, 0x65, 0x76, 0x65, 0x72, 0x74, + 0x69, 0x6e, 0x67, 0x5f, 0x74, 0x78, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x65, 0x73, 0x20, 0x6d, 0x75, + 0x73, 0x74, 0x20, 0x62, 0x65, 0x20, 0x61, 0x6e, 0x20, 0x61, 0x72, 0x72, 0x61, 0x79, 0x20, 0x6f, + 0x66, 0x20, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x20, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x20, 0x68, 0x61, 0x73, 0x68, 0x65, 0x73, 0x2e, 0x1a, 0x3b, 0x74, 0x68, 0x69, + 0x73, 0x20, 0x3d, 0x3d, 0x20, 0x6e, 0x75, 0x6c, 0x6c, 0x20, 0x7c, 0x7c, 0x20, 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, 0x52, 0x11, 0x72, 0x65, 0x76, 0x65, 0x72, 0x74, + 0x69, 0x6e, 0x67, 0x54, 0x78, 0x48, 0x61, 0x73, 0x68, 0x65, 0x73, 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, 0xda, 0x0b, 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, 0x12, 0x7c, 0x0a, 0x13, 0x72, 0x65, 0x76, + 0x65, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x74, 0x78, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x65, 0x73, + 0x18, 0x0c, 0x20, 0x03, 0x28, 0x09, 0x42, 0x4c, 0x92, 0x41, 0x49, 0x32, 0x47, 0x4f, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x61, 0x72, 0x72, 0x61, 0x79, 0x20, 0x6f, 0x66, 0x20, 0x74, + 0x78, 0x20, 0x68, 0x61, 0x73, 0x68, 0x65, 0x73, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x61, 0x72, + 0x65, 0x20, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x20, 0x74, 0x6f, 0x20, 0x72, 0x65, 0x76, + 0x65, 0x72, 0x74, 0x20, 0x6f, 0x72, 0x20, 0x62, 0x65, 0x20, 0x64, 0x69, 0x73, 0x63, 0x61, 0x72, + 0x64, 0x65, 0x64, 0x2e, 0x52, 0x11, 0x72, 0x65, 0x76, 0x65, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x54, + 0x78, 0x48, 0x61, 0x73, 0x68, 0x65, 0x73, 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, 0x72, 0x61, 0x70, 0x69, 0x2e, + 0x76, 0x31, 0x2e, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x1e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x18, 0x12, 0x16, 0x2f, 0x76, 0x31, 0x2f, + 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x2f, 0x67, 0x65, 0x74, 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, + 0x69, 0x74, 0x12, 0x6e, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x4d, 0x69, 0x6e, 0x44, 0x65, 0x70, 0x6f, + 0x73, 0x69, 0x74, 0x12, 0x1a, 0x2e, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x2e, + 0x76, 0x31, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x1a, + 0x1d, 0x2e, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x44, + 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x22, + 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1c, 0x12, 0x1a, 0x2f, 0x76, 0x31, 0x2f, 0x62, 0x69, 0x64, 0x64, + 0x65, 0x72, 0x2f, 0x67, 0x65, 0x74, 0x5f, 0x6d, 0x69, 0x6e, 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, + 0x69, 0x74, 0x12, 0x66, 0x0a, 0x08, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x12, 0x1d, + 0x2e, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x69, + 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, + 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x69, 0x74, + 0x68, 0x64, 0x72, 0x61, 0x77, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1b, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x15, 0x22, 0x13, 0x2f, 0x76, 0x31, 0x2f, 0x62, 0x69, 0x64, 0x64, 0x65, + 0x72, 0x2f, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x42, 0xaa, 0x02, 0x92, 0x41, 0x72, + 0x12, 0x70, 0x0a, 0x0a, 0x42, 0x69, 0x64, 0x64, 0x65, 0x72, 0x20, 0x41, 0x50, 0x49, 0x2a, 0x55, + 0x0a, 0x1b, 0x42, 0x75, 0x73, 0x69, 0x6e, 0x65, 0x73, 0x73, 0x20, 0x53, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x20, 0x4c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x20, 0x31, 0x2e, 0x31, 0x12, 0x36, 0x68, + 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x65, 0x76, 0x2f, 0x6d, 0x65, 0x76, 0x2d, 0x63, 0x6f, 0x6d, + 0x6d, 0x69, 0x74, 0x2f, 0x62, 0x6c, 0x6f, 0x62, 0x2f, 0x6d, 0x61, 0x69, 0x6e, 0x2f, 0x4c, 0x49, + 0x43, 0x45, 0x4e, 0x53, 0x45, 0x32, 0x0b, 0x31, 0x2e, 0x30, 0x2e, 0x30, 0x2d, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x2e, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x61, 0x70, + 0x69, 0x2e, 0x76, 0x31, 0x42, 0x0e, 0x42, 0x69, 0x64, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x50, + 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x40, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x65, 0x76, 0x2f, 0x6d, 0x65, 0x76, 0x2d, 0x63, 0x6f, + 0x6d, 0x6d, 0x69, 0x74, 0x2f, 0x70, 0x32, 0x70, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x67, 0x6f, 0x2f, + 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x3b, 0x62, 0x69, 0x64, + 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x42, 0x58, 0x58, 0xaa, 0x02, + 0x0c, 0x42, 0x69, 0x64, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0c, + 0x42, 0x69, 0x64, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x18, 0x42, + 0x69, 0x64, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0d, 0x42, 0x69, 0x64, 0x64, 0x65, 0x72, + 0x61, 0x70, 0x69, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/p2p/gen/openapi/bidderapi/v1/bidderapi.swagger.yaml b/p2p/gen/openapi/bidderapi/v1/bidderapi.swagger.yaml index 0fbdabdbd..36a940371 100644 --- a/p2p/gen/openapi/bidderapi/v1/bidderapi.swagger.yaml +++ b/p2p/gen/openapi/bidderapi/v1/bidderapi.swagger.yaml @@ -157,6 +157,11 @@ definitions: type: string format: int64 description: Timestamp at which the bid ends decaying. + revertingTxHashes: + type: array + items: + type: string + description: Optional array of tx hashes that are allowed to revert or be discarded. description: Unsigned bid message from bidders to the bidder mev-commit node. title: Bid message required: @@ -225,6 +230,11 @@ definitions: type: string format: int64 description: Timestamp at which the commitment is published. + revertingTxHashes: + type: array + items: + type: string + description: Optional array of tx hashes that are allowed to revert or be discarded. v1DepositResponse: type: object example: diff --git a/p2p/gen/openapi/debugapi/v1/debugapi.swagger.yaml b/p2p/gen/openapi/debugapi/v1/debugapi.swagger.yaml index 6273729b4..7f1033586 100644 --- a/p2p/gen/openapi/debugapi/v1/debugapi.swagger.yaml +++ b/p2p/gen/openapi/debugapi/v1/debugapi.swagger.yaml @@ -86,7 +86,7 @@ definitions: `NullValue` is a singleton enumeration to represent the null value for the `Value` type union. - The JSON representation for `NullValue` is JSON `null`. + The JSON representation for `NullValue` is JSON `null`. v1CancelTransactionResponse: type: object example: diff --git a/p2p/rpc/bidderapi/v1/bidderapi.proto b/p2p/rpc/bidderapi/v1/bidderapi.proto index 77391c04c..e3836e4ad 100644 --- a/p2p/rpc/bidderapi/v1/bidderapi.proto +++ b/p2p/rpc/bidderapi/v1/bidderapi.proto @@ -192,6 +192,13 @@ message Bid { message: "decay_end_timestamp must be a valid integer.", expression: "uint(this) > 0" }]; + repeated string reverting_tx_hashes = 6 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + description: "Optional array of tx hashes that are allowed to revert or be discarded." + }, (buf.validate.field).cel = { + id: "reverting_tx_hashes", + message: "reverting_tx_hashes must be an array of valid transaction hashes.", + expression: "this == null || this.all(r, r.matches('^[a-fA-F0-9]{64}$'))" + }]; }; message Commitment { @@ -229,4 +236,7 @@ message Commitment { int64 dispatch_timestamp = 11 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { description: "Timestamp at which the commitment is published." }]; + repeated string reverting_tx_hashes = 12 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + description: "Optional array of tx hashes that are allowed to revert or be discarded." + }]; }; From 55e2f75cf57d3fd7a8598672345503c6d97265b0 Mon Sep 17 00:00:00 2001 From: Kartik Chopra Date: Tue, 25 Jun 2024 13:47:32 -0400 Subject: [PATCH 09/41] feat: be more descriptive in sendbid --- p2p/pkg/rpc/bidder/service.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/p2p/pkg/rpc/bidder/service.go b/p2p/pkg/rpc/bidder/service.go index 6c5d99185..e7e98cca2 100644 --- a/p2p/pkg/rpc/bidder/service.go +++ b/p2p/pkg/rpc/bidder/service.go @@ -60,7 +60,7 @@ func NewService( } type PreconfSender interface { - SendBid(context.Context, string, string, int64, int64, int64) (chan *preconfirmationv1.PreConfirmation, error) + SendBid(ctx context.Context, txnsStr string, amount string, blockNumber int64, decayStartTimestamp int64, decayEndTimestamp int64, revertingTxHashes string) (chan *preconfirmationv1.PreConfirmation, error) } type BidderRegistryContract interface { From ddd4a7e86b26adcede82f8c9858861e5c0d7bab5 Mon Sep 17 00:00:00 2001 From: Kartik Chopra Date: Tue, 25 Jun 2024 16:14:54 -0400 Subject: [PATCH 10/41] feat: include reverting txns in sendBid --- p2p/pkg/rpc/bidder/service.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/p2p/pkg/rpc/bidder/service.go b/p2p/pkg/rpc/bidder/service.go index e7e98cca2..79dc4f6c0 100644 --- a/p2p/pkg/rpc/bidder/service.go +++ b/p2p/pkg/rpc/bidder/service.go @@ -99,6 +99,7 @@ func (s *Service) SendBid( } txnsStr := strings.Join(bid.TxHashes, ",") + revertingTxHashesStr := strings.Join(bid.RevertingTxHashes, ",") respC, err := s.sender.SendBid( ctx, @@ -107,6 +108,7 @@ func (s *Service) SendBid( bid.BlockNumber, bid.DecayStartTimestamp, bid.DecayEndTimestamp, + revertingTxHashesStr, ) if err != nil { s.logger.Error("sending bid", "error", err) From 7d4a8330b6e66bcb6777901ef11620905d8d5bd1 Mon Sep 17 00:00:00 2001 From: Kartik Chopra Date: Wed, 26 Jun 2024 12:07:42 -0400 Subject: [PATCH 11/41] chore: use constant --- oracle/pkg/updater/updater.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/oracle/pkg/updater/updater.go b/oracle/pkg/updater/updater.go index a68f1e30c..18554fc53 100644 --- a/oracle/pkg/updater/updater.go +++ b/oracle/pkg/updater/updater.go @@ -553,13 +553,14 @@ func (u *Updater) getL1Txns(ctx context.Context, blockNum uint64) (map[string]Tx mu.Unlock() return } - txSucceeded := receipt.Status == 1 + txSucceeded := receipt.Status == types.ReceiptStatusSuccessful mu.Lock() txnsInBlock[strings.TrimPrefix(tx.Hash().Hex(), "0x")] = TxMetadata{PosInBlock: posInBlock, Succeeded: txSucceeded} mu.Unlock() } for posInBlock, tx := range block.Transactions() { + wg.Add(1) go processTransactionMetadata(posInBlock, tx) } From ac32b4253ab4f33161d75bf7c156bd019d9f29a1 Mon Sep 17 00:00:00 2001 From: Kartik Chopra Date: Wed, 26 Jun 2024 12:35:15 -0400 Subject: [PATCH 12/41] feat: adds reverted txn protobuf --- .../preconfirmation/v1/preconfirmation.pb.go | 15 +- p2p/gen/go/providerapi/v1/providerapi.pb.go | 247 ++++++++++++++++++ .../providerapi/v1/providerapi.swagger.yaml | 5 + .../preconfirmation/v1/preconfirmation.proto | 1 + p2p/pkg/rpc/bidder/service_test.go | 2 + p2p/rpc/providerapi/v1/providerapi.proto | 7 + 6 files changed, 275 insertions(+), 2 deletions(-) diff --git a/p2p/gen/go/preconfirmation/v1/preconfirmation.pb.go b/p2p/gen/go/preconfirmation/v1/preconfirmation.pb.go index 658270046..5a84a90e4 100644 --- a/p2p/gen/go/preconfirmation/v1/preconfirmation.pb.go +++ b/p2p/gen/go/preconfirmation/v1/preconfirmation.pb.go @@ -33,6 +33,7 @@ type Bid struct { DecayStartTimestamp int64 `protobuf:"varint,6,opt,name=decay_start_timestamp,json=decayStartTimestamp,proto3" json:"decay_start_timestamp,omitempty"` DecayEndTimestamp int64 `protobuf:"varint,7,opt,name=decay_end_timestamp,json=decayEndTimestamp,proto3" json:"decay_end_timestamp,omitempty"` NikePublicKey []byte `protobuf:"bytes,8,opt,name=nike_public_key,json=nikePublicKey,proto3" json:"nike_public_key,omitempty"` + RevertingTxHashes string `protobuf:"bytes,9,opt,name=reverting_tx_hashes,json=revertingTxHashes,proto3" json:"reverting_tx_hashes,omitempty"` } func (x *Bid) Reset() { @@ -123,6 +124,13 @@ func (x *Bid) GetNikePublicKey() []byte { return nil } +func (x *Bid) GetRevertingTxHashes() string { + if x != nil { + return x.RevertingTxHashes + } + return "" +} + type EncryptedBid struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -334,7 +342,7 @@ var file_preconfirmation_v1_preconfirmation_proto_rawDesc = []byte{ 0x0a, 0x28, 0x70, 0x72, 0x65, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x72, 0x65, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x12, 0x70, 0x72, 0x65, 0x63, - 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x22, 0xa2, + 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x22, 0xd2, 0x02, 0x0a, 0x03, 0x42, 0x69, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x74, 0x78, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, 0x78, 0x48, 0x61, 0x73, 0x68, 0x12, 0x1d, 0x0a, 0x0a, 0x62, 0x69, 0x64, 0x5f, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, @@ -353,7 +361,10 @@ var file_preconfirmation_v1_preconfirmation_proto_rawDesc = []byte{ 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x69, 0x6b, 0x65, 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0d, 0x6e, 0x69, 0x6b, 0x65, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, - 0x4b, 0x65, 0x79, 0x22, 0x2e, 0x0a, 0x0c, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x65, 0x64, + 0x4b, 0x65, 0x79, 0x12, 0x2e, 0x0a, 0x13, 0x72, 0x65, 0x76, 0x65, 0x72, 0x74, 0x69, 0x6e, 0x67, + 0x5f, 0x74, 0x78, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x65, 0x73, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x11, 0x72, 0x65, 0x76, 0x65, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x54, 0x78, 0x48, 0x61, 0x73, + 0x68, 0x65, 0x73, 0x22, 0x2e, 0x0a, 0x0c, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x65, 0x64, 0x42, 0x69, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x69, 0x70, 0x68, 0x65, 0x72, 0x74, 0x65, 0x78, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x63, 0x69, 0x70, 0x68, 0x65, 0x72, 0x74, 0x65, 0x78, 0x74, 0x22, 0xf1, 0x01, 0x0a, 0x0f, 0x50, 0x72, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, diff --git a/p2p/gen/go/providerapi/v1/providerapi.pb.go b/p2p/gen/go/providerapi/v1/providerapi.pb.go index 80129892c..adab24093 100644 --- a/p2p/gen/go/providerapi/v1/providerapi.pb.go +++ b/p2p/gen/go/providerapi/v1/providerapi.pb.go @@ -231,6 +231,7 @@ type Bid struct { BidDigest []byte `protobuf:"bytes,4,opt,name=bid_digest,json=bidDigest,proto3" json:"bid_digest,omitempty"` DecayStartTimestamp int64 `protobuf:"varint,5,opt,name=decay_start_timestamp,json=decayStartTimestamp,proto3" json:"decay_start_timestamp,omitempty"` DecayEndTimestamp int64 `protobuf:"varint,6,opt,name=decay_end_timestamp,json=decayEndTimestamp,proto3" json:"decay_end_timestamp,omitempty"` + RevertingTxHashes []string `protobuf:"bytes,7,rep,name=reverting_tx_hashes,json=revertingTxHashes,proto3" json:"reverting_tx_hashes,omitempty"` } func (x *Bid) Reset() { @@ -307,6 +308,13 @@ func (x *Bid) GetDecayEndTimestamp() int64 { return 0 } +func (x *Bid) GetRevertingTxHashes() []string { + if x != nil { + return x.RevertingTxHashes + } + return nil +} + type BidResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -387,9 +395,69 @@ var file_providerapi_v1_providerapi_proto_rawDesc = []byte{ 0x01, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x99, 0x01, 0x92, 0x41, 0x3b, 0x32, 0x30, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x45, 0x54, 0x48, 0x20, 0x74, 0x6f, 0x20, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x20, 0x69, 0x6e, +<<<<<<< HEAD 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x20, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 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, +======= + 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x20, 0x70, 0x72, + 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x5f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, + 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, 0x3a, 0x73, 0x92, 0x41, + 0x70, 0x0a, 0x4a, 0x2a, 0x0d, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x20, 0x72, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x32, 0x31, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x20, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, + 0x65, 0x72, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, + 0x65, 0x72, 0x20, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x5f, 0x72, 0x65, 0x67, 0x69, + 0x73, 0x74, 0x72, 0x79, 0x2e, 0xd2, 0x01, 0x05, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x32, 0x22, 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, 0x20, + 0x7d, 0x22, 0xa5, 0x01, 0x0a, 0x0d, 0x53, 0x74, 0x61, 0x6b, 0x65, 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, 0x3a, 0x7c, 0x92, 0x41, 0x79, + 0x0a, 0x53, 0x2a, 0x0e, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x20, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x32, 0x41, 0x47, 0x65, 0x74, 0x20, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x64, 0x20, 0x61, + 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, + 0x65, 0x72, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, + 0x65, 0x72, 0x20, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x5f, 0x72, 0x65, 0x67, 0x69, + 0x73, 0x74, 0x72, 0x79, 0x2e, 0x32, 0x22, 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, 0x20, 0x7d, 0x22, 0x0e, 0x0a, 0x0c, 0x45, 0x6d, 0x70, + 0x74, 0x79, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0xce, 0x0e, 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, 0xfc, 0x01, 0x0a, 0x0a, 0x62, 0x69, 0x64, 0x5f, + 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0xdc, 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, 0x60, 0xba, 0x01, 0x5d, 0x0a, 0x0a, + 0x62, 0x69, 0x64, 0x5f, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x23, 0x62, 0x69, 0x64, 0x5f, +>>>>>>> 380b215 (feat: adds reverted txn protobuf) 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, @@ -551,6 +619,7 @@ var file_providerapi_v1_providerapi_proto_rawDesc = []byte{ 0x42, 0x34, 0x92, 0x41, 0x31, 0x32, 0x2f, 0x44, 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, +<<<<<<< HEAD 0x69, 0x64, 0x64, 0x65, 0x72, 0x2e, 0x52, 0x09, 0x62, 0x69, 0x64, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x12, 0x5f, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x22, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x2e, @@ -651,6 +720,184 @@ var file_providerapi_v1_providerapi_proto_rawDesc = []byte{ 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0f, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +======= + 0x69, 0x64, 0x64, 0x65, 0x72, 0x2e, 0xba, 0x48, 0x06, 0x7a, 0x04, 0x10, 0x01, 0x18, 0x40, 0x52, + 0x09, 0x62, 0x69, 0x64, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 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, 0x05, 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, 0x06, 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, 0x12, 0x9a, 0x02, 0x0a, 0x13, 0x72, + 0x65, 0x76, 0x65, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x74, 0x78, 0x5f, 0x68, 0x61, 0x73, 0x68, + 0x65, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x09, 0x42, 0xe9, 0x01, 0x92, 0x41, 0x49, 0x32, 0x47, + 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x61, 0x72, 0x72, 0x61, 0x79, 0x20, 0x6f, + 0x66, 0x20, 0x74, 0x78, 0x20, 0x68, 0x61, 0x73, 0x68, 0x65, 0x73, 0x20, 0x74, 0x68, 0x61, 0x74, + 0x20, 0x61, 0x72, 0x65, 0x20, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x20, 0x74, 0x6f, 0x20, + 0x72, 0x65, 0x76, 0x65, 0x72, 0x74, 0x20, 0x6f, 0x72, 0x20, 0x62, 0x65, 0x20, 0x64, 0x69, 0x73, + 0x63, 0x61, 0x72, 0x64, 0x65, 0x64, 0x2e, 0xba, 0x48, 0x99, 0x01, 0xba, 0x01, 0x95, 0x01, 0x0a, + 0x13, 0x72, 0x65, 0x76, 0x65, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x74, 0x78, 0x5f, 0x68, 0x61, + 0x73, 0x68, 0x65, 0x73, 0x12, 0x41, 0x72, 0x65, 0x76, 0x65, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x5f, + 0x74, 0x78, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x65, 0x73, 0x20, 0x6d, 0x75, 0x73, 0x74, 0x20, 0x62, + 0x65, 0x20, 0x61, 0x6e, 0x20, 0x61, 0x72, 0x72, 0x61, 0x79, 0x20, 0x6f, 0x66, 0x20, 0x76, 0x61, + 0x6c, 0x69, 0x64, 0x20, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, + 0x68, 0x61, 0x73, 0x68, 0x65, 0x73, 0x2e, 0x1a, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x20, 0x3d, 0x3d, + 0x20, 0x6e, 0x75, 0x6c, 0x6c, 0x20, 0x7c, 0x7c, 0x20, 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, 0x52, 0x11, 0x72, 0x65, 0x76, 0x65, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x54, + 0x78, 0x48, 0x61, 0x73, 0x68, 0x65, 0x73, 0x3a, 0xb0, 0x03, 0x92, 0x41, 0xac, 0x03, 0x0a, 0x70, + 0x2a, 0x0b, 0x42, 0x69, 0x64, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x32, 0x30, 0x53, + 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, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x2e, 0xd2, + 0x01, 0x08, 0x74, 0x78, 0x48, 0x61, 0x73, 0x68, 0x65, 0x73, 0xd2, 0x01, 0x09, 0x62, 0x69, 0x64, + 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0xd2, 0x01, 0x0b, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x75, + 0x6d, 0x62, 0x65, 0x72, 0xd2, 0x01, 0x09, 0x62, 0x69, 0x64, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, + 0x32, 0xb7, 0x02, 0x7b, 0x22, 0x74, 0x78, 0x48, 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, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x22, 0x3a, 0x20, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, + 0x2c, 0x20, 0x22, 0x62, 0x69, 0x64, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x22, 0x3a, 0x20, 0x22, + 0x39, 0x64, 0x4a, 0x69, 0x6e, 0x77, 0x4c, 0x2b, 0x46, 0x5a, 0x36, 0x42, 0x31, 0x78, 0x73, 0x49, + 0x51, 0x51, 0x6f, 0x38, 0x74, 0x38, 0x42, 0x30, 0x5a, 0x58, 0x4a, 0x75, 0x62, 0x4a, 0x77, 0x59, + 0x38, 0x36, 0x6c, 0x2f, 0x59, 0x75, 0x37, 0x79, 0x41, 0x48, 0x31, 0x35, 0x39, 0x51, 0x72, 0x50, + 0x48, 0x55, 0x30, 0x71, 0x6a, 0x32, 0x50, 0x2b, 0x59, 0x46, 0x6a, 0x2b, 0x6c, 0x6c, 0x62, 0x75, + 0x49, 0x31, 0x5a, 0x79, 0x67, 0x64, 0x78, 0x47, 0x73, 0x58, 0x38, 0x2b, 0x50, 0x33, 0x62, 0x79, + 0x4d, 0x45, 0x41, 0x35, 0x69, 0x67, 0x3d, 0x3d, 0x22, 0x7d, 0x22, 0x81, 0x06, 0x0a, 0x0b, 0x42, + 0x69, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x53, 0x0a, 0x0a, 0x62, 0x69, + 0x64, 0x5f, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x34, + 0x92, 0x41, 0x31, 0x32, 0x2f, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x20, 0x6f, 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, 0x09, 0x62, 0x69, 0x64, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x12, + 0x5f, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, + 0x22, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, + 0x2e, 0x42, 0x69, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x53, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x42, 0x23, 0x92, 0x41, 0x14, 0x32, 0x12, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x62, 0x69, 0x64, 0x2e, 0xba, 0x48, 0x09, 0x82, + 0x01, 0x06, 0x10, 0x01, 0x1a, 0x02, 0x01, 0x02, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x12, 0xb4, 0x01, 0x0a, 0x12, 0x64, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x74, 0x69, + 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x42, 0x84, 0x01, + 0x92, 0x41, 0x80, 0x01, 0x32, 0x7e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x20, + 0x61, 0x74, 0x20, 0x77, 0x68, 0x69, 0x63, 0x68, 0x20, 0x74, 0x68, 0x65, 0x20, 0x63, 0x6f, 0x6d, + 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x69, 0x73, 0x20, 0x61, 0x63, 0x63, 0x65, 0x70, + 0x74, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x20, + 0x61, 0x6e, 0x64, 0x20, 0x69, 0x73, 0x20, 0x75, 0x73, 0x65, 0x64, 0x20, 0x74, 0x6f, 0x20, 0x63, + 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x65, 0x78, 0x70, 0x65, 0x63, + 0x74, 0x65, 0x64, 0x20, 0x72, 0x65, 0x76, 0x65, 0x6e, 0x75, 0x65, 0x20, 0x66, 0x72, 0x6f, 0x6d, + 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x72, 0x65, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x11, 0x64, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x54, 0x69, + 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x22, 0x4a, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x12, 0x16, 0x0a, 0x12, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x55, 0x4e, 0x53, 0x50, + 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x13, 0x0a, 0x0f, 0x53, 0x54, 0x41, + 0x54, 0x55, 0x53, 0x5f, 0x41, 0x43, 0x43, 0x45, 0x50, 0x54, 0x45, 0x44, 0x10, 0x01, 0x12, 0x13, + 0x0a, 0x0f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x52, 0x45, 0x4a, 0x45, 0x43, 0x54, 0x45, + 0x44, 0x10, 0x02, 0x3a, 0xb8, 0x02, 0x92, 0x41, 0xb4, 0x02, 0x0a, 0x82, 0x01, 0x2a, 0x0c, 0x42, + 0x69, 0x64, 0x20, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0x44, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x20, 0x73, 0x65, 0x6e, 0x74, 0x20, 0x62, 0x79, 0x20, 0x74, 0x68, + 0x65, 0x20, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, + 0x74, 0x68, 0x65, 0x20, 0x64, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x6e, 0x20, + 0x74, 0x68, 0x65, 0x20, 0x62, 0x69, 0x64, 0x20, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, + 0x2e, 0xd2, 0x01, 0x09, 0x62, 0x69, 0x64, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0xd2, 0x01, 0x06, + 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0xd2, 0x01, 0x16, 0x64, 0x65, 0x63, 0x61, 0x79, 0x44, 0x69, + 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x32, + 0xac, 0x01, 0x7b, 0x22, 0x62, 0x69, 0x64, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x22, 0x3a, 0x20, + 0x22, 0x39, 0x64, 0x4a, 0x69, 0x6e, 0x77, 0x4c, 0x2b, 0x46, 0x5a, 0x36, 0x42, 0x31, 0x78, 0x73, + 0x49, 0x51, 0x51, 0x6f, 0x38, 0x74, 0x38, 0x42, 0x30, 0x5a, 0x58, 0x4a, 0x75, 0x62, 0x4a, 0x77, + 0x59, 0x38, 0x36, 0x6c, 0x2f, 0x59, 0x75, 0x37, 0x79, 0x41, 0x48, 0x31, 0x35, 0x39, 0x51, 0x72, + 0x50, 0x48, 0x55, 0x30, 0x71, 0x6a, 0x32, 0x50, 0x2b, 0x59, 0x46, 0x6a, 0x2b, 0x6c, 0x6c, 0x62, + 0x75, 0x49, 0x31, 0x5a, 0x79, 0x67, 0x64, 0x78, 0x47, 0x73, 0x58, 0x38, 0x2b, 0x50, 0x33, 0x62, + 0x79, 0x4d, 0x45, 0x41, 0x35, 0x69, 0x67, 0x3d, 0x3d, 0x22, 0x2c, 0x20, 0x22, 0x73, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x22, 0x3a, 0x20, 0x22, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x41, 0x43, + 0x43, 0x45, 0x50, 0x54, 0x45, 0x44, 0x22, 0x2c, 0x20, 0x22, 0x64, 0x65, 0x63, 0x61, 0x79, 0x44, + 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, + 0x22, 0x3a, 0x20, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x30, 0x7d, 0x32, 0xc5, + 0x04, 0x0a, 0x08, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x12, 0x65, 0x0a, 0x0b, 0x52, + 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x42, 0x69, 0x64, 0x73, 0x12, 0x1c, 0x2e, 0x70, 0x72, 0x6f, + 0x76, 0x69, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x6d, 0x70, 0x74, + 0x79, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x1a, 0x13, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, + 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x69, 0x64, 0x22, 0x21, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x1b, 0x12, 0x19, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x76, 0x69, + 0x64, 0x65, 0x72, 0x2f, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x5f, 0x62, 0x69, 0x64, 0x73, + 0x30, 0x01, 0x12, 0x7d, 0x0a, 0x11, 0x53, 0x65, 0x6e, 0x64, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, + 0x73, 0x65, 0x64, 0x42, 0x69, 0x64, 0x73, 0x12, 0x1b, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, + 0x65, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x69, 0x64, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x1c, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x4d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x22, 0x2b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x25, 0x3a, 0x01, 0x2a, 0x22, 0x20, 0x2f, + 0x76, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x2f, 0x73, 0x65, 0x6e, 0x64, + 0x5f, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x65, 0x64, 0x5f, 0x62, 0x69, 0x64, 0x73, 0x28, + 0x01, 0x12, 0x7a, 0x0a, 0x0d, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x53, 0x74, 0x61, + 0x6b, 0x65, 0x12, 0x1c, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, + 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x1d, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x76, + 0x31, 0x2e, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x2c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x26, 0x22, 0x24, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x72, 0x6f, + 0x76, 0x69, 0x64, 0x65, 0x72, 0x2f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x73, + 0x74, 0x61, 0x6b, 0x65, 0x2f, 0x7b, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x7d, 0x12, 0x67, 0x0a, + 0x08, 0x47, 0x65, 0x74, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x12, 0x1c, 0x2e, 0x70, 0x72, 0x6f, 0x76, + 0x69, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, + 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x1a, 0x1d, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, + 0x65, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x18, 0x12, 0x16, + 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x2f, 0x67, 0x65, 0x74, + 0x5f, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x12, 0x6e, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x4d, 0x69, 0x6e, + 0x53, 0x74, 0x61, 0x6b, 0x65, 0x12, 0x1c, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, + 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x4d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x1a, 0x1d, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x61, 0x70, + 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x22, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1c, 0x12, 0x1a, 0x2f, 0x76, 0x31, 0x2f, + 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x2f, 0x67, 0x65, 0x74, 0x5f, 0x6d, 0x69, 0x6e, + 0x5f, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x42, 0xbc, 0x02, 0x92, 0x41, 0x74, 0x12, 0x72, 0x0a, 0x0c, + 0x50, 0x72, 0x6f, 0x76, 0x69, 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, 0x12, 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x61, 0x70, + 0x69, 0x2e, 0x76, 0x31, 0x42, 0x10, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x61, 0x70, + 0x69, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x44, 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, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, + 0x3b, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x76, 0x31, 0xa2, 0x02, + 0x03, 0x50, 0x58, 0x58, 0xaa, 0x02, 0x0e, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x61, + 0x70, 0x69, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0e, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, + 0x61, 0x70, 0x69, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1a, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, + 0x72, 0x61, 0x70, 0x69, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, + 0x61, 0x74, 0x61, 0xea, 0x02, 0x0f, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x61, 0x70, + 0x69, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +>>>>>>> 380b215 (feat: adds reverted txn protobuf) } var ( diff --git a/p2p/gen/openapi/providerapi/v1/providerapi.swagger.yaml b/p2p/gen/openapi/providerapi/v1/providerapi.swagger.yaml index adfdab05b..35f648303 100644 --- a/p2p/gen/openapi/providerapi/v1/providerapi.swagger.yaml +++ b/p2p/gen/openapi/providerapi/v1/providerapi.swagger.yaml @@ -165,6 +165,11 @@ definitions: type: string format: int64 description: Timestamp at which the bid ends decaying. + revertingTxHashes: + type: array + items: + type: string + description: Optional array of tx hashes that are allowed to revert or be discarded. description: Signed bid message from bidders to the provider. title: Bid message required: diff --git a/p2p/messages/preconfirmation/v1/preconfirmation.proto b/p2p/messages/preconfirmation/v1/preconfirmation.proto index 43b6a515f..34ebd71f9 100644 --- a/p2p/messages/preconfirmation/v1/preconfirmation.proto +++ b/p2p/messages/preconfirmation/v1/preconfirmation.proto @@ -11,6 +11,7 @@ message Bid { int64 decay_start_timestamp = 6; int64 decay_end_timestamp = 7; bytes nike_public_key = 8; + string reverting_tx_hashes = 9; }; message EncryptedBid { diff --git a/p2p/pkg/rpc/bidder/service_test.go b/p2p/pkg/rpc/bidder/service_test.go index 710c2e4cc..d67fdc546 100644 --- a/p2p/pkg/rpc/bidder/service_test.go +++ b/p2p/pkg/rpc/bidder/service_test.go @@ -48,6 +48,7 @@ func (s *testSender) SendBid( blockNum int64, decayStartTimestamp int64, decayEndTimestamp int64, + revertedTxns string, ) (chan *preconfpb.PreConfirmation, error) { s.bids = append(s.bids, bid{ txHex: txHex, @@ -66,6 +67,7 @@ func (s *testSender) SendBid( DecayEndTimestamp: decayEndTimestamp, Digest: []byte("digest"), Signature: []byte("signature"), + RevertingTxHashes: revertedTxns, }, Digest: []byte("digest"), Signature: []byte("signature"), diff --git a/p2p/rpc/providerapi/v1/providerapi.proto b/p2p/rpc/providerapi/v1/providerapi.proto index 4030af74a..fa1789921 100644 --- a/p2p/rpc/providerapi/v1/providerapi.proto +++ b/p2p/rpc/providerapi/v1/providerapi.proto @@ -144,6 +144,13 @@ message Bid { message: "decay_end_timestamp must be a valid integer.", expression: "uint(this) > 0" }]; + repeated string reverting_tx_hashes = 7 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + description: "Optional array of tx hashes that are allowed to revert or be discarded." + }, (buf.validate.field).cel = { + id: "reverting_tx_hashes", + message: "reverting_tx_hashes must be an array of valid transaction hashes.", + expression: "this == null || this.all(r, r.matches('^[a-fA-F0-9]{64}$'))" + }]; }; message BidResponse { From 86cfd8b2e8aa5b81ffcbeb8e572e287a0eb3ea5f Mon Sep 17 00:00:00 2001 From: Kartik Chopra Date: Wed, 26 Jun 2024 14:50:57 -0400 Subject: [PATCH 13/41] feat: fix validation --- contracts/contracts/PreConfCommitmentStore.sol | 8 ++++++-- p2p/gen/go/bidderapi/v1/bidderapi.pb.go | 13 ++++++------- p2p/gen/go/providerapi/v1/providerapi.pb.go | 11 +++++------ p2p/pkg/preconfirmation/preconfirmation.go | 2 ++ p2p/pkg/preconfirmation/preconfirmation_test.go | 5 +++-- p2p/pkg/rpc/bidder/service_test.go | 1 + p2p/pkg/signer/preconfencryptor/encryptor.go | 4 +++- p2p/pkg/signer/preconfencryptor/encryptor_test.go | 8 ++++---- p2p/rpc/bidderapi/v1/bidderapi.proto | 2 +- p2p/rpc/providerapi/v1/providerapi.proto | 2 +- 10 files changed, 32 insertions(+), 24 deletions(-) diff --git a/contracts/contracts/PreConfCommitmentStore.sol b/contracts/contracts/PreConfCommitmentStore.sol index e197e504b..c6c7cc5c4 100644 --- a/contracts/contracts/PreConfCommitmentStore.sol +++ b/contracts/contracts/PreConfCommitmentStore.sol @@ -222,7 +222,8 @@ contract PreConfCommitmentStore is OwnableUpgradeable, UUPSUpgradeable { uint256 _bid, uint64 _blockNumber, uint64 _decayStartTimeStamp, - uint64 _decayEndTimeStamp + uint64 _decayEndTimeStamp, + string memory _revertingTxHashes ) public view returns (bytes32) { return ECDSA.toTypedDataHash( @@ -234,7 +235,8 @@ contract PreConfCommitmentStore is OwnableUpgradeable, UUPSUpgradeable { _bid, _blockNumber, _decayStartTimeStamp, - _decayEndTimeStamp + _decayEndTimeStamp, + _revertingTxHashes ) ) ); @@ -254,6 +256,7 @@ contract PreConfCommitmentStore is OwnableUpgradeable, UUPSUpgradeable { uint64 _blockNumber, uint64 _decayStartTimeStamp, uint64 _decayEndTimeStamp, + string memory _revertingTxHashes, bytes32 _bidHash, string memory _bidSignature, string memory _sharedSecretKey @@ -269,6 +272,7 @@ contract PreConfCommitmentStore is OwnableUpgradeable, UUPSUpgradeable { _blockNumber, _decayStartTimeStamp, _decayEndTimeStamp, + _revertingTxHashes, keccak256( abi.encodePacked(_bytes32ToHexString(_bidHash)) ), diff --git a/p2p/gen/go/bidderapi/v1/bidderapi.pb.go b/p2p/gen/go/bidderapi/v1/bidderapi.pb.go index a34e702c3..582cb545c 100644 --- a/p2p/gen/go/bidderapi/v1/bidderapi.pb.go +++ b/p2p/gen/go/bidderapi/v1/bidderapi.pb.go @@ -694,7 +694,7 @@ var file_bidderapi_v1_bidderapi_proto_rawDesc = []byte{ 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, 0xc3, 0x0d, 0x0a, 0x03, 0x42, 0x69, 0x64, 0x12, 0xa3, 0x02, 0x0a, + 0x20, 0x31, 0x20, 0x7d, 0x22, 0xb3, 0x0d, 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, @@ -763,21 +763,20 @@ var file_bidderapi_v1_bidderapi_proto_rawDesc = []byte{ 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, 0x12, 0x9a, + 0x61, 0x79, 0x45, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x8a, 0x02, 0x0a, 0x13, 0x72, 0x65, 0x76, 0x65, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x74, 0x78, 0x5f, - 0x68, 0x61, 0x73, 0x68, 0x65, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x42, 0xe9, 0x01, 0x92, + 0x68, 0x61, 0x73, 0x68, 0x65, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x42, 0xd9, 0x01, 0x92, 0x41, 0x49, 0x32, 0x47, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x61, 0x72, 0x72, 0x61, 0x79, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x78, 0x20, 0x68, 0x61, 0x73, 0x68, 0x65, 0x73, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x61, 0x72, 0x65, 0x20, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x20, 0x74, 0x6f, 0x20, 0x72, 0x65, 0x76, 0x65, 0x72, 0x74, 0x20, 0x6f, 0x72, 0x20, 0x62, 0x65, - 0x20, 0x64, 0x69, 0x73, 0x63, 0x61, 0x72, 0x64, 0x65, 0x64, 0x2e, 0xba, 0x48, 0x99, 0x01, 0xba, - 0x01, 0x95, 0x01, 0x0a, 0x13, 0x72, 0x65, 0x76, 0x65, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x74, + 0x20, 0x64, 0x69, 0x73, 0x63, 0x61, 0x72, 0x64, 0x65, 0x64, 0x2e, 0xba, 0x48, 0x89, 0x01, 0xba, + 0x01, 0x85, 0x01, 0x0a, 0x13, 0x72, 0x65, 0x76, 0x65, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x74, 0x78, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x65, 0x73, 0x12, 0x41, 0x72, 0x65, 0x76, 0x65, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x74, 0x78, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x65, 0x73, 0x20, 0x6d, 0x75, 0x73, 0x74, 0x20, 0x62, 0x65, 0x20, 0x61, 0x6e, 0x20, 0x61, 0x72, 0x72, 0x61, 0x79, 0x20, 0x6f, 0x66, 0x20, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x20, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x20, 0x68, 0x61, 0x73, 0x68, 0x65, 0x73, 0x2e, 0x1a, 0x3b, 0x74, 0x68, 0x69, - 0x73, 0x20, 0x3d, 0x3d, 0x20, 0x6e, 0x75, 0x6c, 0x6c, 0x20, 0x7c, 0x7c, 0x20, 0x74, 0x68, 0x69, + 0x69, 0x6f, 0x6e, 0x20, 0x68, 0x61, 0x73, 0x68, 0x65, 0x73, 0x2e, 0x1a, 0x2b, 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, 0x52, 0x11, 0x72, 0x65, 0x76, 0x65, 0x72, 0x74, diff --git a/p2p/gen/go/providerapi/v1/providerapi.pb.go b/p2p/gen/go/providerapi/v1/providerapi.pb.go index adab24093..05c475fd2 100644 --- a/p2p/gen/go/providerapi/v1/providerapi.pb.go +++ b/p2p/gen/go/providerapi/v1/providerapi.pb.go @@ -427,7 +427,7 @@ var file_providerapi_v1_providerapi_proto_rawDesc = []byte{ 0x73, 0x74, 0x72, 0x79, 0x2e, 0x32, 0x22, 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, 0x20, 0x7d, 0x22, 0x0e, 0x0a, 0x0c, 0x45, 0x6d, 0x70, - 0x74, 0x79, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0xce, 0x0e, 0x0a, 0x03, 0x42, 0x69, + 0x74, 0x79, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0xbe, 0x0e, 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, @@ -746,21 +746,20 @@ var file_providerapi_v1_providerapi_proto_rawDesc = []byte{ 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, 0x12, 0x9a, 0x02, 0x0a, 0x13, 0x72, + 0x64, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x8a, 0x02, 0x0a, 0x13, 0x72, 0x65, 0x76, 0x65, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x74, 0x78, 0x5f, 0x68, 0x61, 0x73, 0x68, - 0x65, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x09, 0x42, 0xe9, 0x01, 0x92, 0x41, 0x49, 0x32, 0x47, + 0x65, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x09, 0x42, 0xd9, 0x01, 0x92, 0x41, 0x49, 0x32, 0x47, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x61, 0x72, 0x72, 0x61, 0x79, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x78, 0x20, 0x68, 0x61, 0x73, 0x68, 0x65, 0x73, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x61, 0x72, 0x65, 0x20, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x20, 0x74, 0x6f, 0x20, 0x72, 0x65, 0x76, 0x65, 0x72, 0x74, 0x20, 0x6f, 0x72, 0x20, 0x62, 0x65, 0x20, 0x64, 0x69, 0x73, - 0x63, 0x61, 0x72, 0x64, 0x65, 0x64, 0x2e, 0xba, 0x48, 0x99, 0x01, 0xba, 0x01, 0x95, 0x01, 0x0a, + 0x63, 0x61, 0x72, 0x64, 0x65, 0x64, 0x2e, 0xba, 0x48, 0x89, 0x01, 0xba, 0x01, 0x85, 0x01, 0x0a, 0x13, 0x72, 0x65, 0x76, 0x65, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x74, 0x78, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x65, 0x73, 0x12, 0x41, 0x72, 0x65, 0x76, 0x65, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x74, 0x78, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x65, 0x73, 0x20, 0x6d, 0x75, 0x73, 0x74, 0x20, 0x62, 0x65, 0x20, 0x61, 0x6e, 0x20, 0x61, 0x72, 0x72, 0x61, 0x79, 0x20, 0x6f, 0x66, 0x20, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x20, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, - 0x68, 0x61, 0x73, 0x68, 0x65, 0x73, 0x2e, 0x1a, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x20, 0x3d, 0x3d, - 0x20, 0x6e, 0x75, 0x6c, 0x6c, 0x20, 0x7c, 0x7c, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x61, 0x6c, + 0x68, 0x61, 0x73, 0x68, 0x65, 0x73, 0x2e, 0x1a, 0x2b, 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, 0x52, 0x11, 0x72, 0x65, 0x76, 0x65, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x54, diff --git a/p2p/pkg/preconfirmation/preconfirmation.go b/p2p/pkg/preconfirmation/preconfirmation.go index 6d862ccce..7542b3501 100644 --- a/p2p/pkg/preconfirmation/preconfirmation.go +++ b/p2p/pkg/preconfirmation/preconfirmation.go @@ -119,6 +119,7 @@ func (p *Preconfirmation) SendBid( blockNumber int64, decayStartTimestamp int64, decayEndTimestamp int64, + revertingTxHashes string, ) (chan *preconfpb.PreConfirmation, error) { startTime := time.Now() bid, encryptedBid, nikePrivateKey, err := p.encryptor.ConstructEncryptedBid( @@ -127,6 +128,7 @@ func (p *Preconfirmation) SendBid( blockNumber, decayStartTimestamp, decayEndTimestamp, + revertingTxHashes, ) if err != nil { p.logger.Error("constructing encrypted bid", "error", err, "txHash", txHash) diff --git a/p2p/pkg/preconfirmation/preconfirmation_test.go b/p2p/pkg/preconfirmation/preconfirmation_test.go index d587e4acd..4a7b7ff4f 100644 --- a/p2p/pkg/preconfirmation/preconfirmation_test.go +++ b/p2p/pkg/preconfirmation/preconfirmation_test.go @@ -45,7 +45,7 @@ type testEncryptor struct { preConfirmationSigner common.Address } -func (t *testEncryptor) ConstructEncryptedBid(_ string, _ string, _ int64, _ int64, _ int64) (*preconfpb.Bid, *preconfpb.EncryptedBid, *ecdh.PrivateKey, error) { +func (t *testEncryptor) ConstructEncryptedBid(_ string, _ string, _ int64, _ int64, _ int64, _ string) (*preconfpb.Bid, *preconfpb.EncryptedBid, *ecdh.PrivateKey, error) { return t.bid, t.encryptedBid, t.nikePrivateKey, nil } @@ -190,6 +190,7 @@ func TestPreconfBidSubmission(t *testing.T) { encryptedPreConfirmation: encryptedPreConfirmation, bidSigner: common.HexToAddress("0x1"), preConfirmationSigner: common.HexToAddress("0x2"), + revertingTxHashes: "", } depositMgr := &testDepositManager{} @@ -211,7 +212,7 @@ func TestPreconfBidSubmission(t *testing.T) { svc.SetPeerHandler(server, p.Streams()[0]) - respC, err := p.SendBid(context.Background(), bid.TxHash, bid.BidAmount, bid.BlockNumber, bid.DecayStartTimestamp, bid.DecayEndTimestamp) + respC, err := p.SendBid(context.Background(), bid.TxHash, bid.BidAmount, bid.BlockNumber, bid.DecayStartTimestamp, bid.DecayEndTimestamp, "") if err != nil { t.Fatal(err) } diff --git a/p2p/pkg/rpc/bidder/service_test.go b/p2p/pkg/rpc/bidder/service_test.go index d67fdc546..e991aa8ff 100644 --- a/p2p/pkg/rpc/bidder/service_test.go +++ b/p2p/pkg/rpc/bidder/service_test.go @@ -364,6 +364,7 @@ func TestSendBid(t *testing.T) { BlockNumber: tc.blockNum, DecayStartTimestamp: tc.decayStartTimestamp, DecayEndTimestamp: tc.decayEndTimestamp, + RevertingTxHashes: []string{}, }) if err != nil { t.Fatalf("error sending bid: %v", err) diff --git a/p2p/pkg/signer/preconfencryptor/encryptor.go b/p2p/pkg/signer/preconfencryptor/encryptor.go index 86f898ceb..1e7e75e15 100644 --- a/p2p/pkg/signer/preconfencryptor/encryptor.go +++ b/p2p/pkg/signer/preconfencryptor/encryptor.go @@ -32,7 +32,7 @@ var ( ) type Encryptor interface { - ConstructEncryptedBid(string, string, int64, int64, int64) (*preconfpb.Bid, *preconfpb.EncryptedBid, *ecdh.PrivateKey, error) + ConstructEncryptedBid(string, string, int64, int64, int64, string) (*preconfpb.Bid, *preconfpb.EncryptedBid, *ecdh.PrivateKey, error) ConstructEncryptedPreConfirmation(*preconfpb.Bid) (*preconfpb.PreConfirmation, *preconfpb.EncryptedPreConfirmation, error) VerifyBid(*preconfpb.Bid) (*common.Address, error) VerifyEncryptedPreConfirmation(providerNikePK *ecdh.PublicKey, bidderNikeSC *ecdh.PrivateKey, bidHash []byte, c *preconfpb.EncryptedPreConfirmation) ([]byte, *common.Address, error) @@ -85,6 +85,7 @@ func (e *encryptor) ConstructEncryptedBid( blockNumber int64, decayStartTimeStamp int64, decayEndTimeStamp int64, + revertingTxHashes string, ) (*preconfpb.Bid, *preconfpb.EncryptedBid, *ecdh.PrivateKey, error) { if txHash == "" || bidAmt == "" || blockNumber == 0 { return nil, nil, nil, ErrMissingRequiredFields @@ -96,6 +97,7 @@ func (e *encryptor) ConstructEncryptedBid( BlockNumber: blockNumber, DecayStartTimestamp: decayStartTimeStamp, DecayEndTimestamp: decayEndTimeStamp, + RevertingTxHashes: revertingTxHashes, } bidHash, err := GetBidHash(bid) diff --git a/p2p/pkg/signer/preconfencryptor/encryptor_test.go b/p2p/pkg/signer/preconfencryptor/encryptor_test.go index 3dc714b8c..a18160430 100644 --- a/p2p/pkg/signer/preconfencryptor/encryptor_test.go +++ b/p2p/pkg/signer/preconfencryptor/encryptor_test.go @@ -44,7 +44,7 @@ func TestBids(t *testing.T) { } start := time.Now().UnixMilli() end := start + 100000 - _, encryptedBid, _, err := encryptor.ConstructEncryptedBid("0xkartik", "10", 2, start, end) + _, encryptedBid, _, err := encryptor.ConstructEncryptedBid("0xkartik", "10", 2, start, end, "") if err != nil { t.Fatal(err) } @@ -123,7 +123,7 @@ func TestBids(t *testing.T) { start := time.Now().UnixMilli() end := start + 100000 - bid, encryptedBid, nikePrivateKey, err := bidderEncryptor.ConstructEncryptedBid("0xkartik", "10", 2, start, end) + bid, encryptedBid, nikePrivateKey, err := bidderEncryptor.ConstructEncryptedBid("0xkartik", "10", 2, start, end, "") if err != nil { t.Fatal(err) } @@ -309,7 +309,7 @@ func BenchmarkConstructEncryptedBid(b *testing.B) { b.ResetTimer() // Benchmark loop for i := 0; i < b.N; i++ { - _, _, _, err := encryptor.ConstructEncryptedBid(bids[i].hash, bids[i].amount, bids[i].blocknumber, bids[i].start, bids[i].end) + _, _, _, err := encryptor.ConstructEncryptedBid(bids[i].hash, bids[i].amount, bids[i].blocknumber, bids[i].start, bids[i].end, "") if err != nil { b.Fatal(err) } @@ -368,7 +368,7 @@ func BenchmarkConstructEncryptedPreConfirmation(b *testing.B) { if err != nil { b.Fatal(err) } - bids[i], _, _, err = bidderEncryptor.ConstructEncryptedBid(bid.hash, bid.amount, bid.blocknumber, bid.start, bid.end) + bids[i], _, _, err = bidderEncryptor.ConstructEncryptedBid(bid.hash, bid.amount, bid.blocknumber, bid.start, bid.end, "") if err != nil { b.Fatal(err) } diff --git a/p2p/rpc/bidderapi/v1/bidderapi.proto b/p2p/rpc/bidderapi/v1/bidderapi.proto index e3836e4ad..c319dc640 100644 --- a/p2p/rpc/bidderapi/v1/bidderapi.proto +++ b/p2p/rpc/bidderapi/v1/bidderapi.proto @@ -197,7 +197,7 @@ message Bid { }, (buf.validate.field).cel = { id: "reverting_tx_hashes", message: "reverting_tx_hashes must be an array of valid transaction hashes.", - expression: "this == null || this.all(r, r.matches('^[a-fA-F0-9]{64}$'))" + expression: "this.all(r, r.matches('^[a-fA-F0-9]{64}$'))" }]; }; diff --git a/p2p/rpc/providerapi/v1/providerapi.proto b/p2p/rpc/providerapi/v1/providerapi.proto index fa1789921..089b979f3 100644 --- a/p2p/rpc/providerapi/v1/providerapi.proto +++ b/p2p/rpc/providerapi/v1/providerapi.proto @@ -149,7 +149,7 @@ message Bid { }, (buf.validate.field).cel = { id: "reverting_tx_hashes", message: "reverting_tx_hashes must be an array of valid transaction hashes.", - expression: "this == null || this.all(r, r.matches('^[a-fA-F0-9]{64}$'))" + expression: "this.all(r, r.matches('^[a-fA-F0-9]{64}$'))" }]; }; From d4250df454a3d190f0292000f3705376cdf6e472 Mon Sep 17 00:00:00 2001 From: Kartik Chopra Date: Wed, 26 Jun 2024 15:15:54 -0400 Subject: [PATCH 14/41] chore: fixes build fail --- p2p/pkg/preconfirmation/preconfirmation_test.go | 1 - 1 file changed, 1 deletion(-) diff --git a/p2p/pkg/preconfirmation/preconfirmation_test.go b/p2p/pkg/preconfirmation/preconfirmation_test.go index 4a7b7ff4f..121afbef6 100644 --- a/p2p/pkg/preconfirmation/preconfirmation_test.go +++ b/p2p/pkg/preconfirmation/preconfirmation_test.go @@ -190,7 +190,6 @@ func TestPreconfBidSubmission(t *testing.T) { encryptedPreConfirmation: encryptedPreConfirmation, bidSigner: common.HexToAddress("0x1"), preConfirmationSigner: common.HexToAddress("0x2"), - revertingTxHashes: "", } depositMgr := &testDepositManager{} From 26a5334904b2aa692ef4b97e813a83de370452e8 Mon Sep 17 00:00:00 2001 From: Kartik Chopra Date: Fri, 28 Jun 2024 10:32:54 -0400 Subject: [PATCH 15/41] feat: adds in revertingTxn field in contracts --- .../contracts/PreConfCommitmentStore.sol | 27 ++++++++--- .../interfaces/IPreConfCommitmentStore.sol | 1 + contracts/test/OracleTest.sol | 33 ++++++++++++- contracts/test/PreConfirmationConfTest.sol | 47 ++++++++++++++++--- 4 files changed, 93 insertions(+), 15 deletions(-) diff --git a/contracts/contracts/PreConfCommitmentStore.sol b/contracts/contracts/PreConfCommitmentStore.sol index c6c7cc5c4..0f6ac146d 100644 --- a/contracts/contracts/PreConfCommitmentStore.sol +++ b/contracts/contracts/PreConfCommitmentStore.sol @@ -20,13 +20,13 @@ contract PreConfCommitmentStore is OwnableUpgradeable, UUPSUpgradeable { /// @dev EIP-712 Type Hash for preconfirmation commitment bytes32 public constant EIP712_COMMITMENT_TYPEHASH = keccak256( - "PreConfCommitment(string txnHash,uint256 bid,uint64 blockNumber,uint64 decayStartTimeStamp,uint64 decayEndTimeStamp,bytes32 bidHash,string signature,string sharedSecretKey)" + "PreConfCommitment(string txnHash,string revertingTxHashes,uint256 bid,uint64 blockNumber,uint64 decayStartTimeStamp,uint64 decayEndTimeStamp,bytes32 bidHash,string signature,string sharedSecretKey)" ); /// @dev EIP-712 Type Hash for preconfirmation bid bytes32 public constant EIP712_BID_TYPEHASH = keccak256( - "PreConfBid(string txnHash,uint256 bid,uint64 blockNumber,uint64 decayStartTimeStamp,uint64 decayEndTimeStamp)" + "PreConfBid(string txnHash,string revertingTxHashes,uint256 bid,uint64 blockNumber,uint64 decayStartTimeStamp,uint64 decayEndTimeStamp)" ); // Represents the dispatch window in milliseconds @@ -76,6 +76,7 @@ contract PreConfCommitmentStore is OwnableUpgradeable, UUPSUpgradeable { uint64 decayStartTimeStamp; uint64 decayEndTimeStamp; string txnHash; + string revertingTxHashes; bytes32 commitmentHash; bytes bidSignature; bytes commitmentSignature; @@ -94,6 +95,7 @@ contract PreConfCommitmentStore is OwnableUpgradeable, UUPSUpgradeable { uint64 decayStartTimeStamp, uint64 decayEndTimeStamp, string txnHash, + string revertingTxHashes, bytes32 commitmentHash, bytes bidSignature, bytes commitmentSignature, @@ -123,6 +125,7 @@ contract PreConfCommitmentStore is OwnableUpgradeable, UUPSUpgradeable { event SignatureVerified( address indexed signer, string txnHash, + string revertingTxHashes, uint256 indexed bid, uint64 blockNumber ); @@ -219,11 +222,11 @@ contract PreConfCommitmentStore is OwnableUpgradeable, UUPSUpgradeable { */ function getBidHash( string memory _txnHash, + string memory _revertingTxHashes, uint256 _bid, uint64 _blockNumber, uint64 _decayStartTimeStamp, - uint64 _decayEndTimeStamp, - string memory _revertingTxHashes + uint64 _decayEndTimeStamp ) public view returns (bytes32) { return ECDSA.toTypedDataHash( @@ -232,11 +235,11 @@ contract PreConfCommitmentStore is OwnableUpgradeable, UUPSUpgradeable { abi.encode( EIP712_BID_TYPEHASH, keccak256(abi.encodePacked(_txnHash)), + keccak256(abi.encodePacked(_revertingTxHashes)), _bid, _blockNumber, _decayStartTimeStamp, - _decayEndTimeStamp, - _revertingTxHashes + _decayEndTimeStamp ) ) ); @@ -252,11 +255,11 @@ contract PreConfCommitmentStore is OwnableUpgradeable, UUPSUpgradeable { */ function getPreConfHash( string memory _txnHash, + string memory _revertingTxHashes, uint256 _bid, uint64 _blockNumber, uint64 _decayStartTimeStamp, uint64 _decayEndTimeStamp, - string memory _revertingTxHashes, bytes32 _bidHash, string memory _bidSignature, string memory _sharedSecretKey @@ -268,6 +271,7 @@ contract PreConfCommitmentStore is OwnableUpgradeable, UUPSUpgradeable { abi.encode( EIP712_COMMITMENT_TYPEHASH, keccak256(abi.encodePacked(_txnHash)), + keccak256(abi.encodePacked(_revertingTxHashes)), _bid, _blockNumber, _decayStartTimeStamp, @@ -298,10 +302,12 @@ contract PreConfCommitmentStore is OwnableUpgradeable, UUPSUpgradeable { uint64 decayStartTimeStamp, uint64 decayEndTimeStamp, string memory txnHash, + string memory revertingTxHashes, bytes calldata bidSignature ) public view returns (bytes32 messageDigest, address recoveredAddress) { messageDigest = getBidHash( txnHash, + revertingTxHashes, bid, blockNumber, decayStartTimeStamp, @@ -323,6 +329,7 @@ contract PreConfCommitmentStore is OwnableUpgradeable, UUPSUpgradeable { */ function verifyPreConfCommitment( string memory txnHash, + string memory revertingTxHashes, uint256 bid, uint64 blockNumber, uint64 decayStartTimeStamp, @@ -334,6 +341,7 @@ contract PreConfCommitmentStore is OwnableUpgradeable, UUPSUpgradeable { ) public view returns (bytes32 preConfHash, address commiterAddress) { preConfHash = getPreConfHash( txnHash, + revertingTxHashes, bid, blockNumber, decayStartTimeStamp, @@ -398,6 +406,7 @@ contract PreConfCommitmentStore is OwnableUpgradeable, UUPSUpgradeable { uint256 bid, uint64 blockNumber, string memory txnHash, + string memory revertingTxHashes, uint64 decayStartTimeStamp, uint64 decayEndTimeStamp, bytes calldata bidSignature, @@ -410,6 +419,7 @@ contract PreConfCommitmentStore is OwnableUpgradeable, UUPSUpgradeable { decayStartTimeStamp, decayEndTimeStamp, txnHash, + revertingTxHashes, bidSignature ); @@ -417,6 +427,7 @@ contract PreConfCommitmentStore is OwnableUpgradeable, UUPSUpgradeable { { bytes32 commitmentDigest = getPreConfHash( txnHash, + revertingTxHashes, bid, blockNumber, decayStartTimeStamp, @@ -462,6 +473,7 @@ contract PreConfCommitmentStore is OwnableUpgradeable, UUPSUpgradeable { decayStartTimeStamp, decayEndTimeStamp, txnHash, + revertingTxHashes, commitmentDigest, bidSignature, commitmentSignature, @@ -496,6 +508,7 @@ contract PreConfCommitmentStore is OwnableUpgradeable, UUPSUpgradeable { decayStartTimeStamp, decayEndTimeStamp, txnHash, + revertingTxHashes, commitmentDigest, bidSignature, commitmentSignature, diff --git a/contracts/contracts/interfaces/IPreConfCommitmentStore.sol b/contracts/contracts/interfaces/IPreConfCommitmentStore.sol index e9ef66b47..f8eb8ba7d 100644 --- a/contracts/contracts/interfaces/IPreConfCommitmentStore.sol +++ b/contracts/contracts/interfaces/IPreConfCommitmentStore.sol @@ -63,6 +63,7 @@ interface IPreConfCommitmentStore { uint64 bid, uint64 blockNumber, string memory txnHash, + string memory revertingTxHashes, string memory commitmentHash, uint64 decayStartTimeStamp, uint64 decayEndTimeStamp, diff --git a/contracts/test/OracleTest.sol b/contracts/test/OracleTest.sol index 6d481e6cf..211dc61a5 100644 --- a/contracts/test/OracleTest.sol +++ b/contracts/test/OracleTest.sol @@ -166,6 +166,8 @@ contract OracleTest is Test { function test_process_commitment_payment_payout() public { string memory txn = "0x6d9c53ad81249775f8c082b11ac293b2e19194ff791bd1c4fd37683310e90d08"; + string + memory revertingTxHashes = "0x6d9c53ad81249775f8c082b11ac293b2e19194ff791bd1c4fd37683310e90d12"; uint64 blockNumber = uint64(blocksPerWindow + 2); uint64 bid = 2; (address bidder, uint256 bidderPk) = makeAddrAndKey("alice"); @@ -186,6 +188,7 @@ contract OracleTest is Test { bid, blockNumber, txn, + revertingTxHashes, bidderPk, providerPk, provider, @@ -211,6 +214,8 @@ contract OracleTest is Test { function test_process_commitment_slash() public { string memory txn = "0x6d9c53ad81249775f8c082b11ac293b2e19194ff791bd1c4fd37683310e90d08"; + string + memory revertingTxHashes = "0x6d9c53ad81249775f8c082b11ac293b2e19194ff791bd1c4fd37683310e90d12"; uint64 blockNumber = 200; uint64 bid = 200; (address bidder, uint256 bidderPk) = makeAddrAndKey("alice"); @@ -231,6 +236,7 @@ contract OracleTest is Test { bid, blockNumber, txn, + revertingTxHashes, bidderPk, providerPk, provider, @@ -260,6 +266,8 @@ contract OracleTest is Test { memory txn1 = "0x6d9c53ad81249775f8c082b11ac293b2e19194ff791bd1c4fd37683310e90d08"; string memory txn2 = "0x6d9c53ad81249775f8c082b11ac293b2e19194ff791bd1c4fd37683310e90d09"; + string + memory revertingTxHashes = "0x6d9c53ad81249775f8c082b11ac293b2e19194ff791bd1c4fd37683310e90d12"; uint64 blockNumber = uint64(blocksPerWindow + 2); uint64 bid = 100; (address bidder, uint256 bidderPk) = makeAddrAndKey("alice"); @@ -282,6 +290,7 @@ contract OracleTest is Test { bid, blockNumber, txn1, + revertingTxHashes, bidderPk, providerPk, provider, @@ -291,6 +300,7 @@ contract OracleTest is Test { bid, blockNumber, txn2, + revertingTxHashes, bidderPk, providerPk, provider, @@ -335,6 +345,8 @@ contract OracleTest is Test { memory txn3 = "0x6d9c53ad81249775f8c082b11ac293b2e19194ff791bd1c4fd37683310e90d10"; string memory txn4 = "0x6d9c53ad81249775f8c082b11ac293b2e19194ff791bd1c4fd37683310e90d11"; + string + memory revertingTxHashes = "0x6d9c53ad81249775f8c082b11ac293b2e19194ff791bd1c4fd37683310e90d12"; uint64 blockNumber = 201; uint64 bid = 5; (address bidder, uint256 bidderPk) = makeAddrAndKey("alice"); @@ -355,6 +367,7 @@ contract OracleTest is Test { bid, blockNumber, txn1, + revertingTxHashes, bidderPk, providerPk, provider, @@ -364,6 +377,7 @@ contract OracleTest is Test { bid, blockNumber, txn2, + revertingTxHashes, bidderPk, providerPk, provider, @@ -373,6 +387,7 @@ contract OracleTest is Test { bid, blockNumber, txn3, + revertingTxHashes, bidderPk, providerPk, provider, @@ -382,6 +397,7 @@ contract OracleTest is Test { bid, blockNumber, txn4, + revertingTxHashes, bidderPk, providerPk, provider, @@ -445,6 +461,7 @@ contract OracleTest is Test { txnHashes[ 3 ] = "0x6d9c53ad81249775f8c082b11ac293b2e19194ff791bd1c4fd37683310e90d11"; + string memory revertingTxHashes = "0x6d9c53ad81249775f8c082b11ac293b2e19194ff791bd1c4fd37683310e90d12"; uint64 blockNumber = uint64(blocksPerWindow + 2); uint64 bid = 5; (address bidder, uint256 bidderPk) = makeAddrAndKey("alice"); @@ -474,6 +491,7 @@ contract OracleTest is Test { bid, blockNumber, txnHashes[i], + revertingTxHashes, 10, 20, bidderPk, @@ -494,6 +512,7 @@ contract OracleTest is Test { bid, blockNumber, txnHashes[i], + revertingTxHashes, 10, 20, bidSignatures[i], @@ -524,15 +543,17 @@ contract OracleTest is Test { uint64 bid, uint64 blockNumber, string memory txnHash, + string memory revertingTxHashes, uint256 bidderPk, uint256 signerPk, address provider, uint64 dispatchTimestamp ) public returns (bytes32 commitmentIndex) { - bytes32 bidHash = getBidHash(txnHash, bid, blockNumber); + bytes32 bidHash = getBidHash(txnHash, revertingTxHashes, bid, blockNumber); bytes memory bidSignature = getBidSignature(bidderPk, bidHash); bytes32 commitmentHash = getCommitmentHash( txnHash, + revertingTxHashes, bid, blockNumber, bidHash, @@ -557,6 +578,7 @@ contract OracleTest is Test { bid, blockNumber, txnHash, + revertingTxHashes, bidSignature, commitmentSignature ); @@ -565,12 +587,14 @@ contract OracleTest is Test { function getBidHash( string memory txnHash, + string memory revertingTxHashes, uint64 bid, uint64 blockNumber ) public view returns (bytes32) { return preConfCommitmentStore.getBidHash( txnHash, + revertingTxHashes, bid, blockNumber, 10, @@ -588,6 +612,7 @@ contract OracleTest is Test { function getCommitmentHash( string memory txnHash, + string memory revertingTxHashes, uint64 bid, uint64 blockNumber, bytes32 bidHash, @@ -596,6 +621,7 @@ contract OracleTest is Test { return preConfCommitmentStore.getPreConfHash( txnHash, + revertingTxHashes, bid, blockNumber, 10, @@ -644,6 +670,7 @@ contract OracleTest is Test { uint64 bid, uint64 blockNumber, string memory txnHash, + string memory revertingTxHashes, bytes memory bidSignature, bytes memory commitmentSignature ) public returns (bytes32) { @@ -653,6 +680,7 @@ contract OracleTest is Test { bid, blockNumber, txnHash, + revertingTxHashes, 10, 20, bidSignature, @@ -668,6 +696,7 @@ contract OracleTest is Test { uint64 bid, uint64 blockNumber, string memory txnHash, + string memory revertingTxHashes, uint64 decayStartTimestamp, uint64 decayEndTimestamp, uint256 bidderPk, @@ -683,6 +712,7 @@ contract OracleTest is Test { { bytes32 bidHash = preConfCommitmentStore.getBidHash( txnHash, + revertingTxHashes, bid, blockNumber, decayStartTimestamp, @@ -694,6 +724,7 @@ contract OracleTest is Test { bytes32 commitmentHash = preConfCommitmentStore.getPreConfHash( txnHash, + revertingTxHashes, bid, blockNumber, decayStartTimestamp, diff --git a/contracts/test/PreConfirmationConfTest.sol b/contracts/test/PreConfirmationConfTest.sol index e9390dc58..ad6306685 100644 --- a/contracts/test/PreConfirmationConfTest.sol +++ b/contracts/test/PreConfirmationConfTest.sol @@ -17,6 +17,7 @@ contract TestPreConfCommitmentStore is Test { uint256 bid; uint64 blockNumber; string txnHash; + string revertingTxHashes; uint64 decayStartTimestamp; uint64 decayEndTimestamp; bytes32 bidDigest; @@ -44,6 +45,7 @@ contract TestPreConfCommitmentStore is Test { 2, 2, "0xkartik", + "0xkartik", 10, 20, 0x56c06a13be335eba981b780ea45dff258a7c429d0e9d993235ef2d3a7e435df8, @@ -244,6 +246,7 @@ contract TestPreConfCommitmentStore is Test { function test_GetBidHash() public view { bytes32 bidHash = preConfCommitmentStore.getBidHash( _testCommitmentAliceBob.txnHash, + _testCommitmentAliceBob.revertingTxHashes, _testCommitmentAliceBob.bid, _testCommitmentAliceBob.blockNumber, _testCommitmentAliceBob.decayStartTimestamp, @@ -257,6 +260,7 @@ contract TestPreConfCommitmentStore is Test { bytes32 bidHash = preConfCommitmentStore.getBidHash( _testCommitmentAliceBob.txnHash, + _testCommitmentAliceBob.revertingTxHashes, _testCommitmentAliceBob.bid, _testCommitmentAliceBob.blockNumber, _testCommitmentAliceBob.decayStartTimestamp, @@ -269,6 +273,7 @@ contract TestPreConfCommitmentStore is Test { bytes memory sharedSecretKey = bytes("0xsecret"); bytes32 preConfHash = preConfCommitmentStore.getPreConfHash( _testCommitmentAliceBob.txnHash, + _testCommitmentAliceBob.revertingTxHashes, _testCommitmentAliceBob.bid, _testCommitmentAliceBob.blockNumber, _testCommitmentAliceBob.decayStartTimestamp, @@ -306,6 +311,7 @@ contract TestPreConfCommitmentStore is Test { // Step 1: Verify that the commitment has not been used before verifyCommitmentNotUsed( _testCommitmentAliceBob.txnHash, + _testCommitmentAliceBob.revertingTxHashes, _testCommitmentAliceBob.bid, _testCommitmentAliceBob.blockNumber, _testCommitmentAliceBob.decayStartTimestamp, @@ -322,6 +328,7 @@ contract TestPreConfCommitmentStore is Test { _testCommitmentAliceBob.bid, _testCommitmentAliceBob.blockNumber, _testCommitmentAliceBob.txnHash, + _testCommitmentAliceBob.revertingTxHashes, _testCommitmentAliceBob.decayStartTimestamp, _testCommitmentAliceBob.decayEndTimestamp, _testCommitmentAliceBob.bidSignature, @@ -341,6 +348,7 @@ contract TestPreConfCommitmentStore is Test { _testCommitmentAliceBob.bid, _testCommitmentAliceBob.blockNumber, _testCommitmentAliceBob.txnHash, + _testCommitmentAliceBob.revertingTxHashes, _testCommitmentAliceBob.decayStartTimestamp, _testCommitmentAliceBob.decayEndTimestamp, _testCommitmentAliceBob.bidSignature, @@ -356,6 +364,7 @@ contract TestPreConfCommitmentStore is Test { _testCommitmentAliceBob.decayStartTimestamp, _testCommitmentAliceBob.decayEndTimestamp, _testCommitmentAliceBob.txnHash, + _testCommitmentAliceBob.revertingTxHashes, _testCommitmentAliceBob.bidSignature, _testCommitmentAliceBob.commitmentSignature, _testCommitmentAliceBob.sharedSecretKey @@ -368,6 +377,7 @@ contract TestPreConfCommitmentStore is Test { function verifyCommitmentNotUsed( string memory txnHash, + string memory revertingTxHashes, uint256 bid, uint64 blockNumber, uint64 decayStartTimestamp, @@ -376,6 +386,7 @@ contract TestPreConfCommitmentStore is Test { ) public view returns (bytes32) { bytes32 bidHash = preConfCommitmentStore.getBidHash( txnHash, + revertingTxHashes, bid, blockNumber, decayStartTimestamp, @@ -384,6 +395,7 @@ contract TestPreConfCommitmentStore is Test { bytes memory sharedSecretKey = abi.encodePacked(keccak256("0xsecret")); bytes32 preConfHash = preConfCommitmentStore.getPreConfHash( txnHash, + revertingTxHashes, bid, blockNumber, decayStartTimestamp, @@ -393,7 +405,7 @@ contract TestPreConfCommitmentStore is Test { _bytesToHexString(sharedSecretKey) ); - (bool isUsed, , , , , , , , , , , , , ) = preConfCommitmentStore + (bool isUsed, , , , , , , , , , , , , ,) = preConfCommitmentStore .commitments(preConfHash); assertEq(isUsed, false); @@ -405,6 +417,7 @@ contract TestPreConfCommitmentStore is Test { uint256 bid, uint64 blockNumber, string memory txnHash, + string memory revertingTxHashes, uint64 decayStartTimestamp, uint64 decayEndTimestamp, bytes memory bidSignature, @@ -414,6 +427,7 @@ contract TestPreConfCommitmentStore is Test { ) public returns (bytes32) { bytes32 bidHash = preConfCommitmentStore.getBidHash( txnHash, + revertingTxHashes, bid, blockNumber, decayStartTimestamp, @@ -422,6 +436,7 @@ contract TestPreConfCommitmentStore is Test { bytes32 commitmentHash = preConfCommitmentStore.getPreConfHash( txnHash, + revertingTxHashes, bid, blockNumber, decayStartTimestamp, @@ -447,6 +462,7 @@ contract TestPreConfCommitmentStore is Test { uint256 bid, uint64 blockNumber, string memory txnHash, + string memory revertingTxHashes, uint64 decayStartTimestamp, uint64 decayEndTimestamp, bytes memory bidSignature, @@ -459,6 +475,7 @@ contract TestPreConfCommitmentStore is Test { bid, blockNumber, txnHash, + revertingTxHashes, decayStartTimestamp, decayEndTimestamp, bidSignature, @@ -476,6 +493,7 @@ contract TestPreConfCommitmentStore is Test { uint64 decayStartTimestamp, uint64 decayEndTimestamp, string memory txnHash, + string memory revertingTxHashes, bytes memory bidSignature, bytes memory commitmentSignature, bytes memory sharedSecretKey @@ -486,6 +504,7 @@ contract TestPreConfCommitmentStore is Test { (, address commiterAddress) = preConfCommitmentStore .verifyPreConfCommitment( txnHash, + revertingTxHashes, bid, blockNumber, decayStartTimestamp, @@ -532,6 +551,7 @@ contract TestPreConfCommitmentStore is Test { // Step 1: Verify that the commitment has not been used before verifyCommitmentNotUsed( _testCommitmentAliceBob.txnHash, + _testCommitmentAliceBob.revertingTxHashes, _testCommitmentAliceBob.bid, _testCommitmentAliceBob.blockNumber, _testCommitmentAliceBob.decayStartTimestamp, @@ -546,6 +566,7 @@ contract TestPreConfCommitmentStore is Test { _testCommitmentAliceBob.bid, _testCommitmentAliceBob.blockNumber, _testCommitmentAliceBob.txnHash, + _testCommitmentAliceBob.revertingTxHashes, _testCommitmentAliceBob.decayStartTimestamp, _testCommitmentAliceBob.decayEndTimestamp, _testCommitmentAliceBob.bidSignature, @@ -585,6 +606,7 @@ contract TestPreConfCommitmentStore is Test { // Step 1: Verify that the commitment has not been used before bytes32 bidHash = verifyCommitmentNotUsed( _testCommitmentAliceBob.txnHash, + _testCommitmentAliceBob.revertingTxHashes, _testCommitmentAliceBob.bid, _testCommitmentAliceBob.blockNumber, _testCommitmentAliceBob.decayStartTimestamp, @@ -594,6 +616,7 @@ contract TestPreConfCommitmentStore is Test { bytes32 preConfHash = preConfCommitmentStore.getPreConfHash( _testCommitmentAliceBob.txnHash, + _testCommitmentAliceBob.revertingTxHashes, _testCommitmentAliceBob.bid, _testCommitmentAliceBob.blockNumber, _testCommitmentAliceBob.decayStartTimestamp, @@ -604,7 +627,7 @@ contract TestPreConfCommitmentStore is Test { ); // Verify that the commitment has not been set before - (bool isUsed, , , , , , , , , , , , , ) = preConfCommitmentStore + (bool isUsed, , , , , , , , , , , , , ,) = preConfCommitmentStore .commitments(preConfHash); assert(isUsed == false); (address commiter, ) = makeAddrAndKey("bob"); @@ -614,6 +637,7 @@ contract TestPreConfCommitmentStore is Test { _testCommitmentAliceBob.bid, _testCommitmentAliceBob.blockNumber, _testCommitmentAliceBob.txnHash, + _testCommitmentAliceBob.revertingTxHashes, _testCommitmentAliceBob.decayStartTimestamp, _testCommitmentAliceBob.decayEndTimestamp, _testCommitmentAliceBob.bidSignature, @@ -635,6 +659,7 @@ contract TestPreConfCommitmentStore is Test { _testCommitmentAliceBob.bid, _testCommitmentAliceBob.blockNumber, _testCommitmentAliceBob.txnHash, + _testCommitmentAliceBob.revertingTxHashes, _testCommitmentAliceBob.decayStartTimestamp, _testCommitmentAliceBob.decayEndTimestamp, _testCommitmentAliceBob.bidSignature, @@ -644,7 +669,7 @@ contract TestPreConfCommitmentStore is Test { vm.prank(feeRecipient); preConfCommitmentStore.initiateSlash(index, 100); - (isUsed, , , , , , , , , , , , , ) = preConfCommitmentStore + (isUsed, , , , , , , , , , , , , ,) = preConfCommitmentStore .commitments(index); // Verify that the commitment has been deleted assert(isUsed == true); @@ -670,6 +695,7 @@ contract TestPreConfCommitmentStore is Test { // Step 1: Verify that the commitment has not been used before bytes32 bidHash = verifyCommitmentNotUsed( _testCommitmentAliceBob.txnHash, + _testCommitmentAliceBob.revertingTxHashes, _testCommitmentAliceBob.bid, _testCommitmentAliceBob.blockNumber, _testCommitmentAliceBob.decayStartTimestamp, @@ -678,6 +704,7 @@ contract TestPreConfCommitmentStore is Test { ); bytes32 preConfHash = preConfCommitmentStore.getPreConfHash( _testCommitmentAliceBob.txnHash, + _testCommitmentAliceBob.revertingTxHashes, _testCommitmentAliceBob.bid, _testCommitmentAliceBob.blockNumber, _testCommitmentAliceBob.decayStartTimestamp, @@ -688,7 +715,7 @@ contract TestPreConfCommitmentStore is Test { ); // Verify that the commitment has not been used before - (bool isUsed, , , , , , , , , , , , , ) = preConfCommitmentStore + (bool isUsed, , , , , , , , , , , , , ,) = preConfCommitmentStore .commitments(preConfHash); assert(isUsed == false); (address commiter, ) = makeAddrAndKey("bob"); @@ -698,6 +725,7 @@ contract TestPreConfCommitmentStore is Test { _testCommitmentAliceBob.bid, _testCommitmentAliceBob.blockNumber, _testCommitmentAliceBob.txnHash, + _testCommitmentAliceBob.revertingTxHashes, _testCommitmentAliceBob.decayStartTimestamp, _testCommitmentAliceBob.decayEndTimestamp, _testCommitmentAliceBob.bidSignature, @@ -718,6 +746,7 @@ contract TestPreConfCommitmentStore is Test { _testCommitmentAliceBob.bid, _testCommitmentAliceBob.blockNumber, _testCommitmentAliceBob.txnHash, + _testCommitmentAliceBob.revertingTxHashes, _testCommitmentAliceBob.decayStartTimestamp, _testCommitmentAliceBob.decayEndTimestamp, _testCommitmentAliceBob.bidSignature, @@ -727,7 +756,7 @@ contract TestPreConfCommitmentStore is Test { vm.prank(feeRecipient); preConfCommitmentStore.initiateReward(index, 100); - (isUsed, , , , , , , , , , , , , ) = preConfCommitmentStore + (isUsed, , , , , , , , , , , , , ,) = preConfCommitmentStore .commitments(index); // Verify that the commitment has been marked as used assert(isUsed == true); @@ -753,6 +782,7 @@ contract TestPreConfCommitmentStore is Test { // Step 1: Verify that the commitment has not been used before bytes32 bidHash = verifyCommitmentNotUsed( _testCommitmentAliceBob.txnHash, + _testCommitmentAliceBob.revertingTxHashes, _testCommitmentAliceBob.bid, _testCommitmentAliceBob.blockNumber, _testCommitmentAliceBob.decayStartTimestamp, @@ -761,6 +791,7 @@ contract TestPreConfCommitmentStore is Test { ); bytes32 preConfHash = preConfCommitmentStore.getPreConfHash( _testCommitmentAliceBob.txnHash, + _testCommitmentAliceBob.revertingTxHashes, _testCommitmentAliceBob.bid, _testCommitmentAliceBob.blockNumber, _testCommitmentAliceBob.decayStartTimestamp, @@ -771,7 +802,7 @@ contract TestPreConfCommitmentStore is Test { ); // Verify that the commitment has not been used before - (bool isUsed, , , , , , , , , , , , , ) = preConfCommitmentStore + (bool isUsed, , , , , , , , , , , , , ,) = preConfCommitmentStore .commitments(preConfHash); assert(isUsed == false); (address commiter, ) = makeAddrAndKey("bob"); @@ -782,6 +813,7 @@ contract TestPreConfCommitmentStore is Test { _testCommitmentAliceBob.bid, _testCommitmentAliceBob.blockNumber, _testCommitmentAliceBob.txnHash, + _testCommitmentAliceBob.revertingTxHashes, _testCommitmentAliceBob.decayStartTimestamp, _testCommitmentAliceBob.decayEndTimestamp, _testCommitmentAliceBob.bidSignature, @@ -802,6 +834,7 @@ contract TestPreConfCommitmentStore is Test { _testCommitmentAliceBob.bid, _testCommitmentAliceBob.blockNumber, _testCommitmentAliceBob.txnHash, + _testCommitmentAliceBob.revertingTxHashes, _testCommitmentAliceBob.decayStartTimestamp, _testCommitmentAliceBob.decayEndTimestamp, _testCommitmentAliceBob.bidSignature, @@ -812,7 +845,7 @@ contract TestPreConfCommitmentStore is Test { vm.prank(feeRecipient); preConfCommitmentStore.initiateReward(index, 0); - (isUsed, , , , , , , , , , , , , ) = preConfCommitmentStore + (isUsed, , , , , , , , , , , , , ,) = preConfCommitmentStore .commitments(index); // Verify that the commitment has been marked as used assert(isUsed == true); From 03333c9829bd393f73be401a73160de825e09d63 Mon Sep 17 00:00:00 2001 From: kant Date: Wed, 3 Jul 2024 18:48:44 -0700 Subject: [PATCH 16/41] refactor: use struct to mitigate stack-too-deep errors - Introduce CommitmentParams struct to group function parameters - Refactor verifyPreConfCommitment and related functions to use the new struct - Split complex functions into smaller, more manageable pieces - Reduce stack depth to resolve compilation issues --- .../contracts/PreConfCommitmentStore.sol | 173 ++++++++++-------- contracts/test/PreConfirmationConfTest.sol | 85 ++++----- 2 files changed, 139 insertions(+), 119 deletions(-) diff --git a/contracts/contracts/PreConfCommitmentStore.sol b/contracts/contracts/PreConfCommitmentStore.sol index 0f6ac146d..9d4ef0fe3 100644 --- a/contracts/contracts/PreConfCommitmentStore.sol +++ b/contracts/contracts/PreConfCommitmentStore.sol @@ -19,15 +19,15 @@ contract PreConfCommitmentStore is OwnableUpgradeable, UUPSUpgradeable { /// @dev EIP-712 Type Hash for preconfirmation commitment bytes32 public constant EIP712_COMMITMENT_TYPEHASH = - keccak256( - "PreConfCommitment(string txnHash,string revertingTxHashes,uint256 bid,uint64 blockNumber,uint64 decayStartTimeStamp,uint64 decayEndTimeStamp,bytes32 bidHash,string signature,string sharedSecretKey)" - ); + keccak256( + "PreConfCommitment(string txnHash,string revertingTxHashes,uint256 bid,uint64 blockNumber,uint64 decayStartTimeStamp,uint64 decayEndTimeStamp,bytes32 bidHash,string signature,string sharedSecretKey)" + ); /// @dev EIP-712 Type Hash for preconfirmation bid bytes32 public constant EIP712_BID_TYPEHASH = - keccak256( - "PreConfBid(string txnHash,string revertingTxHashes,uint256 bid,uint64 blockNumber,uint64 decayStartTimeStamp,uint64 decayEndTimeStamp)" - ); + keccak256( + "PreConfBid(string txnHash,string revertingTxHashes,uint256 bid,uint64 blockNumber,uint64 decayStartTimeStamp,uint64 decayEndTimeStamp)" + ); // Represents the dispatch window in milliseconds uint64 public commitmentDispatchWindow; @@ -103,6 +103,20 @@ contract PreConfCommitmentStore is OwnableUpgradeable, UUPSUpgradeable { bytes sharedSecretKey ); + /// @dev Struct for all the commitment params to avoid too deep in the stack error + struct CommitmentParams { + string txnHash; + string revertingTxHashes; + uint256 bid; + uint64 blockNumber; + uint64 decayStartTimeStamp; + uint64 decayEndTimeStamp; + bytes32 bidHash; + bytes bidSignature; + bytes commitmentSignature; + bytes sharedSecretKey; + } + /// @dev Struct for all the information around encrypted preconfirmations commitment struct EncrPreConfCommitment { bool isUsed; @@ -230,19 +244,19 @@ contract PreConfCommitmentStore is OwnableUpgradeable, UUPSUpgradeable { ) public view returns (bytes32) { return ECDSA.toTypedDataHash( - DOMAIN_SEPARATOR_BID, - keccak256( - abi.encode( - EIP712_BID_TYPEHASH, - keccak256(abi.encodePacked(_txnHash)), - keccak256(abi.encodePacked(_revertingTxHashes)), - _bid, - _blockNumber, - _decayStartTimeStamp, - _decayEndTimeStamp - ) + DOMAIN_SEPARATOR_BID, + keccak256( + abi.encode( + EIP712_BID_TYPEHASH, + keccak256(abi.encodePacked(_txnHash)), + keccak256(abi.encodePacked(_revertingTxHashes)), + _bid, + _blockNumber, + _decayStartTimeStamp, + _decayEndTimeStamp ) - ); + ) + ); } /** @@ -266,25 +280,25 @@ contract PreConfCommitmentStore is OwnableUpgradeable, UUPSUpgradeable { ) public view returns (bytes32) { return ECDSA.toTypedDataHash( - DOMAIN_SEPARATOR_PRECONF, - keccak256( - abi.encode( - EIP712_COMMITMENT_TYPEHASH, - keccak256(abi.encodePacked(_txnHash)), - keccak256(abi.encodePacked(_revertingTxHashes)), - _bid, - _blockNumber, - _decayStartTimeStamp, - _decayEndTimeStamp, - _revertingTxHashes, - keccak256( - abi.encodePacked(_bytes32ToHexString(_bidHash)) - ), - keccak256(abi.encodePacked(_bidSignature)), - keccak256(abi.encodePacked(_sharedSecretKey)) - ) + DOMAIN_SEPARATOR_PRECONF, + keccak256( + abi.encode( + EIP712_COMMITMENT_TYPEHASH, + keccak256(abi.encodePacked(_txnHash)), + keccak256(abi.encodePacked(_revertingTxHashes)), + _bid, + _blockNumber, + _decayStartTimeStamp, + _decayEndTimeStamp, + _revertingTxHashes, + keccak256( + abi.encodePacked(_bytes32ToHexString(_bidHash)) + ), + keccak256(abi.encodePacked(_bidSignature)), + keccak256(abi.encodePacked(_sharedSecretKey)) ) - ); + ) + ); } /** @@ -318,40 +332,45 @@ contract PreConfCommitmentStore is OwnableUpgradeable, UUPSUpgradeable { /** * @dev Verifies a pre-confirmation commitment by computing the hash and recovering the committer's address. - * @param txnHash The transaction hash associated with the commitment. - * @param bid The bid amount. - * @param blockNumber The block number at the time of the bid. - * @param bidHash The hash of the bid details. - * @param bidSignature The signature of the bid. - * @param commitmentSignature The signature of the commitment. + * @param params The commitment params associated with the commitment. * @return preConfHash The hash of the pre-confirmation commitment. * @return commiterAddress The address of the committer recovered from the commitment signature. */ + function verifyPreConfCommitment( - string memory txnHash, - string memory revertingTxHashes, - uint256 bid, - uint64 blockNumber, - uint64 decayStartTimeStamp, - uint64 decayEndTimeStamp, - bytes32 bidHash, - bytes memory bidSignature, - bytes memory commitmentSignature, - bytes memory sharedSecretKey + CommitmentParams memory params ) public view returns (bytes32 preConfHash, address commiterAddress) { - preConfHash = getPreConfHash( - txnHash, - revertingTxHashes, - bid, - blockNumber, - decayStartTimeStamp, - decayEndTimeStamp, - bidHash, - _bytesToHexString(bidSignature), - _bytesToHexString(sharedSecretKey) + return _verifyPreConfCommitment(params); + } + + function _verifyPreConfCommitment( + CommitmentParams memory params + ) internal view returns (bytes32 preConfHash, address commiterAddress) { + preConfHash = _getPreConfHash(params); + commiterAddress = _recoverCommitterAddress(preConfHash, params.commitmentSignature); + } + + function _getPreConfHash( + CommitmentParams memory params + ) internal view returns (bytes32) { + return getPreConfHash( + params.txnHash, + params.revertingTxHashes, + params.bid, + params.blockNumber, + params.decayStartTimeStamp, + params.decayEndTimeStamp, + params.bidHash, + _bytesToHexString(params.bidSignature), + _bytesToHexString(params.sharedSecretKey) ); + } - commiterAddress = preConfHash.recover(commitmentSignature); + function _recoverCommitterAddress( + bytes32 preConfHash, + bytes memory commitmentSignature + ) internal pure returns (address) { + return preConfHash.recover(commitmentSignature); } /** @@ -364,11 +383,11 @@ contract PreConfCommitmentStore is OwnableUpgradeable, UUPSUpgradeable { ) public pure returns (bytes32) { return keccak256( - abi.encodePacked( - commitment.commitmentHash, - commitment.commitmentSignature - ) - ); + abi.encodePacked( + commitment.commitmentHash, + commitment.commitmentSignature + ) + ); } /** @@ -381,11 +400,11 @@ contract PreConfCommitmentStore is OwnableUpgradeable, UUPSUpgradeable { ) public pure returns (bytes32) { return keccak256( - abi.encodePacked( - commitment.commitmentDigest, - commitment.commitmentSignature - ) - ); + abi.encodePacked( + commitment.commitmentDigest, + commitment.commitmentSignature + ) + ); } /** @@ -437,8 +456,8 @@ contract PreConfCommitmentStore is OwnableUpgradeable, UUPSUpgradeable { _bytesToHexString(sharedSecretKey) ); EncrPreConfCommitment - memory encryptedCommitment = encryptedCommitments[ - encryptedCommitmentIndex + memory encryptedCommitment = encryptedCommitments[ + encryptedCommitmentIndex ]; require(!encryptedCommitment.isUsed, "Commitment already used"); @@ -459,7 +478,7 @@ contract PreConfCommitmentStore is OwnableUpgradeable, UUPSUpgradeable { address winner = blockTracker.getBlockWinner(blockNumber); require( (msg.sender == winner && winner == commiterAddress) || - msg.sender == bidderAddress, + msg.sender == bidderAddress, "Caller is not a winner provider or bidder" ); @@ -724,4 +743,4 @@ contract PreConfCommitmentStore is OwnableUpgradeable, UUPSUpgradeable { } return string(_string); } -} +} \ No newline at end of file diff --git a/contracts/test/PreConfirmationConfTest.sol b/contracts/test/PreConfirmationConfTest.sol index ad6306685..c22eaa65f 100644 --- a/contracts/test/PreConfirmationConfTest.sol +++ b/contracts/test/PreConfirmationConfTest.sol @@ -152,10 +152,10 @@ contract TestPreConfCommitmentStore is Test { // Step 2: Store the commitment bytes32 commitmentIndex = preConfCommitmentStore .storeEncryptedCommitment( - commitmentDigest, - commitmentSignature, - 1000 - ); + commitmentDigest, + commitmentSignature, + 1000 + ); // Step 3: Verify the results // a. Check that the commitment index is correctly generated and not zero @@ -163,9 +163,9 @@ contract TestPreConfCommitmentStore is Test { // b. Retrieve the commitment by index and verify its properties PreConfCommitmentStore.EncrPreConfCommitment - memory commitment = preConfCommitmentStore.getEncryptedCommitment( - commitmentIndex - ); + memory commitment = preConfCommitmentStore.getEncryptedCommitment( + commitmentIndex + ); // c. Assertions to verify the stored commitment matches the input assertEq(commitment.commiter, committer); @@ -198,7 +198,7 @@ contract TestPreConfCommitmentStore is Test { } function test_StoreCommitmentFailureDueToTimestampValidationWithNewWindow() - public + public { bytes32 commitmentDigest = keccak256( abi.encodePacked("commitment data") @@ -448,10 +448,10 @@ contract TestPreConfCommitmentStore is Test { vm.startPrank(commiter); bytes32 commitmentIndex = preConfCommitmentStore .storeEncryptedCommitment( - commitmentHash, - commitmentSignature, - dispatchTimestamp - ); + commitmentHash, + commitmentSignature, + dispatchTimestamp + ); vm.stopPrank(); return commitmentIndex; } @@ -499,21 +499,22 @@ contract TestPreConfCommitmentStore is Test { bytes memory sharedSecretKey ) public view { PreConfCommitmentStore.PreConfCommitment - memory commitment = preConfCommitmentStore.getCommitment(index); - - (, address commiterAddress) = preConfCommitmentStore - .verifyPreConfCommitment( - txnHash, - revertingTxHashes, - bid, - blockNumber, - decayStartTimestamp, - decayEndTimestamp, - commitment.bidHash, - bidSignature, - commitmentSignature, - sharedSecretKey - ); + memory commitment = preConfCommitmentStore.getCommitment(index); + + PreConfCommitmentStore.CommitmentParams memory commitmentParams = PreConfCommitmentStore.CommitmentParams({ + txnHash: txnHash, + revertingTxHashes: revertingTxHashes, + bid: bid, + blockNumber: blockNumber, + decayStartTimeStamp: decayStartTimestamp, + decayEndTimeStamp: decayEndTimestamp, + bidHash: commitment.bidHash, + bidSignature: bidSignature, + commitmentSignature: commitmentSignature, + sharedSecretKey: sharedSecretKey + }); + + (, address commiterAddress) = preConfCommitmentStore.verifyPreConfCommitment(commitmentParams); assertNotEq(commiterAddress, address(0)); assertEq(commitment.bid, bid, "Stored bid should match input bid"); @@ -575,8 +576,8 @@ contract TestPreConfCommitmentStore is Test { _testCommitmentAliceBob.sharedSecretKey ); PreConfCommitmentStore.EncrPreConfCommitment - memory storedCommitment = preConfCommitmentStore - .getEncryptedCommitment(commitmentIndex); + memory storedCommitment = preConfCommitmentStore + .getEncryptedCommitment(commitmentIndex); assertEq( storedCommitment.commitmentDigest, @@ -596,9 +597,9 @@ contract TestPreConfCommitmentStore is Test { vm.prank(bidder); uint256 depositWindow = WindowFromBlockNumber .getWindowFromBlockNumber( - _testCommitmentAliceBob.blockNumber, - blocksPerWindow - ); + _testCommitmentAliceBob.blockNumber, + blocksPerWindow + ); bidderRegistry.depositForSpecificWindow{value: 2 ether}( depositWindow ); @@ -670,7 +671,7 @@ contract TestPreConfCommitmentStore is Test { preConfCommitmentStore.initiateSlash(index, 100); (isUsed, , , , , , , , , , , , , ,) = preConfCommitmentStore - .commitments(index); + .commitments(index); // Verify that the commitment has been deleted assert(isUsed == true); } @@ -685,9 +686,9 @@ contract TestPreConfCommitmentStore is Test { vm.prank(bidder); uint256 depositWindow = WindowFromBlockNumber .getWindowFromBlockNumber( - _testCommitmentAliceBob.blockNumber, - blocksPerWindow - ); + _testCommitmentAliceBob.blockNumber, + blocksPerWindow + ); bidderRegistry.depositForSpecificWindow{value: 2 ether}( depositWindow ); @@ -757,7 +758,7 @@ contract TestPreConfCommitmentStore is Test { preConfCommitmentStore.initiateReward(index, 100); (isUsed, , , , , , , , , , , , , ,) = preConfCommitmentStore - .commitments(index); + .commitments(index); // Verify that the commitment has been marked as used assert(isUsed == true); // commitmentHash value is internal to contract and not asserted @@ -770,9 +771,9 @@ contract TestPreConfCommitmentStore is Test { (address bidder, ) = makeAddrAndKey("alice"); uint256 depositWindow = WindowFromBlockNumber .getWindowFromBlockNumber( - _testCommitmentAliceBob.blockNumber, - blocksPerWindow - ); + _testCommitmentAliceBob.blockNumber, + blocksPerWindow + ); vm.deal(bidder, 5 ether); vm.prank(bidder); bidderRegistry.depositForSpecificWindow{value: 2 ether}( @@ -846,7 +847,7 @@ contract TestPreConfCommitmentStore is Test { preConfCommitmentStore.initiateReward(index, 0); (isUsed, , , , , , , , , , , , , ,) = preConfCommitmentStore - .commitments(index); + .commitments(index); // Verify that the commitment has been marked as used assert(isUsed == true); // commitmentHash value is internal to contract and not asserted @@ -867,4 +868,4 @@ contract TestPreConfCommitmentStore is Test { } return string(_string); } -} +} \ No newline at end of file From deac3fbbc56786dc5d5fcd19d0361ae5d370b3d6 Mon Sep 17 00:00:00 2001 From: Kartik Chopra Date: Sun, 7 Jul 2024 19:02:55 -0400 Subject: [PATCH 17/41] feat: resolves all issues with solidity tests --- contracts/contracts/PreConfCommitmentStore.sol | 2 +- .../interfaces/IPreConfCommitmentStore.sol | 2 ++ contracts/test/OracleTest.sol | 9 +++++++-- contracts/test/PreConfirmationConfTest.sol | 14 +++++++++----- 4 files changed, 19 insertions(+), 8 deletions(-) diff --git a/contracts/contracts/PreConfCommitmentStore.sol b/contracts/contracts/PreConfCommitmentStore.sol index 9d4ef0fe3..958530429 100644 --- a/contracts/contracts/PreConfCommitmentStore.sol +++ b/contracts/contracts/PreConfCommitmentStore.sol @@ -9,6 +9,7 @@ import {IProviderRegistry} from "./interfaces/IProviderRegistry.sol"; import {IBidderRegistry} from "./interfaces/IBidderRegistry.sol"; import {IBlockTracker} from "./interfaces/IBlockTracker.sol"; import {WindowFromBlockNumber} from "./utils/WindowFromBlockNumber.sol"; +import "forge-std/console.sol"; /** * @title PreConfCommitmentStore - A contract for managing preconfirmation commitments and bids. @@ -504,7 +505,6 @@ contract PreConfCommitmentStore is OwnableUpgradeable, UUPSUpgradeable { // Store commitment commitments[commitmentIndex] = newCommitment; - // Mark the encrypted commitment as used encryptedCommitments[encryptedCommitmentIndex].isUsed = true; diff --git a/contracts/contracts/interfaces/IPreConfCommitmentStore.sol b/contracts/contracts/interfaces/IPreConfCommitmentStore.sol index f8eb8ba7d..214b0429a 100644 --- a/contracts/contracts/interfaces/IPreConfCommitmentStore.sol +++ b/contracts/contracts/interfaces/IPreConfCommitmentStore.sol @@ -19,10 +19,12 @@ interface IPreConfCommitmentStore { uint64 decayStartTimeStamp; uint64 decayEndTimeStamp; string txnHash; + string revertingTxHashes; bytes32 commitmentHash; bytes bidSignature; bytes commitmentSignature; uint64 dispatchTimestamp; + bytes sharedSecretKey; } event SignatureVerified( diff --git a/contracts/test/OracleTest.sol b/contracts/test/OracleTest.sol index 211dc61a5..e9571650a 100644 --- a/contracts/test/OracleTest.sol +++ b/contracts/test/OracleTest.sol @@ -11,6 +11,7 @@ import "../contracts/BlockTracker.sol"; import {Upgrades} from "openzeppelin-foundry-upgrades/Upgrades.sol"; import {WindowFromBlockNumber} from "../contracts/utils/WindowFromBlockNumber.sol"; +import "forge-std/console.sol"; contract OracleTest is Test { address public owner; @@ -61,7 +62,7 @@ contract OracleTest is Test { function setUp() public { testNumber = 2; testNumber2 = 2; - sharedSecretKey = abi.encodePacked(keccak256("0xsecret")); + sharedSecretKey = bytes("0xsecret"); _testCommitmentAliceBob = TestCommitment( 2, 2, @@ -521,7 +522,6 @@ contract OracleTest is Test { ); vm.stopPrank(); } - vm.startPrank(address(0x6d503Fd50142C7C469C7c6B64794B55bfa6883f3)); for (uint256 i = 0; i < commitments.length; i++) { vm.expectEmit(true, false, false, true); @@ -551,6 +551,7 @@ contract OracleTest is Test { ) public returns (bytes32 commitmentIndex) { bytes32 bidHash = getBidHash(txnHash, revertingTxHashes, bid, blockNumber); bytes memory bidSignature = getBidSignature(bidderPk, bidHash); + bytes32 commitmentHash = getCommitmentHash( txnHash, revertingTxHashes, @@ -559,10 +560,14 @@ contract OracleTest is Test { bidHash, bidSignature ); + console.log("commitmentHash"); + console.logBytes32(commitmentHash); bytes memory commitmentSignature = getCommitmentSignature( signerPk, commitmentHash ); + console.log("commitmentSignature"); + console.logBytes(commitmentSignature); bytes32 encryptedCommitmentIndex = storeEncryptedCommitment( provider, diff --git a/contracts/test/PreConfirmationConfTest.sol b/contracts/test/PreConfirmationConfTest.sol index c22eaa65f..aee663dd4 100644 --- a/contracts/test/PreConfirmationConfTest.sol +++ b/contracts/test/PreConfirmationConfTest.sol @@ -48,10 +48,10 @@ contract TestPreConfCommitmentStore is Test { "0xkartik", 10, 20, - 0x56c06a13be335eba981b780ea45dff258a7c429d0e9d993235ef2d3a7e435df8, - 0x9d954942ad3f6cb41ccd029869be7b28036270b4754665a3783c2d6bf0ef7d08, - hex"2e7df27808c72d7d5b2543bb63b06c0ae2144e021593b8d2a7cca6a3fb2d9c4b1a82dd2a07266de9364d255bdb709476ad96b826ec855efb528eaff66682997e1c", - hex"682a1bc8659a0d2616f579ca0e0944d4e21911e65561b7d9ae7dba36c5a5b699248f1c93e8e6f52492ee6c3cb0f34f20f5a97fb2653c5a67200e1de9254389e11c", + 0x9890bcda118cfabed02ff3b9d05a54dca5310e9ace3b05f259f4731f58ad0900, + 0x5798166a22386ff729228c55f79ebff1abe1ea579989d7d59a46a1e50590e2e1, + hex"f9b66c6d57dac947a3aa2b37010df745592cf57f907d437767bc0af6d44b3dc1112168e4cab311d6dfddf7f58c0d07bb95403fca2cc48d4450e088cf9ee894c81b", + hex"5b3000290d4f347b94146eb37f66d5368aed18fb8713bf78620abe40ae3de7f635f7ed161801c31ea10e736d88e6fd2a2286bbd59385161dd24c9fefd2568f341b", 15, bytes("0xsecret") ); @@ -433,7 +433,8 @@ contract TestPreConfCommitmentStore is Test { decayStartTimestamp, decayEndTimestamp ); - + console.log("bidHash"); + console.logBytes32(bidHash); bytes32 commitmentHash = preConfCommitmentStore.getPreConfHash( txnHash, revertingTxHashes, @@ -445,6 +446,8 @@ contract TestPreConfCommitmentStore is Test { _bytesToHexString(bidSignature), _bytesToHexString(sharedSecretKey) ); + console.log("commitmentHash"); + console.logBytes32(commitmentHash); vm.startPrank(commiter); bytes32 commitmentIndex = preConfCommitmentStore .storeEncryptedCommitment( @@ -562,6 +565,7 @@ contract TestPreConfCommitmentStore is Test { // Step 2: Store the commitment (address commiter, ) = makeAddrAndKey("bob"); vm.deal(commiter, 5 ether); + bytes32 commitmentIndex = storeCommitment( commiter, _testCommitmentAliceBob.bid, From cd2b085d10d9ae33fb74ff218dc1d8f4e155b9bf Mon Sep 17 00:00:00 2001 From: Kartik Chopra Date: Sun, 7 Jul 2024 19:04:32 -0400 Subject: [PATCH 18/41] feat: removes console logs --- contracts/test/OracleTest.sol | 6 ++---- contracts/test/PreConfirmationConfTest.sol | 7 +------ 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/contracts/test/OracleTest.sol b/contracts/test/OracleTest.sol index e9571650a..fb79c0076 100644 --- a/contracts/test/OracleTest.sol +++ b/contracts/test/OracleTest.sol @@ -560,14 +560,12 @@ contract OracleTest is Test { bidHash, bidSignature ); - console.log("commitmentHash"); - console.logBytes32(commitmentHash); + bytes memory commitmentSignature = getCommitmentSignature( signerPk, commitmentHash ); - console.log("commitmentSignature"); - console.logBytes(commitmentSignature); + bytes32 encryptedCommitmentIndex = storeEncryptedCommitment( provider, diff --git a/contracts/test/PreConfirmationConfTest.sol b/contracts/test/PreConfirmationConfTest.sol index aee663dd4..e33b9d2b0 100644 --- a/contracts/test/PreConfirmationConfTest.sol +++ b/contracts/test/PreConfirmationConfTest.sol @@ -269,7 +269,6 @@ contract TestPreConfCommitmentStore is Test { (uint8 v, bytes32 r, bytes32 s) = vm.sign(bidderPk, bidHash); bytes memory signature = abi.encodePacked(r, s, v); - console.logBytes(signature); bytes memory sharedSecretKey = bytes("0xsecret"); bytes32 preConfHash = preConfCommitmentStore.getPreConfHash( _testCommitmentAliceBob.txnHash, @@ -287,7 +286,6 @@ contract TestPreConfCommitmentStore is Test { (, uint256 providerPk) = makeAddrAndKey("bob"); (v, r, s) = vm.sign(providerPk, preConfHash); signature = abi.encodePacked(r, s, v); - console.logBytes(signature); } function _bytes32ToHexString( @@ -433,8 +431,7 @@ contract TestPreConfCommitmentStore is Test { decayStartTimestamp, decayEndTimestamp ); - console.log("bidHash"); - console.logBytes32(bidHash); + bytes32 commitmentHash = preConfCommitmentStore.getPreConfHash( txnHash, revertingTxHashes, @@ -446,8 +443,6 @@ contract TestPreConfCommitmentStore is Test { _bytesToHexString(bidSignature), _bytesToHexString(sharedSecretKey) ); - console.log("commitmentHash"); - console.logBytes32(commitmentHash); vm.startPrank(commiter); bytes32 commitmentIndex = preConfCommitmentStore .storeEncryptedCommitment( From c4658837659ff0d8408772120e7b9fa88e6d0587 Mon Sep 17 00:00:00 2001 From: Kartik Chopra Date: Sun, 7 Jul 2024 19:56:28 -0400 Subject: [PATCH 19/41] chore: reverts updater to main --- oracle/pkg/updater/updater.go | 92 ------------------------------ oracle/pkg/updater/updater_test.go | 22 ------- 2 files changed, 114 deletions(-) diff --git a/oracle/pkg/updater/updater.go b/oracle/pkg/updater/updater.go index 18554fc53..1f1ae92e5 100644 --- a/oracle/pkg/updater/updater.go +++ b/oracle/pkg/updater/updater.go @@ -92,7 +92,6 @@ type Oracle interface { type EVMClient interface { BlockByNumber(ctx context.Context, number *big.Int) (*types.Block, error) - TransactionReceipt(ctx context.Context, txHash common.Hash) (*types.Receipt, error) } type Updater struct { @@ -337,16 +336,9 @@ func (u *Updater) handleOpenedCommitment( ) commitmentTxnHashes := strings.Split(update.TxnHash, ",") - // TODO(@ckartik): replace this with a set of revertable txns from the bidder - revertableTxnHashes := make(map[string]struct{}) - // We want to temporarily emulate a skip list of transactions that can be either removed or not succeed and still have a valid commitment. - // There are three states: the txn is present and successful, the txn is present but reverted, or the txn is missing entirely. - // We can operate on this with a set inclusion check for revertable txns and a separate check for missing txns. // Ensure Bundle is atomic and present in the block - expectedPos := txns[commitmentTxnHashes[0]].PosInBlock for i := 0; i < len(commitmentTxnHashes); i++ { txnDetails, found := txns[commitmentTxnHashes[i]] -<<<<<<< HEAD if !found || txnDetails.PosInBlock != (txns[commitmentTxnHashes[0]].PosInBlock)+i || !txnDetails.Succeeded { u.logger.Info( "bundle does not satsify commited requirements", @@ -368,53 +360,7 @@ func (u *Updater) handleOpenedCommitment( decayPercentage, winner.Window, ) -======= - if !found { - // NOTE(@ckartik): we can also add droppable here in case that's needed. - if _, revertable := revertableTxnHashes[commitmentTxnHashes[i]]; !revertable { - u.logger.Info( - "bundle is not atomic: transaction missing", - "commitmentIdx", common.Bytes2Hex(update.CommitmentIndex[:]), - "txnHash", commitmentTxnHashes[i], - "blockNumber", update.BlockNumber, - ) - return u.settle(ctx, update, SettlementTypeSlash, decayPercentage, winner.Window) - } - continue // Skip this transaction as it's revertable and missing ->>>>>>> c3cfccb (feat: reorganizes the oracle check for revertable txns) - } - if txnDetails.PosInBlock != expectedPos { - u.logger.Info( - "bundle is not atomic: incorrect position", - "commitmentIdx", common.Bytes2Hex(update.CommitmentIndex[:]), - "txnHash", commitmentTxnHashes[i], - "blockNumber", update.BlockNumber, - "actualPos", txnDetails.PosInBlock, - "expectedPos", expectedPos, - ) - return u.settle(ctx, update, SettlementTypeSlash, decayPercentage, winner.Window) - } - if !txnDetails.Succeeded && revertableTxnHashes[commitmentTxnHashes[i]] == struct{}{} { - u.logger.Info( - "revertable transaction failed", - "commitmentIdx", common.Bytes2Hex(update.CommitmentIndex[:]), - "txnHash", commitmentTxnHashes[i], - "blockNumber", update.BlockNumber, - ) - // This is allowed, so we continue to the next transaction - expectedPos++ // Increment expected position for the next transaction - continue - } - if !txnDetails.Succeeded { - u.logger.Info( - "non-revertable transaction failed", - "commitmentIdx", common.Bytes2Hex(update.CommitmentIndex[:]), - "txnHash", commitmentTxnHashes[i], - "blockNumber", update.BlockNumber, - ) - return u.settle(ctx, update, SettlementTypeSlash, decayPercentage, winner.Window) } - expectedPos++ // Increment expected position for the next transaction } return u.settle( @@ -517,7 +463,6 @@ func (u *Updater) addSettlement( return nil } - func (u *Updater) getL1Txns(ctx context.Context, blockNum uint64) (map[string]TxMetadata, error) { txns, ok := u.l1BlockCache.Get(blockNum) if ok { @@ -535,44 +480,7 @@ func (u *Updater) getL1Txns(ctx context.Context, blockNum uint64) (map[string]Tx return nil, fmt.Errorf("failed to get block by number: %w", err) } -<<<<<<< HEAD u.logger.Info("retrieved block", "blockNum", blockNum, "blockHash", block.Hash().Hex()) -======= - txnsInBlock := make(map[string]TxMetadata) - var wg sync.WaitGroup - var mu sync.Mutex - var receiptErr error - - processTransactionMetadata := func(posInBlock int, tx *types.Transaction) { - defer wg.Done() - receipt, err := u.l1Client.TransactionReceipt(ctx, tx.Hash()) - if err != nil { - u.logger.Error("failed to get transaction receipt", "txHash", tx.Hash().Hex(), "error", err) - mu.Lock() - receiptErr = err - mu.Unlock() - return - } - txSucceeded := receipt.Status == types.ReceiptStatusSuccessful - mu.Lock() - txnsInBlock[strings.TrimPrefix(tx.Hash().Hex(), "0x")] = TxMetadata{PosInBlock: posInBlock, Succeeded: txSucceeded} - mu.Unlock() - } - - for posInBlock, tx := range block.Transactions() { - - wg.Add(1) - go processTransactionMetadata(posInBlock, tx) - } - - wg.Wait() - - if receiptErr != nil { - return nil, receiptErr - } - - _ = u.l1BlockCache.Add(blockNum, txnsInBlock) ->>>>>>> e18f314 (feat: request receipts concurrently) var txnReceipts sync.Map eg, ctx := errgroup.WithContext(ctx) diff --git a/oracle/pkg/updater/updater_test.go b/oracle/pkg/updater/updater_test.go index 41953d30e..12176098d 100644 --- a/oracle/pkg/updater/updater_test.go +++ b/oracle/pkg/updater/updater_test.go @@ -360,11 +360,7 @@ func TestUpdaterRevertedTxns(t *testing.T) { signer := types.NewLondonSigner(big.NewInt(5)) var txns []*types.Transaction -<<<<<<< HEAD for i := range 10 { -======= - for i := 0; i < 10; i++ { ->>>>>>> 1ad9a07 (feat: adds a revert check in tests) txns = append(txns, types.MustSignNewTx(key, signer, &types.DynamicFeeTx{ Nonce: uint64(i + 1), Gas: 1000000, @@ -412,11 +408,7 @@ func TestUpdaterRevertedTxns(t *testing.T) { } // constructing bundles -<<<<<<< HEAD for i := range 10 { -======= - for i := 0; i < 10; i++ { ->>>>>>> 1ad9a07 (feat: adds a revert check in tests) idxBytes := getIdxBytes(int64(i + 10)) bundle := strings.TrimPrefix(txns[i].Hash().Hex(), "0x") @@ -494,15 +486,12 @@ func TestUpdaterRevertedTxns(t *testing.T) { oracle := &testOracle{ commitments: make(chan processedCommitment, 1), } -<<<<<<< HEAD testBatcher := &testBatcher{ failedReceipts: make(map[common.Hash]bool), } for _, txn := range txns { testBatcher.failedReceipts[txn.Hash()] = true } -======= ->>>>>>> 1ad9a07 (feat: adds a revert check in tests) updtr, err := updater.NewUpdater( slog.New(slog.NewTextHandler(io.Discard, nil)), @@ -510,10 +499,7 @@ func TestUpdaterRevertedTxns(t *testing.T) { register, evtMgr, oracle, -<<<<<<< HEAD testBatcher, -======= ->>>>>>> 1ad9a07 (feat: adds a revert check in tests) ) if err != nil { t.Fatal(err) @@ -1141,14 +1127,6 @@ func (t *testEVMClient) BlockByNumber(ctx context.Context, blkNum *big.Int) (*ty return blk, nil } -func (t *testEVMClient) TransactionReceipt(ctx context.Context, txHash common.Hash) (*types.Receipt, error) { - receipt, found := t.receipts[txHash.Hex()] - if !found { - return nil, fmt.Errorf("receipt for transaction hash %s not found", txHash.Hex()) - } - return receipt, nil -} - type processedCommitment struct { commitmentIdx [32]byte blockNum *big.Int From 6a8a3427d1bc23bcaf21efa2bc75f5cea69dd8ab Mon Sep 17 00:00:00 2001 From: Kartik Chopra Date: Sun, 7 Jul 2024 20:16:50 -0400 Subject: [PATCH 20/41] feat: generates new abi code --- contracts-abi/abi/PreConfCommitmentStore.abi | 145 ++++++++---- .../PreConfCommitmentStore.go | 212 ++++++++++-------- oracle/pkg/updater/updater.go | 2 + 3 files changed, 221 insertions(+), 138 deletions(-) diff --git a/contracts-abi/abi/PreConfCommitmentStore.abi b/contracts-abi/abi/PreConfCommitmentStore.abi index a6a49c9ec..48dff1852 100644 --- a/contracts-abi/abi/PreConfCommitmentStore.abi +++ b/contracts-abi/abi/PreConfCommitmentStore.abi @@ -204,6 +204,11 @@ "type": "string", "internalType": "string" }, + { + "name": "revertingTxHashes", + "type": "string", + "internalType": "string" + }, { "name": "commitmentHash", "type": "bytes32", @@ -299,6 +304,11 @@ "type": "string", "internalType": "string" }, + { + "name": "_revertingTxHashes", + "type": "string", + "internalType": "string" + }, { "name": "_bid", "type": "uint256", @@ -390,6 +400,11 @@ "type": "string", "internalType": "string" }, + { + "name": "revertingTxHashes", + "type": "string", + "internalType": "string" + }, { "name": "commitmentHash", "type": "bytes32", @@ -474,6 +489,11 @@ "type": "string", "internalType": "string" }, + { + "name": "revertingTxHashes", + "type": "string", + "internalType": "string" + }, { "name": "commitmentHash", "type": "bytes32", @@ -612,6 +632,11 @@ "type": "string", "internalType": "string" }, + { + "name": "_revertingTxHashes", + "type": "string", + "internalType": "string" + }, { "name": "_bid", "type": "uint256", @@ -792,6 +817,11 @@ "type": "string", "internalType": "string" }, + { + "name": "revertingTxHashes", + "type": "string", + "internalType": "string" + }, { "name": "decayStartTimeStamp", "type": "uint64", @@ -1027,6 +1057,11 @@ "type": "string", "internalType": "string" }, + { + "name": "revertingTxHashes", + "type": "string", + "internalType": "string" + }, { "name": "bidSignature", "type": "bytes", @@ -1052,49 +1087,61 @@ "name": "verifyPreConfCommitment", "inputs": [ { - "name": "txnHash", - "type": "string", - "internalType": "string" - }, - { - "name": "bid", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "blockNumber", - "type": "uint64", - "internalType": "uint64" - }, - { - "name": "decayStartTimeStamp", - "type": "uint64", - "internalType": "uint64" - }, - { - "name": "decayEndTimeStamp", - "type": "uint64", - "internalType": "uint64" - }, - { - "name": "bidHash", - "type": "bytes32", - "internalType": "bytes32" - }, - { - "name": "bidSignature", - "type": "bytes", - "internalType": "bytes" - }, - { - "name": "commitmentSignature", - "type": "bytes", - "internalType": "bytes" - }, - { - "name": "sharedSecretKey", - "type": "bytes", - "internalType": "bytes" + "name": "params", + "type": "tuple", + "internalType": "struct PreConfCommitmentStore.CommitmentParams", + "components": [ + { + "name": "txnHash", + "type": "string", + "internalType": "string" + }, + { + "name": "revertingTxHashes", + "type": "string", + "internalType": "string" + }, + { + "name": "bid", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "blockNumber", + "type": "uint64", + "internalType": "uint64" + }, + { + "name": "decayStartTimeStamp", + "type": "uint64", + "internalType": "uint64" + }, + { + "name": "decayEndTimeStamp", + "type": "uint64", + "internalType": "uint64" + }, + { + "name": "bidHash", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "bidSignature", + "type": "bytes", + "internalType": "bytes" + }, + { + "name": "commitmentSignature", + "type": "bytes", + "internalType": "bytes" + }, + { + "name": "sharedSecretKey", + "type": "bytes", + "internalType": "bytes" + } + ] } ], "outputs": [ @@ -1169,6 +1216,12 @@ "indexed": false, "internalType": "string" }, + { + "name": "revertingTxHashes", + "type": "string", + "indexed": false, + "internalType": "string" + }, { "name": "commitmentHash", "type": "bytes32", @@ -1287,6 +1340,12 @@ "indexed": false, "internalType": "string" }, + { + "name": "revertingTxHashes", + "type": "string", + "indexed": false, + "internalType": "string" + }, { "name": "bid", "type": "uint256", diff --git a/contracts-abi/clients/PreConfCommitmentStore/PreConfCommitmentStore.go b/contracts-abi/clients/PreConfCommitmentStore/PreConfCommitmentStore.go index 2e5622eaf..49d325bca 100644 --- a/contracts-abi/clients/PreConfCommitmentStore/PreConfCommitmentStore.go +++ b/contracts-abi/clients/PreConfCommitmentStore/PreConfCommitmentStore.go @@ -29,6 +29,20 @@ var ( _ = abi.ConvertType ) +// PreConfCommitmentStoreCommitmentParams is an auto generated low-level Go binding around an user-defined struct. +type PreConfCommitmentStoreCommitmentParams struct { + TxnHash string + RevertingTxHashes string + Bid *big.Int + BlockNumber uint64 + DecayStartTimeStamp uint64 + DecayEndTimeStamp uint64 + BidHash [32]byte + BidSignature []byte + CommitmentSignature []byte + SharedSecretKey []byte +} + // PreConfCommitmentStoreEncrPreConfCommitment is an auto generated low-level Go binding around an user-defined struct. type PreConfCommitmentStoreEncrPreConfCommitment struct { IsUsed bool @@ -49,6 +63,7 @@ type PreConfCommitmentStorePreConfCommitment struct { DecayStartTimeStamp uint64 DecayEndTimeStamp uint64 TxnHash string + RevertingTxHashes string CommitmentHash [32]byte BidSignature []byte CommitmentSignature []byte @@ -58,7 +73,7 @@ type PreConfCommitmentStorePreConfCommitment struct { // PreconfcommitmentstoreMetaData contains all meta data concerning the Preconfcommitmentstore contract. var PreconfcommitmentstoreMetaData = &bind.MetaData{ - ABI: "[{\"type\":\"constructor\",\"inputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"fallback\",\"stateMutability\":\"payable\"},{\"type\":\"receive\",\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"DOMAIN_SEPARATOR_BID\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"DOMAIN_SEPARATOR_PRECONF\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"EIP712_BID_TYPEHASH\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"EIP712_COMMITMENT_TYPEHASH\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"UPGRADE_INTERFACE_VERSION\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"_bytesToHexString\",\"inputs\":[{\"name\":\"_bytes\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"pure\"},{\"type\":\"function\",\"name\":\"bidderRegistry\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIBidderRegistry\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"blockTracker\",\"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\":\"commitmentDispatchWindow\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"commitments\",\"inputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"isUsed\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"bidder\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"commiter\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"bid\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"blockNumber\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"bidHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"decayStartTimeStamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"decayEndTimeStamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"txnHash\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"commitmentHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"bidSignature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"commitmentSignature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"dispatchTimestamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"sharedSecretKey\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"commitmentsCount\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"encryptedCommitments\",\"inputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"isUsed\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"commiter\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"commitmentDigest\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"commitmentSignature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"dispatchTimestamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getBidHash\",\"inputs\":[{\"name\":\"_txnHash\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"_bid\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_blockNumber\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"_decayStartTimeStamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"_decayEndTimeStamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getCommitment\",\"inputs\":[{\"name\":\"commitmentIndex\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structPreConfCommitmentStore.PreConfCommitment\",\"components\":[{\"name\":\"isUsed\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"bidder\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"commiter\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"bid\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"blockNumber\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"bidHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"decayStartTimeStamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"decayEndTimeStamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"txnHash\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"commitmentHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"bidSignature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"commitmentSignature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"dispatchTimestamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"sharedSecretKey\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getCommitmentIndex\",\"inputs\":[{\"name\":\"commitment\",\"type\":\"tuple\",\"internalType\":\"structPreConfCommitmentStore.PreConfCommitment\",\"components\":[{\"name\":\"isUsed\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"bidder\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"commiter\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"bid\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"blockNumber\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"bidHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"decayStartTimeStamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"decayEndTimeStamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"txnHash\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"commitmentHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"bidSignature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"commitmentSignature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"dispatchTimestamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"sharedSecretKey\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"pure\"},{\"type\":\"function\",\"name\":\"getEncryptedCommitment\",\"inputs\":[{\"name\":\"commitmentIndex\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structPreConfCommitmentStore.EncrPreConfCommitment\",\"components\":[{\"name\":\"isUsed\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"commiter\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"commitmentDigest\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"commitmentSignature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"dispatchTimestamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getEncryptedCommitmentIndex\",\"inputs\":[{\"name\":\"commitment\",\"type\":\"tuple\",\"internalType\":\"structPreConfCommitmentStore.EncrPreConfCommitment\",\"components\":[{\"name\":\"isUsed\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"commiter\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"commitmentDigest\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"commitmentSignature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"dispatchTimestamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"pure\"},{\"type\":\"function\",\"name\":\"getPreConfHash\",\"inputs\":[{\"name\":\"_txnHash\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"_bid\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_blockNumber\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"_decayStartTimeStamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"_decayEndTimeStamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"_bidHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"_bidSignature\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"_sharedSecretKey\",\"type\":\"string\",\"internalType\":\"string\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getTxnHashFromCommitment\",\"inputs\":[{\"name\":\"commitmentIndex\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"txnHash\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"initialize\",\"inputs\":[{\"name\":\"_providerRegistry\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_bidderRegistry\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_oracle\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_owner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_blockTracker\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_commitmentDispatchWindow\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"_blocksPerWindow\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"initiateReward\",\"inputs\":[{\"name\":\"commitmentIndex\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"residualBidPercentAfterDecay\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"initiateSlash\",\"inputs\":[{\"name\":\"commitmentIndex\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"residualBidPercentAfterDecay\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"lastProcessedBlock\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"openCommitment\",\"inputs\":[{\"name\":\"encryptedCommitmentIndex\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"bid\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"blockNumber\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"txnHash\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"decayStartTimeStamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"decayEndTimeStamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"bidSignature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"commitmentSignature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"sharedSecretKey\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"commitmentIndex\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"oracle\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"owner\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"providerRegistry\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIProviderRegistry\"}],\"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\":\"storeEncryptedCommitment\",\"inputs\":[{\"name\":\"commitmentDigest\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"commitmentSignature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"dispatchTimestamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"outputs\":[{\"name\":\"commitmentIndex\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"transferOwnership\",\"inputs\":[{\"name\":\"newOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"updateBidderRegistry\",\"inputs\":[{\"name\":\"newBidderRegistry\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"updateCommitmentDispatchWindow\",\"inputs\":[{\"name\":\"newDispatchWindow\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"updateOracle\",\"inputs\":[{\"name\":\"newOracle\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"updateProviderRegistry\",\"inputs\":[{\"name\":\"newProviderRegistry\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"upgradeToAndCall\",\"inputs\":[{\"name\":\"newImplementation\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"data\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"verifyBid\",\"inputs\":[{\"name\":\"bid\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"blockNumber\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"decayStartTimeStamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"decayEndTimeStamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"txnHash\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"bidSignature\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"messageDigest\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"recoveredAddress\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"verifyPreConfCommitment\",\"inputs\":[{\"name\":\"txnHash\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"bid\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"blockNumber\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"decayStartTimeStamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"decayEndTimeStamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"bidHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"bidSignature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"commitmentSignature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"sharedSecretKey\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"preConfHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"commiterAddress\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"event\",\"name\":\"CommitmentStored\",\"inputs\":[{\"name\":\"commitmentIndex\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"bidder\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"commiter\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"bid\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"blockNumber\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"},{\"name\":\"bidHash\",\"type\":\"bytes32\",\"indexed\":false,\"internalType\":\"bytes32\"},{\"name\":\"decayStartTimeStamp\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"},{\"name\":\"decayEndTimeStamp\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"},{\"name\":\"txnHash\",\"type\":\"string\",\"indexed\":false,\"internalType\":\"string\"},{\"name\":\"commitmentHash\",\"type\":\"bytes32\",\"indexed\":false,\"internalType\":\"bytes32\"},{\"name\":\"bidSignature\",\"type\":\"bytes\",\"indexed\":false,\"internalType\":\"bytes\"},{\"name\":\"commitmentSignature\",\"type\":\"bytes\",\"indexed\":false,\"internalType\":\"bytes\"},{\"name\":\"dispatchTimestamp\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"},{\"name\":\"sharedSecretKey\",\"type\":\"bytes\",\"indexed\":false,\"internalType\":\"bytes\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"EncryptedCommitmentStored\",\"inputs\":[{\"name\":\"commitmentIndex\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"commiter\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"commitmentDigest\",\"type\":\"bytes32\",\"indexed\":false,\"internalType\":\"bytes32\"},{\"name\":\"commitmentSignature\",\"type\":\"bytes\",\"indexed\":false,\"internalType\":\"bytes\"},{\"name\":\"dispatchTimestamp\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"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\":\"SignatureVerified\",\"inputs\":[{\"name\":\"signer\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"txnHash\",\"type\":\"string\",\"indexed\":false,\"internalType\":\"string\"},{\"name\":\"bid\",\"type\":\"uint256\",\"indexed\":true,\"internalType\":\"uint256\"},{\"name\":\"blockNumber\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"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\":\"DOMAIN_SEPARATOR_BID\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"DOMAIN_SEPARATOR_PRECONF\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"EIP712_BID_TYPEHASH\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"EIP712_COMMITMENT_TYPEHASH\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"UPGRADE_INTERFACE_VERSION\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"_bytesToHexString\",\"inputs\":[{\"name\":\"_bytes\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"pure\"},{\"type\":\"function\",\"name\":\"bidderRegistry\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIBidderRegistry\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"blockTracker\",\"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\":\"commitmentDispatchWindow\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"commitments\",\"inputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"isUsed\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"bidder\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"commiter\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"bid\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"blockNumber\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"bidHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"decayStartTimeStamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"decayEndTimeStamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"txnHash\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"revertingTxHashes\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"commitmentHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"bidSignature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"commitmentSignature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"dispatchTimestamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"sharedSecretKey\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"commitmentsCount\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"encryptedCommitments\",\"inputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"isUsed\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"commiter\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"commitmentDigest\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"commitmentSignature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"dispatchTimestamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getBidHash\",\"inputs\":[{\"name\":\"_txnHash\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"_revertingTxHashes\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"_bid\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_blockNumber\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"_decayStartTimeStamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"_decayEndTimeStamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getCommitment\",\"inputs\":[{\"name\":\"commitmentIndex\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structPreConfCommitmentStore.PreConfCommitment\",\"components\":[{\"name\":\"isUsed\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"bidder\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"commiter\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"bid\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"blockNumber\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"bidHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"decayStartTimeStamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"decayEndTimeStamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"txnHash\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"revertingTxHashes\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"commitmentHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"bidSignature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"commitmentSignature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"dispatchTimestamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"sharedSecretKey\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getCommitmentIndex\",\"inputs\":[{\"name\":\"commitment\",\"type\":\"tuple\",\"internalType\":\"structPreConfCommitmentStore.PreConfCommitment\",\"components\":[{\"name\":\"isUsed\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"bidder\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"commiter\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"bid\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"blockNumber\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"bidHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"decayStartTimeStamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"decayEndTimeStamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"txnHash\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"revertingTxHashes\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"commitmentHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"bidSignature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"commitmentSignature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"dispatchTimestamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"sharedSecretKey\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"pure\"},{\"type\":\"function\",\"name\":\"getEncryptedCommitment\",\"inputs\":[{\"name\":\"commitmentIndex\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structPreConfCommitmentStore.EncrPreConfCommitment\",\"components\":[{\"name\":\"isUsed\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"commiter\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"commitmentDigest\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"commitmentSignature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"dispatchTimestamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getEncryptedCommitmentIndex\",\"inputs\":[{\"name\":\"commitment\",\"type\":\"tuple\",\"internalType\":\"structPreConfCommitmentStore.EncrPreConfCommitment\",\"components\":[{\"name\":\"isUsed\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"commiter\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"commitmentDigest\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"commitmentSignature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"dispatchTimestamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"pure\"},{\"type\":\"function\",\"name\":\"getPreConfHash\",\"inputs\":[{\"name\":\"_txnHash\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"_revertingTxHashes\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"_bid\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_blockNumber\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"_decayStartTimeStamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"_decayEndTimeStamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"_bidHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"_bidSignature\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"_sharedSecretKey\",\"type\":\"string\",\"internalType\":\"string\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getTxnHashFromCommitment\",\"inputs\":[{\"name\":\"commitmentIndex\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"txnHash\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"initialize\",\"inputs\":[{\"name\":\"_providerRegistry\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_bidderRegistry\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_oracle\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_owner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_blockTracker\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_commitmentDispatchWindow\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"_blocksPerWindow\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"initiateReward\",\"inputs\":[{\"name\":\"commitmentIndex\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"residualBidPercentAfterDecay\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"initiateSlash\",\"inputs\":[{\"name\":\"commitmentIndex\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"residualBidPercentAfterDecay\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"lastProcessedBlock\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"openCommitment\",\"inputs\":[{\"name\":\"encryptedCommitmentIndex\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"bid\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"blockNumber\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"txnHash\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"revertingTxHashes\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"decayStartTimeStamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"decayEndTimeStamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"bidSignature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"commitmentSignature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"sharedSecretKey\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"commitmentIndex\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"oracle\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"owner\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"providerRegistry\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIProviderRegistry\"}],\"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\":\"storeEncryptedCommitment\",\"inputs\":[{\"name\":\"commitmentDigest\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"commitmentSignature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"dispatchTimestamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"outputs\":[{\"name\":\"commitmentIndex\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"transferOwnership\",\"inputs\":[{\"name\":\"newOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"updateBidderRegistry\",\"inputs\":[{\"name\":\"newBidderRegistry\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"updateCommitmentDispatchWindow\",\"inputs\":[{\"name\":\"newDispatchWindow\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"updateOracle\",\"inputs\":[{\"name\":\"newOracle\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"updateProviderRegistry\",\"inputs\":[{\"name\":\"newProviderRegistry\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"upgradeToAndCall\",\"inputs\":[{\"name\":\"newImplementation\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"data\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"verifyBid\",\"inputs\":[{\"name\":\"bid\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"blockNumber\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"decayStartTimeStamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"decayEndTimeStamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"txnHash\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"revertingTxHashes\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"bidSignature\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"messageDigest\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"recoveredAddress\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"verifyPreConfCommitment\",\"inputs\":[{\"name\":\"params\",\"type\":\"tuple\",\"internalType\":\"structPreConfCommitmentStore.CommitmentParams\",\"components\":[{\"name\":\"txnHash\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"revertingTxHashes\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"bid\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"blockNumber\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"decayStartTimeStamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"decayEndTimeStamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"bidHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"bidSignature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"commitmentSignature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"sharedSecretKey\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]}],\"outputs\":[{\"name\":\"preConfHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"commiterAddress\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"event\",\"name\":\"CommitmentStored\",\"inputs\":[{\"name\":\"commitmentIndex\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"bidder\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"commiter\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"bid\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"blockNumber\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"},{\"name\":\"bidHash\",\"type\":\"bytes32\",\"indexed\":false,\"internalType\":\"bytes32\"},{\"name\":\"decayStartTimeStamp\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"},{\"name\":\"decayEndTimeStamp\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"},{\"name\":\"txnHash\",\"type\":\"string\",\"indexed\":false,\"internalType\":\"string\"},{\"name\":\"revertingTxHashes\",\"type\":\"string\",\"indexed\":false,\"internalType\":\"string\"},{\"name\":\"commitmentHash\",\"type\":\"bytes32\",\"indexed\":false,\"internalType\":\"bytes32\"},{\"name\":\"bidSignature\",\"type\":\"bytes\",\"indexed\":false,\"internalType\":\"bytes\"},{\"name\":\"commitmentSignature\",\"type\":\"bytes\",\"indexed\":false,\"internalType\":\"bytes\"},{\"name\":\"dispatchTimestamp\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"},{\"name\":\"sharedSecretKey\",\"type\":\"bytes\",\"indexed\":false,\"internalType\":\"bytes\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"EncryptedCommitmentStored\",\"inputs\":[{\"name\":\"commitmentIndex\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"commiter\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"commitmentDigest\",\"type\":\"bytes32\",\"indexed\":false,\"internalType\":\"bytes32\"},{\"name\":\"commitmentSignature\",\"type\":\"bytes\",\"indexed\":false,\"internalType\":\"bytes\"},{\"name\":\"dispatchTimestamp\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"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\":\"SignatureVerified\",\"inputs\":[{\"name\":\"signer\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"txnHash\",\"type\":\"string\",\"indexed\":false,\"internalType\":\"string\"},{\"name\":\"revertingTxHashes\",\"type\":\"string\",\"indexed\":false,\"internalType\":\"string\"},{\"name\":\"bid\",\"type\":\"uint256\",\"indexed\":true,\"internalType\":\"uint256\"},{\"name\":\"blockNumber\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"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\"}]}]", } // PreconfcommitmentstoreABI is the input ABI used to generate the binding from. @@ -519,7 +534,7 @@ func (_Preconfcommitmentstore *PreconfcommitmentstoreCallerSession) CommitmentDi // Commitments is a free data retrieval call binding the contract method 0x839df945. // -// Solidity: function commitments(bytes32 ) view returns(bool isUsed, address bidder, address commiter, uint256 bid, uint64 blockNumber, bytes32 bidHash, uint64 decayStartTimeStamp, uint64 decayEndTimeStamp, string txnHash, bytes32 commitmentHash, bytes bidSignature, bytes commitmentSignature, uint64 dispatchTimestamp, bytes sharedSecretKey) +// Solidity: function commitments(bytes32 ) view returns(bool isUsed, address bidder, address commiter, uint256 bid, uint64 blockNumber, bytes32 bidHash, uint64 decayStartTimeStamp, uint64 decayEndTimeStamp, string txnHash, string revertingTxHashes, bytes32 commitmentHash, bytes bidSignature, bytes commitmentSignature, uint64 dispatchTimestamp, bytes sharedSecretKey) func (_Preconfcommitmentstore *PreconfcommitmentstoreCaller) Commitments(opts *bind.CallOpts, arg0 [32]byte) (struct { IsUsed bool Bidder common.Address @@ -530,6 +545,7 @@ func (_Preconfcommitmentstore *PreconfcommitmentstoreCaller) Commitments(opts *b DecayStartTimeStamp uint64 DecayEndTimeStamp uint64 TxnHash string + RevertingTxHashes string CommitmentHash [32]byte BidSignature []byte CommitmentSignature []byte @@ -549,6 +565,7 @@ func (_Preconfcommitmentstore *PreconfcommitmentstoreCaller) Commitments(opts *b DecayStartTimeStamp uint64 DecayEndTimeStamp uint64 TxnHash string + RevertingTxHashes string CommitmentHash [32]byte BidSignature []byte CommitmentSignature []byte @@ -568,11 +585,12 @@ func (_Preconfcommitmentstore *PreconfcommitmentstoreCaller) Commitments(opts *b outstruct.DecayStartTimeStamp = *abi.ConvertType(out[6], new(uint64)).(*uint64) outstruct.DecayEndTimeStamp = *abi.ConvertType(out[7], new(uint64)).(*uint64) outstruct.TxnHash = *abi.ConvertType(out[8], new(string)).(*string) - outstruct.CommitmentHash = *abi.ConvertType(out[9], new([32]byte)).(*[32]byte) - outstruct.BidSignature = *abi.ConvertType(out[10], new([]byte)).(*[]byte) - outstruct.CommitmentSignature = *abi.ConvertType(out[11], new([]byte)).(*[]byte) - outstruct.DispatchTimestamp = *abi.ConvertType(out[12], new(uint64)).(*uint64) - outstruct.SharedSecretKey = *abi.ConvertType(out[13], new([]byte)).(*[]byte) + outstruct.RevertingTxHashes = *abi.ConvertType(out[9], new(string)).(*string) + outstruct.CommitmentHash = *abi.ConvertType(out[10], new([32]byte)).(*[32]byte) + outstruct.BidSignature = *abi.ConvertType(out[11], new([]byte)).(*[]byte) + outstruct.CommitmentSignature = *abi.ConvertType(out[12], new([]byte)).(*[]byte) + outstruct.DispatchTimestamp = *abi.ConvertType(out[13], new(uint64)).(*uint64) + outstruct.SharedSecretKey = *abi.ConvertType(out[14], new([]byte)).(*[]byte) return *outstruct, err @@ -580,7 +598,7 @@ func (_Preconfcommitmentstore *PreconfcommitmentstoreCaller) Commitments(opts *b // Commitments is a free data retrieval call binding the contract method 0x839df945. // -// Solidity: function commitments(bytes32 ) view returns(bool isUsed, address bidder, address commiter, uint256 bid, uint64 blockNumber, bytes32 bidHash, uint64 decayStartTimeStamp, uint64 decayEndTimeStamp, string txnHash, bytes32 commitmentHash, bytes bidSignature, bytes commitmentSignature, uint64 dispatchTimestamp, bytes sharedSecretKey) +// Solidity: function commitments(bytes32 ) view returns(bool isUsed, address bidder, address commiter, uint256 bid, uint64 blockNumber, bytes32 bidHash, uint64 decayStartTimeStamp, uint64 decayEndTimeStamp, string txnHash, string revertingTxHashes, bytes32 commitmentHash, bytes bidSignature, bytes commitmentSignature, uint64 dispatchTimestamp, bytes sharedSecretKey) func (_Preconfcommitmentstore *PreconfcommitmentstoreSession) Commitments(arg0 [32]byte) (struct { IsUsed bool Bidder common.Address @@ -591,6 +609,7 @@ func (_Preconfcommitmentstore *PreconfcommitmentstoreSession) Commitments(arg0 [ DecayStartTimeStamp uint64 DecayEndTimeStamp uint64 TxnHash string + RevertingTxHashes string CommitmentHash [32]byte BidSignature []byte CommitmentSignature []byte @@ -602,7 +621,7 @@ func (_Preconfcommitmentstore *PreconfcommitmentstoreSession) Commitments(arg0 [ // Commitments is a free data retrieval call binding the contract method 0x839df945. // -// Solidity: function commitments(bytes32 ) view returns(bool isUsed, address bidder, address commiter, uint256 bid, uint64 blockNumber, bytes32 bidHash, uint64 decayStartTimeStamp, uint64 decayEndTimeStamp, string txnHash, bytes32 commitmentHash, bytes bidSignature, bytes commitmentSignature, uint64 dispatchTimestamp, bytes sharedSecretKey) +// Solidity: function commitments(bytes32 ) view returns(bool isUsed, address bidder, address commiter, uint256 bid, uint64 blockNumber, bytes32 bidHash, uint64 decayStartTimeStamp, uint64 decayEndTimeStamp, string txnHash, string revertingTxHashes, bytes32 commitmentHash, bytes bidSignature, bytes commitmentSignature, uint64 dispatchTimestamp, bytes sharedSecretKey) func (_Preconfcommitmentstore *PreconfcommitmentstoreCallerSession) Commitments(arg0 [32]byte) (struct { IsUsed bool Bidder common.Address @@ -613,6 +632,7 @@ func (_Preconfcommitmentstore *PreconfcommitmentstoreCallerSession) Commitments( DecayStartTimeStamp uint64 DecayEndTimeStamp uint64 TxnHash string + RevertingTxHashes string CommitmentHash [32]byte BidSignature []byte CommitmentSignature []byte @@ -713,12 +733,12 @@ func (_Preconfcommitmentstore *PreconfcommitmentstoreCallerSession) EncryptedCom return _Preconfcommitmentstore.Contract.EncryptedCommitments(&_Preconfcommitmentstore.CallOpts, arg0) } -// GetBidHash is a free data retrieval call binding the contract method 0x4e26887a. +// GetBidHash is a free data retrieval call binding the contract method 0xdbd007ab. // -// Solidity: function getBidHash(string _txnHash, uint256 _bid, uint64 _blockNumber, uint64 _decayStartTimeStamp, uint64 _decayEndTimeStamp) view returns(bytes32) -func (_Preconfcommitmentstore *PreconfcommitmentstoreCaller) GetBidHash(opts *bind.CallOpts, _txnHash string, _bid *big.Int, _blockNumber uint64, _decayStartTimeStamp uint64, _decayEndTimeStamp uint64) ([32]byte, error) { +// Solidity: function getBidHash(string _txnHash, string _revertingTxHashes, uint256 _bid, uint64 _blockNumber, uint64 _decayStartTimeStamp, uint64 _decayEndTimeStamp) view returns(bytes32) +func (_Preconfcommitmentstore *PreconfcommitmentstoreCaller) GetBidHash(opts *bind.CallOpts, _txnHash string, _revertingTxHashes string, _bid *big.Int, _blockNumber uint64, _decayStartTimeStamp uint64, _decayEndTimeStamp uint64) ([32]byte, error) { var out []interface{} - err := _Preconfcommitmentstore.contract.Call(opts, &out, "getBidHash", _txnHash, _bid, _blockNumber, _decayStartTimeStamp, _decayEndTimeStamp) + err := _Preconfcommitmentstore.contract.Call(opts, &out, "getBidHash", _txnHash, _revertingTxHashes, _bid, _blockNumber, _decayStartTimeStamp, _decayEndTimeStamp) if err != nil { return *new([32]byte), err @@ -730,23 +750,23 @@ func (_Preconfcommitmentstore *PreconfcommitmentstoreCaller) GetBidHash(opts *bi } -// GetBidHash is a free data retrieval call binding the contract method 0x4e26887a. +// GetBidHash is a free data retrieval call binding the contract method 0xdbd007ab. // -// Solidity: function getBidHash(string _txnHash, uint256 _bid, uint64 _blockNumber, uint64 _decayStartTimeStamp, uint64 _decayEndTimeStamp) view returns(bytes32) -func (_Preconfcommitmentstore *PreconfcommitmentstoreSession) GetBidHash(_txnHash string, _bid *big.Int, _blockNumber uint64, _decayStartTimeStamp uint64, _decayEndTimeStamp uint64) ([32]byte, error) { - return _Preconfcommitmentstore.Contract.GetBidHash(&_Preconfcommitmentstore.CallOpts, _txnHash, _bid, _blockNumber, _decayStartTimeStamp, _decayEndTimeStamp) +// Solidity: function getBidHash(string _txnHash, string _revertingTxHashes, uint256 _bid, uint64 _blockNumber, uint64 _decayStartTimeStamp, uint64 _decayEndTimeStamp) view returns(bytes32) +func (_Preconfcommitmentstore *PreconfcommitmentstoreSession) GetBidHash(_txnHash string, _revertingTxHashes string, _bid *big.Int, _blockNumber uint64, _decayStartTimeStamp uint64, _decayEndTimeStamp uint64) ([32]byte, error) { + return _Preconfcommitmentstore.Contract.GetBidHash(&_Preconfcommitmentstore.CallOpts, _txnHash, _revertingTxHashes, _bid, _blockNumber, _decayStartTimeStamp, _decayEndTimeStamp) } -// GetBidHash is a free data retrieval call binding the contract method 0x4e26887a. +// GetBidHash is a free data retrieval call binding the contract method 0xdbd007ab. // -// Solidity: function getBidHash(string _txnHash, uint256 _bid, uint64 _blockNumber, uint64 _decayStartTimeStamp, uint64 _decayEndTimeStamp) view returns(bytes32) -func (_Preconfcommitmentstore *PreconfcommitmentstoreCallerSession) GetBidHash(_txnHash string, _bid *big.Int, _blockNumber uint64, _decayStartTimeStamp uint64, _decayEndTimeStamp uint64) ([32]byte, error) { - return _Preconfcommitmentstore.Contract.GetBidHash(&_Preconfcommitmentstore.CallOpts, _txnHash, _bid, _blockNumber, _decayStartTimeStamp, _decayEndTimeStamp) +// Solidity: function getBidHash(string _txnHash, string _revertingTxHashes, uint256 _bid, uint64 _blockNumber, uint64 _decayStartTimeStamp, uint64 _decayEndTimeStamp) view returns(bytes32) +func (_Preconfcommitmentstore *PreconfcommitmentstoreCallerSession) GetBidHash(_txnHash string, _revertingTxHashes string, _bid *big.Int, _blockNumber uint64, _decayStartTimeStamp uint64, _decayEndTimeStamp uint64) ([32]byte, error) { + return _Preconfcommitmentstore.Contract.GetBidHash(&_Preconfcommitmentstore.CallOpts, _txnHash, _revertingTxHashes, _bid, _blockNumber, _decayStartTimeStamp, _decayEndTimeStamp) } // GetCommitment is a free data retrieval call binding the contract method 0x7795820c. // -// Solidity: function getCommitment(bytes32 commitmentIndex) view returns((bool,address,address,uint256,uint64,bytes32,uint64,uint64,string,bytes32,bytes,bytes,uint64,bytes)) +// Solidity: function getCommitment(bytes32 commitmentIndex) view returns((bool,address,address,uint256,uint64,bytes32,uint64,uint64,string,string,bytes32,bytes,bytes,uint64,bytes)) func (_Preconfcommitmentstore *PreconfcommitmentstoreCaller) GetCommitment(opts *bind.CallOpts, commitmentIndex [32]byte) (PreConfCommitmentStorePreConfCommitment, error) { var out []interface{} err := _Preconfcommitmentstore.contract.Call(opts, &out, "getCommitment", commitmentIndex) @@ -763,21 +783,21 @@ func (_Preconfcommitmentstore *PreconfcommitmentstoreCaller) GetCommitment(opts // GetCommitment is a free data retrieval call binding the contract method 0x7795820c. // -// Solidity: function getCommitment(bytes32 commitmentIndex) view returns((bool,address,address,uint256,uint64,bytes32,uint64,uint64,string,bytes32,bytes,bytes,uint64,bytes)) +// Solidity: function getCommitment(bytes32 commitmentIndex) view returns((bool,address,address,uint256,uint64,bytes32,uint64,uint64,string,string,bytes32,bytes,bytes,uint64,bytes)) func (_Preconfcommitmentstore *PreconfcommitmentstoreSession) GetCommitment(commitmentIndex [32]byte) (PreConfCommitmentStorePreConfCommitment, error) { return _Preconfcommitmentstore.Contract.GetCommitment(&_Preconfcommitmentstore.CallOpts, commitmentIndex) } // GetCommitment is a free data retrieval call binding the contract method 0x7795820c. // -// Solidity: function getCommitment(bytes32 commitmentIndex) view returns((bool,address,address,uint256,uint64,bytes32,uint64,uint64,string,bytes32,bytes,bytes,uint64,bytes)) +// Solidity: function getCommitment(bytes32 commitmentIndex) view returns((bool,address,address,uint256,uint64,bytes32,uint64,uint64,string,string,bytes32,bytes,bytes,uint64,bytes)) func (_Preconfcommitmentstore *PreconfcommitmentstoreCallerSession) GetCommitment(commitmentIndex [32]byte) (PreConfCommitmentStorePreConfCommitment, error) { return _Preconfcommitmentstore.Contract.GetCommitment(&_Preconfcommitmentstore.CallOpts, commitmentIndex) } -// GetCommitmentIndex is a free data retrieval call binding the contract method 0x32528fb5. +// GetCommitmentIndex is a free data retrieval call binding the contract method 0x67e35d04. // -// Solidity: function getCommitmentIndex((bool,address,address,uint256,uint64,bytes32,uint64,uint64,string,bytes32,bytes,bytes,uint64,bytes) commitment) pure returns(bytes32) +// Solidity: function getCommitmentIndex((bool,address,address,uint256,uint64,bytes32,uint64,uint64,string,string,bytes32,bytes,bytes,uint64,bytes) commitment) pure returns(bytes32) func (_Preconfcommitmentstore *PreconfcommitmentstoreCaller) GetCommitmentIndex(opts *bind.CallOpts, commitment PreConfCommitmentStorePreConfCommitment) ([32]byte, error) { var out []interface{} err := _Preconfcommitmentstore.contract.Call(opts, &out, "getCommitmentIndex", commitment) @@ -792,16 +812,16 @@ func (_Preconfcommitmentstore *PreconfcommitmentstoreCaller) GetCommitmentIndex( } -// GetCommitmentIndex is a free data retrieval call binding the contract method 0x32528fb5. +// GetCommitmentIndex is a free data retrieval call binding the contract method 0x67e35d04. // -// Solidity: function getCommitmentIndex((bool,address,address,uint256,uint64,bytes32,uint64,uint64,string,bytes32,bytes,bytes,uint64,bytes) commitment) pure returns(bytes32) +// Solidity: function getCommitmentIndex((bool,address,address,uint256,uint64,bytes32,uint64,uint64,string,string,bytes32,bytes,bytes,uint64,bytes) commitment) pure returns(bytes32) func (_Preconfcommitmentstore *PreconfcommitmentstoreSession) GetCommitmentIndex(commitment PreConfCommitmentStorePreConfCommitment) ([32]byte, error) { return _Preconfcommitmentstore.Contract.GetCommitmentIndex(&_Preconfcommitmentstore.CallOpts, commitment) } -// GetCommitmentIndex is a free data retrieval call binding the contract method 0x32528fb5. +// GetCommitmentIndex is a free data retrieval call binding the contract method 0x67e35d04. // -// Solidity: function getCommitmentIndex((bool,address,address,uint256,uint64,bytes32,uint64,uint64,string,bytes32,bytes,bytes,uint64,bytes) commitment) pure returns(bytes32) +// Solidity: function getCommitmentIndex((bool,address,address,uint256,uint64,bytes32,uint64,uint64,string,string,bytes32,bytes,bytes,uint64,bytes) commitment) pure returns(bytes32) func (_Preconfcommitmentstore *PreconfcommitmentstoreCallerSession) GetCommitmentIndex(commitment PreConfCommitmentStorePreConfCommitment) ([32]byte, error) { return _Preconfcommitmentstore.Contract.GetCommitmentIndex(&_Preconfcommitmentstore.CallOpts, commitment) } @@ -868,12 +888,12 @@ func (_Preconfcommitmentstore *PreconfcommitmentstoreCallerSession) GetEncrypted return _Preconfcommitmentstore.Contract.GetEncryptedCommitmentIndex(&_Preconfcommitmentstore.CallOpts, commitment) } -// GetPreConfHash is a free data retrieval call binding the contract method 0xd6d5ddc7. +// GetPreConfHash is a free data retrieval call binding the contract method 0xd3dff2ae. // -// Solidity: function getPreConfHash(string _txnHash, uint256 _bid, uint64 _blockNumber, uint64 _decayStartTimeStamp, uint64 _decayEndTimeStamp, bytes32 _bidHash, string _bidSignature, string _sharedSecretKey) view returns(bytes32) -func (_Preconfcommitmentstore *PreconfcommitmentstoreCaller) GetPreConfHash(opts *bind.CallOpts, _txnHash string, _bid *big.Int, _blockNumber uint64, _decayStartTimeStamp uint64, _decayEndTimeStamp uint64, _bidHash [32]byte, _bidSignature string, _sharedSecretKey string) ([32]byte, error) { +// Solidity: function getPreConfHash(string _txnHash, string _revertingTxHashes, uint256 _bid, uint64 _blockNumber, uint64 _decayStartTimeStamp, uint64 _decayEndTimeStamp, bytes32 _bidHash, string _bidSignature, string _sharedSecretKey) view returns(bytes32) +func (_Preconfcommitmentstore *PreconfcommitmentstoreCaller) GetPreConfHash(opts *bind.CallOpts, _txnHash string, _revertingTxHashes string, _bid *big.Int, _blockNumber uint64, _decayStartTimeStamp uint64, _decayEndTimeStamp uint64, _bidHash [32]byte, _bidSignature string, _sharedSecretKey string) ([32]byte, error) { var out []interface{} - err := _Preconfcommitmentstore.contract.Call(opts, &out, "getPreConfHash", _txnHash, _bid, _blockNumber, _decayStartTimeStamp, _decayEndTimeStamp, _bidHash, _bidSignature, _sharedSecretKey) + err := _Preconfcommitmentstore.contract.Call(opts, &out, "getPreConfHash", _txnHash, _revertingTxHashes, _bid, _blockNumber, _decayStartTimeStamp, _decayEndTimeStamp, _bidHash, _bidSignature, _sharedSecretKey) if err != nil { return *new([32]byte), err @@ -885,18 +905,18 @@ func (_Preconfcommitmentstore *PreconfcommitmentstoreCaller) GetPreConfHash(opts } -// GetPreConfHash is a free data retrieval call binding the contract method 0xd6d5ddc7. +// GetPreConfHash is a free data retrieval call binding the contract method 0xd3dff2ae. // -// Solidity: function getPreConfHash(string _txnHash, uint256 _bid, uint64 _blockNumber, uint64 _decayStartTimeStamp, uint64 _decayEndTimeStamp, bytes32 _bidHash, string _bidSignature, string _sharedSecretKey) view returns(bytes32) -func (_Preconfcommitmentstore *PreconfcommitmentstoreSession) GetPreConfHash(_txnHash string, _bid *big.Int, _blockNumber uint64, _decayStartTimeStamp uint64, _decayEndTimeStamp uint64, _bidHash [32]byte, _bidSignature string, _sharedSecretKey string) ([32]byte, error) { - return _Preconfcommitmentstore.Contract.GetPreConfHash(&_Preconfcommitmentstore.CallOpts, _txnHash, _bid, _blockNumber, _decayStartTimeStamp, _decayEndTimeStamp, _bidHash, _bidSignature, _sharedSecretKey) +// Solidity: function getPreConfHash(string _txnHash, string _revertingTxHashes, uint256 _bid, uint64 _blockNumber, uint64 _decayStartTimeStamp, uint64 _decayEndTimeStamp, bytes32 _bidHash, string _bidSignature, string _sharedSecretKey) view returns(bytes32) +func (_Preconfcommitmentstore *PreconfcommitmentstoreSession) GetPreConfHash(_txnHash string, _revertingTxHashes string, _bid *big.Int, _blockNumber uint64, _decayStartTimeStamp uint64, _decayEndTimeStamp uint64, _bidHash [32]byte, _bidSignature string, _sharedSecretKey string) ([32]byte, error) { + return _Preconfcommitmentstore.Contract.GetPreConfHash(&_Preconfcommitmentstore.CallOpts, _txnHash, _revertingTxHashes, _bid, _blockNumber, _decayStartTimeStamp, _decayEndTimeStamp, _bidHash, _bidSignature, _sharedSecretKey) } -// GetPreConfHash is a free data retrieval call binding the contract method 0xd6d5ddc7. +// GetPreConfHash is a free data retrieval call binding the contract method 0xd3dff2ae. // -// Solidity: function getPreConfHash(string _txnHash, uint256 _bid, uint64 _blockNumber, uint64 _decayStartTimeStamp, uint64 _decayEndTimeStamp, bytes32 _bidHash, string _bidSignature, string _sharedSecretKey) view returns(bytes32) -func (_Preconfcommitmentstore *PreconfcommitmentstoreCallerSession) GetPreConfHash(_txnHash string, _bid *big.Int, _blockNumber uint64, _decayStartTimeStamp uint64, _decayEndTimeStamp uint64, _bidHash [32]byte, _bidSignature string, _sharedSecretKey string) ([32]byte, error) { - return _Preconfcommitmentstore.Contract.GetPreConfHash(&_Preconfcommitmentstore.CallOpts, _txnHash, _bid, _blockNumber, _decayStartTimeStamp, _decayEndTimeStamp, _bidHash, _bidSignature, _sharedSecretKey) +// Solidity: function getPreConfHash(string _txnHash, string _revertingTxHashes, uint256 _bid, uint64 _blockNumber, uint64 _decayStartTimeStamp, uint64 _decayEndTimeStamp, bytes32 _bidHash, string _bidSignature, string _sharedSecretKey) view returns(bytes32) +func (_Preconfcommitmentstore *PreconfcommitmentstoreCallerSession) GetPreConfHash(_txnHash string, _revertingTxHashes string, _bid *big.Int, _blockNumber uint64, _decayStartTimeStamp uint64, _decayEndTimeStamp uint64, _bidHash [32]byte, _bidSignature string, _sharedSecretKey string) ([32]byte, error) { + return _Preconfcommitmentstore.Contract.GetPreConfHash(&_Preconfcommitmentstore.CallOpts, _txnHash, _revertingTxHashes, _bid, _blockNumber, _decayStartTimeStamp, _decayEndTimeStamp, _bidHash, _bidSignature, _sharedSecretKey) } // GetTxnHashFromCommitment is a free data retrieval call binding the contract method 0xfc4fbe32. @@ -1085,15 +1105,15 @@ func (_Preconfcommitmentstore *PreconfcommitmentstoreCallerSession) ProxiableUUI return _Preconfcommitmentstore.Contract.ProxiableUUID(&_Preconfcommitmentstore.CallOpts) } -// VerifyBid is a free data retrieval call binding the contract method 0xd4c12558. +// VerifyBid is a free data retrieval call binding the contract method 0x20ee734c. // -// Solidity: function verifyBid(uint256 bid, uint64 blockNumber, uint64 decayStartTimeStamp, uint64 decayEndTimeStamp, string txnHash, bytes bidSignature) view returns(bytes32 messageDigest, address recoveredAddress) -func (_Preconfcommitmentstore *PreconfcommitmentstoreCaller) VerifyBid(opts *bind.CallOpts, bid *big.Int, blockNumber uint64, decayStartTimeStamp uint64, decayEndTimeStamp uint64, txnHash string, bidSignature []byte) (struct { +// Solidity: function verifyBid(uint256 bid, uint64 blockNumber, uint64 decayStartTimeStamp, uint64 decayEndTimeStamp, string txnHash, string revertingTxHashes, bytes bidSignature) view returns(bytes32 messageDigest, address recoveredAddress) +func (_Preconfcommitmentstore *PreconfcommitmentstoreCaller) VerifyBid(opts *bind.CallOpts, bid *big.Int, blockNumber uint64, decayStartTimeStamp uint64, decayEndTimeStamp uint64, txnHash string, revertingTxHashes string, bidSignature []byte) (struct { MessageDigest [32]byte RecoveredAddress common.Address }, error) { var out []interface{} - err := _Preconfcommitmentstore.contract.Call(opts, &out, "verifyBid", bid, blockNumber, decayStartTimeStamp, decayEndTimeStamp, txnHash, bidSignature) + err := _Preconfcommitmentstore.contract.Call(opts, &out, "verifyBid", bid, blockNumber, decayStartTimeStamp, decayEndTimeStamp, txnHash, revertingTxHashes, bidSignature) outstruct := new(struct { MessageDigest [32]byte @@ -1110,35 +1130,35 @@ func (_Preconfcommitmentstore *PreconfcommitmentstoreCaller) VerifyBid(opts *bin } -// VerifyBid is a free data retrieval call binding the contract method 0xd4c12558. +// VerifyBid is a free data retrieval call binding the contract method 0x20ee734c. // -// Solidity: function verifyBid(uint256 bid, uint64 blockNumber, uint64 decayStartTimeStamp, uint64 decayEndTimeStamp, string txnHash, bytes bidSignature) view returns(bytes32 messageDigest, address recoveredAddress) -func (_Preconfcommitmentstore *PreconfcommitmentstoreSession) VerifyBid(bid *big.Int, blockNumber uint64, decayStartTimeStamp uint64, decayEndTimeStamp uint64, txnHash string, bidSignature []byte) (struct { +// Solidity: function verifyBid(uint256 bid, uint64 blockNumber, uint64 decayStartTimeStamp, uint64 decayEndTimeStamp, string txnHash, string revertingTxHashes, bytes bidSignature) view returns(bytes32 messageDigest, address recoveredAddress) +func (_Preconfcommitmentstore *PreconfcommitmentstoreSession) VerifyBid(bid *big.Int, blockNumber uint64, decayStartTimeStamp uint64, decayEndTimeStamp uint64, txnHash string, revertingTxHashes string, bidSignature []byte) (struct { MessageDigest [32]byte RecoveredAddress common.Address }, error) { - return _Preconfcommitmentstore.Contract.VerifyBid(&_Preconfcommitmentstore.CallOpts, bid, blockNumber, decayStartTimeStamp, decayEndTimeStamp, txnHash, bidSignature) + return _Preconfcommitmentstore.Contract.VerifyBid(&_Preconfcommitmentstore.CallOpts, bid, blockNumber, decayStartTimeStamp, decayEndTimeStamp, txnHash, revertingTxHashes, bidSignature) } -// VerifyBid is a free data retrieval call binding the contract method 0xd4c12558. +// VerifyBid is a free data retrieval call binding the contract method 0x20ee734c. // -// Solidity: function verifyBid(uint256 bid, uint64 blockNumber, uint64 decayStartTimeStamp, uint64 decayEndTimeStamp, string txnHash, bytes bidSignature) view returns(bytes32 messageDigest, address recoveredAddress) -func (_Preconfcommitmentstore *PreconfcommitmentstoreCallerSession) VerifyBid(bid *big.Int, blockNumber uint64, decayStartTimeStamp uint64, decayEndTimeStamp uint64, txnHash string, bidSignature []byte) (struct { +// Solidity: function verifyBid(uint256 bid, uint64 blockNumber, uint64 decayStartTimeStamp, uint64 decayEndTimeStamp, string txnHash, string revertingTxHashes, bytes bidSignature) view returns(bytes32 messageDigest, address recoveredAddress) +func (_Preconfcommitmentstore *PreconfcommitmentstoreCallerSession) VerifyBid(bid *big.Int, blockNumber uint64, decayStartTimeStamp uint64, decayEndTimeStamp uint64, txnHash string, revertingTxHashes string, bidSignature []byte) (struct { MessageDigest [32]byte RecoveredAddress common.Address }, error) { - return _Preconfcommitmentstore.Contract.VerifyBid(&_Preconfcommitmentstore.CallOpts, bid, blockNumber, decayStartTimeStamp, decayEndTimeStamp, txnHash, bidSignature) + return _Preconfcommitmentstore.Contract.VerifyBid(&_Preconfcommitmentstore.CallOpts, bid, blockNumber, decayStartTimeStamp, decayEndTimeStamp, txnHash, revertingTxHashes, bidSignature) } -// VerifyPreConfCommitment is a free data retrieval call binding the contract method 0xd2e94c60. +// VerifyPreConfCommitment is a free data retrieval call binding the contract method 0xe93bbf26. // -// Solidity: function verifyPreConfCommitment(string txnHash, uint256 bid, uint64 blockNumber, uint64 decayStartTimeStamp, uint64 decayEndTimeStamp, bytes32 bidHash, bytes bidSignature, bytes commitmentSignature, bytes sharedSecretKey) view returns(bytes32 preConfHash, address commiterAddress) -func (_Preconfcommitmentstore *PreconfcommitmentstoreCaller) VerifyPreConfCommitment(opts *bind.CallOpts, txnHash string, bid *big.Int, blockNumber uint64, decayStartTimeStamp uint64, decayEndTimeStamp uint64, bidHash [32]byte, bidSignature []byte, commitmentSignature []byte, sharedSecretKey []byte) (struct { +// Solidity: function verifyPreConfCommitment((string,string,uint256,uint64,uint64,uint64,bytes32,bytes,bytes,bytes) params) view returns(bytes32 preConfHash, address commiterAddress) +func (_Preconfcommitmentstore *PreconfcommitmentstoreCaller) VerifyPreConfCommitment(opts *bind.CallOpts, params PreConfCommitmentStoreCommitmentParams) (struct { PreConfHash [32]byte CommiterAddress common.Address }, error) { var out []interface{} - err := _Preconfcommitmentstore.contract.Call(opts, &out, "verifyPreConfCommitment", txnHash, bid, blockNumber, decayStartTimeStamp, decayEndTimeStamp, bidHash, bidSignature, commitmentSignature, sharedSecretKey) + err := _Preconfcommitmentstore.contract.Call(opts, &out, "verifyPreConfCommitment", params) outstruct := new(struct { PreConfHash [32]byte @@ -1155,24 +1175,24 @@ func (_Preconfcommitmentstore *PreconfcommitmentstoreCaller) VerifyPreConfCommit } -// VerifyPreConfCommitment is a free data retrieval call binding the contract method 0xd2e94c60. +// VerifyPreConfCommitment is a free data retrieval call binding the contract method 0xe93bbf26. // -// Solidity: function verifyPreConfCommitment(string txnHash, uint256 bid, uint64 blockNumber, uint64 decayStartTimeStamp, uint64 decayEndTimeStamp, bytes32 bidHash, bytes bidSignature, bytes commitmentSignature, bytes sharedSecretKey) view returns(bytes32 preConfHash, address commiterAddress) -func (_Preconfcommitmentstore *PreconfcommitmentstoreSession) VerifyPreConfCommitment(txnHash string, bid *big.Int, blockNumber uint64, decayStartTimeStamp uint64, decayEndTimeStamp uint64, bidHash [32]byte, bidSignature []byte, commitmentSignature []byte, sharedSecretKey []byte) (struct { +// Solidity: function verifyPreConfCommitment((string,string,uint256,uint64,uint64,uint64,bytes32,bytes,bytes,bytes) params) view returns(bytes32 preConfHash, address commiterAddress) +func (_Preconfcommitmentstore *PreconfcommitmentstoreSession) VerifyPreConfCommitment(params PreConfCommitmentStoreCommitmentParams) (struct { PreConfHash [32]byte CommiterAddress common.Address }, error) { - return _Preconfcommitmentstore.Contract.VerifyPreConfCommitment(&_Preconfcommitmentstore.CallOpts, txnHash, bid, blockNumber, decayStartTimeStamp, decayEndTimeStamp, bidHash, bidSignature, commitmentSignature, sharedSecretKey) + return _Preconfcommitmentstore.Contract.VerifyPreConfCommitment(&_Preconfcommitmentstore.CallOpts, params) } -// VerifyPreConfCommitment is a free data retrieval call binding the contract method 0xd2e94c60. +// VerifyPreConfCommitment is a free data retrieval call binding the contract method 0xe93bbf26. // -// Solidity: function verifyPreConfCommitment(string txnHash, uint256 bid, uint64 blockNumber, uint64 decayStartTimeStamp, uint64 decayEndTimeStamp, bytes32 bidHash, bytes bidSignature, bytes commitmentSignature, bytes sharedSecretKey) view returns(bytes32 preConfHash, address commiterAddress) -func (_Preconfcommitmentstore *PreconfcommitmentstoreCallerSession) VerifyPreConfCommitment(txnHash string, bid *big.Int, blockNumber uint64, decayStartTimeStamp uint64, decayEndTimeStamp uint64, bidHash [32]byte, bidSignature []byte, commitmentSignature []byte, sharedSecretKey []byte) (struct { +// Solidity: function verifyPreConfCommitment((string,string,uint256,uint64,uint64,uint64,bytes32,bytes,bytes,bytes) params) view returns(bytes32 preConfHash, address commiterAddress) +func (_Preconfcommitmentstore *PreconfcommitmentstoreCallerSession) VerifyPreConfCommitment(params PreConfCommitmentStoreCommitmentParams) (struct { PreConfHash [32]byte CommiterAddress common.Address }, error) { - return _Preconfcommitmentstore.Contract.VerifyPreConfCommitment(&_Preconfcommitmentstore.CallOpts, txnHash, bid, blockNumber, decayStartTimeStamp, decayEndTimeStamp, bidHash, bidSignature, commitmentSignature, sharedSecretKey) + return _Preconfcommitmentstore.Contract.VerifyPreConfCommitment(&_Preconfcommitmentstore.CallOpts, params) } // Initialize is a paid mutator transaction binding the contract method 0xd8d0cbc1. @@ -1238,25 +1258,25 @@ func (_Preconfcommitmentstore *PreconfcommitmentstoreTransactorSession) Initiate return _Preconfcommitmentstore.Contract.InitiateSlash(&_Preconfcommitmentstore.TransactOpts, commitmentIndex, residualBidPercentAfterDecay) } -// OpenCommitment is a paid mutator transaction binding the contract method 0x7696c0b8. +// OpenCommitment is a paid mutator transaction binding the contract method 0x05880c6a. // -// Solidity: function openCommitment(bytes32 encryptedCommitmentIndex, uint256 bid, uint64 blockNumber, string txnHash, uint64 decayStartTimeStamp, uint64 decayEndTimeStamp, bytes bidSignature, bytes commitmentSignature, bytes sharedSecretKey) returns(bytes32 commitmentIndex) -func (_Preconfcommitmentstore *PreconfcommitmentstoreTransactor) OpenCommitment(opts *bind.TransactOpts, encryptedCommitmentIndex [32]byte, bid *big.Int, blockNumber uint64, txnHash string, decayStartTimeStamp uint64, decayEndTimeStamp uint64, bidSignature []byte, commitmentSignature []byte, sharedSecretKey []byte) (*types.Transaction, error) { - return _Preconfcommitmentstore.contract.Transact(opts, "openCommitment", encryptedCommitmentIndex, bid, blockNumber, txnHash, decayStartTimeStamp, decayEndTimeStamp, bidSignature, commitmentSignature, sharedSecretKey) +// Solidity: function openCommitment(bytes32 encryptedCommitmentIndex, uint256 bid, uint64 blockNumber, string txnHash, string revertingTxHashes, uint64 decayStartTimeStamp, uint64 decayEndTimeStamp, bytes bidSignature, bytes commitmentSignature, bytes sharedSecretKey) returns(bytes32 commitmentIndex) +func (_Preconfcommitmentstore *PreconfcommitmentstoreTransactor) OpenCommitment(opts *bind.TransactOpts, encryptedCommitmentIndex [32]byte, bid *big.Int, blockNumber uint64, txnHash string, revertingTxHashes string, decayStartTimeStamp uint64, decayEndTimeStamp uint64, bidSignature []byte, commitmentSignature []byte, sharedSecretKey []byte) (*types.Transaction, error) { + return _Preconfcommitmentstore.contract.Transact(opts, "openCommitment", encryptedCommitmentIndex, bid, blockNumber, txnHash, revertingTxHashes, decayStartTimeStamp, decayEndTimeStamp, bidSignature, commitmentSignature, sharedSecretKey) } -// OpenCommitment is a paid mutator transaction binding the contract method 0x7696c0b8. +// OpenCommitment is a paid mutator transaction binding the contract method 0x05880c6a. // -// Solidity: function openCommitment(bytes32 encryptedCommitmentIndex, uint256 bid, uint64 blockNumber, string txnHash, uint64 decayStartTimeStamp, uint64 decayEndTimeStamp, bytes bidSignature, bytes commitmentSignature, bytes sharedSecretKey) returns(bytes32 commitmentIndex) -func (_Preconfcommitmentstore *PreconfcommitmentstoreSession) OpenCommitment(encryptedCommitmentIndex [32]byte, bid *big.Int, blockNumber uint64, txnHash string, decayStartTimeStamp uint64, decayEndTimeStamp uint64, bidSignature []byte, commitmentSignature []byte, sharedSecretKey []byte) (*types.Transaction, error) { - return _Preconfcommitmentstore.Contract.OpenCommitment(&_Preconfcommitmentstore.TransactOpts, encryptedCommitmentIndex, bid, blockNumber, txnHash, decayStartTimeStamp, decayEndTimeStamp, bidSignature, commitmentSignature, sharedSecretKey) +// Solidity: function openCommitment(bytes32 encryptedCommitmentIndex, uint256 bid, uint64 blockNumber, string txnHash, string revertingTxHashes, uint64 decayStartTimeStamp, uint64 decayEndTimeStamp, bytes bidSignature, bytes commitmentSignature, bytes sharedSecretKey) returns(bytes32 commitmentIndex) +func (_Preconfcommitmentstore *PreconfcommitmentstoreSession) OpenCommitment(encryptedCommitmentIndex [32]byte, bid *big.Int, blockNumber uint64, txnHash string, revertingTxHashes string, decayStartTimeStamp uint64, decayEndTimeStamp uint64, bidSignature []byte, commitmentSignature []byte, sharedSecretKey []byte) (*types.Transaction, error) { + return _Preconfcommitmentstore.Contract.OpenCommitment(&_Preconfcommitmentstore.TransactOpts, encryptedCommitmentIndex, bid, blockNumber, txnHash, revertingTxHashes, decayStartTimeStamp, decayEndTimeStamp, bidSignature, commitmentSignature, sharedSecretKey) } -// OpenCommitment is a paid mutator transaction binding the contract method 0x7696c0b8. +// OpenCommitment is a paid mutator transaction binding the contract method 0x05880c6a. // -// Solidity: function openCommitment(bytes32 encryptedCommitmentIndex, uint256 bid, uint64 blockNumber, string txnHash, uint64 decayStartTimeStamp, uint64 decayEndTimeStamp, bytes bidSignature, bytes commitmentSignature, bytes sharedSecretKey) returns(bytes32 commitmentIndex) -func (_Preconfcommitmentstore *PreconfcommitmentstoreTransactorSession) OpenCommitment(encryptedCommitmentIndex [32]byte, bid *big.Int, blockNumber uint64, txnHash string, decayStartTimeStamp uint64, decayEndTimeStamp uint64, bidSignature []byte, commitmentSignature []byte, sharedSecretKey []byte) (*types.Transaction, error) { - return _Preconfcommitmentstore.Contract.OpenCommitment(&_Preconfcommitmentstore.TransactOpts, encryptedCommitmentIndex, bid, blockNumber, txnHash, decayStartTimeStamp, decayEndTimeStamp, bidSignature, commitmentSignature, sharedSecretKey) +// Solidity: function openCommitment(bytes32 encryptedCommitmentIndex, uint256 bid, uint64 blockNumber, string txnHash, string revertingTxHashes, uint64 decayStartTimeStamp, uint64 decayEndTimeStamp, bytes bidSignature, bytes commitmentSignature, bytes sharedSecretKey) returns(bytes32 commitmentIndex) +func (_Preconfcommitmentstore *PreconfcommitmentstoreTransactorSession) OpenCommitment(encryptedCommitmentIndex [32]byte, bid *big.Int, blockNumber uint64, txnHash string, revertingTxHashes string, decayStartTimeStamp uint64, decayEndTimeStamp uint64, bidSignature []byte, commitmentSignature []byte, sharedSecretKey []byte) (*types.Transaction, error) { + return _Preconfcommitmentstore.Contract.OpenCommitment(&_Preconfcommitmentstore.TransactOpts, encryptedCommitmentIndex, bid, blockNumber, txnHash, revertingTxHashes, decayStartTimeStamp, decayEndTimeStamp, bidSignature, commitmentSignature, sharedSecretKey) } // RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. @@ -1547,6 +1567,7 @@ type PreconfcommitmentstoreCommitmentStored struct { DecayStartTimeStamp uint64 DecayEndTimeStamp uint64 TxnHash string + RevertingTxHashes string CommitmentHash [32]byte BidSignature []byte CommitmentSignature []byte @@ -1555,9 +1576,9 @@ type PreconfcommitmentstoreCommitmentStored struct { Raw types.Log // Blockchain specific contextual infos } -// FilterCommitmentStored is a free log retrieval operation binding the contract event 0x65a26490031434e303a64e52c432df3fc125c55d6e9f5f9287ca2d5aaa01ff9b. +// FilterCommitmentStored is a free log retrieval operation binding the contract event 0xe44dd4d002deb2c79cf08ce285a9d80c69753f31ca65c8e49f0a60d27ed9fea3. // -// Solidity: event CommitmentStored(bytes32 indexed commitmentIndex, address bidder, address commiter, uint256 bid, uint64 blockNumber, bytes32 bidHash, uint64 decayStartTimeStamp, uint64 decayEndTimeStamp, string txnHash, bytes32 commitmentHash, bytes bidSignature, bytes commitmentSignature, uint64 dispatchTimestamp, bytes sharedSecretKey) +// Solidity: event CommitmentStored(bytes32 indexed commitmentIndex, address bidder, address commiter, uint256 bid, uint64 blockNumber, bytes32 bidHash, uint64 decayStartTimeStamp, uint64 decayEndTimeStamp, string txnHash, string revertingTxHashes, bytes32 commitmentHash, bytes bidSignature, bytes commitmentSignature, uint64 dispatchTimestamp, bytes sharedSecretKey) func (_Preconfcommitmentstore *PreconfcommitmentstoreFilterer) FilterCommitmentStored(opts *bind.FilterOpts, commitmentIndex [][32]byte) (*PreconfcommitmentstoreCommitmentStoredIterator, error) { var commitmentIndexRule []interface{} @@ -1572,9 +1593,9 @@ func (_Preconfcommitmentstore *PreconfcommitmentstoreFilterer) FilterCommitmentS return &PreconfcommitmentstoreCommitmentStoredIterator{contract: _Preconfcommitmentstore.contract, event: "CommitmentStored", logs: logs, sub: sub}, nil } -// WatchCommitmentStored is a free log subscription operation binding the contract event 0x65a26490031434e303a64e52c432df3fc125c55d6e9f5f9287ca2d5aaa01ff9b. +// WatchCommitmentStored is a free log subscription operation binding the contract event 0xe44dd4d002deb2c79cf08ce285a9d80c69753f31ca65c8e49f0a60d27ed9fea3. // -// Solidity: event CommitmentStored(bytes32 indexed commitmentIndex, address bidder, address commiter, uint256 bid, uint64 blockNumber, bytes32 bidHash, uint64 decayStartTimeStamp, uint64 decayEndTimeStamp, string txnHash, bytes32 commitmentHash, bytes bidSignature, bytes commitmentSignature, uint64 dispatchTimestamp, bytes sharedSecretKey) +// Solidity: event CommitmentStored(bytes32 indexed commitmentIndex, address bidder, address commiter, uint256 bid, uint64 blockNumber, bytes32 bidHash, uint64 decayStartTimeStamp, uint64 decayEndTimeStamp, string txnHash, string revertingTxHashes, bytes32 commitmentHash, bytes bidSignature, bytes commitmentSignature, uint64 dispatchTimestamp, bytes sharedSecretKey) func (_Preconfcommitmentstore *PreconfcommitmentstoreFilterer) WatchCommitmentStored(opts *bind.WatchOpts, sink chan<- *PreconfcommitmentstoreCommitmentStored, commitmentIndex [][32]byte) (event.Subscription, error) { var commitmentIndexRule []interface{} @@ -1614,9 +1635,9 @@ func (_Preconfcommitmentstore *PreconfcommitmentstoreFilterer) WatchCommitmentSt }), nil } -// ParseCommitmentStored is a log parse operation binding the contract event 0x65a26490031434e303a64e52c432df3fc125c55d6e9f5f9287ca2d5aaa01ff9b. +// ParseCommitmentStored is a log parse operation binding the contract event 0xe44dd4d002deb2c79cf08ce285a9d80c69753f31ca65c8e49f0a60d27ed9fea3. // -// Solidity: event CommitmentStored(bytes32 indexed commitmentIndex, address bidder, address commiter, uint256 bid, uint64 blockNumber, bytes32 bidHash, uint64 decayStartTimeStamp, uint64 decayEndTimeStamp, string txnHash, bytes32 commitmentHash, bytes bidSignature, bytes commitmentSignature, uint64 dispatchTimestamp, bytes sharedSecretKey) +// Solidity: event CommitmentStored(bytes32 indexed commitmentIndex, address bidder, address commiter, uint256 bid, uint64 blockNumber, bytes32 bidHash, uint64 decayStartTimeStamp, uint64 decayEndTimeStamp, string txnHash, string revertingTxHashes, bytes32 commitmentHash, bytes bidSignature, bytes commitmentSignature, uint64 dispatchTimestamp, bytes sharedSecretKey) func (_Preconfcommitmentstore *PreconfcommitmentstoreFilterer) ParseCommitmentStored(log types.Log) (*PreconfcommitmentstoreCommitmentStored, error) { event := new(PreconfcommitmentstoreCommitmentStored) if err := _Preconfcommitmentstore.contract.UnpackLog(event, "CommitmentStored", log); err != nil { @@ -2130,16 +2151,17 @@ func (it *PreconfcommitmentstoreSignatureVerifiedIterator) Close() error { // PreconfcommitmentstoreSignatureVerified represents a SignatureVerified event raised by the Preconfcommitmentstore contract. type PreconfcommitmentstoreSignatureVerified struct { - Signer common.Address - TxnHash string - Bid *big.Int - BlockNumber uint64 - Raw types.Log // Blockchain specific contextual infos + Signer common.Address + TxnHash string + RevertingTxHashes string + Bid *big.Int + BlockNumber uint64 + Raw types.Log // Blockchain specific contextual infos } -// FilterSignatureVerified is a free log retrieval operation binding the contract event 0xe872564fb7c047879c36afa1ab2c8a8466c69098cc6a38d2b2f36cc786e65c34. +// FilterSignatureVerified is a free log retrieval operation binding the contract event 0xf5fa3f7902916f0e4e2af218fa9a77809c54e64b77ec4061a205ec3b7ce5c35e. // -// Solidity: event SignatureVerified(address indexed signer, string txnHash, uint256 indexed bid, uint64 blockNumber) +// Solidity: event SignatureVerified(address indexed signer, string txnHash, string revertingTxHashes, uint256 indexed bid, uint64 blockNumber) func (_Preconfcommitmentstore *PreconfcommitmentstoreFilterer) FilterSignatureVerified(opts *bind.FilterOpts, signer []common.Address, bid []*big.Int) (*PreconfcommitmentstoreSignatureVerifiedIterator, error) { var signerRule []interface{} @@ -2159,9 +2181,9 @@ func (_Preconfcommitmentstore *PreconfcommitmentstoreFilterer) FilterSignatureVe return &PreconfcommitmentstoreSignatureVerifiedIterator{contract: _Preconfcommitmentstore.contract, event: "SignatureVerified", logs: logs, sub: sub}, nil } -// WatchSignatureVerified is a free log subscription operation binding the contract event 0xe872564fb7c047879c36afa1ab2c8a8466c69098cc6a38d2b2f36cc786e65c34. +// WatchSignatureVerified is a free log subscription operation binding the contract event 0xf5fa3f7902916f0e4e2af218fa9a77809c54e64b77ec4061a205ec3b7ce5c35e. // -// Solidity: event SignatureVerified(address indexed signer, string txnHash, uint256 indexed bid, uint64 blockNumber) +// Solidity: event SignatureVerified(address indexed signer, string txnHash, string revertingTxHashes, uint256 indexed bid, uint64 blockNumber) func (_Preconfcommitmentstore *PreconfcommitmentstoreFilterer) WatchSignatureVerified(opts *bind.WatchOpts, sink chan<- *PreconfcommitmentstoreSignatureVerified, signer []common.Address, bid []*big.Int) (event.Subscription, error) { var signerRule []interface{} @@ -2206,9 +2228,9 @@ func (_Preconfcommitmentstore *PreconfcommitmentstoreFilterer) WatchSignatureVer }), nil } -// ParseSignatureVerified is a log parse operation binding the contract event 0xe872564fb7c047879c36afa1ab2c8a8466c69098cc6a38d2b2f36cc786e65c34. +// ParseSignatureVerified is a log parse operation binding the contract event 0xf5fa3f7902916f0e4e2af218fa9a77809c54e64b77ec4061a205ec3b7ce5c35e. // -// Solidity: event SignatureVerified(address indexed signer, string txnHash, uint256 indexed bid, uint64 blockNumber) +// Solidity: event SignatureVerified(address indexed signer, string txnHash, string revertingTxHashes, uint256 indexed bid, uint64 blockNumber) func (_Preconfcommitmentstore *PreconfcommitmentstoreFilterer) ParseSignatureVerified(log types.Log) (*PreconfcommitmentstoreSignatureVerified, error) { event := new(PreconfcommitmentstoreSignatureVerified) if err := _Preconfcommitmentstore.contract.UnpackLog(event, "SignatureVerified", log); err != nil { diff --git a/oracle/pkg/updater/updater.go b/oracle/pkg/updater/updater.go index 1f1ae92e5..dae065815 100644 --- a/oracle/pkg/updater/updater.go +++ b/oracle/pkg/updater/updater.go @@ -336,6 +336,8 @@ func (u *Updater) handleOpenedCommitment( ) commitmentTxnHashes := strings.Split(update.TxnHash, ",") + u.logger.Info("commitmentTxnHashes", "commitmentTxnHashes", commitmentTxnHashes) + revertableTxns := make(map[string]bool) // Ensure Bundle is atomic and present in the block for i := 0; i < len(commitmentTxnHashes); i++ { txnDetails, found := txns[commitmentTxnHashes[i]] From 1ed9e01180d95cf17e2c881efb909fb983d287d2 Mon Sep 17 00:00:00 2001 From: Kartik Chopra Date: Sun, 7 Jul 2024 20:59:14 -0400 Subject: [PATCH 21/41] feat: adds back revertible check --- oracle/pkg/updater/updater.go | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/oracle/pkg/updater/updater.go b/oracle/pkg/updater/updater.go index dae065815..f77ab0fbc 100644 --- a/oracle/pkg/updater/updater.go +++ b/oracle/pkg/updater/updater.go @@ -337,13 +337,21 @@ func (u *Updater) handleOpenedCommitment( commitmentTxnHashes := strings.Split(update.TxnHash, ",") u.logger.Info("commitmentTxnHashes", "commitmentTxnHashes", commitmentTxnHashes) - revertableTxns := make(map[string]bool) + revertableTxns := strings.Split(update.RevertingTxHashes, ",") + u.logger.Info("revertableTxns", "revertableTxns", revertableTxns) + + // Create a map for revertable transactions + revertableTxnsMap := make(map[string]bool) + for _, txn := range revertableTxns { + revertableTxnsMap[txn] = true + } + // Ensure Bundle is atomic and present in the block for i := 0; i < len(commitmentTxnHashes); i++ { txnDetails, found := txns[commitmentTxnHashes[i]] - if !found || txnDetails.PosInBlock != (txns[commitmentTxnHashes[0]].PosInBlock)+i || !txnDetails.Succeeded { + if !found || txnDetails.PosInBlock != (txns[commitmentTxnHashes[0]].PosInBlock)+i || (!txnDetails.Succeeded && !revertableTxnsMap[commitmentTxnHashes[i]]) { u.logger.Info( - "bundle does not satsify commited requirements", + "bundle does not satisfy committed requirements", "commitmentIdx", common.Bytes2Hex(update.CommitmentIndex[:]), "txnHash", update.TxnHash, "blockNumber", update.BlockNumber, @@ -351,6 +359,7 @@ func (u *Updater) handleOpenedCommitment( "posInBlock", txnDetails.PosInBlock, "succeeded", txnDetails.Succeeded, "expectedPosInBlock", txns[commitmentTxnHashes[0]].PosInBlock+i, + "revertible", revertableTxnsMap[commitmentTxnHashes[i]], ) // The committer did not include the transactions in the block From 9324f0cae8dfff0d8d874aa9c006796f03452b34 Mon Sep 17 00:00:00 2001 From: Kartik Chopra Date: Sun, 7 Jul 2024 21:10:06 -0400 Subject: [PATCH 22/41] feat: resolves all issues with updater --- oracle/pkg/updater/updater_test.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/oracle/pkg/updater/updater_test.go b/oracle/pkg/updater/updater_test.go index 12176098d..a332710e4 100644 --- a/oracle/pkg/updater/updater_test.go +++ b/oracle/pkg/updater/updater_test.go @@ -131,6 +131,8 @@ func TestUpdater(t *testing.T) { DecayStartTimeStamp: uint64(startTimestamp.UnixMilli()), DecayEndTimeStamp: uint64(endTimestamp.UnixMilli()), DispatchTimestamp: uint64(midTimestamp.UnixMilli()), + RevertingTxHashes: "", + SharedSecretKey: []byte("shared_secret_key"), } if i%2 == 0 { @@ -173,6 +175,8 @@ func TestUpdater(t *testing.T) { DecayStartTimeStamp: uint64(startTimestamp.UnixMilli()), DecayEndTimeStamp: uint64(endTimestamp.UnixMilli()), DispatchTimestamp: uint64(midTimestamp.UnixMilli()), + RevertingTxHashes: "", + SharedSecretKey: []byte("shared_secret_key"), } encCommitments = append(encCommitments, encCommitment) commitments = append(commitments, commitment) @@ -392,6 +396,8 @@ func TestUpdaterRevertedTxns(t *testing.T) { DecayStartTimeStamp: uint64(startTimestamp.UnixMilli()), DecayEndTimeStamp: uint64(endTimestamp.UnixMilli()), DispatchTimestamp: uint64(midTimestamp.UnixMilli()), + RevertingTxHashes: "", + SharedSecretKey: []byte("shared_secret_key"), } if i%2 == 0 { @@ -434,6 +440,8 @@ func TestUpdaterRevertedTxns(t *testing.T) { DecayStartTimeStamp: uint64(startTimestamp.UnixMilli()), DecayEndTimeStamp: uint64(endTimestamp.UnixMilli()), DispatchTimestamp: uint64(midTimestamp.UnixMilli()), + RevertingTxHashes: "", + SharedSecretKey: []byte("shared_secret_key"), } encCommitments = append(encCommitments, encCommitment) commitments = append(commitments, commitment) @@ -657,6 +665,8 @@ func TestUpdaterBundlesFailure(t *testing.T) { DecayStartTimeStamp: uint64(startTimestamp.UnixMilli()), DecayEndTimeStamp: uint64(endTimestamp.UnixMilli()), DispatchTimestamp: uint64(midTimestamp.UnixMilli()), + RevertingTxHashes: "", + SharedSecretKey: []byte("shared_secret_key"), } commitments = append(commitments, commitment) @@ -841,6 +851,7 @@ func TestUpdaterIgnoreCommitments(t *testing.T) { Commiter: builderAddr, Bid: big.NewInt(10), TxnHash: strings.TrimPrefix(txn.Hash().Hex(), "0x"), + RevertingTxHashes: "", BlockNumber: blockNum, CommitmentHash: common.HexToHash(fmt.Sprintf("0x%02d", i)), CommitmentSignature: []byte("signature"), @@ -1203,6 +1214,7 @@ func publishCommitment( c.DecayStartTimeStamp, c.DecayEndTimeStamp, c.TxnHash, + c.RevertingTxHashes, c.CommitmentHash, c.BidSignature, c.CommitmentSignature, From 2395d17c871ec1aa0c92ecc5a41c2dc81d6913f7 Mon Sep 17 00:00:00 2001 From: Kartik Chopra Date: Sun, 7 Jul 2024 21:19:44 -0400 Subject: [PATCH 23/41] feat: fixes p2p test issues --- p2p/pkg/preconfirmation/tracker/tracker.go | 14 ++++++++------ p2p/pkg/preconfirmation/tracker/tracker_test.go | 8 ++++++++ 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/p2p/pkg/preconfirmation/tracker/tracker.go b/p2p/pkg/preconfirmation/tracker/tracker.go index 10d2d770f..fa1d7c806 100644 --- a/p2p/pkg/preconfirmation/tracker/tracker.go +++ b/p2p/pkg/preconfirmation/tracker/tracker.go @@ -32,9 +32,9 @@ type Tracker struct { newL1Blocks chan *blocktracker.BlocktrackerNewL1Block enryptedCmts chan *preconfcommstore.PreconfcommitmentstoreEncryptedCommitmentStored commitments chan *preconfcommstore.PreconfcommitmentstoreCommitmentStored - winners map[int64]*blocktracker.BlocktrackerNewL1Block - metrics *metrics - logger *slog.Logger + winners map[int64]*blocktracker.BlocktrackerNewL1Block + metrics *metrics + logger *slog.Logger } type OptsGetter func(context.Context) (*bind.TransactOpts, error) @@ -60,6 +60,7 @@ type PreconfContract interface { bid *big.Int, blockNumber uint64, txnHash string, + revertingTxHashes string, decayStartTimeStamp uint64, decayEndTimeStamp uint64, bidSignature []byte, @@ -89,9 +90,9 @@ func NewTracker( newL1Blocks: make(chan *blocktracker.BlocktrackerNewL1Block), enryptedCmts: make(chan *preconfcommstore.PreconfcommitmentstoreEncryptedCommitmentStored), commitments: make(chan *preconfcommstore.PreconfcommitmentstoreCommitmentStored), - winners: make(map[int64]*blocktracker.BlocktrackerNewL1Block), - metrics: newMetrics(), - logger: logger, + winners: make(map[int64]*blocktracker.BlocktrackerNewL1Block), + metrics: newMetrics(), + logger: logger, } } @@ -324,6 +325,7 @@ func (t *Tracker) handleNewL1Block( bidAmt, uint64(commitment.PreConfirmation.Bid.BlockNumber), commitment.PreConfirmation.Bid.TxHash, + commitment.PreConfirmation.Bid.RevertingTxHashes, uint64(commitment.PreConfirmation.Bid.DecayStartTimestamp), uint64(commitment.PreConfirmation.Bid.DecayEndTimestamp), commitment.PreConfirmation.Bid.Signature, diff --git a/p2p/pkg/preconfirmation/tracker/tracker_test.go b/p2p/pkg/preconfirmation/tracker/tracker_test.go index b370ef868..ee8aa229d 100644 --- a/p2p/pkg/preconfirmation/tracker/tracker_test.go +++ b/p2p/pkg/preconfirmation/tracker/tracker_test.go @@ -158,6 +158,7 @@ func TestTracker(t *testing.T) { DecayStartTimeStamp: uint64(commitments[4].PreConfirmation.Bid.DecayStartTimestamp), DecayEndTimeStamp: uint64(commitments[4].PreConfirmation.Bid.DecayEndTimestamp), TxnHash: commitments[4].PreConfirmation.Bid.TxHash, + RevertingTxHashes: commitments[4].PreConfirmation.Bid.RevertingTxHashes, CommitmentHash: common.BytesToHash(commitments[4].PreConfirmation.Digest), BidSignature: commitments[4].PreConfirmation.Bid.Signature, CommitmentSignature: commitments[4].PreConfirmation.Signature, @@ -280,6 +281,9 @@ func TestTracker(t *testing.T) { oc.decayStartTimeStamp, ) } + if c.PreConfirmation.Bid.RevertingTxHashes != oc.revertingTxHashes { + t.Fatalf("expected reverting tx hashes %s, got %s", c.PreConfirmation.Bid.RevertingTxHashes, oc.revertingTxHashes) + } if c.PreConfirmation.Bid.DecayEndTimestamp != int64(oc.decayEndTimeStamp) { t.Fatalf("expected decay end timestamp %d, got %d", c.PreConfirmation.Bid.DecayEndTimestamp, oc.decayEndTimeStamp) } @@ -316,6 +320,7 @@ type openedCommitment struct { bid *big.Int blockNumber uint64 txnHash string + revertingTxHashes string decayStartTimeStamp uint64 decayEndTimeStamp uint64 bidSignature []byte @@ -333,6 +338,7 @@ func (t *testPreconfContract) OpenCommitment( bid *big.Int, blockNumber uint64, txnHash string, + revertingTxHashes string, decayStartTimeStamp uint64, decayEndTimeStamp uint64, bidSignature []byte, @@ -344,6 +350,7 @@ func (t *testPreconfContract) OpenCommitment( bid: bid, blockNumber: blockNumber, txnHash: txnHash, + revertingTxHashes: revertingTxHashes, decayStartTimeStamp: decayStartTimeStamp, decayEndTimeStamp: decayEndTimeStamp, bidSignature: bidSignature, @@ -417,6 +424,7 @@ func publishCommitment( c.DecayStartTimeStamp, c.DecayEndTimeStamp, c.TxnHash, + c.RevertingTxHashes, c.CommitmentHash, c.BidSignature, c.CommitmentSignature, From 95dd461491b8aa71705c5594d6ba5ce86c278eed Mon Sep 17 00:00:00 2001 From: kant Date: Mon, 8 Jul 2024 02:57:46 -0700 Subject: [PATCH 24/41] feat: adding swagger file. Note the buf version needs to be 1.31.0 --- p2p/gen/openapi/debugapi/v1/debugapi.swagger.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/p2p/gen/openapi/debugapi/v1/debugapi.swagger.yaml b/p2p/gen/openapi/debugapi/v1/debugapi.swagger.yaml index 7f1033586..6273729b4 100644 --- a/p2p/gen/openapi/debugapi/v1/debugapi.swagger.yaml +++ b/p2p/gen/openapi/debugapi/v1/debugapi.swagger.yaml @@ -86,7 +86,7 @@ definitions: `NullValue` is a singleton enumeration to represent the null value for the `Value` type union. - The JSON representation for `NullValue` is JSON `null`. + The JSON representation for `NullValue` is JSON `null`. v1CancelTransactionResponse: type: object example: From 6b2c57c203350a5ecce6cc54e831af722e3e4122 Mon Sep 17 00:00:00 2001 From: Kartik Chopra Date: Mon, 8 Jul 2024 12:17:50 -0400 Subject: [PATCH 25/41] feat: adds verbose logs to tracker --- p2p/pkg/preconfirmation/tracker/tracker.go | 38 ++++++++++++++-------- 1 file changed, 24 insertions(+), 14 deletions(-) diff --git a/p2p/pkg/preconfirmation/tracker/tracker.go b/p2p/pkg/preconfirmation/tracker/tracker.go index fa1d7c806..efd7c0189 100644 --- a/p2p/pkg/preconfirmation/tracker/tracker.go +++ b/p2p/pkg/preconfirmation/tracker/tracker.go @@ -249,7 +249,6 @@ func (t *Tracker) TrackCommitment( func (t *Tracker) Metrics() []prometheus.Collector { return t.metrics.Metrics() } - func (t *Tracker) handleNewL1Block( ctx context.Context, newL1Block *blocktracker.BlocktrackerNewL1Block, @@ -269,14 +268,18 @@ func (t *Tracker) handleNewL1Block( // for bidder to open is only in cases of slashes as he will get refund. Only one // of bidder or provider should open the commitment as 1 of the txns would // fail. This delay is to ensure this. + t.logger.Info("Bidder detected, processing block 1 behind the current one") t.winners[newL1Block.BlockNumber.Int64()] = newL1Block pastBlock, ok := t.winners[newL1Block.BlockNumber.Int64()-2] if !ok { + t.logger.Info("Past block not found, returning") return nil } newL1Block = pastBlock + t.logger.Info("Processing past block", "blockNumber", pastBlock.BlockNumber) for k := range t.winners { if k < pastBlock.BlockNumber.Int64() { + t.logger.Info("Deleting old winner entry", "blockNumber", k) delete(t.winners, k) } } @@ -284,19 +287,23 @@ func (t *Tracker) handleNewL1Block( commitments, err := t.store.GetCommitmentsByBlockNumber(newL1Block.BlockNumber.Int64()) if err != nil { + t.logger.Error("Failed to get commitments by block number", "blockNumber", newL1Block.BlockNumber, "error", err) return err } + t.logger.Info("Commitments retrieved", "count", len(commitments)) + failedCommitments := make([]common.Hash, 0) settled := 0 for _, commitment := range commitments { if commitment.CommitmentIndex == nil { + t.logger.Info("Commitment index is nil, adding to failed commitments", "txnHash", commitment.TxnHash) failedCommitments = append(failedCommitments, commitment.TxnHash) continue } if common.BytesToAddress(commitment.ProviderAddress).Cmp(newL1Block.Winner) != 0 { t.logger.Debug( - "provider address does not match the winner", + "Provider address does not match the winner", "providerAddress", commitment.ProviderAddress, "winner", newL1Block.Winner, ) @@ -309,16 +316,18 @@ func (t *Tracker) handleNewL1Block( bidAmt, ok := new(big.Int).SetString(commitment.Bid.BidAmount, 10) if !ok { - t.logger.Error("failed to parse bid amount", "bidAmount", commitment.Bid.BidAmount) + t.logger.Error("Failed to parse bid amount", "bidAmount", commitment.Bid.BidAmount) continue } opts, err := t.optsGetter(ctx) if err != nil { - t.logger.Error("failed to get transact opts", "error", err) + t.logger.Error("Failed to get transact opts", "error", err) continue } + t.logger.Info("Opening commitment", "commitmentIdx", commitmentIdx, "bidAmount", bidAmt) + txHash, err := t.preconfContract.OpenCommitment( opts, commitmentIdx, @@ -333,11 +342,11 @@ func (t *Tracker) handleNewL1Block( commitment.PreConfirmation.SharedSecret, ) if err != nil { - t.logger.Error("failed to open commitment", "error", err) + t.logger.Error("Failed to open commitment", "error", err) continue } duration := time.Since(startTime) - t.logger.Info("opened commitment", + t.logger.Info("Opened commitment", "txHash", txHash, "duration", duration, "blockNumber", newL1Block.BlockNumber, "commiter", common.Bytes2Hex(commitment.ProviderAddress), @@ -347,16 +356,12 @@ func (t *Tracker) handleNewL1Block( err = t.store.DeleteCommitmentByBlockNumber(newL1Block.BlockNumber.Int64()) if err != nil { - t.logger.Error("failed to delete commitments by block number", "error", err) + t.logger.Error("Failed to delete commitments by block number", "blockNumber", newL1Block.BlockNumber, "error", err) return err } openDuration := time.Since(openStart) - t.metrics.totalCommitmentsToOpen.Add(float64(len(commitments))) - t.metrics.totalOpenedCommitments.Add(float64(settled)) - t.metrics.blockCommitmentProcessDuration.Set(float64(openDuration)) - - t.logger.Info("commitments opened", + t.logger.Info("Commitments opened", "blockNumber", newL1Block.BlockNumber, "total", len(commitments), "settled", settled, @@ -364,14 +369,19 @@ func (t *Tracker) handleNewL1Block( "duration", openDuration, ) + t.metrics.totalCommitmentsToOpen.Add(float64(len(commitments))) + t.metrics.totalOpenedCommitments.Add(float64(settled)) + t.metrics.blockCommitmentProcessDuration.Set(float64(openDuration)) + if len(failedCommitments) > 0 { + t.logger.Info("Processing failed commitments", "count", len(failedCommitments)) receipts, err := t.receiptGetter.BatchReceipts(ctx, failedCommitments) if err != nil { - t.logger.Warn("failed to get receipts for failed commitments", "error", err) + t.logger.Warn("Failed to get receipts for failed commitments", "error", err) return nil } for i, receipt := range receipts { - t.logger.Debug("receipt for failed commitment", + t.logger.Debug("Receipt for failed commitment", "txHash", failedCommitments[i], "error", receipt.Err, ) From 5d873fa9a93210adcb2250467f6da73485b6679d Mon Sep 17 00:00:00 2001 From: Kartik Chopra Date: Mon, 8 Jul 2024 12:55:42 -0400 Subject: [PATCH 26/41] feat: adds reverting txns to hashing --- p2p/pkg/signer/preconfencryptor/encryptor.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/p2p/pkg/signer/preconfencryptor/encryptor.go b/p2p/pkg/signer/preconfencryptor/encryptor.go index 1e7e75e15..9614345e4 100644 --- a/p2p/pkg/signer/preconfencryptor/encryptor.go +++ b/p2p/pkg/signer/preconfencryptor/encryptor.go @@ -307,18 +307,20 @@ func GetBidHash(bid *preconfpb.Bid) ([]byte, error) { return nil, ErrInvalidBidAmt } - // EIP712_MESSAGE_TYPEHASH + // EIP712_BID_TYPEHASH eip712MessageTypeHash := crypto.Keccak256Hash( - []byte("PreConfBid(string txnHash,uint256 bid,uint64 blockNumber,uint64 decayStartTimeStamp,uint64 decayEndTimeStamp)"), + []byte("PreConfBid(string txnHash,string revertingTxHashes,uint256 bid,uint64 blockNumber,uint64 decayStartTimeStamp,uint64 decayEndTimeStamp)"), ) // Convert the txnHash to a byte array and hash it txnHashHash := crypto.Keccak256Hash([]byte(bid.TxHash)) + revertingTxHashesHash := crypto.Keccak256Hash([]byte(bid.RevertingTxHashes)) // Encode values similar to Solidity's abi.encode // The reason we use math.U256Bytes is because we want to encode the uint64 as a 32 byte array // The EVM does this for values due via padding to 32 bytes, as that's the base size of a word in the EVM data := append(eip712MessageTypeHash.Bytes(), txnHashHash.Bytes()...) + data = append(data, revertingTxHashesHash.Bytes()...) data = append(data, math.U256Bytes(bidAmt)...) data = append(data, math.U256Bytes(big.NewInt(bid.BlockNumber))...) data = append(data, math.U256Bytes(big.NewInt(bid.DecayStartTimestamp))...) @@ -350,19 +352,21 @@ func GetPreConfirmationHash(c *preconfpb.PreConfirmation) ([]byte, error) { return nil, ErrInvalidBidAmt } - // EIP712_MESSAGE_TYPEHASH + // EIP712_COMMITMENT_TYPEHASH eip712MessageTypeHash := crypto.Keccak256Hash( - []byte("PreConfCommitment(string txnHash,uint256 bid,uint64 blockNumber,uint64 decayStartTimeStamp,uint64 decayEndTimeStamp,bytes32 bidHash,string signature,string sharedSecretKey)"), + []byte("PreConfCommitment(string txnHash,string revertingTxHashes,uint256 bid,uint64 blockNumber,uint64 decayStartTimeStamp,uint64 decayEndTimeStamp,bytes32 bidHash,string signature,string sharedSecretKey)"), ) // Convert the txnHash to a byte array and hash it txnHashHash := crypto.Keccak256Hash([]byte(c.Bid.TxHash)) + revertingTxHashesHash := crypto.Keccak256Hash([]byte(c.Bid.RevertingTxHashes)) bidDigestHash := crypto.Keccak256Hash([]byte(hex.EncodeToString(c.Bid.Digest))) bidSigHash := crypto.Keccak256Hash([]byte(hex.EncodeToString(c.Bid.Signature))) sharedSecretHash := crypto.Keccak256Hash([]byte(hex.EncodeToString(c.SharedSecret))) // Encode values similar to Solidity's abi.encode data := append(eip712MessageTypeHash.Bytes(), txnHashHash.Bytes()...) + data = append(data, revertingTxHashesHash.Bytes()...) data = append(data, math.U256Bytes(bidAmt)...) data = append(data, math.U256Bytes(big.NewInt(c.Bid.BlockNumber))...) data = append(data, math.U256Bytes(big.NewInt(c.Bid.DecayStartTimestamp))...) From de23ab2b9a5c5d3bf6aae8412f4cc94f1756e979 Mon Sep 17 00:00:00 2001 From: Kartik Chopra Date: Mon, 8 Jul 2024 12:58:03 -0400 Subject: [PATCH 27/41] feat: fix correct hash --- p2p/pkg/signer/preconfencryptor/encryptor_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/p2p/pkg/signer/preconfencryptor/encryptor_test.go b/p2p/pkg/signer/preconfencryptor/encryptor_test.go index a18160430..ac600147c 100644 --- a/p2p/pkg/signer/preconfencryptor/encryptor_test.go +++ b/p2p/pkg/signer/preconfencryptor/encryptor_test.go @@ -165,14 +165,14 @@ func TestHashing(t *testing.T) { hashStr := hex.EncodeToString(hash) // This hash is sourced from the solidity contract to ensure interoperability - expHash := "56c06a13be335eba981b780ea45dff258a7c429d0e9d993235ef2d3a7e435df8" + expHash := "d794a5899d123c0bf474ca2a39b00a3b421e13575e6dde349fa7bef78356c9a2" if hashStr != expHash { t.Fatalf("hash mismatch: %s != %s", hashStr, expHash) } }) t.Run("preConfirmation", func(t *testing.T) { - bidHash := "56c06a13be335eba981b780ea45dff258a7c429d0e9d993235ef2d3a7e435df8" + bidHash := "d794a5899d123c0bf474ca2a39b00a3b421e13575e6dde349fa7bef78356c9a2" bidSignature := "2e7df27808c72d7d5b2543bb63b06c0ae2144e021593b8d2a7cca6a3fb2d9c4b1a82dd2a07266de9364d255bdb709476ad96b826ec855efb528eaff66682997e1c" bidHashBytes, err := hex.DecodeString(bidHash) @@ -207,7 +207,7 @@ func TestHashing(t *testing.T) { } hashStr := hex.EncodeToString(hash) - expHash := "9d954942ad3f6cb41ccd029869be7b28036270b4754665a3783c2d6bf0ef7d08" + expHash := "fa013e066e60e39d4f20cbb08aaab09d98e9830716132f5e6ebbcd1b1119775b" if hashStr != expHash { t.Fatalf("hash mismatch: %s != %s", hashStr, expHash) } From 4b7a2871c0ff6c88ebe2d76a201c63960037fcb9 Mon Sep 17 00:00:00 2001 From: Kartik Chopra Date: Mon, 8 Jul 2024 15:27:30 -0400 Subject: [PATCH 28/41] feat: fix all issues with hash mismatch --- .../contracts/PreConfCommitmentStore.sol | 51 ++++++++++++++- contracts/test/PreConfirmationConfTest.sol | 62 +++++++++++++++++++ p2p/pkg/signer/preconfencryptor/encryptor.go | 2 + .../signer/preconfencryptor/encryptor_test.go | 10 +-- 4 files changed, 120 insertions(+), 5 deletions(-) diff --git a/contracts/contracts/PreConfCommitmentStore.sol b/contracts/contracts/PreConfCommitmentStore.sol index 958530429..d2c51959d 100644 --- a/contracts/contracts/PreConfCommitmentStore.sol +++ b/contracts/contracts/PreConfCommitmentStore.sol @@ -279,6 +279,56 @@ contract PreConfCommitmentStore is OwnableUpgradeable, UUPSUpgradeable { string memory _bidSignature, string memory _sharedSecretKey ) public view returns (bytes32) { + // console.log("EIP712_COMMITMENT_TYPEHASH:"); + // console.logBytes32(EIP712_COMMITMENT_TYPEHASH); + + // console.log("Transaction Hash:"); + // console.logBytes32(keccak256(abi.encodePacked(_txnHash))); + + // console.log("Reverting Transaction Hashes:"); + // console.logBytes32(keccak256(abi.encodePacked(_revertingTxHashes))); + + // console.log("Bid:"); + // console.logUint(_bid); + + // console.log("Block Number:"); + // console.logUint(_blockNumber); + + // console.log("Decay Start Timestamp:"); + // console.logUint(_decayStartTimeStamp); + + // console.log("Decay End Timestamp:"); + // console.logUint(_decayEndTimeStamp); + + // console.log("Reverting Transaction Hashes (again):"); + // console.logBytes32(keccak256(abi.encodePacked(_revertingTxHashes))); + + // console.log("Bid Hash:"); + // console.logBytes32(keccak256(abi.encodePacked(_bytes32ToHexString(_bidHash)))); + + // console.log("Bid Signature:"); + // console.logBytes32(keccak256(abi.encodePacked(_bidSignature))); + + // console.log("Shared Secret Key:"); + // console.logBytes32(keccak256(abi.encodePacked(_sharedSecretKey))); + // console.log("whole thing"); + // console.logBytes( + // abi.encode( + // EIP712_COMMITMENT_TYPEHASH, + // keccak256(abi.encodePacked(_txnHash)), + // keccak256(abi.encodePacked(_revertingTxHashes)), + // _bid, + // _blockNumber, + // _decayStartTimeStamp, + // _decayEndTimeStamp, + // _revertingTxHashes, + // keccak256( + // abi.encodePacked(_bytes32ToHexString(_bidHash)) + // ), + // keccak256(abi.encodePacked(_bidSignature)), + // keccak256(abi.encodePacked(_sharedSecretKey)) + // ) + // ); return ECDSA.toTypedDataHash( DOMAIN_SEPARATOR_PRECONF, @@ -291,7 +341,6 @@ contract PreConfCommitmentStore is OwnableUpgradeable, UUPSUpgradeable { _blockNumber, _decayStartTimeStamp, _decayEndTimeStamp, - _revertingTxHashes, keccak256( abi.encodePacked(_bytes32ToHexString(_bidHash)) ), diff --git a/contracts/test/PreConfirmationConfTest.sol b/contracts/test/PreConfirmationConfTest.sol index e33b9d2b0..633595a81 100644 --- a/contracts/test/PreConfirmationConfTest.sol +++ b/contracts/test/PreConfirmationConfTest.sol @@ -121,6 +121,68 @@ contract TestPreConfCommitmentStore is Test { ); } + function test_getBidHash() public { + // Step 1: Prepare the test commitment data + PreConfCommitmentStore.CommitmentParams memory testCommitment = PreConfCommitmentStore.CommitmentParams({ + txnHash: "0xkartik", + revertingTxHashes: "0xkartik", + bid: 2, + blockNumber: 2, + decayStartTimeStamp: 10, + decayEndTimeStamp: 20, + sharedSecretKey: bytes("0xsecret"), + bidHash: hex"9890bcda118cfabed02ff3b9d05a54dca5310e9ace3b05f259f4731f58ad0900", + bidSignature: hex"c2ab6e530f6b09337e53e1192857fa10017cdb488cf2a07e0aa4457571492b8c6bff93cbda4e003336656b4ecf8ff46bd1d408b310acdf07be4925a1a8fee4471c", + commitmentSignature: hex"5b3000290d4f347b94146eb37f66d5368aed18fb8713bf78620abe40ae3de7f635f7ed161801c31ea10e736d88e6fd2a2286bbd59385161dd24c9fefd2568f341b" + }); + // Step 2: Calculate the bid hash using the getBidHash function + bytes32 bidHash = preConfCommitmentStore.getBidHash( + testCommitment.txnHash, + testCommitment.revertingTxHashes, + testCommitment.bid, + testCommitment.blockNumber, + testCommitment.decayStartTimeStamp, + testCommitment.decayEndTimeStamp + ); + + // Add a bob private key and console log the key + (address bob, uint256 bobPk) = makeAddrAndKey("bob"); + console.log("Bob's Private Key:", bobPk); + + // Make a signature on the bid hash + (uint8 v, bytes32 r, bytes32 s) = vm.sign(bobPk, bidHash); + bytes memory bidSignature = abi.encodePacked(r, s, v); + console.logBytes(bidSignature); + + // Step 3: Calculate the commitment hash using the getPreConfHash function + bytes32 commitmentHash = preConfCommitmentStore.getPreConfHash( + testCommitment.txnHash, + testCommitment.revertingTxHashes, + testCommitment.bid, + testCommitment.blockNumber, + testCommitment.decayStartTimeStamp, + testCommitment.decayEndTimeStamp, + bidHash, + _bytesToHexString(bidSignature), + _bytesToHexString(testCommitment.sharedSecretKey) + ); + + // Step 4: Verify the bid hash is correctly generated and not zero + assert(bidHash != bytes32(0)); + + // Optional: Log the bid hash for debugging purposes + console.logBytes32(bidHash); + + // Step 5: Verify the commitment hash is correctly generated and not zero + assert(commitmentHash != bytes32(0)); + // Log the commitment hash for debugging purposes + console.log("Logging commitment hash:"); + console.logBytes32(commitmentHash); + + // Optional: Log the commitment hash for debugging purposes + console.logBytes32(commitmentHash); + } + function test_Initialize() public view { assertEq(preConfCommitmentStore.oracle(), feeRecipient); assertEq( diff --git a/p2p/pkg/signer/preconfencryptor/encryptor.go b/p2p/pkg/signer/preconfencryptor/encryptor.go index 9614345e4..98afd0e15 100644 --- a/p2p/pkg/signer/preconfencryptor/encryptor.go +++ b/p2p/pkg/signer/preconfencryptor/encryptor.go @@ -6,6 +6,7 @@ import ( "crypto/rand" "encoding/hex" "errors" + "fmt" "math/big" "github.com/ethereum/go-ethereum/common" @@ -374,6 +375,7 @@ func GetPreConfirmationHash(c *preconfpb.PreConfirmation) ([]byte, error) { data = append(data, bidDigestHash.Bytes()...) data = append(data, bidSigHash.Bytes()...) data = append(data, sharedSecretHash.Bytes()...) + fmt.Printf("Data to be hashed: %x\n", data) dataHash := crypto.Keccak256Hash(data) rawData := append([]byte("\x19\x01"), append(domainSeparatorBid.Bytes(), dataHash.Bytes()...)...) diff --git a/p2p/pkg/signer/preconfencryptor/encryptor_test.go b/p2p/pkg/signer/preconfencryptor/encryptor_test.go index ac600147c..08d6df573 100644 --- a/p2p/pkg/signer/preconfencryptor/encryptor_test.go +++ b/p2p/pkg/signer/preconfencryptor/encryptor_test.go @@ -152,6 +152,7 @@ func TestHashing(t *testing.T) { t.Run("bid", func(t *testing.T) { bid := &preconfpb.Bid{ TxHash: "0xkartik", + RevertingTxHashes: "0xkartik", BidAmount: "2", BlockNumber: 2, DecayStartTimestamp: 10, @@ -165,15 +166,15 @@ func TestHashing(t *testing.T) { hashStr := hex.EncodeToString(hash) // This hash is sourced from the solidity contract to ensure interoperability - expHash := "d794a5899d123c0bf474ca2a39b00a3b421e13575e6dde349fa7bef78356c9a2" + expHash := "9890bcda118cfabed02ff3b9d05a54dca5310e9ace3b05f259f4731f58ad0900" if hashStr != expHash { t.Fatalf("hash mismatch: %s != %s", hashStr, expHash) } }) t.Run("preConfirmation", func(t *testing.T) { - bidHash := "d794a5899d123c0bf474ca2a39b00a3b421e13575e6dde349fa7bef78356c9a2" - bidSignature := "2e7df27808c72d7d5b2543bb63b06c0ae2144e021593b8d2a7cca6a3fb2d9c4b1a82dd2a07266de9364d255bdb709476ad96b826ec855efb528eaff66682997e1c" + bidHash := "9890bcda118cfabed02ff3b9d05a54dca5310e9ace3b05f259f4731f58ad0900" + bidSignature := "c2ab6e530f6b09337e53e1192857fa10017cdb488cf2a07e0aa4457571492b8c6bff93cbda4e003336656b4ecf8ff46bd1d408b310acdf07be4925a1a8fee4471c" bidHashBytes, err := hex.DecodeString(bidHash) if err != nil { @@ -186,6 +187,7 @@ func TestHashing(t *testing.T) { bid := &preconfpb.Bid{ TxHash: "0xkartik", + RevertingTxHashes: "0xkartik", BidAmount: "2", BlockNumber: 2, DecayStartTimestamp: 10, @@ -207,7 +209,7 @@ func TestHashing(t *testing.T) { } hashStr := hex.EncodeToString(hash) - expHash := "fa013e066e60e39d4f20cbb08aaab09d98e9830716132f5e6ebbcd1b1119775b" + expHash := "e872828431f235bf75bebc05bd1a7d349e3b3d30be926c04502a674a05ef802d" if hashStr != expHash { t.Fatalf("hash mismatch: %s != %s", hashStr, expHash) } From d22aeaa6ea1fe0bade67328ba2b473a5cbbdf160 Mon Sep 17 00:00:00 2001 From: Kartik Chopra Date: Tue, 9 Jul 2024 12:34:26 -0400 Subject: [PATCH 29/41] feat: resolves all issues with tests --- .../contracts/PreConfCommitmentStore.sol | 100 +++++++++--------- contracts/test/PreConfirmationConfTest.sol | 10 +- p2p/pkg/signer/preconfencryptor/encryptor.go | 1 + .../signer/preconfencryptor/encryptor_test.go | 43 +++++++- 4 files changed, 94 insertions(+), 60 deletions(-) diff --git a/contracts/contracts/PreConfCommitmentStore.sol b/contracts/contracts/PreConfCommitmentStore.sol index d2c51959d..e06668b14 100644 --- a/contracts/contracts/PreConfCommitmentStore.sol +++ b/contracts/contracts/PreConfCommitmentStore.sol @@ -279,56 +279,56 @@ contract PreConfCommitmentStore is OwnableUpgradeable, UUPSUpgradeable { string memory _bidSignature, string memory _sharedSecretKey ) public view returns (bytes32) { - // console.log("EIP712_COMMITMENT_TYPEHASH:"); - // console.logBytes32(EIP712_COMMITMENT_TYPEHASH); - - // console.log("Transaction Hash:"); - // console.logBytes32(keccak256(abi.encodePacked(_txnHash))); - - // console.log("Reverting Transaction Hashes:"); - // console.logBytes32(keccak256(abi.encodePacked(_revertingTxHashes))); - - // console.log("Bid:"); - // console.logUint(_bid); - - // console.log("Block Number:"); - // console.logUint(_blockNumber); - - // console.log("Decay Start Timestamp:"); - // console.logUint(_decayStartTimeStamp); - - // console.log("Decay End Timestamp:"); - // console.logUint(_decayEndTimeStamp); - - // console.log("Reverting Transaction Hashes (again):"); - // console.logBytes32(keccak256(abi.encodePacked(_revertingTxHashes))); - - // console.log("Bid Hash:"); - // console.logBytes32(keccak256(abi.encodePacked(_bytes32ToHexString(_bidHash)))); - - // console.log("Bid Signature:"); - // console.logBytes32(keccak256(abi.encodePacked(_bidSignature))); - - // console.log("Shared Secret Key:"); - // console.logBytes32(keccak256(abi.encodePacked(_sharedSecretKey))); - // console.log("whole thing"); - // console.logBytes( - // abi.encode( - // EIP712_COMMITMENT_TYPEHASH, - // keccak256(abi.encodePacked(_txnHash)), - // keccak256(abi.encodePacked(_revertingTxHashes)), - // _bid, - // _blockNumber, - // _decayStartTimeStamp, - // _decayEndTimeStamp, - // _revertingTxHashes, - // keccak256( - // abi.encodePacked(_bytes32ToHexString(_bidHash)) - // ), - // keccak256(abi.encodePacked(_bidSignature)), - // keccak256(abi.encodePacked(_sharedSecretKey)) - // ) - // ); + console.log("EIP712_COMMITMENT_TYPEHASH:"); + console.logBytes32(EIP712_COMMITMENT_TYPEHASH); + + console.log("Transaction Hash:"); + console.logBytes32(keccak256(abi.encodePacked(_txnHash))); + + console.log("Reverting Transaction Hashes:"); + console.logBytes32(keccak256(abi.encodePacked(_revertingTxHashes))); + + console.log("Bid:"); + console.logUint(_bid); + + console.log("Block Number:"); + console.logUint(_blockNumber); + + console.log("Decay Start Timestamp:"); + console.logUint(_decayStartTimeStamp); + + console.log("Decay End Timestamp:"); + console.logUint(_decayEndTimeStamp); + + console.log("Reverting Transaction Hashes (again):"); + console.logBytes32(keccak256(abi.encodePacked(_revertingTxHashes))); + + console.log("Bid Hash:"); + console.logBytes32(keccak256(abi.encodePacked(_bytes32ToHexString(_bidHash)))); + + console.log("Bid Signature:"); + console.logBytes(abi.encodePacked(_bidSignature)); + + console.log("Shared Secret Key:"); + console.logBytes32(keccak256(abi.encodePacked(_sharedSecretKey))); + console.log("whole thing"); + console.logBytes( + abi.encode( + EIP712_COMMITMENT_TYPEHASH, + keccak256(abi.encodePacked(_txnHash)), + keccak256(abi.encodePacked(_revertingTxHashes)), + _bid, + _blockNumber, + _decayStartTimeStamp, + _decayEndTimeStamp, + keccak256( + abi.encodePacked(_bytes32ToHexString(_bidHash)) + ), + keccak256(abi.encodePacked(_bidSignature)), + keccak256(abi.encodePacked(_sharedSecretKey)) + ) + ); + return ECDSA.toTypedDataHash( DOMAIN_SEPARATOR_PRECONF, diff --git a/contracts/test/PreConfirmationConfTest.sol b/contracts/test/PreConfirmationConfTest.sol index 633595a81..d04edc368 100644 --- a/contracts/test/PreConfirmationConfTest.sol +++ b/contracts/test/PreConfirmationConfTest.sol @@ -49,9 +49,9 @@ contract TestPreConfCommitmentStore is Test { 10, 20, 0x9890bcda118cfabed02ff3b9d05a54dca5310e9ace3b05f259f4731f58ad0900, - 0x5798166a22386ff729228c55f79ebff1abe1ea579989d7d59a46a1e50590e2e1, + 0x8257770d4be5c4b622e6bd6b45ff8deb6602235f3aa844b774eb21800eb4923a, hex"f9b66c6d57dac947a3aa2b37010df745592cf57f907d437767bc0af6d44b3dc1112168e4cab311d6dfddf7f58c0d07bb95403fca2cc48d4450e088cf9ee894c81b", - hex"5b3000290d4f347b94146eb37f66d5368aed18fb8713bf78620abe40ae3de7f635f7ed161801c31ea10e736d88e6fd2a2286bbd59385161dd24c9fefd2568f341b", + hex"8101af732be6879be2cea25a792b3dcc8a5372b5e7636e8348445351a6dd079c534bcaf61e3f7fb4f9f45238e4068a8a5fe20d0204c7644d25b12c60fa95404201", 15, bytes("0xsecret") ); @@ -146,7 +146,7 @@ contract TestPreConfCommitmentStore is Test { ); // Add a bob private key and console log the key - (address bob, uint256 bobPk) = makeAddrAndKey("bob"); + (address bob, uint256 bobPk) = makeAddrAndKey("alice"); console.log("Bob's Private Key:", bobPk); // Make a signature on the bid hash @@ -319,7 +319,7 @@ contract TestPreConfCommitmentStore is Test { function test_GetCommitmentDigest() public { (, uint256 bidderPk) = makeAddrAndKey("alice"); - + console.log("Bidder Private Key:", bidderPk); bytes32 bidHash = preConfCommitmentStore.getBidHash( _testCommitmentAliceBob.txnHash, _testCommitmentAliceBob.revertingTxHashes, @@ -775,7 +775,7 @@ contract TestPreConfCommitmentStore is Test { _bytesToHexString(_testCommitmentAliceBob.bidSignature), _bytesToHexString(_testCommitmentAliceBob.sharedSecretKey) ); - + // Verify that the commitment has not been used before (bool isUsed, , , , , , , , , , , , , ,) = preConfCommitmentStore .commitments(preConfHash); diff --git a/p2p/pkg/signer/preconfencryptor/encryptor.go b/p2p/pkg/signer/preconfencryptor/encryptor.go index 98afd0e15..6e9ea22f3 100644 --- a/p2p/pkg/signer/preconfencryptor/encryptor.go +++ b/p2p/pkg/signer/preconfencryptor/encryptor.go @@ -363,6 +363,7 @@ func GetPreConfirmationHash(c *preconfpb.PreConfirmation) ([]byte, error) { revertingTxHashesHash := crypto.Keccak256Hash([]byte(c.Bid.RevertingTxHashes)) bidDigestHash := crypto.Keccak256Hash([]byte(hex.EncodeToString(c.Bid.Digest))) bidSigHash := crypto.Keccak256Hash([]byte(hex.EncodeToString(c.Bid.Signature))) + fmt.Printf("Bid Signature Hash: %x\n", bidSigHash.Bytes()) sharedSecretHash := crypto.Keccak256Hash([]byte(hex.EncodeToString(c.SharedSecret))) // Encode values similar to Solidity's abi.encode diff --git a/p2p/pkg/signer/preconfencryptor/encryptor_test.go b/p2p/pkg/signer/preconfencryptor/encryptor_test.go index 08d6df573..1bd6a3971 100644 --- a/p2p/pkg/signer/preconfencryptor/encryptor_test.go +++ b/p2p/pkg/signer/preconfencryptor/encryptor_test.go @@ -170,11 +170,32 @@ func TestHashing(t *testing.T) { if hashStr != expHash { t.Fatalf("hash mismatch: %s != %s", hashStr, expHash) } + + alicePrivateKey, err := crypto.HexToECDSA("9C0257114EB9399A2985F8E75DAD7600C5D89FE3824FFA99EC1C3EB8BF3B0501") + if err != nil { + t.Fatal(err) + } + + expHashBytes, err := hex.DecodeString(expHash) + if err != nil { + t.Fatal(err) + } + + signature, err := crypto.Sign(expHashBytes, alicePrivateKey) + if err != nil { + t.Fatal(err) + } + + t.Logf("Signature: %s", hex.EncodeToString(signature)) + + // Log the keccak of the signature + signatureHash := crypto.Keccak256Hash(signature) + t.Logf("Keccak256 of Signature: %s", signatureHash.Hex()) }) t.Run("preConfirmation", func(t *testing.T) { bidHash := "9890bcda118cfabed02ff3b9d05a54dca5310e9ace3b05f259f4731f58ad0900" - bidSignature := "c2ab6e530f6b09337e53e1192857fa10017cdb488cf2a07e0aa4457571492b8c6bff93cbda4e003336656b4ecf8ff46bd1d408b310acdf07be4925a1a8fee4471c" + bidSignature := "f9b66c6d57dac947a3aa2b37010df745592cf57f907d437767bc0af6d44b3dc1112168e4cab311d6dfddf7f58c0d07bb95403fca2cc48d4450e088cf9ee894c81b" bidHashBytes, err := hex.DecodeString(bidHash) if err != nil { @@ -207,20 +228,32 @@ func TestHashing(t *testing.T) { if err != nil { t.Fatal(err) } - hashStr := hex.EncodeToString(hash) - expHash := "e872828431f235bf75bebc05bd1a7d349e3b3d30be926c04502a674a05ef802d" + expHash := "8257770d4be5c4b622e6bd6b45ff8deb6602235f3aa844b774eb21800eb4923a" if hashStr != expHash { t.Fatalf("hash mismatch: %s != %s", hashStr, expHash) } + + // Sign the hash with Bob's private key + bobPrivateKey, err := crypto.HexToECDSA("38E47A7B719DCE63662AEAF43440326F551B8A7EE198CEE35CB5D517F2D296A2") + if err != nil { + t.Fatal(err) + } + + signature, err := crypto.Sign(hash, bobPrivateKey) + if err != nil { + t.Fatal(err) + } + + t.Logf("Bob's Signature: %s", hex.EncodeToString(signature)) }) } func TestVerify(t *testing.T) { t.Parallel() - bidSig := "8af22e36247e14ba05d3a5a3cc62eee708cfd9ce293c0aebcbe7f89229f6db56638af8427806247d9abb295f681c1a2f2bb127f3bf80799f80d62b252cce04d91c" - bidHash := "2574b1ab8a90e173528ddee748be8e8e696b1f0cf687f75966550f5e9ef408b0" + bidSig := "f9b66c6d57dac947a3aa2b37010df745592cf57f907d437767bc0af6d44b3dc1112168e4cab311d6dfddf7f58c0d07bb95403fca2cc48d4450e088cf9ee894c800" + bidHash := "9890bcda118cfabed02ff3b9d05a54dca5310e9ace3b05f259f4731f58ad0900" bidHashBytes, err := hex.DecodeString(bidHash) if err != nil { From e61e0eafa6764c2ca296af631f062c4e1bf4cbe4 Mon Sep 17 00:00:00 2001 From: Kartik Chopra Date: Tue, 9 Jul 2024 13:24:53 -0400 Subject: [PATCH 30/41] feat: get tests to run --- .../contracts/PreConfCommitmentStore.sol | 51 +------------------ contracts/test/PreConfirmationConfTest.sol | 18 ++++--- 2 files changed, 11 insertions(+), 58 deletions(-) diff --git a/contracts/contracts/PreConfCommitmentStore.sol b/contracts/contracts/PreConfCommitmentStore.sol index e06668b14..8174eeb48 100644 --- a/contracts/contracts/PreConfCommitmentStore.sol +++ b/contracts/contracts/PreConfCommitmentStore.sol @@ -279,56 +279,7 @@ contract PreConfCommitmentStore is OwnableUpgradeable, UUPSUpgradeable { string memory _bidSignature, string memory _sharedSecretKey ) public view returns (bytes32) { - console.log("EIP712_COMMITMENT_TYPEHASH:"); - console.logBytes32(EIP712_COMMITMENT_TYPEHASH); - - console.log("Transaction Hash:"); - console.logBytes32(keccak256(abi.encodePacked(_txnHash))); - - console.log("Reverting Transaction Hashes:"); - console.logBytes32(keccak256(abi.encodePacked(_revertingTxHashes))); - - console.log("Bid:"); - console.logUint(_bid); - - console.log("Block Number:"); - console.logUint(_blockNumber); - - console.log("Decay Start Timestamp:"); - console.logUint(_decayStartTimeStamp); - - console.log("Decay End Timestamp:"); - console.logUint(_decayEndTimeStamp); - - console.log("Reverting Transaction Hashes (again):"); - console.logBytes32(keccak256(abi.encodePacked(_revertingTxHashes))); - - console.log("Bid Hash:"); - console.logBytes32(keccak256(abi.encodePacked(_bytes32ToHexString(_bidHash)))); - - console.log("Bid Signature:"); - console.logBytes(abi.encodePacked(_bidSignature)); - - console.log("Shared Secret Key:"); - console.logBytes32(keccak256(abi.encodePacked(_sharedSecretKey))); - console.log("whole thing"); - console.logBytes( - abi.encode( - EIP712_COMMITMENT_TYPEHASH, - keccak256(abi.encodePacked(_txnHash)), - keccak256(abi.encodePacked(_revertingTxHashes)), - _bid, - _blockNumber, - _decayStartTimeStamp, - _decayEndTimeStamp, - keccak256( - abi.encodePacked(_bytes32ToHexString(_bidHash)) - ), - keccak256(abi.encodePacked(_bidSignature)), - keccak256(abi.encodePacked(_sharedSecretKey)) - ) - ); - + return ECDSA.toTypedDataHash( DOMAIN_SEPARATOR_PRECONF, diff --git a/contracts/test/PreConfirmationConfTest.sol b/contracts/test/PreConfirmationConfTest.sol index d04edc368..8b3540c94 100644 --- a/contracts/test/PreConfirmationConfTest.sol +++ b/contracts/test/PreConfirmationConfTest.sol @@ -51,7 +51,7 @@ contract TestPreConfCommitmentStore is Test { 0x9890bcda118cfabed02ff3b9d05a54dca5310e9ace3b05f259f4731f58ad0900, 0x8257770d4be5c4b622e6bd6b45ff8deb6602235f3aa844b774eb21800eb4923a, hex"f9b66c6d57dac947a3aa2b37010df745592cf57f907d437767bc0af6d44b3dc1112168e4cab311d6dfddf7f58c0d07bb95403fca2cc48d4450e088cf9ee894c81b", - hex"8101af732be6879be2cea25a792b3dcc8a5372b5e7636e8348445351a6dd079c534bcaf61e3f7fb4f9f45238e4068a8a5fe20d0204c7644d25b12c60fa95404201", + hex"8101af732be6879be2cea25a792b3dcc8a5372b5e7636e8348445351a6dd079c534bcaf61e3f7fb4f9f45238e4068a8a5fe20d0204c7644d25b12c60fa9540421c", 15, bytes("0xsecret") ); @@ -147,12 +147,12 @@ contract TestPreConfCommitmentStore is Test { // Add a bob private key and console log the key (address bob, uint256 bobPk) = makeAddrAndKey("alice"); - console.log("Bob's Private Key:", bobPk); + // Make a signature on the bid hash (uint8 v, bytes32 r, bytes32 s) = vm.sign(bobPk, bidHash); bytes memory bidSignature = abi.encodePacked(r, s, v); - console.logBytes(bidSignature); + // Step 3: Calculate the commitment hash using the getPreConfHash function bytes32 commitmentHash = preConfCommitmentStore.getPreConfHash( @@ -171,16 +171,16 @@ contract TestPreConfCommitmentStore is Test { assert(bidHash != bytes32(0)); // Optional: Log the bid hash for debugging purposes - console.logBytes32(bidHash); + // Step 5: Verify the commitment hash is correctly generated and not zero assert(commitmentHash != bytes32(0)); // Log the commitment hash for debugging purposes - console.log("Logging commitment hash:"); - console.logBytes32(commitmentHash); + + // Optional: Log the commitment hash for debugging purposes - console.logBytes32(commitmentHash); + } function test_Initialize() public view { @@ -319,7 +319,7 @@ contract TestPreConfCommitmentStore is Test { function test_GetCommitmentDigest() public { (, uint256 bidderPk) = makeAddrAndKey("alice"); - console.log("Bidder Private Key:", bidderPk); + bytes32 bidHash = preConfCommitmentStore.getBidHash( _testCommitmentAliceBob.txnHash, _testCommitmentAliceBob.revertingTxHashes, @@ -348,6 +348,8 @@ contract TestPreConfCommitmentStore is Test { (, uint256 providerPk) = makeAddrAndKey("bob"); (v, r, s) = vm.sign(providerPk, preConfHash); signature = abi.encodePacked(r, s, v); + + } function _bytes32ToHexString( From 405108a13475653b239ec431d5c1a0aaf90f2f87 Mon Sep 17 00:00:00 2001 From: Kartik Chopra Date: Tue, 9 Jul 2024 13:43:27 -0400 Subject: [PATCH 31/41] chore: update owner to alice in test --- oracle/pkg/updater/updater.go | 4 ++-- p2p/pkg/signer/preconfencryptor/encryptor_test.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/oracle/pkg/updater/updater.go b/oracle/pkg/updater/updater.go index f77ab0fbc..3b1f841c5 100644 --- a/oracle/pkg/updater/updater.go +++ b/oracle/pkg/updater/updater.go @@ -336,9 +336,9 @@ func (u *Updater) handleOpenedCommitment( ) commitmentTxnHashes := strings.Split(update.TxnHash, ",") - u.logger.Info("commitmentTxnHashes", "commitmentTxnHashes", commitmentTxnHashes) + u.logger.Debug("commitmentTxnHashes", "commitmentTxnHashes", commitmentTxnHashes) revertableTxns := strings.Split(update.RevertingTxHashes, ",") - u.logger.Info("revertableTxns", "revertableTxns", revertableTxns) + u.logger.Debug("revertableTxns", "revertableTxns", revertableTxns) // Create a map for revertable transactions revertableTxnsMap := make(map[string]bool) diff --git a/p2p/pkg/signer/preconfencryptor/encryptor_test.go b/p2p/pkg/signer/preconfencryptor/encryptor_test.go index 1bd6a3971..60a369298 100644 --- a/p2p/pkg/signer/preconfencryptor/encryptor_test.go +++ b/p2p/pkg/signer/preconfencryptor/encryptor_test.go @@ -275,7 +275,7 @@ func TestVerify(t *testing.T) { t.Fatal(err) } - expOwner := "0x8339F9E3d7B2693aD8955Aa5EC59D56669A84d60" + expOwner := "0x328809Bc894f92807417D2dAD6b7C998c1aFdac6" if owner.Hex() != expOwner { t.Fatalf("owner mismatch: %s != %s", owner.Hex(), expOwner) } From 885e07fb2e0db6dc917f57fafc3d1f9e8798eb0b Mon Sep 17 00:00:00 2001 From: Kartik Chopra Date: Tue, 9 Jul 2024 13:44:17 -0400 Subject: [PATCH 32/41] chore: remove debugging log --- p2p/pkg/signer/preconfencryptor/encryptor.go | 1 - 1 file changed, 1 deletion(-) diff --git a/p2p/pkg/signer/preconfencryptor/encryptor.go b/p2p/pkg/signer/preconfencryptor/encryptor.go index 6e9ea22f3..afc1fe5ac 100644 --- a/p2p/pkg/signer/preconfencryptor/encryptor.go +++ b/p2p/pkg/signer/preconfencryptor/encryptor.go @@ -376,7 +376,6 @@ func GetPreConfirmationHash(c *preconfpb.PreConfirmation) ([]byte, error) { data = append(data, bidDigestHash.Bytes()...) data = append(data, bidSigHash.Bytes()...) data = append(data, sharedSecretHash.Bytes()...) - fmt.Printf("Data to be hashed: %x\n", data) dataHash := crypto.Keccak256Hash(data) rawData := append([]byte("\x19\x01"), append(domainSeparatorBid.Bytes(), dataHash.Bytes()...)...) From ec8bb234e55911598c88eb8883fecad9eb28452f Mon Sep 17 00:00:00 2001 From: Kartik Chopra Date: Tue, 9 Jul 2024 13:45:49 -0400 Subject: [PATCH 33/41] chore: lowercase logs --- p2p/pkg/preconfirmation/tracker/tracker.go | 36 +++++++++++----------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/p2p/pkg/preconfirmation/tracker/tracker.go b/p2p/pkg/preconfirmation/tracker/tracker.go index efd7c0189..21882135d 100644 --- a/p2p/pkg/preconfirmation/tracker/tracker.go +++ b/p2p/pkg/preconfirmation/tracker/tracker.go @@ -268,18 +268,18 @@ func (t *Tracker) handleNewL1Block( // for bidder to open is only in cases of slashes as he will get refund. Only one // of bidder or provider should open the commitment as 1 of the txns would // fail. This delay is to ensure this. - t.logger.Info("Bidder detected, processing block 1 behind the current one") + t.logger.Info("bidder detected, processing block 1 behind the current one") t.winners[newL1Block.BlockNumber.Int64()] = newL1Block pastBlock, ok := t.winners[newL1Block.BlockNumber.Int64()-2] if !ok { - t.logger.Info("Past block not found, returning") + t.logger.Info("past block not found, returning") return nil } newL1Block = pastBlock - t.logger.Info("Processing past block", "blockNumber", pastBlock.BlockNumber) + t.logger.Info("processing past block", "blockNumber", pastBlock.BlockNumber) for k := range t.winners { if k < pastBlock.BlockNumber.Int64() { - t.logger.Info("Deleting old winner entry", "blockNumber", k) + t.logger.Info("deleting old winner entry", "blockNumber", k) delete(t.winners, k) } } @@ -287,23 +287,23 @@ func (t *Tracker) handleNewL1Block( commitments, err := t.store.GetCommitmentsByBlockNumber(newL1Block.BlockNumber.Int64()) if err != nil { - t.logger.Error("Failed to get commitments by block number", "blockNumber", newL1Block.BlockNumber, "error", err) + t.logger.Error("failed to get commitments by block number", "blockNumber", newL1Block.BlockNumber, "error", err) return err } - t.logger.Info("Commitments retrieved", "count", len(commitments)) + t.logger.Info("commitments retrieved", "count", len(commitments)) failedCommitments := make([]common.Hash, 0) settled := 0 for _, commitment := range commitments { if commitment.CommitmentIndex == nil { - t.logger.Info("Commitment index is nil, adding to failed commitments", "txnHash", commitment.TxnHash) + t.logger.Info("commitment index is nil, adding to failed commitments", "txnHash", commitment.TxnHash) failedCommitments = append(failedCommitments, commitment.TxnHash) continue } if common.BytesToAddress(commitment.ProviderAddress).Cmp(newL1Block.Winner) != 0 { t.logger.Debug( - "Provider address does not match the winner", + "provider address does not match the winner", "providerAddress", commitment.ProviderAddress, "winner", newL1Block.Winner, ) @@ -316,17 +316,17 @@ func (t *Tracker) handleNewL1Block( bidAmt, ok := new(big.Int).SetString(commitment.Bid.BidAmount, 10) if !ok { - t.logger.Error("Failed to parse bid amount", "bidAmount", commitment.Bid.BidAmount) + t.logger.Error("failed to parse bid amount", "bidAmount", commitment.Bid.BidAmount) continue } opts, err := t.optsGetter(ctx) if err != nil { - t.logger.Error("Failed to get transact opts", "error", err) + t.logger.Error("failed to get transact opts", "error", err) continue } - t.logger.Info("Opening commitment", "commitmentIdx", commitmentIdx, "bidAmount", bidAmt) + t.logger.Info("opening commitment", "commitmentIdx", commitmentIdx, "bidAmount", bidAmt) txHash, err := t.preconfContract.OpenCommitment( opts, @@ -342,11 +342,11 @@ func (t *Tracker) handleNewL1Block( commitment.PreConfirmation.SharedSecret, ) if err != nil { - t.logger.Error("Failed to open commitment", "error", err) + t.logger.Error("failed to open commitment", "error", err) continue } duration := time.Since(startTime) - t.logger.Info("Opened commitment", + t.logger.Info("opened commitment", "txHash", txHash, "duration", duration, "blockNumber", newL1Block.BlockNumber, "commiter", common.Bytes2Hex(commitment.ProviderAddress), @@ -356,12 +356,12 @@ func (t *Tracker) handleNewL1Block( err = t.store.DeleteCommitmentByBlockNumber(newL1Block.BlockNumber.Int64()) if err != nil { - t.logger.Error("Failed to delete commitments by block number", "blockNumber", newL1Block.BlockNumber, "error", err) + t.logger.Error("failed to delete commitments by block number", "blockNumber", newL1Block.BlockNumber, "error", err) return err } openDuration := time.Since(openStart) - t.logger.Info("Commitments opened", + t.logger.Info("commitments opened", "blockNumber", newL1Block.BlockNumber, "total", len(commitments), "settled", settled, @@ -374,14 +374,14 @@ func (t *Tracker) handleNewL1Block( t.metrics.blockCommitmentProcessDuration.Set(float64(openDuration)) if len(failedCommitments) > 0 { - t.logger.Info("Processing failed commitments", "count", len(failedCommitments)) + t.logger.Info("processing failed commitments", "count", len(failedCommitments)) receipts, err := t.receiptGetter.BatchReceipts(ctx, failedCommitments) if err != nil { - t.logger.Warn("Failed to get receipts for failed commitments", "error", err) + t.logger.Warn("failed to get receipts for failed commitments", "error", err) return nil } for i, receipt := range receipts { - t.logger.Debug("Receipt for failed commitment", + t.logger.Debug("receipt for failed commitment", "txHash", failedCommitments[i], "error", receipt.Err, ) From c7d033348fcc21fc6bb680b1864b478009a3fc24 Mon Sep 17 00:00:00 2001 From: Kartik Chopra Date: Tue, 9 Jul 2024 13:48:20 -0400 Subject: [PATCH 34/41] chore: adds a newline --- contracts/contracts/PreConfCommitmentStore.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contracts/contracts/PreConfCommitmentStore.sol b/contracts/contracts/PreConfCommitmentStore.sol index 8174eeb48..3b80d0d8e 100644 --- a/contracts/contracts/PreConfCommitmentStore.sol +++ b/contracts/contracts/PreConfCommitmentStore.sol @@ -743,4 +743,4 @@ contract PreConfCommitmentStore is OwnableUpgradeable, UUPSUpgradeable { } return string(_string); } -} \ No newline at end of file +} From bedd280a3dc1f78f9643ffd5f9a5f847e946b737 Mon Sep 17 00:00:00 2001 From: Kartik Chopra Date: Tue, 9 Jul 2024 14:10:46 -0400 Subject: [PATCH 35/41] feat: fixes bufgen --- p2p/gen/go/providerapi/v1/providerapi.pb.go | 511 ++++++-------------- 1 file changed, 145 insertions(+), 366 deletions(-) diff --git a/p2p/gen/go/providerapi/v1/providerapi.pb.go b/p2p/gen/go/providerapi/v1/providerapi.pb.go index 05c475fd2..4f7e08e53 100644 --- a/p2p/gen/go/providerapi/v1/providerapi.pb.go +++ b/p2p/gen/go/providerapi/v1/providerapi.pb.go @@ -395,69 +395,9 @@ var file_providerapi_v1_providerapi_proto_rawDesc = []byte{ 0x01, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x99, 0x01, 0x92, 0x41, 0x3b, 0x32, 0x30, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x45, 0x54, 0x48, 0x20, 0x74, 0x6f, 0x20, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x20, 0x69, 0x6e, -<<<<<<< HEAD 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x20, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 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, -======= - 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x20, 0x70, 0x72, - 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x5f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, - 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, 0x3a, 0x73, 0x92, 0x41, - 0x70, 0x0a, 0x4a, 0x2a, 0x0d, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x20, 0x72, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x32, 0x31, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x20, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, - 0x65, 0x72, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, - 0x65, 0x72, 0x20, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x5f, 0x72, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x72, 0x79, 0x2e, 0xd2, 0x01, 0x05, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x32, 0x22, 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, 0x20, - 0x7d, 0x22, 0xa5, 0x01, 0x0a, 0x0d, 0x53, 0x74, 0x61, 0x6b, 0x65, 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, 0x3a, 0x7c, 0x92, 0x41, 0x79, - 0x0a, 0x53, 0x2a, 0x0e, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x20, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x32, 0x41, 0x47, 0x65, 0x74, 0x20, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x64, 0x20, 0x61, - 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, - 0x65, 0x72, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, - 0x65, 0x72, 0x20, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x5f, 0x72, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x72, 0x79, 0x2e, 0x32, 0x22, 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, 0x20, 0x7d, 0x22, 0x0e, 0x0a, 0x0c, 0x45, 0x6d, 0x70, - 0x74, 0x79, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0xbe, 0x0e, 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, 0xfc, 0x01, 0x0a, 0x0a, 0x62, 0x69, 0x64, 0x5f, - 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0xdc, 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, 0x60, 0xba, 0x01, 0x5d, 0x0a, 0x0a, - 0x62, 0x69, 0x64, 0x5f, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x23, 0x62, 0x69, 0x64, 0x5f, ->>>>>>> 380b215 (feat: adds reverted txn protobuf) 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, @@ -514,7 +454,7 @@ var file_providerapi_v1_providerapi_proto_rawDesc = []byte{ 0x37, 0x30, 0x34, 0x38, 0x32, 0x65, 0x34, 0x38, 0x38, 0x64, 0x64, 0x31, 0x62, 0x62, 0x65, 0x35, 0x33, 0x33, 0x61, 0x39, 0x64, 0x34, 0x34, 0x39, 0x37, 0x62, 0x61, 0x38, 0x62, 0x37, 0x35, 0x36, 0x65, 0x31, 0x65, 0x38, 0x32, 0x62, 0x22, 0x7d, 0x22, 0x0e, 0x0a, 0x0c, 0x45, 0x6d, 0x70, 0x74, - 0x79, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0xb1, 0x0c, 0x0a, 0x03, 0x42, 0x69, 0x64, + 0x79, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0xbe, 0x0e, 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, @@ -586,317 +526,156 @@ var file_providerapi_v1_providerapi_proto_rawDesc = []byte{ 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, 0xb0, 0x03, 0x92, 0x41, 0xac, 0x03, - 0x0a, 0x70, 0x2a, 0x0b, 0x42, 0x69, 0x64, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x32, - 0x30, 0x53, 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, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, - 0x2e, 0xd2, 0x01, 0x08, 0x74, 0x78, 0x48, 0x61, 0x73, 0x68, 0x65, 0x73, 0xd2, 0x01, 0x09, 0x62, - 0x69, 0x64, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0xd2, 0x01, 0x0b, 0x62, 0x6c, 0x6f, 0x63, 0x6b, - 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0xd2, 0x01, 0x09, 0x62, 0x69, 0x64, 0x44, 0x69, 0x67, 0x65, - 0x73, 0x74, 0x32, 0xb7, 0x02, 0x7b, 0x22, 0x74, 0x78, 0x48, 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, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x22, 0x3a, 0x20, 0x31, 0x32, 0x33, 0x34, - 0x35, 0x36, 0x2c, 0x20, 0x22, 0x62, 0x69, 0x64, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x22, 0x3a, - 0x20, 0x22, 0x39, 0x64, 0x4a, 0x69, 0x6e, 0x77, 0x4c, 0x2b, 0x46, 0x5a, 0x36, 0x42, 0x31, 0x78, - 0x73, 0x49, 0x51, 0x51, 0x6f, 0x38, 0x74, 0x38, 0x42, 0x30, 0x5a, 0x58, 0x4a, 0x75, 0x62, 0x4a, - 0x77, 0x59, 0x38, 0x36, 0x6c, 0x2f, 0x59, 0x75, 0x37, 0x79, 0x41, 0x48, 0x31, 0x35, 0x39, 0x51, - 0x72, 0x50, 0x48, 0x55, 0x30, 0x71, 0x6a, 0x32, 0x50, 0x2b, 0x59, 0x46, 0x6a, 0x2b, 0x6c, 0x6c, - 0x62, 0x75, 0x49, 0x31, 0x5a, 0x79, 0x67, 0x64, 0x78, 0x47, 0x73, 0x58, 0x38, 0x2b, 0x50, 0x33, - 0x62, 0x79, 0x4d, 0x45, 0x41, 0x35, 0x69, 0x67, 0x3d, 0x3d, 0x22, 0x7d, 0x22, 0x81, 0x06, 0x0a, - 0x0b, 0x42, 0x69, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x53, 0x0a, 0x0a, - 0x62, 0x69, 0x64, 0x5f, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, - 0x42, 0x34, 0x92, 0x41, 0x31, 0x32, 0x2f, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x20, 0x6f, 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, -<<<<<<< HEAD - 0x69, 0x64, 0x64, 0x65, 0x72, 0x2e, 0x52, 0x09, 0x62, 0x69, 0x64, 0x44, 0x69, 0x67, 0x65, 0x73, - 0x74, 0x12, 0x5f, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0e, 0x32, 0x22, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x2e, - 0x76, 0x31, 0x2e, 0x42, 0x69, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x53, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x42, 0x23, 0x92, 0x41, 0x14, 0x32, 0x12, 0x53, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x62, 0x69, 0x64, 0x2e, 0xba, 0x48, - 0x09, 0x82, 0x01, 0x06, 0x10, 0x01, 0x1a, 0x02, 0x01, 0x02, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x12, 0xb4, 0x01, 0x0a, 0x12, 0x64, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x5f, - 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x42, - 0x84, 0x01, 0x92, 0x41, 0x80, 0x01, 0x32, 0x7e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, - 0x70, 0x20, 0x61, 0x74, 0x20, 0x77, 0x68, 0x69, 0x63, 0x68, 0x20, 0x74, 0x68, 0x65, 0x20, 0x63, - 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x69, 0x73, 0x20, 0x61, 0x63, 0x63, - 0x65, 0x70, 0x74, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, - 0x72, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x69, 0x73, 0x20, 0x75, 0x73, 0x65, 0x64, 0x20, 0x74, 0x6f, - 0x20, 0x63, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x65, 0x78, 0x70, - 0x65, 0x63, 0x74, 0x65, 0x64, 0x20, 0x72, 0x65, 0x76, 0x65, 0x6e, 0x75, 0x65, 0x20, 0x66, 0x72, - 0x6f, 0x6d, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x72, 0x65, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x72, - 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x11, 0x64, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, - 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x22, 0x4a, 0x0a, 0x06, 0x53, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x12, 0x16, 0x0a, 0x12, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x55, 0x4e, - 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x13, 0x0a, 0x0f, 0x53, - 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x41, 0x43, 0x43, 0x45, 0x50, 0x54, 0x45, 0x44, 0x10, 0x01, - 0x12, 0x13, 0x0a, 0x0f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x52, 0x45, 0x4a, 0x45, 0x43, - 0x54, 0x45, 0x44, 0x10, 0x02, 0x3a, 0xb8, 0x02, 0x92, 0x41, 0xb4, 0x02, 0x0a, 0x82, 0x01, 0x2a, - 0x0c, 0x42, 0x69, 0x64, 0x20, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0x44, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x20, 0x73, 0x65, 0x6e, 0x74, 0x20, 0x62, 0x79, 0x20, - 0x74, 0x68, 0x65, 0x20, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x20, 0x77, 0x69, 0x74, - 0x68, 0x20, 0x74, 0x68, 0x65, 0x20, 0x64, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x6f, - 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x62, 0x69, 0x64, 0x20, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, - 0x65, 0x64, 0x2e, 0xd2, 0x01, 0x09, 0x62, 0x69, 0x64, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0xd2, - 0x01, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0xd2, 0x01, 0x16, 0x64, 0x65, 0x63, 0x61, 0x79, - 0x44, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, - 0x70, 0x32, 0xac, 0x01, 0x7b, 0x22, 0x62, 0x69, 0x64, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x22, - 0x3a, 0x20, 0x22, 0x39, 0x64, 0x4a, 0x69, 0x6e, 0x77, 0x4c, 0x2b, 0x46, 0x5a, 0x36, 0x42, 0x31, - 0x78, 0x73, 0x49, 0x51, 0x51, 0x6f, 0x38, 0x74, 0x38, 0x42, 0x30, 0x5a, 0x58, 0x4a, 0x75, 0x62, - 0x4a, 0x77, 0x59, 0x38, 0x36, 0x6c, 0x2f, 0x59, 0x75, 0x37, 0x79, 0x41, 0x48, 0x31, 0x35, 0x39, - 0x51, 0x72, 0x50, 0x48, 0x55, 0x30, 0x71, 0x6a, 0x32, 0x50, 0x2b, 0x59, 0x46, 0x6a, 0x2b, 0x6c, - 0x6c, 0x62, 0x75, 0x49, 0x31, 0x5a, 0x79, 0x67, 0x64, 0x78, 0x47, 0x73, 0x58, 0x38, 0x2b, 0x50, - 0x33, 0x62, 0x79, 0x4d, 0x45, 0x41, 0x35, 0x69, 0x67, 0x3d, 0x3d, 0x22, 0x2c, 0x20, 0x22, 0x73, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x3a, 0x20, 0x22, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, - 0x41, 0x43, 0x43, 0x45, 0x50, 0x54, 0x45, 0x44, 0x22, 0x2c, 0x20, 0x22, 0x64, 0x65, 0x63, 0x61, - 0x79, 0x44, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, - 0x6d, 0x70, 0x22, 0x3a, 0x20, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x30, 0x7d, - 0x32, 0xc5, 0x04, 0x0a, 0x08, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x12, 0x65, 0x0a, - 0x0b, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x42, 0x69, 0x64, 0x73, 0x12, 0x1c, 0x2e, 0x70, - 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x6d, - 0x70, 0x74, 0x79, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x1a, 0x13, 0x2e, 0x70, 0x72, 0x6f, - 0x76, 0x69, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x69, 0x64, 0x22, - 0x21, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1b, 0x12, 0x19, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x72, 0x6f, - 0x76, 0x69, 0x64, 0x65, 0x72, 0x2f, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x5f, 0x62, 0x69, - 0x64, 0x73, 0x30, 0x01, 0x12, 0x7d, 0x0a, 0x11, 0x53, 0x65, 0x6e, 0x64, 0x50, 0x72, 0x6f, 0x63, - 0x65, 0x73, 0x73, 0x65, 0x64, 0x42, 0x69, 0x64, 0x73, 0x12, 0x1b, 0x2e, 0x70, 0x72, 0x6f, 0x76, - 0x69, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x69, 0x64, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x1c, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, - 0x72, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x4d, 0x65, 0x73, - 0x73, 0x61, 0x67, 0x65, 0x22, 0x2b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x25, 0x3a, 0x01, 0x2a, 0x22, - 0x20, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x2f, 0x73, 0x65, - 0x6e, 0x64, 0x5f, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x65, 0x64, 0x5f, 0x62, 0x69, 0x64, - 0x73, 0x28, 0x01, 0x12, 0x7a, 0x0a, 0x0d, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x53, - 0x74, 0x61, 0x6b, 0x65, 0x12, 0x1c, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x61, - 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, - 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x2c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x26, 0x22, 0x24, 0x2f, 0x76, 0x31, 0x2f, 0x70, - 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x2f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, - 0x5f, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x2f, 0x7b, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x7d, 0x12, - 0x67, 0x0a, 0x08, 0x47, 0x65, 0x74, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x12, 0x1c, 0x2e, 0x70, 0x72, - 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x6d, 0x70, - 0x74, 0x79, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x1a, 0x1d, 0x2e, 0x70, 0x72, 0x6f, 0x76, - 0x69, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x6b, 0x65, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x18, - 0x12, 0x16, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x2f, 0x67, - 0x65, 0x74, 0x5f, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x12, 0x6e, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x4d, - 0x69, 0x6e, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x12, 0x1c, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, - 0x65, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x4d, 0x65, - 0x73, 0x73, 0x61, 0x67, 0x65, 0x1a, 0x1d, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, - 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x22, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1c, 0x12, 0x1a, 0x2f, 0x76, - 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x2f, 0x67, 0x65, 0x74, 0x5f, 0x6d, - 0x69, 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x42, 0xbc, 0x02, 0x92, 0x41, 0x74, 0x12, 0x72, - 0x0a, 0x0c, 0x50, 0x72, 0x6f, 0x76, 0x69, 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, 0x12, 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, - 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x42, 0x10, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, - 0x61, 0x70, 0x69, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x44, 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, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x2f, - 0x76, 0x31, 0x3b, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x76, 0x31, - 0xa2, 0x02, 0x03, 0x50, 0x58, 0x58, 0xaa, 0x02, 0x0e, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, - 0x72, 0x61, 0x70, 0x69, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0e, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, - 0x65, 0x72, 0x61, 0x70, 0x69, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1a, 0x50, 0x72, 0x6f, 0x76, 0x69, - 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, - 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0f, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, - 0x61, 0x70, 0x69, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -======= - 0x69, 0x64, 0x64, 0x65, 0x72, 0x2e, 0xba, 0x48, 0x06, 0x7a, 0x04, 0x10, 0x01, 0x18, 0x40, 0x52, - 0x09, 0x62, 0x69, 0x64, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 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, 0x05, 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, 0x06, 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, 0x12, 0x8a, 0x02, 0x0a, 0x13, 0x72, - 0x65, 0x76, 0x65, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x74, 0x78, 0x5f, 0x68, 0x61, 0x73, 0x68, - 0x65, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x09, 0x42, 0xd9, 0x01, 0x92, 0x41, 0x49, 0x32, 0x47, - 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x61, 0x72, 0x72, 0x61, 0x79, 0x20, 0x6f, - 0x66, 0x20, 0x74, 0x78, 0x20, 0x68, 0x61, 0x73, 0x68, 0x65, 0x73, 0x20, 0x74, 0x68, 0x61, 0x74, - 0x20, 0x61, 0x72, 0x65, 0x20, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x20, 0x74, 0x6f, 0x20, - 0x72, 0x65, 0x76, 0x65, 0x72, 0x74, 0x20, 0x6f, 0x72, 0x20, 0x62, 0x65, 0x20, 0x64, 0x69, 0x73, - 0x63, 0x61, 0x72, 0x64, 0x65, 0x64, 0x2e, 0xba, 0x48, 0x89, 0x01, 0xba, 0x01, 0x85, 0x01, 0x0a, - 0x13, 0x72, 0x65, 0x76, 0x65, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x74, 0x78, 0x5f, 0x68, 0x61, - 0x73, 0x68, 0x65, 0x73, 0x12, 0x41, 0x72, 0x65, 0x76, 0x65, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x5f, - 0x74, 0x78, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x65, 0x73, 0x20, 0x6d, 0x75, 0x73, 0x74, 0x20, 0x62, - 0x65, 0x20, 0x61, 0x6e, 0x20, 0x61, 0x72, 0x72, 0x61, 0x79, 0x20, 0x6f, 0x66, 0x20, 0x76, 0x61, - 0x6c, 0x69, 0x64, 0x20, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, - 0x68, 0x61, 0x73, 0x68, 0x65, 0x73, 0x2e, 0x1a, 0x2b, 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, 0x52, 0x11, 0x72, 0x65, 0x76, 0x65, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x54, - 0x78, 0x48, 0x61, 0x73, 0x68, 0x65, 0x73, 0x3a, 0xb0, 0x03, 0x92, 0x41, 0xac, 0x03, 0x0a, 0x70, - 0x2a, 0x0b, 0x42, 0x69, 0x64, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x32, 0x30, 0x53, - 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, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x2e, 0xd2, - 0x01, 0x08, 0x74, 0x78, 0x48, 0x61, 0x73, 0x68, 0x65, 0x73, 0xd2, 0x01, 0x09, 0x62, 0x69, 0x64, - 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0xd2, 0x01, 0x0b, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x75, - 0x6d, 0x62, 0x65, 0x72, 0xd2, 0x01, 0x09, 0x62, 0x69, 0x64, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, - 0x32, 0xb7, 0x02, 0x7b, 0x22, 0x74, 0x78, 0x48, 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, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x22, 0x3a, 0x20, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, - 0x2c, 0x20, 0x22, 0x62, 0x69, 0x64, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x22, 0x3a, 0x20, 0x22, + 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x8a, 0x02, 0x0a, 0x13, 0x72, 0x65, + 0x76, 0x65, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x74, 0x78, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x65, + 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x09, 0x42, 0xd9, 0x01, 0x92, 0x41, 0x49, 0x32, 0x47, 0x4f, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x61, 0x72, 0x72, 0x61, 0x79, 0x20, 0x6f, 0x66, + 0x20, 0x74, 0x78, 0x20, 0x68, 0x61, 0x73, 0x68, 0x65, 0x73, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, + 0x61, 0x72, 0x65, 0x20, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x20, 0x74, 0x6f, 0x20, 0x72, + 0x65, 0x76, 0x65, 0x72, 0x74, 0x20, 0x6f, 0x72, 0x20, 0x62, 0x65, 0x20, 0x64, 0x69, 0x73, 0x63, + 0x61, 0x72, 0x64, 0x65, 0x64, 0x2e, 0xba, 0x48, 0x89, 0x01, 0xba, 0x01, 0x85, 0x01, 0x0a, 0x13, + 0x72, 0x65, 0x76, 0x65, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x74, 0x78, 0x5f, 0x68, 0x61, 0x73, + 0x68, 0x65, 0x73, 0x12, 0x41, 0x72, 0x65, 0x76, 0x65, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x74, + 0x78, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x65, 0x73, 0x20, 0x6d, 0x75, 0x73, 0x74, 0x20, 0x62, 0x65, + 0x20, 0x61, 0x6e, 0x20, 0x61, 0x72, 0x72, 0x61, 0x79, 0x20, 0x6f, 0x66, 0x20, 0x76, 0x61, 0x6c, + 0x69, 0x64, 0x20, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x68, + 0x61, 0x73, 0x68, 0x65, 0x73, 0x2e, 0x1a, 0x2b, 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, 0x52, 0x11, 0x72, 0x65, 0x76, 0x65, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x54, 0x78, + 0x48, 0x61, 0x73, 0x68, 0x65, 0x73, 0x3a, 0xb0, 0x03, 0x92, 0x41, 0xac, 0x03, 0x0a, 0x70, 0x2a, + 0x0b, 0x42, 0x69, 0x64, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x32, 0x30, 0x53, 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, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x2e, 0xd2, 0x01, + 0x08, 0x74, 0x78, 0x48, 0x61, 0x73, 0x68, 0x65, 0x73, 0xd2, 0x01, 0x09, 0x62, 0x69, 0x64, 0x41, + 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0xd2, 0x01, 0x0b, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x75, 0x6d, + 0x62, 0x65, 0x72, 0xd2, 0x01, 0x09, 0x62, 0x69, 0x64, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x32, + 0xb7, 0x02, 0x7b, 0x22, 0x74, 0x78, 0x48, 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, + 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x22, 0x3a, 0x20, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x2c, + 0x20, 0x22, 0x62, 0x69, 0x64, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x22, 0x3a, 0x20, 0x22, 0x39, + 0x64, 0x4a, 0x69, 0x6e, 0x77, 0x4c, 0x2b, 0x46, 0x5a, 0x36, 0x42, 0x31, 0x78, 0x73, 0x49, 0x51, + 0x51, 0x6f, 0x38, 0x74, 0x38, 0x42, 0x30, 0x5a, 0x58, 0x4a, 0x75, 0x62, 0x4a, 0x77, 0x59, 0x38, + 0x36, 0x6c, 0x2f, 0x59, 0x75, 0x37, 0x79, 0x41, 0x48, 0x31, 0x35, 0x39, 0x51, 0x72, 0x50, 0x48, + 0x55, 0x30, 0x71, 0x6a, 0x32, 0x50, 0x2b, 0x59, 0x46, 0x6a, 0x2b, 0x6c, 0x6c, 0x62, 0x75, 0x49, + 0x31, 0x5a, 0x79, 0x67, 0x64, 0x78, 0x47, 0x73, 0x58, 0x38, 0x2b, 0x50, 0x33, 0x62, 0x79, 0x4d, + 0x45, 0x41, 0x35, 0x69, 0x67, 0x3d, 0x3d, 0x22, 0x7d, 0x22, 0x81, 0x06, 0x0a, 0x0b, 0x42, 0x69, + 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x53, 0x0a, 0x0a, 0x62, 0x69, 0x64, + 0x5f, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x34, 0x92, + 0x41, 0x31, 0x32, 0x2f, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x20, 0x6f, 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, 0x09, 0x62, 0x69, 0x64, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x12, 0x5f, + 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x22, + 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, + 0x42, 0x69, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x53, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x42, 0x23, 0x92, 0x41, 0x14, 0x32, 0x12, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x20, + 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x62, 0x69, 0x64, 0x2e, 0xba, 0x48, 0x09, 0x82, 0x01, + 0x06, 0x10, 0x01, 0x1a, 0x02, 0x01, 0x02, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, + 0xb4, 0x01, 0x0a, 0x12, 0x64, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x74, 0x69, 0x6d, + 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x42, 0x84, 0x01, 0x92, + 0x41, 0x80, 0x01, 0x32, 0x7e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x20, 0x61, + 0x74, 0x20, 0x77, 0x68, 0x69, 0x63, 0x68, 0x20, 0x74, 0x68, 0x65, 0x20, 0x63, 0x6f, 0x6d, 0x6d, + 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x69, 0x73, 0x20, 0x61, 0x63, 0x63, 0x65, 0x70, 0x74, + 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x20, 0x61, + 0x6e, 0x64, 0x20, 0x69, 0x73, 0x20, 0x75, 0x73, 0x65, 0x64, 0x20, 0x74, 0x6f, 0x20, 0x63, 0x6f, + 0x6d, 0x70, 0x75, 0x74, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x65, 0x78, 0x70, 0x65, 0x63, 0x74, + 0x65, 0x64, 0x20, 0x72, 0x65, 0x76, 0x65, 0x6e, 0x75, 0x65, 0x20, 0x66, 0x72, 0x6f, 0x6d, 0x20, + 0x74, 0x68, 0x65, 0x20, 0x70, 0x72, 0x65, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x52, 0x11, 0x64, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x54, 0x69, 0x6d, + 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x22, 0x4a, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x12, 0x16, 0x0a, 0x12, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, + 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x13, 0x0a, 0x0f, 0x53, 0x54, 0x41, 0x54, + 0x55, 0x53, 0x5f, 0x41, 0x43, 0x43, 0x45, 0x50, 0x54, 0x45, 0x44, 0x10, 0x01, 0x12, 0x13, 0x0a, + 0x0f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x52, 0x45, 0x4a, 0x45, 0x43, 0x54, 0x45, 0x44, + 0x10, 0x02, 0x3a, 0xb8, 0x02, 0x92, 0x41, 0xb4, 0x02, 0x0a, 0x82, 0x01, 0x2a, 0x0c, 0x42, 0x69, + 0x64, 0x20, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0x44, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x20, 0x73, 0x65, 0x6e, 0x74, 0x20, 0x62, 0x79, 0x20, 0x74, 0x68, 0x65, + 0x20, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x74, + 0x68, 0x65, 0x20, 0x64, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x6e, 0x20, 0x74, + 0x68, 0x65, 0x20, 0x62, 0x69, 0x64, 0x20, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x2e, + 0xd2, 0x01, 0x09, 0x62, 0x69, 0x64, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0xd2, 0x01, 0x06, 0x73, + 0x74, 0x61, 0x74, 0x75, 0x73, 0xd2, 0x01, 0x16, 0x64, 0x65, 0x63, 0x61, 0x79, 0x44, 0x69, 0x73, + 0x70, 0x61, 0x74, 0x63, 0x68, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x32, 0xac, + 0x01, 0x7b, 0x22, 0x62, 0x69, 0x64, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x22, 0x3a, 0x20, 0x22, 0x39, 0x64, 0x4a, 0x69, 0x6e, 0x77, 0x4c, 0x2b, 0x46, 0x5a, 0x36, 0x42, 0x31, 0x78, 0x73, 0x49, 0x51, 0x51, 0x6f, 0x38, 0x74, 0x38, 0x42, 0x30, 0x5a, 0x58, 0x4a, 0x75, 0x62, 0x4a, 0x77, 0x59, 0x38, 0x36, 0x6c, 0x2f, 0x59, 0x75, 0x37, 0x79, 0x41, 0x48, 0x31, 0x35, 0x39, 0x51, 0x72, 0x50, 0x48, 0x55, 0x30, 0x71, 0x6a, 0x32, 0x50, 0x2b, 0x59, 0x46, 0x6a, 0x2b, 0x6c, 0x6c, 0x62, 0x75, 0x49, 0x31, 0x5a, 0x79, 0x67, 0x64, 0x78, 0x47, 0x73, 0x58, 0x38, 0x2b, 0x50, 0x33, 0x62, 0x79, - 0x4d, 0x45, 0x41, 0x35, 0x69, 0x67, 0x3d, 0x3d, 0x22, 0x7d, 0x22, 0x81, 0x06, 0x0a, 0x0b, 0x42, - 0x69, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x53, 0x0a, 0x0a, 0x62, 0x69, - 0x64, 0x5f, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x34, - 0x92, 0x41, 0x31, 0x32, 0x2f, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x20, 0x6f, 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, 0x09, 0x62, 0x69, 0x64, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x12, - 0x5f, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, - 0x22, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, - 0x2e, 0x42, 0x69, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x53, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x42, 0x23, 0x92, 0x41, 0x14, 0x32, 0x12, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x62, 0x69, 0x64, 0x2e, 0xba, 0x48, 0x09, 0x82, - 0x01, 0x06, 0x10, 0x01, 0x1a, 0x02, 0x01, 0x02, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x12, 0xb4, 0x01, 0x0a, 0x12, 0x64, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x74, 0x69, - 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x42, 0x84, 0x01, - 0x92, 0x41, 0x80, 0x01, 0x32, 0x7e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x20, - 0x61, 0x74, 0x20, 0x77, 0x68, 0x69, 0x63, 0x68, 0x20, 0x74, 0x68, 0x65, 0x20, 0x63, 0x6f, 0x6d, - 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x69, 0x73, 0x20, 0x61, 0x63, 0x63, 0x65, 0x70, - 0x74, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x20, - 0x61, 0x6e, 0x64, 0x20, 0x69, 0x73, 0x20, 0x75, 0x73, 0x65, 0x64, 0x20, 0x74, 0x6f, 0x20, 0x63, - 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x65, 0x78, 0x70, 0x65, 0x63, - 0x74, 0x65, 0x64, 0x20, 0x72, 0x65, 0x76, 0x65, 0x6e, 0x75, 0x65, 0x20, 0x66, 0x72, 0x6f, 0x6d, - 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x72, 0x65, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x11, 0x64, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x54, 0x69, - 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x22, 0x4a, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x12, 0x16, 0x0a, 0x12, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x55, 0x4e, 0x53, 0x50, - 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x13, 0x0a, 0x0f, 0x53, 0x54, 0x41, - 0x54, 0x55, 0x53, 0x5f, 0x41, 0x43, 0x43, 0x45, 0x50, 0x54, 0x45, 0x44, 0x10, 0x01, 0x12, 0x13, - 0x0a, 0x0f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x52, 0x45, 0x4a, 0x45, 0x43, 0x54, 0x45, - 0x44, 0x10, 0x02, 0x3a, 0xb8, 0x02, 0x92, 0x41, 0xb4, 0x02, 0x0a, 0x82, 0x01, 0x2a, 0x0c, 0x42, - 0x69, 0x64, 0x20, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0x44, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x20, 0x73, 0x65, 0x6e, 0x74, 0x20, 0x62, 0x79, 0x20, 0x74, 0x68, - 0x65, 0x20, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, - 0x74, 0x68, 0x65, 0x20, 0x64, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x6e, 0x20, - 0x74, 0x68, 0x65, 0x20, 0x62, 0x69, 0x64, 0x20, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, - 0x2e, 0xd2, 0x01, 0x09, 0x62, 0x69, 0x64, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0xd2, 0x01, 0x06, - 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0xd2, 0x01, 0x16, 0x64, 0x65, 0x63, 0x61, 0x79, 0x44, 0x69, - 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x32, - 0xac, 0x01, 0x7b, 0x22, 0x62, 0x69, 0x64, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x22, 0x3a, 0x20, - 0x22, 0x39, 0x64, 0x4a, 0x69, 0x6e, 0x77, 0x4c, 0x2b, 0x46, 0x5a, 0x36, 0x42, 0x31, 0x78, 0x73, - 0x49, 0x51, 0x51, 0x6f, 0x38, 0x74, 0x38, 0x42, 0x30, 0x5a, 0x58, 0x4a, 0x75, 0x62, 0x4a, 0x77, - 0x59, 0x38, 0x36, 0x6c, 0x2f, 0x59, 0x75, 0x37, 0x79, 0x41, 0x48, 0x31, 0x35, 0x39, 0x51, 0x72, - 0x50, 0x48, 0x55, 0x30, 0x71, 0x6a, 0x32, 0x50, 0x2b, 0x59, 0x46, 0x6a, 0x2b, 0x6c, 0x6c, 0x62, - 0x75, 0x49, 0x31, 0x5a, 0x79, 0x67, 0x64, 0x78, 0x47, 0x73, 0x58, 0x38, 0x2b, 0x50, 0x33, 0x62, - 0x79, 0x4d, 0x45, 0x41, 0x35, 0x69, 0x67, 0x3d, 0x3d, 0x22, 0x2c, 0x20, 0x22, 0x73, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x22, 0x3a, 0x20, 0x22, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x41, 0x43, - 0x43, 0x45, 0x50, 0x54, 0x45, 0x44, 0x22, 0x2c, 0x20, 0x22, 0x64, 0x65, 0x63, 0x61, 0x79, 0x44, - 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, - 0x22, 0x3a, 0x20, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x30, 0x7d, 0x32, 0xc5, - 0x04, 0x0a, 0x08, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x12, 0x65, 0x0a, 0x0b, 0x52, - 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x42, 0x69, 0x64, 0x73, 0x12, 0x1c, 0x2e, 0x70, 0x72, 0x6f, - 0x76, 0x69, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x6d, 0x70, 0x74, - 0x79, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x1a, 0x13, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, - 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x69, 0x64, 0x22, 0x21, 0x82, - 0xd3, 0xe4, 0x93, 0x02, 0x1b, 0x12, 0x19, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x76, 0x69, - 0x64, 0x65, 0x72, 0x2f, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x5f, 0x62, 0x69, 0x64, 0x73, - 0x30, 0x01, 0x12, 0x7d, 0x0a, 0x11, 0x53, 0x65, 0x6e, 0x64, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, - 0x73, 0x65, 0x64, 0x42, 0x69, 0x64, 0x73, 0x12, 0x1b, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, - 0x65, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x69, 0x64, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x1c, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x61, - 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x4d, 0x65, 0x73, 0x73, 0x61, - 0x67, 0x65, 0x22, 0x2b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x25, 0x3a, 0x01, 0x2a, 0x22, 0x20, 0x2f, - 0x76, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x2f, 0x73, 0x65, 0x6e, 0x64, - 0x5f, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x65, 0x64, 0x5f, 0x62, 0x69, 0x64, 0x73, 0x28, - 0x01, 0x12, 0x7a, 0x0a, 0x0d, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x53, 0x74, 0x61, - 0x6b, 0x65, 0x12, 0x1c, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, - 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x1d, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x76, - 0x31, 0x2e, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x2c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x26, 0x22, 0x24, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x72, 0x6f, - 0x76, 0x69, 0x64, 0x65, 0x72, 0x2f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x73, - 0x74, 0x61, 0x6b, 0x65, 0x2f, 0x7b, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x7d, 0x12, 0x67, 0x0a, - 0x08, 0x47, 0x65, 0x74, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x12, 0x1c, 0x2e, 0x70, 0x72, 0x6f, 0x76, + 0x4d, 0x45, 0x41, 0x35, 0x69, 0x67, 0x3d, 0x3d, 0x22, 0x2c, 0x20, 0x22, 0x73, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x22, 0x3a, 0x20, 0x22, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x41, 0x43, 0x43, + 0x45, 0x50, 0x54, 0x45, 0x44, 0x22, 0x2c, 0x20, 0x22, 0x64, 0x65, 0x63, 0x61, 0x79, 0x44, 0x69, + 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x22, + 0x3a, 0x20, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x30, 0x7d, 0x32, 0xc5, 0x04, + 0x0a, 0x08, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x12, 0x65, 0x0a, 0x0b, 0x52, 0x65, + 0x63, 0x65, 0x69, 0x76, 0x65, 0x42, 0x69, 0x64, 0x73, 0x12, 0x1c, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, - 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x1a, 0x1d, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, - 0x65, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x18, 0x12, 0x16, - 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x2f, 0x67, 0x65, 0x74, - 0x5f, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x12, 0x6e, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x4d, 0x69, 0x6e, - 0x53, 0x74, 0x61, 0x6b, 0x65, 0x12, 0x1c, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, - 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x4d, 0x65, 0x73, 0x73, - 0x61, 0x67, 0x65, 0x1a, 0x1d, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x61, 0x70, - 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x22, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1c, 0x12, 0x1a, 0x2f, 0x76, 0x31, 0x2f, - 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x2f, 0x67, 0x65, 0x74, 0x5f, 0x6d, 0x69, 0x6e, - 0x5f, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x42, 0xbc, 0x02, 0x92, 0x41, 0x74, 0x12, 0x72, 0x0a, 0x0c, - 0x50, 0x72, 0x6f, 0x76, 0x69, 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, 0x12, 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x61, 0x70, - 0x69, 0x2e, 0x76, 0x31, 0x42, 0x10, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x61, 0x70, - 0x69, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x44, 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, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, - 0x3b, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x76, 0x31, 0xa2, 0x02, - 0x03, 0x50, 0x58, 0x58, 0xaa, 0x02, 0x0e, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x61, - 0x70, 0x69, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0e, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, - 0x61, 0x70, 0x69, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1a, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, - 0x72, 0x61, 0x70, 0x69, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, - 0x61, 0x74, 0x61, 0xea, 0x02, 0x0f, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x61, 0x70, - 0x69, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, ->>>>>>> 380b215 (feat: adds reverted txn protobuf) + 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x1a, 0x13, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, + 0x65, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x69, 0x64, 0x22, 0x21, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x1b, 0x12, 0x19, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, + 0x65, 0x72, 0x2f, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x5f, 0x62, 0x69, 0x64, 0x73, 0x30, + 0x01, 0x12, 0x7d, 0x0a, 0x11, 0x53, 0x65, 0x6e, 0x64, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, + 0x65, 0x64, 0x42, 0x69, 0x64, 0x73, 0x12, 0x1b, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, + 0x72, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x69, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x1a, 0x1c, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x61, 0x70, + 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x22, 0x2b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x25, 0x3a, 0x01, 0x2a, 0x22, 0x20, 0x2f, 0x76, + 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x2f, 0x73, 0x65, 0x6e, 0x64, 0x5f, + 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x65, 0x64, 0x5f, 0x62, 0x69, 0x64, 0x73, 0x28, 0x01, + 0x12, 0x7a, 0x0a, 0x0d, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x53, 0x74, 0x61, 0x6b, + 0x65, 0x12, 0x1c, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x2e, + 0x76, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x1d, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, + 0x2e, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2c, + 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x26, 0x22, 0x24, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x76, + 0x69, 0x64, 0x65, 0x72, 0x2f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x73, 0x74, + 0x61, 0x6b, 0x65, 0x2f, 0x7b, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x7d, 0x12, 0x67, 0x0a, 0x08, + 0x47, 0x65, 0x74, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x12, 0x1c, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, + 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x4d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x1a, 0x1d, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, + 0x72, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x18, 0x12, 0x16, 0x2f, + 0x76, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x2f, 0x67, 0x65, 0x74, 0x5f, + 0x73, 0x74, 0x61, 0x6b, 0x65, 0x12, 0x6e, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x4d, 0x69, 0x6e, 0x53, + 0x74, 0x61, 0x6b, 0x65, 0x12, 0x1c, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x4d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x1a, 0x1d, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, + 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x22, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1c, 0x12, 0x1a, 0x2f, 0x76, 0x31, 0x2f, 0x70, + 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x2f, 0x67, 0x65, 0x74, 0x5f, 0x6d, 0x69, 0x6e, 0x5f, + 0x73, 0x74, 0x61, 0x6b, 0x65, 0x42, 0xbc, 0x02, 0x92, 0x41, 0x74, 0x12, 0x72, 0x0a, 0x0c, 0x50, + 0x72, 0x6f, 0x76, 0x69, 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, + 0x12, 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, + 0x2e, 0x76, 0x31, 0x42, 0x10, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, + 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x44, 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, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x3b, + 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, 0x76, 0x31, 0xa2, 0x02, 0x03, + 0x50, 0x58, 0x58, 0xaa, 0x02, 0x0e, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x61, 0x70, + 0x69, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0e, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x61, + 0x70, 0x69, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1a, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, + 0x61, 0x70, 0x69, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0xea, 0x02, 0x0f, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x61, 0x70, 0x69, + 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( From d4193dc3ca7098536af25944bf8976537986420c Mon Sep 17 00:00:00 2001 From: Kartik Chopra Date: Tue, 9 Jul 2024 14:12:16 -0400 Subject: [PATCH 36/41] chore: remove console sol --- contracts/contracts/PreConfCommitmentStore.sol | 1 - 1 file changed, 1 deletion(-) diff --git a/contracts/contracts/PreConfCommitmentStore.sol b/contracts/contracts/PreConfCommitmentStore.sol index 3b80d0d8e..3442f1260 100644 --- a/contracts/contracts/PreConfCommitmentStore.sol +++ b/contracts/contracts/PreConfCommitmentStore.sol @@ -9,7 +9,6 @@ import {IProviderRegistry} from "./interfaces/IProviderRegistry.sol"; import {IBidderRegistry} from "./interfaces/IBidderRegistry.sol"; import {IBlockTracker} from "./interfaces/IBlockTracker.sol"; import {WindowFromBlockNumber} from "./utils/WindowFromBlockNumber.sol"; -import "forge-std/console.sol"; /** * @title PreConfCommitmentStore - A contract for managing preconfirmation commitments and bids. From acc413fa719ee58e8c15b3192479aa4b52eb5a55 Mon Sep 17 00:00:00 2001 From: Kartik Chopra Date: Tue, 9 Jul 2024 16:09:33 -0400 Subject: [PATCH 37/41] feat: reattempt individual txns --- x/contracts/txmonitor/eth_helper.go | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/x/contracts/txmonitor/eth_helper.go b/x/contracts/txmonitor/eth_helper.go index 4826c08b8..a44ed9a12 100644 --- a/x/contracts/txmonitor/eth_helper.go +++ b/x/contracts/txmonitor/eth_helper.go @@ -118,7 +118,7 @@ func (e *evmHelper) BatchReceipts(ctx context.Context, txHashes []common.Hash) ( var receipts []Result var err error for attempts := 0; attempts < 50; attempts++ { - e.logger.Debug("Attempting batch call", "attempt", attempts+1) + e.logger.Info("Attempting batch call", "attempt", attempts+1) // Execute the batch request err = e.client.BatchCallContext(context.Background(), batch) if err != nil { @@ -134,6 +134,7 @@ func (e *evmHelper) BatchReceipts(ctx context.Context, txHashes []common.Hash) ( e.logger.Error("All batch call attempts failed", "error", err) return nil, err } + receipts = make([]Result, len(batch)) for i, elem := range batch { e.logger.Debug("Processing batch element", "index", i, "result", elem.Result, "error", elem.Error) @@ -143,6 +144,24 @@ func (e *evmHelper) BatchReceipts(ctx context.Context, txHashes []common.Hash) ( } } + // Retry individual failed transactions + for i, receipt := range receipts { + if receipt.Err != nil { + e.logger.Info("Retrying failed transaction", "index", i, "hash", txHashes[i].Hex()) + for attempts := 0; attempts < 50; attempts++ { + e.logger.Info("Attempting individual call", "attempt", attempts+1, "hash", txHashes[i].Hex()) + err = e.client.CallContext(context.Background(), receipt.Receipt, "eth_getTransactionReceipt", txHashes[i]) + if err == nil { + e.logger.Info("Individual call succeeded", "attempt", attempts+1, "hash", txHashes[i].Hex()) + receipts[i].Err = nil + break + } + e.logger.Error("Individual call attempt failed", "attempt", attempts+1, "hash", txHashes[i].Hex(), "error", err) + time.Sleep(1 * time.Second) + } + } + } + e.logger.Info("BatchReceipts completed successfully", "receipts", receipts) return receipts, nil } From 77c0db74f1cea42768cc291052a75427af4be4cd Mon Sep 17 00:00:00 2001 From: Kartik Chopra Date: Tue, 9 Jul 2024 19:36:22 -0400 Subject: [PATCH 38/41] feat: adds a test for revertable txns --- oracle/pkg/updater/updater_test.go | 271 ++++++++++++++++++++++++++++- 1 file changed, 270 insertions(+), 1 deletion(-) diff --git a/oracle/pkg/updater/updater_test.go b/oracle/pkg/updater/updater_test.go index a332710e4..fcc030d9f 100644 --- a/oracle/pkg/updater/updater_test.go +++ b/oracle/pkg/updater/updater_test.go @@ -345,7 +345,6 @@ func TestUpdater(t *testing.T) { t.Fatal("timeout") } } - func TestUpdaterRevertedTxns(t *testing.T) { t.Parallel() @@ -617,6 +616,276 @@ func TestUpdaterRevertedTxns(t *testing.T) { } } +func TestUpdaterRevertedTxnsWithRevertingHashes(t *testing.T) { + t.Parallel() + + // timestamp of the First block commitment is X + startTimestamp := time.UnixMilli(1615195200000) + midTimestamp := startTimestamp.Add(time.Duration(2.5 * float64(time.Second))) + endTimestamp := startTimestamp.Add(5 * time.Second) + + key, err := crypto.GenerateKey() + if err != nil { + t.Fatal(err) + } + + builderAddr := common.HexToAddress("0xabcd") + otherBuilderAddr := common.HexToAddress("0xabdc") + + signer := types.NewLondonSigner(big.NewInt(5)) + var txns []*types.Transaction + for i := range 10 { + txns = append(txns, types.MustSignNewTx(key, signer, &types.DynamicFeeTx{ + Nonce: uint64(i + 1), + Gas: 1000000, + Value: big.NewInt(1), + GasTipCap: big.NewInt(500), + GasFeeCap: big.NewInt(500), + })) + } + + encCommitments := make([]preconf.PreconfcommitmentstoreEncryptedCommitmentStored, 0) + commitments := make([]preconf.PreconfcommitmentstoreCommitmentStored, 0) + + for i, txn := range txns { + idxBytes := getIdxBytes(int64(i)) + + encCommitment := preconf.PreconfcommitmentstoreEncryptedCommitmentStored{ + CommitmentIndex: idxBytes, + CommitmentDigest: common.HexToHash(fmt.Sprintf("0x%02d", i)), + CommitmentSignature: []byte("signature"), + DispatchTimestamp: uint64(midTimestamp.UnixMilli()), + } + commitment := preconf.PreconfcommitmentstoreCommitmentStored{ + CommitmentIndex: idxBytes, + TxnHash: strings.TrimPrefix(txn.Hash().Hex(), "0x"), + Bid: big.NewInt(10), + BlockNumber: 5, + CommitmentHash: common.HexToHash(fmt.Sprintf("0x%02d", i)), + CommitmentSignature: []byte("signature"), + DecayStartTimeStamp: uint64(startTimestamp.UnixMilli()), + DecayEndTimeStamp: uint64(endTimestamp.UnixMilli()), + DispatchTimestamp: uint64(midTimestamp.UnixMilli()), + RevertingTxHashes: strings.TrimPrefix(txn.Hash().Hex(), "0x"), + SharedSecretKey: []byte("shared_secret_key"), + } + + if i%2 == 0 { + encCommitment.Commiter = builderAddr + commitment.Commiter = builderAddr + encCommitments = append(encCommitments, encCommitment) + commitments = append(commitments, commitment) + } else { + encCommitment.Commiter = otherBuilderAddr + commitment.Commiter = otherBuilderAddr + encCommitments = append(encCommitments, encCommitment) + commitments = append(commitments, commitment) + } + } + + // constructing bundles + for i := range 10 { + idxBytes := getIdxBytes(int64(i + 10)) + + bundle := strings.TrimPrefix(txns[i].Hash().Hex(), "0x") + for j := i + 1; j < 10; j++ { + bundle += "," + strings.TrimPrefix(txns[j].Hash().Hex(), "0x") + } + + encCommitment := preconf.PreconfcommitmentstoreEncryptedCommitmentStored{ + CommitmentIndex: idxBytes, + Commiter: builderAddr, + CommitmentDigest: common.HexToHash(fmt.Sprintf("0x%02d", i)), + CommitmentSignature: []byte("signature"), + DispatchTimestamp: uint64(midTimestamp.UnixMilli()), + } + commitment := preconf.PreconfcommitmentstoreCommitmentStored{ + CommitmentIndex: idxBytes, + Commiter: builderAddr, + Bid: big.NewInt(10), + TxnHash: bundle, + BlockNumber: 5, + CommitmentHash: common.HexToHash(fmt.Sprintf("0x%02d", i)), + CommitmentSignature: []byte("signature"), + DecayStartTimeStamp: uint64(startTimestamp.UnixMilli()), + DecayEndTimeStamp: uint64(endTimestamp.UnixMilli()), + DispatchTimestamp: uint64(midTimestamp.UnixMilli()), + RevertingTxHashes: bundle, + SharedSecretKey: []byte("shared_secret_key"), + } + encCommitments = append(encCommitments, encCommitment) + commitments = append(commitments, commitment) + } + + register := &testWinnerRegister{ + winners: []testWinner{ + { + blockNum: 5, + winner: updater.Winner{ + Winner: builderAddr.Bytes(), + Window: 1, + }, + }, + }, + settlements: make(chan testSettlement, 1), + encCommit: make(chan testEncryptedCommitment, 1), + } + + l1Client := &testEVMClient{ + blocks: map[int64]*types.Block{ + 5: types.NewBlock(&types.Header{}, txns, nil, nil, NewHasher()), + }, + receipts: make(map[string]*types.Receipt), + } + for _, txn := range txns { + receipt := &types.Receipt{ + Status: types.ReceiptStatusFailed, + TxHash: txn.Hash(), + } + l1Client.receipts[txn.Hash().Hex()] = receipt + } + + pcABI, err := abi.JSON(strings.NewReader(preconf.PreconfcommitmentstoreABI)) + if err != nil { + t.Fatal(err) + } + + btABI, err := abi.JSON(strings.NewReader(blocktracker.BlocktrackerABI)) + if err != nil { + t.Fatal(err) + } + + evtMgr := events.NewListener( + util.NewTestLogger(io.Discard), + &btABI, + &pcABI, + ) + + oracle := &testOracle{ + commitments: make(chan processedCommitment, 1), + } + testBatcher := &testBatcher{ + failedReceipts: make(map[common.Hash]bool), + } + for _, txn := range txns { + testBatcher.failedReceipts[txn.Hash()] = true + } + + updtr, err := updater.NewUpdater( + slog.New(slog.NewTextHandler(io.Discard, nil)), + l1Client, + register, + evtMgr, + oracle, + testBatcher, + ) + if err != nil { + t.Fatal(err) + } + + ctx, cancel := context.WithCancel(context.Background()) + done := updtr.Start(ctx) + + w := blocktracker.BlocktrackerNewWindow{ + Window: big.NewInt(1), + } + publishNewWindow(evtMgr, &btABI, w) + + for _, ec := range encCommitments { + if err := publishEncCommitment(evtMgr, &pcABI, ec); err != nil { + t.Fatal(err) + } + + select { + case <-time.After(5 * time.Second): + t.Fatal("timeout") + case enc := <-register.encCommit: + if !bytes.Equal(enc.commitmentIdx, ec.CommitmentIndex[:]) { + t.Fatal("wrong commitment index") + } + if !bytes.Equal(enc.committer, ec.Commiter.Bytes()) { + t.Fatal("wrong committer") + } + if !bytes.Equal(enc.commitmentHash, ec.CommitmentDigest[:]) { + t.Fatal("wrong commitment hash") + } + if !bytes.Equal(enc.commitmentSignature, ec.CommitmentSignature) { + t.Fatal("wrong commitment signature") + } + if enc.dispatchTimestamp != ec.DispatchTimestamp { + t.Fatal("wrong dispatch timestamp") + } + } + } + + for _, c := range commitments { + if err := publishCommitment(evtMgr, &pcABI, c); err != nil { + t.Fatal(err) + } + + if c.Commiter.Cmp(otherBuilderAddr) == 0 { + continue + } + + select { + case <-time.After(5 * time.Second): + t.Fatal("timeout") + case commitment := <-oracle.commitments: + if !bytes.Equal(commitment.commitmentIdx[:], c.CommitmentIndex[:]) { + t.Fatal("wrong commitment index") + } + if commitment.blockNum.Cmp(big.NewInt(5)) != 0 { + t.Fatal("wrong block number") + } + if commitment.builder != c.Commiter { + t.Fatal("wrong builder") + } + if commitment.isSlash { + t.Fatal("wrong isSlash") + } + if commitment.residualDecay.Cmp(big.NewInt(50)) != 0 { + t.Fatal("wrong residual decay") + } + } + + select { + case <-time.After(5 * time.Second): + t.Fatal("timeout") + case settlement := <-register.settlements: + if !bytes.Equal(settlement.commitmentIdx, c.CommitmentIndex[:]) { + t.Fatal("wrong commitment index") + } + if settlement.txHash != c.TxnHash { + t.Fatal("wrong txn hash") + } + if settlement.blockNum != 5 { + t.Fatal("wrong block number") + } + if !bytes.Equal(settlement.builder, c.Commiter.Bytes()) { + t.Fatal("wrong builder") + } + if settlement.amount.Uint64() != 10 { + t.Fatal("wrong amount") + } + if settlement.settlementType != updater.SettlementTypeReward { + t.Fatal("wrong settlement type") + } + if settlement.decayPercentage != 50 { + t.Fatal("wrong decay percentage") + } + if settlement.window != 1 { + t.Fatal("wrong window") + } + } + } + + cancel() + select { + case <-done: + case <-time.After(5 * time.Second): + t.Fatal("timeout") + } +} func TestUpdaterBundlesFailure(t *testing.T) { t.Parallel() From 801e4d7a87fbe5734662c087865299f605ff10a9 Mon Sep 17 00:00:00 2001 From: Kartik Chopra Date: Tue, 9 Jul 2024 20:14:10 -0400 Subject: [PATCH 39/41] chore: remove debug log --- p2p/pkg/signer/preconfencryptor/encryptor.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/p2p/pkg/signer/preconfencryptor/encryptor.go b/p2p/pkg/signer/preconfencryptor/encryptor.go index afc1fe5ac..9614345e4 100644 --- a/p2p/pkg/signer/preconfencryptor/encryptor.go +++ b/p2p/pkg/signer/preconfencryptor/encryptor.go @@ -6,7 +6,6 @@ import ( "crypto/rand" "encoding/hex" "errors" - "fmt" "math/big" "github.com/ethereum/go-ethereum/common" @@ -363,7 +362,6 @@ func GetPreConfirmationHash(c *preconfpb.PreConfirmation) ([]byte, error) { revertingTxHashesHash := crypto.Keccak256Hash([]byte(c.Bid.RevertingTxHashes)) bidDigestHash := crypto.Keccak256Hash([]byte(hex.EncodeToString(c.Bid.Digest))) bidSigHash := crypto.Keccak256Hash([]byte(hex.EncodeToString(c.Bid.Signature))) - fmt.Printf("Bid Signature Hash: %x\n", bidSigHash.Bytes()) sharedSecretHash := crypto.Keccak256Hash([]byte(hex.EncodeToString(c.SharedSecret))) // Encode values similar to Solidity's abi.encode From 52f942ff2959d17b9b8367c8176a4c6983be3ab8 Mon Sep 17 00:00:00 2001 From: Kartik Chopra Date: Tue, 9 Jul 2024 20:18:09 -0400 Subject: [PATCH 40/41] chore: removes debugging logs --- p2p/pkg/preconfirmation/tracker/tracker.go | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/p2p/pkg/preconfirmation/tracker/tracker.go b/p2p/pkg/preconfirmation/tracker/tracker.go index 21882135d..00fc6ca5f 100644 --- a/p2p/pkg/preconfirmation/tracker/tracker.go +++ b/p2p/pkg/preconfirmation/tracker/tracker.go @@ -249,6 +249,7 @@ func (t *Tracker) TrackCommitment( func (t *Tracker) Metrics() []prometheus.Collector { return t.metrics.Metrics() } + func (t *Tracker) handleNewL1Block( ctx context.Context, newL1Block *blocktracker.BlocktrackerNewL1Block, @@ -272,14 +273,12 @@ func (t *Tracker) handleNewL1Block( t.winners[newL1Block.BlockNumber.Int64()] = newL1Block pastBlock, ok := t.winners[newL1Block.BlockNumber.Int64()-2] if !ok { - t.logger.Info("past block not found, returning") return nil } newL1Block = pastBlock t.logger.Info("processing past block", "blockNumber", pastBlock.BlockNumber) for k := range t.winners { if k < pastBlock.BlockNumber.Int64() { - t.logger.Info("deleting old winner entry", "blockNumber", k) delete(t.winners, k) } } @@ -291,13 +290,10 @@ func (t *Tracker) handleNewL1Block( return err } - t.logger.Info("commitments retrieved", "count", len(commitments)) - failedCommitments := make([]common.Hash, 0) settled := 0 for _, commitment := range commitments { if commitment.CommitmentIndex == nil { - t.logger.Info("commitment index is nil, adding to failed commitments", "txnHash", commitment.TxnHash) failedCommitments = append(failedCommitments, commitment.TxnHash) continue } @@ -326,8 +322,6 @@ func (t *Tracker) handleNewL1Block( continue } - t.logger.Info("opening commitment", "commitmentIdx", commitmentIdx, "bidAmount", bidAmt) - txHash, err := t.preconfContract.OpenCommitment( opts, commitmentIdx, From d1dd7cac8e610ee5875860c9b0541c23c66d9b75 Mon Sep 17 00:00:00 2001 From: Kartik Chopra Date: Tue, 9 Jul 2024 21:07:07 -0400 Subject: [PATCH 41/41] chore: adds revertinglist param in comments --- contracts/contracts/PreConfCommitmentStore.sol | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/contracts/contracts/PreConfCommitmentStore.sol b/contracts/contracts/PreConfCommitmentStore.sol index 3442f1260..64144ba64 100644 --- a/contracts/contracts/PreConfCommitmentStore.sol +++ b/contracts/contracts/PreConfCommitmentStore.sol @@ -232,6 +232,7 @@ contract PreConfCommitmentStore is OwnableUpgradeable, UUPSUpgradeable { * @param _txnHash transaction Hash. * @param _bid bid id. * @param _blockNumber block number + * @param _revertingTxHashes reverting transaction hashes. * @return digest it returns a digest that can be used for signing bids */ function getBidHash( @@ -264,6 +265,7 @@ contract PreConfCommitmentStore is OwnableUpgradeable, UUPSUpgradeable { * @param _txnHash transaction Hash. * @param _bid bid id. * @param _blockNumber block number. + * @param _revertingTxHashes reverting transaction hashes. * @param _bidHash hash of the bid. * @return digest it returns a digest that can be used for signing bids. */ @@ -306,6 +308,7 @@ contract PreConfCommitmentStore is OwnableUpgradeable, UUPSUpgradeable { * @param bid bid id. * @param blockNumber block number. * @param txnHash transaction Hash. + * @param revertingTxHashes reverting transaction hashes. * @param bidSignature bid signature. * @return messageDigest returns the bid hash for given bid id. * @return recoveredAddress the address from the bid hash. @@ -413,6 +416,7 @@ contract PreConfCommitmentStore is OwnableUpgradeable, UUPSUpgradeable { @param bid The bid amount @param blockNumber The block number @param txnHash The transaction hash + @param revertingTxHashes The reverting transaction hashes @param decayStartTimeStamp The start time of the decay @param decayEndTimeStamp The end time of the decay @param bidSignature The signature of the bid