From 93ef61bfad8fb1bb633a7ffa20ca0b6da22f524f Mon Sep 17 00:00:00 2001 From: Ferran Borreguero Date: Wed, 7 Feb 2024 09:06:24 +0000 Subject: [PATCH 01/12] Add method to include Bundles --- suave/builder/api/api.go | 11 ++++ suave/builder/api/api_client.go | 4 ++ suave/builder/api/api_server.go | 9 +++ suave/builder/api/api_test.go | 4 ++ suave/builder/builder.go | 96 ++++++++++++++++++++++++++++++++ suave/builder/session_manager.go | 9 +++ 6 files changed, 133 insertions(+) diff --git a/suave/builder/api/api.go b/suave/builder/api/api.go index b11d237ba2c9..f144e65f18b3 100644 --- a/suave/builder/api/api.go +++ b/suave/builder/api/api.go @@ -2,11 +2,22 @@ package api import ( "context" + "math/big" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" ) +type Bundle struct { + BlockNumber *big.Int `json:"blockNumber,omitempty"` // if BlockNumber is set it must match DecryptionCondition! + MaxBlock *big.Int `json:"maxBlock,omitempty"` + Txs types.Transactions `json:"txs"` + RevertingHashes []common.Hash `json:"revertingHashes,omitempty"` + RefundPercent *int `json:"percent,omitempty"` +} + type API interface { NewSession(ctx context.Context) (string, error) AddTransaction(ctx context.Context, sessionId string, tx *types.Transaction) (*types.SimulateTransactionResult, error) + AddBundle(ctx context.Context, sessionId string, bundle Bundle) error } diff --git a/suave/builder/api/api_client.go b/suave/builder/api/api_client.go index 3baefde531dd..e7ca8246b42e 100644 --- a/suave/builder/api/api_client.go +++ b/suave/builder/api/api_client.go @@ -40,3 +40,7 @@ func (a *APIClient) AddTransaction(ctx context.Context, sessionId string, tx *ty err := a.rpc.CallContext(ctx, &receipt, "suavex_addTransaction", sessionId, tx) return receipt, err } + +func (a *APIClient) AddBundle(ctx context.Context, sessionId string, bundle Bundle) error { + return a.rpc.CallContext(ctx, nil, "suavex_addBundle", sessionId, bundle) +} diff --git a/suave/builder/api/api_server.go b/suave/builder/api/api_server.go index 4b8336ed0688..e78f435e14da 100644 --- a/suave/builder/api/api_server.go +++ b/suave/builder/api/api_server.go @@ -10,6 +10,7 @@ import ( type SessionManager interface { NewSession(context.Context) (string, error) AddTransaction(sessionId string, tx *types.Transaction) (*types.SimulateTransactionResult, error) + AddBundle(sessionId string, bundle Bundle) error } func NewServer(s SessionManager) *Server { @@ -31,6 +32,10 @@ func (s *Server) AddTransaction(ctx context.Context, sessionId string, tx *types return s.sessionMngr.AddTransaction(sessionId, tx) } +func (s *Server) AddBundle(ctx context.Context, sessionId string, bundle Bundle) error { + return s.sessionMngr.AddBundle(sessionId, bundle) +} + type MockServer struct { } @@ -41,3 +46,7 @@ func (s *MockServer) NewSession(ctx context.Context) (string, error) { func (s *MockServer) AddTransaction(ctx context.Context, sessionId string, tx *types.Transaction) (*types.SimulateTransactionResult, error) { return &types.SimulateTransactionResult{}, nil } + +func (s *MockServer) AddBundle(ctx context.Context, sessionId string, bundle Bundle) error { + return nil +} diff --git a/suave/builder/api/api_test.go b/suave/builder/api/api_test.go index f9d795033cd3..30a9dabb39db 100644 --- a/suave/builder/api/api_test.go +++ b/suave/builder/api/api_test.go @@ -37,3 +37,7 @@ func (nullSessionManager) NewSession(ctx context.Context) (string, error) { func (nullSessionManager) AddTransaction(sessionId string, tx *types.Transaction) (*types.SimulateTransactionResult, error) { return &types.SimulateTransactionResult{Logs: []*types.SimulatedLog{}}, nil } + +func (nullSessionManager) AddBundle(sessionId string, bundle Bundle) error { + return nil +} diff --git a/suave/builder/builder.go b/suave/builder/builder.go index 0d5c30ce9ecf..b471f7a94957 100644 --- a/suave/builder/builder.go +++ b/suave/builder/builder.go @@ -1,12 +1,16 @@ package builder import ( + "math/big" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core" "github.com/ethereum/go-ethereum/core/state" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/core/vm" + "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/params" + "github.com/ethereum/go-ethereum/suave/builder/api" ) type builder struct { @@ -16,6 +20,7 @@ type builder struct { state *state.StateDB gasPool *core.GasPool gasUsed *uint64 + signer types.Signer } type builderConfig struct { @@ -34,9 +39,100 @@ func newBuilder(config *builderConfig) *builder { state: config.preState.Copy(), gasPool: &gp, gasUsed: &gasUsed, + signer: types.MakeSigner(config.config, config.header.Number, config.header.Time), } } +func (b *builder) takeSnapshot() func() { + indx := len(b.txns) + snap := b.state.Snapshot() + + return func() { + b.txns = b.txns[:indx] + b.receipts = b.receipts[:indx] + b.state.RevertToSnapshot(snap) + } +} + +func (b *builder) AddBundle(bundle api.Bundle) error { + revertFn := b.takeSnapshot() + + // create ephemeral addr and private key for payment txn + ephemeralPrivKey, err := crypto.GenerateKey() + if err != nil { + return err + } + ephemeralAddr := crypto.PubkeyToAddress(ephemeralPrivKey.PublicKey) + + // Assume static 28000 gas transfers for both mev-share and proposer payments + refundTransferCost := new(big.Int).Mul(big.NewInt(28000), b.config.header.BaseFee) + + // apply bundle + profitPreBundle := b.state.GetBalance(b.config.header.Coinbase) + if err := b.AddTransactions(bundle.Txs); err != nil { + revertFn() + return err + } + + profitPostBundle := b.state.GetBalance(b.config.header.Coinbase) + + // calc & refund user if bundle has multiple txns and wants refund + if len(bundle.Txs) > 1 && bundle.RefundPercent != nil { + // Note: PoC logic, this could be gamed by not sending any eth to coinbase + refundPrct := *bundle.RefundPercent + if refundPrct == 0 { + // default refund + refundPrct = 10 + } + bundleProfit := new(big.Int).Sub(profitPostBundle, profitPreBundle) + refundAmt := new(big.Int).Div(bundleProfit, big.NewInt(int64(refundPrct))) + // subtract payment txn transfer costs + refundAmt = new(big.Int).Sub(refundAmt, refundTransferCost) + + currNonce := b.state.GetNonce(ephemeralAddr) + + // HACK to include payment txn + // multi refund block untested + userTx := bundle.Txs[0] // NOTE : assumes first txn is refund recipient + refundAddr, err := types.Sender(types.LatestSignerForChainID(userTx.ChainId()), userTx) + if err != nil { + return err + } + paymentTx, err := types.SignTx(types.NewTx(&types.LegacyTx{ + Nonce: currNonce, + To: &refundAddr, + Value: refundAmt, + Gas: 28000, + GasPrice: b.config.header.BaseFee, + }), b.signer, ephemeralPrivKey) + + if err != nil { + return err + } + + // commit payment txn + if _, err := b.AddTransaction(paymentTx); err != nil { + revertFn() + return err + } + } + + return nil +} + +func (b *builder) AddTransactions(txns types.Transactions) error { + revertFn := b.takeSnapshot() + + for _, txn := range txns { + if _, err := b.AddTransaction(txn); err != nil { + revertFn() + return err + } + } + + return nil +} + func (b *builder) AddTransaction(txn *types.Transaction) (*types.SimulateTransactionResult, error) { dummyAuthor := common.Address{} diff --git a/suave/builder/session_manager.go b/suave/builder/session_manager.go index 905241a5bd45..2a2ddda062f2 100644 --- a/suave/builder/session_manager.go +++ b/suave/builder/session_manager.go @@ -13,6 +13,7 @@ import ( "github.com/ethereum/go-ethereum/core/state" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/params" + "github.com/ethereum/go-ethereum/suave/builder/api" "github.com/google/uuid" ) @@ -162,6 +163,14 @@ func (s *SessionManager) AddTransaction(sessionId string, tx *types.Transaction) return builder.AddTransaction(tx) } +func (s *SessionManager) AddBundle(sessionId string, bundle api.Bundle) error { + builder, err := s.getSession(sessionId) + if err != nil { + return err + } + return builder.AddBundle(bundle) +} + // CalcBaseFee calculates the basefee of the header. func CalcBaseFee(config *params.ChainConfig, parent *types.Header) *big.Int { // If the current block is the first EIP-1559 block, return the InitialBaseFee. From 7d72612dbbf0894e374103d28c1e4367bc3c37d5 Mon Sep 17 00:00:00 2001 From: Ferran Borreguero Date: Wed, 7 Feb 2024 09:09:46 +0000 Subject: [PATCH 02/12] Add args to newSession --- suave/builder/api/api.go | 15 ++++++++++++++- suave/builder/api/api_client.go | 4 ++-- suave/builder/api/api_server.go | 8 ++++---- suave/builder/api/api_test.go | 4 ++-- suave/builder/session_manager.go | 2 +- suave/builder/session_manager_test.go | 12 ++++++------ 6 files changed, 29 insertions(+), 16 deletions(-) diff --git a/suave/builder/api/api.go b/suave/builder/api/api.go index f144e65f18b3..773d7086af84 100644 --- a/suave/builder/api/api.go +++ b/suave/builder/api/api.go @@ -16,8 +16,21 @@ type Bundle struct { RefundPercent *int `json:"percent,omitempty"` } +type BuildBlockArgs struct { + Slot uint64 + ProposerPubkey []byte + Parent common.Hash + Timestamp uint64 + FeeRecipient common.Address + GasLimit uint64 + Random common.Hash + Withdrawals []*types.Withdrawal + Extra []byte + FillPending bool +} + type API interface { - NewSession(ctx context.Context) (string, error) + NewSession(ctx context.Context, args *BuildBlockArgs) (string, error) AddTransaction(ctx context.Context, sessionId string, tx *types.Transaction) (*types.SimulateTransactionResult, error) AddBundle(ctx context.Context, sessionId string, bundle Bundle) error } diff --git a/suave/builder/api/api_client.go b/suave/builder/api/api_client.go index e7ca8246b42e..62631df8b470 100644 --- a/suave/builder/api/api_client.go +++ b/suave/builder/api/api_client.go @@ -29,9 +29,9 @@ func NewClientFromRPC(rpc rpcClient) *APIClient { return &APIClient{rpc: rpc} } -func (a *APIClient) NewSession(ctx context.Context) (string, error) { +func (a *APIClient) NewSession(ctx context.Context, args *BuildBlockArgs) (string, error) { var id string - err := a.rpc.CallContext(ctx, &id, "suavex_newSession") + err := a.rpc.CallContext(ctx, &id, "suavex_newSession", args) return id, err } diff --git a/suave/builder/api/api_server.go b/suave/builder/api/api_server.go index e78f435e14da..eb598270d98a 100644 --- a/suave/builder/api/api_server.go +++ b/suave/builder/api/api_server.go @@ -8,7 +8,7 @@ import ( // SessionManager is the backend that manages the session state of the builder API. type SessionManager interface { - NewSession(context.Context) (string, error) + NewSession(context.Context, *BuildBlockArgs) (string, error) AddTransaction(sessionId string, tx *types.Transaction) (*types.SimulateTransactionResult, error) AddBundle(sessionId string, bundle Bundle) error } @@ -24,8 +24,8 @@ type Server struct { sessionMngr SessionManager } -func (s *Server) NewSession(ctx context.Context) (string, error) { - return s.sessionMngr.NewSession(ctx) +func (s *Server) NewSession(ctx context.Context, args *BuildBlockArgs) (string, error) { + return s.sessionMngr.NewSession(ctx, args) } func (s *Server) AddTransaction(ctx context.Context, sessionId string, tx *types.Transaction) (*types.SimulateTransactionResult, error) { @@ -39,7 +39,7 @@ func (s *Server) AddBundle(ctx context.Context, sessionId string, bundle Bundle) type MockServer struct { } -func (s *MockServer) NewSession(ctx context.Context) (string, error) { +func (s *MockServer) NewSession(ctx context.Context, args *BuildBlockArgs) (string, error) { return "", nil } diff --git a/suave/builder/api/api_test.go b/suave/builder/api/api_test.go index 30a9dabb39db..356ff0d08303 100644 --- a/suave/builder/api/api_test.go +++ b/suave/builder/api/api_test.go @@ -19,7 +19,7 @@ func TestAPI(t *testing.T) { c := NewClientFromRPC(rpc.DialInProc(srv)) - res0, err := c.NewSession(context.Background()) + res0, err := c.NewSession(context.Background(), nil) require.NoError(t, err) require.Equal(t, res0, "1") @@ -30,7 +30,7 @@ func TestAPI(t *testing.T) { type nullSessionManager struct{} -func (nullSessionManager) NewSession(ctx context.Context) (string, error) { +func (nullSessionManager) NewSession(ctx context.Context, args *BuildBlockArgs) (string, error) { return "1", ctx.Err() } diff --git a/suave/builder/session_manager.go b/suave/builder/session_manager.go index 2a2ddda062f2..194bd9067de5 100644 --- a/suave/builder/session_manager.go +++ b/suave/builder/session_manager.go @@ -74,7 +74,7 @@ func NewSessionManager(blockchain blockchain, config *Config) *SessionManager { } // NewSession creates a new builder session and returns the session id -func (s *SessionManager) NewSession(ctx context.Context) (string, error) { +func (s *SessionManager) NewSession(ctx context.Context, args *api.BuildBlockArgs) (string, error) { // Wait for session to become available select { case <-s.sem: diff --git a/suave/builder/session_manager_test.go b/suave/builder/session_manager_test.go index a7a37aa14e8f..994c5e082fb7 100644 --- a/suave/builder/session_manager_test.go +++ b/suave/builder/session_manager_test.go @@ -22,7 +22,7 @@ func TestSessionManager_SessionTimeout(t *testing.T) { SessionIdleTimeout: 500 * time.Millisecond, }) - id, err := mngr.NewSession(context.TODO()) + id, err := mngr.NewSession(context.TODO(), nil) require.NoError(t, err) time.Sleep(1 * time.Second) @@ -42,7 +42,7 @@ func TestSessionManager_MaxConcurrentSessions(t *testing.T) { }) t.Run("SessionAvailable", func(t *testing.T) { - sess, err := mngr.NewSession(context.TODO()) + sess, err := mngr.NewSession(context.TODO(), nil) require.NoError(t, err) require.NotZero(t, sess) }) @@ -53,7 +53,7 @@ func TestSessionManager_MaxConcurrentSessions(t *testing.T) { ctx, cancel := context.WithCancel(context.Background()) cancel() - sess, err := mngr.NewSession(ctx) + sess, err := mngr.NewSession(ctx, nil) require.Zero(t, sess) require.ErrorIs(t, err, context.Canceled) }) @@ -62,7 +62,7 @@ func TestSessionManager_MaxConcurrentSessions(t *testing.T) { time.Sleep(d) // Wait for the session to expire. // We should be able to open a session again. - sess, err := mngr.NewSession(context.TODO()) + sess, err := mngr.NewSession(context.TODO(), nil) require.NoError(t, err) require.NotZero(t, sess) }) @@ -73,7 +73,7 @@ func TestSessionManager_SessionRefresh(t *testing.T) { SessionIdleTimeout: 500 * time.Millisecond, }) - id, err := mngr.NewSession(context.TODO()) + id, err := mngr.NewSession(context.TODO(), nil) require.NoError(t, err) // if we query the session under the idle timeout, @@ -98,7 +98,7 @@ func TestSessionManager_StartSession(t *testing.T) { // test that the session starts and it can simulate transactions mngr, bMock := newSessionManager(t, &Config{}) - id, err := mngr.NewSession(context.TODO()) + id, err := mngr.NewSession(context.TODO(), nil) require.NoError(t, err) txn := bMock.state.newTransfer(t, common.Address{}, big.NewInt(1)) From 733df027e925397feeb3b6234848f1fb212965ac Mon Sep 17 00:00:00 2001 From: Ferran Borreguero Date: Wed, 7 Feb 2024 09:32:46 +0000 Subject: [PATCH 03/12] Build block? --- suave/builder/api/api.go | 1 + suave/builder/api/api_client.go | 4 + suave/builder/api/api_server.go | 9 +++ suave/builder/api/api_test.go | 4 + suave/builder/builder.go | 134 +++++++++++++++++++++++++++---- suave/builder/session_manager.go | 8 ++ 6 files changed, 144 insertions(+), 16 deletions(-) diff --git a/suave/builder/api/api.go b/suave/builder/api/api.go index 773d7086af84..8e08280c2bd1 100644 --- a/suave/builder/api/api.go +++ b/suave/builder/api/api.go @@ -33,4 +33,5 @@ type API interface { NewSession(ctx context.Context, args *BuildBlockArgs) (string, error) AddTransaction(ctx context.Context, sessionId string, tx *types.Transaction) (*types.SimulateTransactionResult, error) AddBundle(ctx context.Context, sessionId string, bundle Bundle) error + BuildBlock(ctx context.Context, sessionId string) error } diff --git a/suave/builder/api/api_client.go b/suave/builder/api/api_client.go index 62631df8b470..d781c642d56e 100644 --- a/suave/builder/api/api_client.go +++ b/suave/builder/api/api_client.go @@ -44,3 +44,7 @@ func (a *APIClient) AddTransaction(ctx context.Context, sessionId string, tx *ty func (a *APIClient) AddBundle(ctx context.Context, sessionId string, bundle Bundle) error { return a.rpc.CallContext(ctx, nil, "suavex_addBundle", sessionId, bundle) } + +func (a *APIClient) BuildBlock(ctx context.Context, sessionId string) error { + return a.rpc.CallContext(ctx, nil, "suavex_buildBlock", sessionId) +} diff --git a/suave/builder/api/api_server.go b/suave/builder/api/api_server.go index eb598270d98a..f6eeb80127d5 100644 --- a/suave/builder/api/api_server.go +++ b/suave/builder/api/api_server.go @@ -11,6 +11,7 @@ type SessionManager interface { NewSession(context.Context, *BuildBlockArgs) (string, error) AddTransaction(sessionId string, tx *types.Transaction) (*types.SimulateTransactionResult, error) AddBundle(sessionId string, bundle Bundle) error + BuildBlock(sessionId string) error } func NewServer(s SessionManager) *Server { @@ -36,6 +37,10 @@ func (s *Server) AddBundle(ctx context.Context, sessionId string, bundle Bundle) return s.sessionMngr.AddBundle(sessionId, bundle) } +func (s *Server) BuildBlock(ctx context.Context, sessionId string) error { + return s.sessionMngr.BuildBlock(sessionId) +} + type MockServer struct { } @@ -50,3 +55,7 @@ func (s *MockServer) AddTransaction(ctx context.Context, sessionId string, tx *t func (s *MockServer) AddBundle(ctx context.Context, sessionId string, bundle Bundle) error { return nil } + +func (s *MockServer) BuildBlock(ctx context.Context) error { + return nil +} diff --git a/suave/builder/api/api_test.go b/suave/builder/api/api_test.go index 356ff0d08303..66ab9ec8f7bc 100644 --- a/suave/builder/api/api_test.go +++ b/suave/builder/api/api_test.go @@ -41,3 +41,7 @@ func (nullSessionManager) AddTransaction(sessionId string, tx *types.Transaction func (nullSessionManager) AddBundle(sessionId string, bundle Bundle) error { return nil } + +func (nullSessionManager) BuildBlock(sessionId string) error { + return nil +} diff --git a/suave/builder/builder.go b/suave/builder/builder.go index b471f7a94957..83c695f87acd 100644 --- a/suave/builder/builder.go +++ b/suave/builder/builder.go @@ -1,9 +1,13 @@ package builder import ( + "fmt" "math/big" + "sync/atomic" + "time" "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/consensus" "github.com/ethereum/go-ethereum/core" "github.com/ethereum/go-ethereum/core/state" "github.com/ethereum/go-ethereum/core/types" @@ -14,20 +18,31 @@ import ( ) type builder struct { - config *builderConfig - txns []*types.Transaction - receipts []*types.Receipt - state *state.StateDB - gasPool *core.GasPool - gasUsed *uint64 - signer types.Signer + config *builderConfig + txns []*types.Transaction + receipts []*types.Receipt + state *state.StateDB + gasPool *core.GasPool + gasUsed *uint64 + signer types.Signer + args api.BuildBlockArgs + coinbasePreBalance *big.Int + engine consensus.Engine } type builderConfig struct { - preState *state.StateDB - header *types.Header - config *params.ChainConfig - context core.ChainContext + preState *state.StateDB + header *types.Header + config *params.ChainConfig + context core.ChainContext + chainReader consensus.ChainHeaderReader + + // newpayloadTimeout is the maximum timeout allowance for creating payload. + // The default value is 2 seconds but node operator can set it to arbitrary + // large value. A large timeout allowance may cause Geth to fail creating + // a non-empty payload within the specified time and eventually miss the slot + // in case there are some computation expensive transactions in txpool. + newpayloadTimeout time.Duration } func newBuilder(config *builderConfig) *builder { @@ -35,11 +50,12 @@ func newBuilder(config *builderConfig) *builder { var gasUsed uint64 return &builder{ - config: config, - state: config.preState.Copy(), - gasPool: &gp, - gasUsed: &gasUsed, - signer: types.MakeSigner(config.config, config.header.Number, config.header.Time), + config: config, + state: config.preState.Copy(), + gasPool: &gp, + gasUsed: &gasUsed, + signer: types.MakeSigner(config.config, config.header.Number, config.header.Time), + coinbasePreBalance: config.preState.GetBalance(config.header.Coinbase), } } @@ -171,3 +187,89 @@ func (b *builder) AddTransaction(txn *types.Transaction) (*types.SimulateTransac return result, nil } + +func (b *builder) commitPendingTxs() error { + interrupt := new(atomic.Int32) + timer := time.AfterFunc(b.config.newpayloadTimeout, func() { + interrupt.Store(commitInterruptTimeout) + }) + defer timer.Stop() + if err := b.fillTransactions(); err != nil { + return err + } + return nil +} + +func (b *builder) fillTransactions() error { + // Split the pending transactions into locals and remotes + // Fill the block with all available pending transactions. + pending := w.eth.TxPool().Pending(true) + localTxs, remoteTxs := make(map[common.Address]types.Transactions), pending + for _, account := range w.eth.TxPool().Locals() { + if txs := remoteTxs[account]; len(txs) > 0 { + delete(remoteTxs, account) + localTxs[account] = txs + } + } + if len(localTxs) > 0 { + txs := types.NewTransactionsByPriceAndNonce(env.signer, localTxs, env.header.BaseFee) + if err := b.commitTransactions(env, txs, interrupt); err != nil { + return err + } + } + if len(remoteTxs) > 0 { + txs := types.NewTransactionsByPriceAndNonce(env.signer, remoteTxs, env.header.BaseFee) + if err := w.commitTransactions(env, txs, interrupt); err != nil { + return err + } + } + return nil +} + +func (b *builder) BuildBlock() error { + if b.args.FillPending { + if err := b.commitPendingTxs(); err != nil { + return err + } + } + + // create ephemeral addr and private key for payment txn + ephemeralPrivKey, err := crypto.GenerateKey() + if err != nil { + return err + } + ephemeralAddr := crypto.PubkeyToAddress(ephemeralPrivKey.PublicKey) + + // Assume static 28000 gas transfers for both mev-share and proposer payments + refundTransferCost := new(big.Int).Mul(big.NewInt(28000), b.config.header.BaseFee) + + profitPost := b.state.GetBalance(b.config.header.Coinbase) + proposerProfit := new(big.Int).Set(profitPost) // = post-pre-transfer_cost + proposerProfit = proposerProfit.Sub(profitPost, b.coinbasePreBalance) + proposerProfit = proposerProfit.Sub(proposerProfit, refundTransferCost) + + currNonce := b.state.GetNonce(ephemeralAddr) + paymentTx, err := types.SignTx(types.NewTx(&types.LegacyTx{ + Nonce: currNonce, + To: &b.args.FeeRecipient, + Value: proposerProfit, + Gas: 28000, + GasPrice: b.config.header.BaseFee, + }), b.signer, ephemeralPrivKey) + if err != nil { + return fmt.Errorf("could not sign proposer payment: %w", err) + } + + // commit payment txn + if _, err := b.AddTransaction(paymentTx); err != nil { + return err + } + + block, err := b.engine.FinalizeAndAssemble(b.config.chainReader, b.config.header, b.state, b.txns, []*types.Header{}, b.receipts, b.args.Withdrawals) + if err != nil { + return err + } + + fmt.Println("-- block --", block) + return nil +} diff --git a/suave/builder/session_manager.go b/suave/builder/session_manager.go index 194bd9067de5..6ed89f288e7c 100644 --- a/suave/builder/session_manager.go +++ b/suave/builder/session_manager.go @@ -171,6 +171,14 @@ func (s *SessionManager) AddBundle(sessionId string, bundle api.Bundle) error { return builder.AddBundle(bundle) } +func (s *SessionManager) BuildBlock(sessionId string) error { + builder, err := s.getSession(sessionId) + if err != nil { + return err + } + return builder.BuildBlock() +} + // CalcBaseFee calculates the basefee of the header. func CalcBaseFee(config *params.ChainConfig, parent *types.Header) *big.Int { // If the current block is the first EIP-1559 block, return the InitialBaseFee. From dd1a5901d47d171f22cda8fc047fe6caa924d5b0 Mon Sep 17 00:00:00 2001 From: Ferran Borreguero Date: Mon, 12 Feb 2024 12:32:33 +0000 Subject: [PATCH 04/12] Add more stuff --- miner/builder.go | 221 +++++++++++++++++++++++++ miner/builder_test.go | 97 +++++++++++ suave/builder/builder.go | 275 ------------------------------- suave/builder/builder_test.go | 122 -------------- suave/builder/session_manager.go | 49 ++---- 5 files changed, 334 insertions(+), 430 deletions(-) create mode 100644 miner/builder.go create mode 100644 miner/builder_test.go delete mode 100644 suave/builder/builder.go delete mode 100644 suave/builder/builder_test.go diff --git a/miner/builder.go b/miner/builder.go new file mode 100644 index 000000000000..3aea42a42fdb --- /dev/null +++ b/miner/builder.go @@ -0,0 +1,221 @@ +package miner + +import ( + "fmt" + "math/big" + + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/consensus" + "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/params" +) + +type BuilderConfig struct { + ChainConfig *params.ChainConfig + Engine consensus.Engine + EthBackend Backend + Chain *core.BlockChain + GasCeil uint64 +} + +type BuilderArgs struct { + ParentHash common.Hash + FeeRecipient common.Address + Extra []byte +} + +type Builder struct { + env *environment + wrk *worker + args *BuilderArgs + + profitPre *big.Int +} + +func NewBuilder(config *BuilderConfig, args *BuilderArgs) (*Builder, error) { + b := &Builder{ + args: args, + } + + b.wrk = &worker{ + config: &Config{ + GasCeil: config.GasCeil, + }, + eth: config.EthBackend, + chainConfig: config.ChainConfig, + engine: config.Engine, + chain: config.Chain, + } + + workerParams := &generateParams{ + parentHash: args.ParentHash, + forceTime: false, + coinbase: args.FeeRecipient, + extra: args.Extra, + } + env, err := b.wrk.prepareWork(workerParams) + if err != nil { + return nil, err + } + + env.gasPool = new(core.GasPool).AddGas(env.header.GasLimit) + b.env = env + b.profitPre = env.state.GetBalance(env.coinbase) + + return b, nil +} + +type SBundle struct { + BlockNumber *big.Int `json:"blockNumber,omitempty"` // if BlockNumber is set it must match DecryptionCondition! + MaxBlock *big.Int `json:"maxBlock,omitempty"` + Txs types.Transactions `json:"txs"` + RevertingHashes []common.Hash `json:"revertingHashes,omitempty"` + RefundPercent *int `json:"percent,omitempty"` +} + +func (b *Builder) AddTransaction(txn *types.Transaction) (*types.SimulateTransactionResult, error) { + logs, err := b.wrk.commitTransaction(b.env, txn) + if err != nil { + return &types.SimulateTransactionResult{ + Success: false, + }, nil + } + return receiptToSimResult(&types.Receipt{Logs: logs}), nil +} + +func (b *Builder) AddBundles(bundles []*SBundle) error { + for _, bundle := range bundles { + if err := b.AddBundle(bundle); err != nil { + return err + } + } + return nil +} + +func (b *Builder) AddBundle(bundle *SBundle) error { + work := b.env + + // Assume static 28000 gas transfers for both mev-share and proposer payments + refundTransferCost := new(big.Int).Mul(big.NewInt(28000), work.header.BaseFee) + + // create ephemeral addr and private key for payment txn + ephemeralPrivKey, err := crypto.GenerateKey() + if err != nil { + return err + } + ephemeralAddr := crypto.PubkeyToAddress(ephemeralPrivKey.PublicKey) + + // apply bundle + profitPreBundle := work.state.GetBalance(b.env.coinbase) + if err := b.wrk.rawCommitTransactions(work, bundle.Txs); err != nil { + return err + } + profitPostBundle := work.state.GetBalance(b.env.coinbase) + + // calc & refund user if bundle has multiple txns and wants refund + if len(bundle.Txs) > 1 && bundle.RefundPercent != nil { + // Note: PoC logic, this could be gamed by not sending any eth to coinbase + refundPrct := *bundle.RefundPercent + if refundPrct == 0 { + // default refund + refundPrct = 10 + } + bundleProfit := new(big.Int).Sub(profitPostBundle, profitPreBundle) + refundAmt := new(big.Int).Div(bundleProfit, big.NewInt(int64(refundPrct))) + // subtract payment txn transfer costs + refundAmt = new(big.Int).Sub(refundAmt, refundTransferCost) + + currNonce := work.state.GetNonce(ephemeralAddr) + // HACK to include payment txn + // multi refund block untested + userTx := bundle.Txs[0] // NOTE : assumes first txn is refund recipient + refundAddr, err := types.Sender(types.LatestSignerForChainID(userTx.ChainId()), userTx) + if err != nil { + return err + } + paymentTx, err := types.SignTx(types.NewTx(&types.LegacyTx{ + Nonce: currNonce, + To: &refundAddr, + Value: refundAmt, + Gas: 28000, + GasPrice: work.header.BaseFee, + }), work.signer, ephemeralPrivKey) + + if err != nil { + return err + } + + // commit payment txn + if err := b.wrk.rawCommitTransactions(work, types.Transactions{paymentTx}); err != nil { + return err + } + } + + return nil +} + +func (b *Builder) FillPending() error { + if err := b.wrk.commitPendingTxs(b.env); err != nil { + return err + } + return nil +} + +func (b *Builder) BuildBlock() (*types.Block, error) { + work := b.env + + // Assume static 28000 gas transfers for both mev-share and proposer payments + refundTransferCost := new(big.Int).Mul(big.NewInt(28000), work.header.BaseFee) + + // create ephemeral addr and private key for payment txn + ephemeralPrivKey, err := crypto.GenerateKey() + if err != nil { + return nil, err + } + ephemeralAddr := crypto.PubkeyToAddress(ephemeralPrivKey.PublicKey) + + profitPost := work.state.GetBalance(b.env.coinbase) + proposerProfit := new(big.Int).Set(profitPost) // = post-pre-transfer_cost + proposerProfit = proposerProfit.Sub(profitPost, b.profitPre) + proposerProfit = proposerProfit.Sub(proposerProfit, refundTransferCost) + + currNonce := work.state.GetNonce(ephemeralAddr) + paymentTx, err := types.SignTx(types.NewTx(&types.LegacyTx{ + Nonce: currNonce, + To: &b.args.FeeRecipient, + Value: proposerProfit, + Gas: 28000, + GasPrice: work.header.BaseFee, + }), work.signer, ephemeralPrivKey) + if err != nil { + return nil, fmt.Errorf("could not sign proposer payment: %w", err) + } + + // commit payment txn + if err := b.wrk.rawCommitTransactions(work, types.Transactions{paymentTx}); err != nil { + return nil, fmt.Errorf("could not sign proposer payment: %w", err) + } + + block, err := b.wrk.engine.FinalizeAndAssemble(b.wrk.chain, work.header, work.state, work.txs, nil, work.receipts, nil) + if err != nil { + return nil, err + } + return block, nil +} + +func receiptToSimResult(receipt *types.Receipt) *types.SimulateTransactionResult { + result := &types.SimulateTransactionResult{ + Success: true, + Logs: []*types.SimulatedLog{}, + } + for _, log := range receipt.Logs { + result.Logs = append(result.Logs, &types.SimulatedLog{ + Addr: log.Address, + Topics: log.Topics, + Data: log.Data, + }) + } + return result +} diff --git a/miner/builder_test.go b/miner/builder_test.go new file mode 100644 index 000000000000..0077f9565607 --- /dev/null +++ b/miner/builder_test.go @@ -0,0 +1,97 @@ +package miner + +import ( + "fmt" + "testing" + + "github.com/ethereum/go-ethereum/consensus/clique" + "github.com/ethereum/go-ethereum/core/rawdb" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/params" + "github.com/stretchr/testify/require" +) + +func TestBuilder_AddTxn_Simple(t *testing.T) { + config, backend := newMockBuilderConfig(t) + + builder, err := NewBuilder(config, &BuilderArgs{}) + require.NoError(t, err) + + tx1 := backend.newRandomTx(true) + + res, err := builder.AddTransaction(tx1) + require.NoError(t, err) + require.True(t, res.Success) + require.Len(t, builder.env.receipts, 1) + + // we cannot add the same transaction again. Note that by design the + // function does not error but returns the SimulateTransactionResult.success = false + res, err = builder.AddTransaction(tx1) + require.NoError(t, err) + require.False(t, res.Success) + require.Len(t, builder.env.receipts, 1) +} + +func TestBuilder_FillTransactions(t *testing.T) { + config, backend := newMockBuilderConfig(t) + + builder, err := NewBuilder(config, &BuilderArgs{}) + require.NoError(t, err) + + tx1 := backend.newRandomTx(true) + errArr := backend.TxPool().Add(types.Transactions{tx1}, false, true) + require.NoError(t, errArr[0]) + + tx2 := backend.newRandomTx(true) + errArr = backend.TxPool().Add(types.Transactions{tx2}, false, true) + require.NoError(t, errArr[0]) + + require.NoError(t, builder.FillPending()) + require.Len(t, builder.env.receipts, 2) + + require.Equal(t, tx1.Hash(), builder.env.receipts[0].TxHash) + require.Equal(t, tx2.Hash(), builder.env.receipts[1].TxHash) +} + +func TestBuilder_Bundle(t *testing.T) { + t.Skip("TODO") +} + +func TestBuilder_BuildBlock(t *testing.T) { + t.Skip("TODO") + + config, backend := newMockBuilderConfig(t) + + builder, err := NewBuilder(config, &BuilderArgs{}) + require.NoError(t, err) + + tx1 := backend.newRandomTx(true) + + _, err = builder.AddTransaction(tx1) + require.NoError(t, err) + + block, err := builder.BuildBlock() + require.NoError(t, err) + fmt.Println(block) +} + +func newMockBuilderConfig(t *testing.T) (*BuilderConfig, *testWorkerBackend) { + var ( + db = rawdb.NewMemoryDatabase() + config = *params.AllCliqueProtocolChanges + ) + config.Clique = ¶ms.CliqueConfig{Period: 1, Epoch: 30000} + engine := clique.New(config.Clique, db) + + w, backend := newTestWorker(t, &config, engine, db, 0) + w.close() + + bConfig := &BuilderConfig{ + ChainConfig: w.chainConfig, + Engine: w.engine, + EthBackend: w.eth, + Chain: w.chain, + GasCeil: 10000000, + } + return bConfig, backend +} diff --git a/suave/builder/builder.go b/suave/builder/builder.go deleted file mode 100644 index 83c695f87acd..000000000000 --- a/suave/builder/builder.go +++ /dev/null @@ -1,275 +0,0 @@ -package builder - -import ( - "fmt" - "math/big" - "sync/atomic" - "time" - - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/consensus" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/state" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/core/vm" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/params" - "github.com/ethereum/go-ethereum/suave/builder/api" -) - -type builder struct { - config *builderConfig - txns []*types.Transaction - receipts []*types.Receipt - state *state.StateDB - gasPool *core.GasPool - gasUsed *uint64 - signer types.Signer - args api.BuildBlockArgs - coinbasePreBalance *big.Int - engine consensus.Engine -} - -type builderConfig struct { - preState *state.StateDB - header *types.Header - config *params.ChainConfig - context core.ChainContext - chainReader consensus.ChainHeaderReader - - // newpayloadTimeout is the maximum timeout allowance for creating payload. - // The default value is 2 seconds but node operator can set it to arbitrary - // large value. A large timeout allowance may cause Geth to fail creating - // a non-empty payload within the specified time and eventually miss the slot - // in case there are some computation expensive transactions in txpool. - newpayloadTimeout time.Duration -} - -func newBuilder(config *builderConfig) *builder { - gp := core.GasPool(config.header.GasLimit) - var gasUsed uint64 - - return &builder{ - config: config, - state: config.preState.Copy(), - gasPool: &gp, - gasUsed: &gasUsed, - signer: types.MakeSigner(config.config, config.header.Number, config.header.Time), - coinbasePreBalance: config.preState.GetBalance(config.header.Coinbase), - } -} - -func (b *builder) takeSnapshot() func() { - indx := len(b.txns) - snap := b.state.Snapshot() - - return func() { - b.txns = b.txns[:indx] - b.receipts = b.receipts[:indx] - b.state.RevertToSnapshot(snap) - } -} - -func (b *builder) AddBundle(bundle api.Bundle) error { - revertFn := b.takeSnapshot() - - // create ephemeral addr and private key for payment txn - ephemeralPrivKey, err := crypto.GenerateKey() - if err != nil { - return err - } - ephemeralAddr := crypto.PubkeyToAddress(ephemeralPrivKey.PublicKey) - - // Assume static 28000 gas transfers for both mev-share and proposer payments - refundTransferCost := new(big.Int).Mul(big.NewInt(28000), b.config.header.BaseFee) - - // apply bundle - profitPreBundle := b.state.GetBalance(b.config.header.Coinbase) - if err := b.AddTransactions(bundle.Txs); err != nil { - revertFn() - return err - } - - profitPostBundle := b.state.GetBalance(b.config.header.Coinbase) - - // calc & refund user if bundle has multiple txns and wants refund - if len(bundle.Txs) > 1 && bundle.RefundPercent != nil { - // Note: PoC logic, this could be gamed by not sending any eth to coinbase - refundPrct := *bundle.RefundPercent - if refundPrct == 0 { - // default refund - refundPrct = 10 - } - bundleProfit := new(big.Int).Sub(profitPostBundle, profitPreBundle) - refundAmt := new(big.Int).Div(bundleProfit, big.NewInt(int64(refundPrct))) - // subtract payment txn transfer costs - refundAmt = new(big.Int).Sub(refundAmt, refundTransferCost) - - currNonce := b.state.GetNonce(ephemeralAddr) - - // HACK to include payment txn - // multi refund block untested - userTx := bundle.Txs[0] // NOTE : assumes first txn is refund recipient - refundAddr, err := types.Sender(types.LatestSignerForChainID(userTx.ChainId()), userTx) - if err != nil { - return err - } - paymentTx, err := types.SignTx(types.NewTx(&types.LegacyTx{ - Nonce: currNonce, - To: &refundAddr, - Value: refundAmt, - Gas: 28000, - GasPrice: b.config.header.BaseFee, - }), b.signer, ephemeralPrivKey) - - if err != nil { - return err - } - - // commit payment txn - if _, err := b.AddTransaction(paymentTx); err != nil { - revertFn() - return err - } - } - - return nil -} - -func (b *builder) AddTransactions(txns types.Transactions) error { - revertFn := b.takeSnapshot() - - for _, txn := range txns { - if _, err := b.AddTransaction(txn); err != nil { - revertFn() - return err - } - } - - return nil -} - -func (b *builder) AddTransaction(txn *types.Transaction) (*types.SimulateTransactionResult, error) { - dummyAuthor := common.Address{} - - vmConfig := vm.Config{ - NoBaseFee: true, - } - - snap := b.state.Snapshot() - - b.state.SetTxContext(txn.Hash(), len(b.txns)) - receipt, err := core.ApplyTransaction(b.config.config, b.config.context, &dummyAuthor, b.gasPool, b.state, b.config.header, txn, b.gasUsed, vmConfig) - if err != nil { - b.state.RevertToSnapshot(snap) - - result := &types.SimulateTransactionResult{ - Success: false, - Error: err.Error(), - } - return result, nil - } - - b.txns = append(b.txns, txn) - b.receipts = append(b.receipts, receipt) - - result := &types.SimulateTransactionResult{ - Success: true, - Logs: []*types.SimulatedLog{}, - } - for _, log := range receipt.Logs { - result.Logs = append(result.Logs, &types.SimulatedLog{ - Addr: log.Address, - Topics: log.Topics, - Data: log.Data, - }) - } - - return result, nil -} - -func (b *builder) commitPendingTxs() error { - interrupt := new(atomic.Int32) - timer := time.AfterFunc(b.config.newpayloadTimeout, func() { - interrupt.Store(commitInterruptTimeout) - }) - defer timer.Stop() - if err := b.fillTransactions(); err != nil { - return err - } - return nil -} - -func (b *builder) fillTransactions() error { - // Split the pending transactions into locals and remotes - // Fill the block with all available pending transactions. - pending := w.eth.TxPool().Pending(true) - localTxs, remoteTxs := make(map[common.Address]types.Transactions), pending - for _, account := range w.eth.TxPool().Locals() { - if txs := remoteTxs[account]; len(txs) > 0 { - delete(remoteTxs, account) - localTxs[account] = txs - } - } - if len(localTxs) > 0 { - txs := types.NewTransactionsByPriceAndNonce(env.signer, localTxs, env.header.BaseFee) - if err := b.commitTransactions(env, txs, interrupt); err != nil { - return err - } - } - if len(remoteTxs) > 0 { - txs := types.NewTransactionsByPriceAndNonce(env.signer, remoteTxs, env.header.BaseFee) - if err := w.commitTransactions(env, txs, interrupt); err != nil { - return err - } - } - return nil -} - -func (b *builder) BuildBlock() error { - if b.args.FillPending { - if err := b.commitPendingTxs(); err != nil { - return err - } - } - - // create ephemeral addr and private key for payment txn - ephemeralPrivKey, err := crypto.GenerateKey() - if err != nil { - return err - } - ephemeralAddr := crypto.PubkeyToAddress(ephemeralPrivKey.PublicKey) - - // Assume static 28000 gas transfers for both mev-share and proposer payments - refundTransferCost := new(big.Int).Mul(big.NewInt(28000), b.config.header.BaseFee) - - profitPost := b.state.GetBalance(b.config.header.Coinbase) - proposerProfit := new(big.Int).Set(profitPost) // = post-pre-transfer_cost - proposerProfit = proposerProfit.Sub(profitPost, b.coinbasePreBalance) - proposerProfit = proposerProfit.Sub(proposerProfit, refundTransferCost) - - currNonce := b.state.GetNonce(ephemeralAddr) - paymentTx, err := types.SignTx(types.NewTx(&types.LegacyTx{ - Nonce: currNonce, - To: &b.args.FeeRecipient, - Value: proposerProfit, - Gas: 28000, - GasPrice: b.config.header.BaseFee, - }), b.signer, ephemeralPrivKey) - if err != nil { - return fmt.Errorf("could not sign proposer payment: %w", err) - } - - // commit payment txn - if _, err := b.AddTransaction(paymentTx); err != nil { - return err - } - - block, err := b.engine.FinalizeAndAssemble(b.config.chainReader, b.config.header, b.state, b.txns, []*types.Header{}, b.receipts, b.args.Withdrawals) - if err != nil { - return err - } - - fmt.Println("-- block --", block) - return nil -} diff --git a/suave/builder/builder_test.go b/suave/builder/builder_test.go deleted file mode 100644 index 0ceae209ae18..000000000000 --- a/suave/builder/builder_test.go +++ /dev/null @@ -1,122 +0,0 @@ -package builder - -import ( - "math/big" - "testing" - - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/consensus" - "github.com/ethereum/go-ethereum/core/types" - "github.com/stretchr/testify/require" -) - -func TestBuilder_AddTxn_Simple(t *testing.T) { - to := common.Address{0x01, 0x10, 0xab} - - mock := newMockBuilder(t) - txn := mock.state.newTransfer(t, to, big.NewInt(1)) - - _, err := mock.builder.AddTransaction(txn) - require.NoError(t, err) - - mock.expect(t, expectedResult{ - txns: []*types.Transaction{ - txn, - }, - balances: map[common.Address]*big.Int{ - to: big.NewInt(1), - }, - }) -} - -func newMockBuilder(t *testing.T) *mockBuilder { - // create a dummy header at 0 - header := &types.Header{ - Number: big.NewInt(0), - GasLimit: 1000000000000, - Time: 1000, - Difficulty: big.NewInt(1), - } - - mState := newMockState(t) - - m := &mockBuilder{ - state: mState, - } - - stateRef, err := mState.stateAt(mState.stateRoot) - require.NoError(t, err) - - config := &builderConfig{ - header: header, - preState: stateRef, - config: mState.chainConfig, - context: m, // m implements ChainContext with panics - } - m.builder = newBuilder(config) - - return m -} - -type mockBuilder struct { - builder *builder - state *mockState -} - -func (m *mockBuilder) Engine() consensus.Engine { - panic("TODO") -} - -func (m *mockBuilder) GetHeader(common.Hash, uint64) *types.Header { - panic("TODO") -} - -type expectedResult struct { - txns []*types.Transaction - balances map[common.Address]*big.Int -} - -func (m *mockBuilder) expect(t *testing.T, res expectedResult) { - // validate txns - if len(res.txns) != len(m.builder.txns) { - t.Fatalf("expected %d txns, got %d", len(res.txns), len(m.builder.txns)) - } - for indx, txn := range res.txns { - if txn.Hash() != m.builder.txns[indx].Hash() { - t.Fatalf("expected txn %d to be %s, got %s", indx, txn.Hash(), m.builder.txns[indx].Hash()) - } - } - - // The receipts must be the same as the txns - if len(res.txns) != len(m.builder.receipts) { - t.Fatalf("expected %d receipts, got %d", len(res.txns), len(m.builder.receipts)) - } - for indx, txn := range res.txns { - if txn.Hash() != m.builder.receipts[indx].TxHash { - t.Fatalf("expected receipt %d to be %s, got %s", indx, txn.Hash(), m.builder.receipts[indx].TxHash) - } - } - - // The gas left in the pool must be the header gas limit minus - // the total gas consumed by all the transactions in the block. - totalGasConsumed := uint64(0) - for _, receipt := range m.builder.receipts { - totalGasConsumed += receipt.GasUsed - } - if m.builder.gasPool.Gas() != m.builder.config.header.GasLimit-totalGasConsumed { - t.Fatalf("expected gas pool to be %d, got %d", m.builder.config.header.GasLimit-totalGasConsumed, m.builder.gasPool.Gas()) - } - - // The 'gasUsed' must match the total gas consumed by all the transactions - if *m.builder.gasUsed != totalGasConsumed { - t.Fatalf("expected gas used to be %d, got %d", totalGasConsumed, m.builder.gasUsed) - } - - // The state must match the expected balances - for addr, expectedBalance := range res.balances { - balance := m.builder.state.GetBalance(addr) - if balance.Cmp(expectedBalance) != 0 { - t.Fatalf("expected balance of %s to be %d, got %d", addr, expectedBalance, balance) - } - } -} diff --git a/suave/builder/session_manager.go b/suave/builder/session_manager.go index 6ed89f288e7c..012f628514c2 100644 --- a/suave/builder/session_manager.go +++ b/suave/builder/session_manager.go @@ -12,6 +12,7 @@ import ( "github.com/ethereum/go-ethereum/core" "github.com/ethereum/go-ethereum/core/state" "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/miner" "github.com/ethereum/go-ethereum/params" "github.com/ethereum/go-ethereum/suave/builder/api" "github.com/google/uuid" @@ -40,7 +41,7 @@ type Config struct { type SessionManager struct { sem chan struct{} - sessions map[string]*builder + sessions map[string]*miner.Builder sessionTimers map[string]*time.Timer sessionsLock sync.RWMutex blockchain blockchain @@ -65,7 +66,7 @@ func NewSessionManager(blockchain blockchain, config *Config) *SessionManager { s := &SessionManager{ sem: sem, - sessions: make(map[string]*builder), + sessions: make(map[string]*miner.Builder), sessionTimers: make(map[string]*time.Timer), blockchain: blockchain, config: config, @@ -84,41 +85,22 @@ func (s *SessionManager) NewSession(ctx context.Context, args *api.BuildBlockArg return "", ctx.Err() } - parent := s.blockchain.CurrentHeader() - chainConfig := s.blockchain.Config() - - header := &types.Header{ - ParentHash: parent.Hash(), - Number: new(big.Int).Add(parent.Number, common.Big1), - GasLimit: core.CalcGasLimit(parent.GasLimit, s.config.GasCeil), - Time: 1000, // TODO: fix this - Coinbase: common.Address{}, // TODO: fix this - Difficulty: big.NewInt(1), + builderCfg := &miner.BuilderConfig{ + ChainConfig: s.blockchain.Config(), + Engine: s.blockchain.Engine(), + // TODO } - // Set baseFee and GasLimit if we are on an EIP-1559 chain - if chainConfig.IsLondon(header.Number) { - header.BaseFee = CalcBaseFee(chainConfig, parent) - if !chainConfig.IsLondon(parent.Number) { - parentGasLimit := parent.GasLimit * chainConfig.ElasticityMultiplier() - header.GasLimit = core.CalcGasLimit(parentGasLimit, s.config.GasCeil) - } + builderArgs := &miner.BuilderArgs{ + ParentHash: args.Parent, } - stateRef, err := s.blockchain.StateAt(parent.Root) + id := uuid.New().String()[:7] + session, err := miner.NewBuilder(builderCfg, builderArgs) if err != nil { return "", err } - - cfg := &builderConfig{ - preState: stateRef, - header: header, - config: s.blockchain.Config(), - context: s.blockchain, - } - - id := uuid.New().String()[:7] - s.sessions[id] = newBuilder(cfg) + s.sessions[id] = session // start session timer s.sessionTimers[id] = time.AfterFunc(s.config.SessionIdleTimeout, func() { @@ -140,7 +122,7 @@ func (s *SessionManager) NewSession(ctx context.Context, args *api.BuildBlockArg return id, nil } -func (s *SessionManager) getSession(sessionId string) (*builder, error) { +func (s *SessionManager) getSession(sessionId string) (*miner.Builder, error) { s.sessionsLock.RLock() defer s.sessionsLock.RUnlock() @@ -168,7 +150,7 @@ func (s *SessionManager) AddBundle(sessionId string, bundle api.Bundle) error { if err != nil { return err } - return builder.AddBundle(bundle) + return builder.AddBundle(nil) // TODO: Use api.Bundle type } func (s *SessionManager) BuildBlock(sessionId string) error { @@ -176,7 +158,8 @@ func (s *SessionManager) BuildBlock(sessionId string) error { if err != nil { return err } - return builder.BuildBlock() + _, err = builder.BuildBlock() // TODO: Return more info + return err } // CalcBaseFee calculates the basefee of the header. From 977f127c330362a6942effd07160aa0350f071d1 Mon Sep 17 00:00:00 2001 From: Ferran Borreguero Date: Thu, 15 Feb 2024 11:11:22 +0000 Subject: [PATCH 05/12] Address feedback --- miner/builder_test.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/miner/builder_test.go b/miner/builder_test.go index 0077f9565607..9c5aaecc4eb5 100644 --- a/miner/builder_test.go +++ b/miner/builder_test.go @@ -12,6 +12,7 @@ import ( ) func TestBuilder_AddTxn_Simple(t *testing.T) { + t.Parallel() config, backend := newMockBuilderConfig(t) builder, err := NewBuilder(config, &BuilderArgs{}) @@ -33,6 +34,7 @@ func TestBuilder_AddTxn_Simple(t *testing.T) { } func TestBuilder_FillTransactions(t *testing.T) { + t.Parallel() config, backend := newMockBuilderConfig(t) builder, err := NewBuilder(config, &BuilderArgs{}) @@ -53,11 +55,8 @@ func TestBuilder_FillTransactions(t *testing.T) { require.Equal(t, tx2.Hash(), builder.env.receipts[1].TxHash) } -func TestBuilder_Bundle(t *testing.T) { - t.Skip("TODO") -} - func TestBuilder_BuildBlock(t *testing.T) { + t.Parallel() t.Skip("TODO") config, backend := newMockBuilderConfig(t) From f338f50c307c96c755e220cac72ef2014b6a1bcc Mon Sep 17 00:00:00 2001 From: Ferran Borreguero Date: Thu, 15 Feb 2024 11:15:04 +0000 Subject: [PATCH 06/12] Fix tests --- miner/builder.go | 108 ------------------------------- miner/builder_test.go | 5 +- suave/builder/api/api.go | 1 - suave/builder/api/api_client.go | 4 -- suave/builder/api/api_server.go | 9 --- suave/builder/session_manager.go | 8 --- 6 files changed, 2 insertions(+), 133 deletions(-) diff --git a/miner/builder.go b/miner/builder.go index 3aea42a42fdb..26be2d98fe47 100644 --- a/miner/builder.go +++ b/miner/builder.go @@ -1,14 +1,12 @@ package miner import ( - "fmt" "math/big" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/consensus" "github.com/ethereum/go-ethereum/core" "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/params" ) @@ -30,8 +28,6 @@ type Builder struct { env *environment wrk *worker args *BuilderArgs - - profitPre *big.Int } func NewBuilder(config *BuilderConfig, args *BuilderArgs) (*Builder, error) { @@ -62,7 +58,6 @@ func NewBuilder(config *BuilderConfig, args *BuilderArgs) (*Builder, error) { env.gasPool = new(core.GasPool).AddGas(env.header.GasLimit) b.env = env - b.profitPre = env.state.GetBalance(env.coinbase) return b, nil } @@ -85,77 +80,6 @@ func (b *Builder) AddTransaction(txn *types.Transaction) (*types.SimulateTransac return receiptToSimResult(&types.Receipt{Logs: logs}), nil } -func (b *Builder) AddBundles(bundles []*SBundle) error { - for _, bundle := range bundles { - if err := b.AddBundle(bundle); err != nil { - return err - } - } - return nil -} - -func (b *Builder) AddBundle(bundle *SBundle) error { - work := b.env - - // Assume static 28000 gas transfers for both mev-share and proposer payments - refundTransferCost := new(big.Int).Mul(big.NewInt(28000), work.header.BaseFee) - - // create ephemeral addr and private key for payment txn - ephemeralPrivKey, err := crypto.GenerateKey() - if err != nil { - return err - } - ephemeralAddr := crypto.PubkeyToAddress(ephemeralPrivKey.PublicKey) - - // apply bundle - profitPreBundle := work.state.GetBalance(b.env.coinbase) - if err := b.wrk.rawCommitTransactions(work, bundle.Txs); err != nil { - return err - } - profitPostBundle := work.state.GetBalance(b.env.coinbase) - - // calc & refund user if bundle has multiple txns and wants refund - if len(bundle.Txs) > 1 && bundle.RefundPercent != nil { - // Note: PoC logic, this could be gamed by not sending any eth to coinbase - refundPrct := *bundle.RefundPercent - if refundPrct == 0 { - // default refund - refundPrct = 10 - } - bundleProfit := new(big.Int).Sub(profitPostBundle, profitPreBundle) - refundAmt := new(big.Int).Div(bundleProfit, big.NewInt(int64(refundPrct))) - // subtract payment txn transfer costs - refundAmt = new(big.Int).Sub(refundAmt, refundTransferCost) - - currNonce := work.state.GetNonce(ephemeralAddr) - // HACK to include payment txn - // multi refund block untested - userTx := bundle.Txs[0] // NOTE : assumes first txn is refund recipient - refundAddr, err := types.Sender(types.LatestSignerForChainID(userTx.ChainId()), userTx) - if err != nil { - return err - } - paymentTx, err := types.SignTx(types.NewTx(&types.LegacyTx{ - Nonce: currNonce, - To: &refundAddr, - Value: refundAmt, - Gas: 28000, - GasPrice: work.header.BaseFee, - }), work.signer, ephemeralPrivKey) - - if err != nil { - return err - } - - // commit payment txn - if err := b.wrk.rawCommitTransactions(work, types.Transactions{paymentTx}); err != nil { - return err - } - } - - return nil -} - func (b *Builder) FillPending() error { if err := b.wrk.commitPendingTxs(b.env); err != nil { return err @@ -166,38 +90,6 @@ func (b *Builder) FillPending() error { func (b *Builder) BuildBlock() (*types.Block, error) { work := b.env - // Assume static 28000 gas transfers for both mev-share and proposer payments - refundTransferCost := new(big.Int).Mul(big.NewInt(28000), work.header.BaseFee) - - // create ephemeral addr and private key for payment txn - ephemeralPrivKey, err := crypto.GenerateKey() - if err != nil { - return nil, err - } - ephemeralAddr := crypto.PubkeyToAddress(ephemeralPrivKey.PublicKey) - - profitPost := work.state.GetBalance(b.env.coinbase) - proposerProfit := new(big.Int).Set(profitPost) // = post-pre-transfer_cost - proposerProfit = proposerProfit.Sub(profitPost, b.profitPre) - proposerProfit = proposerProfit.Sub(proposerProfit, refundTransferCost) - - currNonce := work.state.GetNonce(ephemeralAddr) - paymentTx, err := types.SignTx(types.NewTx(&types.LegacyTx{ - Nonce: currNonce, - To: &b.args.FeeRecipient, - Value: proposerProfit, - Gas: 28000, - GasPrice: work.header.BaseFee, - }), work.signer, ephemeralPrivKey) - if err != nil { - return nil, fmt.Errorf("could not sign proposer payment: %w", err) - } - - // commit payment txn - if err := b.wrk.rawCommitTransactions(work, types.Transactions{paymentTx}); err != nil { - return nil, fmt.Errorf("could not sign proposer payment: %w", err) - } - block, err := b.wrk.engine.FinalizeAndAssemble(b.wrk.chain, work.header, work.state, work.txs, nil, work.receipts, nil) if err != nil { return nil, err diff --git a/miner/builder_test.go b/miner/builder_test.go index 9c5aaecc4eb5..6ef847675d7c 100644 --- a/miner/builder_test.go +++ b/miner/builder_test.go @@ -1,7 +1,6 @@ package miner import ( - "fmt" "testing" "github.com/ethereum/go-ethereum/consensus/clique" @@ -57,7 +56,6 @@ func TestBuilder_FillTransactions(t *testing.T) { func TestBuilder_BuildBlock(t *testing.T) { t.Parallel() - t.Skip("TODO") config, backend := newMockBuilderConfig(t) @@ -71,7 +69,8 @@ func TestBuilder_BuildBlock(t *testing.T) { block, err := builder.BuildBlock() require.NoError(t, err) - fmt.Println(block) + require.NotNil(t, block) + require.Len(t, block.Transactions(), 1) } func newMockBuilderConfig(t *testing.T) (*BuilderConfig, *testWorkerBackend) { diff --git a/suave/builder/api/api.go b/suave/builder/api/api.go index 8e08280c2bd1..846e079b7ce2 100644 --- a/suave/builder/api/api.go +++ b/suave/builder/api/api.go @@ -32,6 +32,5 @@ type BuildBlockArgs struct { type API interface { NewSession(ctx context.Context, args *BuildBlockArgs) (string, error) AddTransaction(ctx context.Context, sessionId string, tx *types.Transaction) (*types.SimulateTransactionResult, error) - AddBundle(ctx context.Context, sessionId string, bundle Bundle) error BuildBlock(ctx context.Context, sessionId string) error } diff --git a/suave/builder/api/api_client.go b/suave/builder/api/api_client.go index d781c642d56e..f0ac7165c739 100644 --- a/suave/builder/api/api_client.go +++ b/suave/builder/api/api_client.go @@ -41,10 +41,6 @@ func (a *APIClient) AddTransaction(ctx context.Context, sessionId string, tx *ty return receipt, err } -func (a *APIClient) AddBundle(ctx context.Context, sessionId string, bundle Bundle) error { - return a.rpc.CallContext(ctx, nil, "suavex_addBundle", sessionId, bundle) -} - func (a *APIClient) BuildBlock(ctx context.Context, sessionId string) error { return a.rpc.CallContext(ctx, nil, "suavex_buildBlock", sessionId) } diff --git a/suave/builder/api/api_server.go b/suave/builder/api/api_server.go index f6eeb80127d5..6ce40a61b6b4 100644 --- a/suave/builder/api/api_server.go +++ b/suave/builder/api/api_server.go @@ -10,7 +10,6 @@ import ( type SessionManager interface { NewSession(context.Context, *BuildBlockArgs) (string, error) AddTransaction(sessionId string, tx *types.Transaction) (*types.SimulateTransactionResult, error) - AddBundle(sessionId string, bundle Bundle) error BuildBlock(sessionId string) error } @@ -33,10 +32,6 @@ func (s *Server) AddTransaction(ctx context.Context, sessionId string, tx *types return s.sessionMngr.AddTransaction(sessionId, tx) } -func (s *Server) AddBundle(ctx context.Context, sessionId string, bundle Bundle) error { - return s.sessionMngr.AddBundle(sessionId, bundle) -} - func (s *Server) BuildBlock(ctx context.Context, sessionId string) error { return s.sessionMngr.BuildBlock(sessionId) } @@ -52,10 +47,6 @@ func (s *MockServer) AddTransaction(ctx context.Context, sessionId string, tx *t return &types.SimulateTransactionResult{}, nil } -func (s *MockServer) AddBundle(ctx context.Context, sessionId string, bundle Bundle) error { - return nil -} - func (s *MockServer) BuildBlock(ctx context.Context) error { return nil } diff --git a/suave/builder/session_manager.go b/suave/builder/session_manager.go index 012f628514c2..d2c03f55969a 100644 --- a/suave/builder/session_manager.go +++ b/suave/builder/session_manager.go @@ -145,14 +145,6 @@ func (s *SessionManager) AddTransaction(sessionId string, tx *types.Transaction) return builder.AddTransaction(tx) } -func (s *SessionManager) AddBundle(sessionId string, bundle api.Bundle) error { - builder, err := s.getSession(sessionId) - if err != nil { - return err - } - return builder.AddBundle(nil) // TODO: Use api.Bundle type -} - func (s *SessionManager) BuildBlock(sessionId string) error { builder, err := s.getSession(sessionId) if err != nil { From 1a5fe3fec1eefa4dfd3ae67ba7ebd65b4a4b2785 Mon Sep 17 00:00:00 2001 From: Ferran Borreguero Date: Thu, 15 Feb 2024 11:50:05 +0000 Subject: [PATCH 07/12] Add Bid method --- go.mod | 44 +++-- go.sum | 494 +++++++++++------------------------------------ miner/builder.go | 126 +++++++++++- 3 files changed, 261 insertions(+), 403 deletions(-) diff --git a/go.mod b/go.mod index b4d077fc47f2..7584321c21e1 100644 --- a/go.mod +++ b/go.mod @@ -6,6 +6,8 @@ require ( github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.2.0 github.com/Microsoft/go-winio v0.6.1 github.com/VictoriaMetrics/fastcache v1.12.1 + github.com/attestantio/go-builder-client v0.4.3 + github.com/attestantio/go-eth2-client v0.19.10 github.com/aws/aws-sdk-go-v2 v1.21.2 github.com/aws/aws-sdk-go-v2/config v1.18.45 github.com/aws/aws-sdk-go-v2/credentials v1.13.43 @@ -21,9 +23,10 @@ require ( github.com/deckarep/golang-set/v2 v2.1.0 github.com/dop251/goja v0.0.0-20230806174421-c933cf95e127 github.com/ethereum/c-kzg-4844 v0.4.0 - github.com/fatih/color v1.13.0 + github.com/fatih/color v1.16.0 github.com/fjl/gencodec v0.0.0-20230517082657-f9840df7b83e github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5 + github.com/flashbots/go-boost-utils v1.8.0 github.com/fsnotify/fsnotify v1.6.0 github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff github.com/gballet/go-verkle v0.1.1-0.20231031103413-a67434b50f46 @@ -48,7 +51,7 @@ require ( github.com/karalabe/usb v0.0.2 github.com/kylelemons/godebug v1.1.0 github.com/mattn/go-colorable v0.1.13 - github.com/mattn/go-isatty v0.0.17 + github.com/mattn/go-isatty v0.0.20 github.com/naoina/toml v0.1.2-0.20170918210437-9fafd6967416 github.com/olekukonko/tablewriter v0.0.5 github.com/peterh/liner v1.1.1-0.20190123174540-a2c9a5303de7 @@ -62,10 +65,10 @@ require ( github.com/tyler-smith/go-bip39 v1.1.0 github.com/urfave/cli/v2 v2.25.7 go.uber.org/automaxprocs v1.5.2 - golang.org/x/crypto v0.17.0 + golang.org/x/crypto v0.18.0 golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa golang.org/x/sync v0.5.0 - golang.org/x/sys v0.15.0 + golang.org/x/sys v0.16.0 golang.org/x/text v0.14.0 golang.org/x/time v0.3.0 golang.org/x/tools v0.15.0 @@ -76,7 +79,7 @@ require ( require ( github.com/Azure/azure-sdk-for-go/sdk/azcore v1.7.0 // indirect github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0 // indirect - github.com/DataDog/zstd v1.4.5 // indirect + github.com/DataDog/zstd v1.5.2 // indirect github.com/StackExchange/wmi v1.2.1 // indirect github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.13 // indirect github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.43 // indirect @@ -90,22 +93,23 @@ require ( github.com/beorn7/perks v1.0.1 // indirect github.com/bits-and-blooms/bitset v1.10.0 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect - github.com/cockroachdb/errors v1.8.1 // indirect - github.com/cockroachdb/logtags v0.0.0-20190617123548-eb05cc24525f // indirect - github.com/cockroachdb/redact v1.0.8 // indirect - github.com/cockroachdb/sentry-go v0.6.1-cockroachdb.2 // indirect + github.com/cockroachdb/errors v1.9.1 // indirect + github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect + github.com/cockroachdb/redact v1.1.3 // indirect github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect github.com/consensys/bavard v0.1.13 // indirect github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 // indirect github.com/deepmap/oapi-codegen v1.6.0 // indirect github.com/dlclark/regexp2 v1.7.0 // indirect + github.com/ferranbt/fastssz v0.1.3 // indirect github.com/garslo/gogen v0.0.0-20170306192744-1d203ffc1f61 // indirect + github.com/getsentry/sentry-go v0.18.0 // indirect github.com/go-ole/go-ole v1.2.5 // indirect github.com/go-sourcemap/sourcemap v2.1.3+incompatible // indirect github.com/goccy/go-json v0.10.2 // indirect + github.com/goccy/go-yaml v1.11.2 // indirect github.com/gogo/protobuf v1.3.2 // indirect - github.com/google/go-cmp v0.5.9 // indirect github.com/google/go-querystring v1.1.0 // indirect github.com/google/pprof v0.0.0-20230207041349-798e818bf904 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect @@ -114,30 +118,34 @@ require ( github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/kilic/bls12-381 v0.1.0 // indirect github.com/klauspost/compress v1.15.15 // indirect + github.com/klauspost/cpuid/v2 v2.2.6 // indirect github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect github.com/mattn/go-runewidth v0.0.13 // indirect - github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect - github.com/mitchellh/mapstructure v1.4.1 // indirect + github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect + github.com/minio/sha256-simd v1.0.1 // indirect + github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/mitchellh/pointerstructure v1.2.0 // indirect github.com/mmcloughlin/addchain v0.4.0 // indirect github.com/naoina/go-stringutil v0.1.0 // indirect github.com/opentracing/opentracing-go v1.1.0 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/client_golang v1.12.0 // indirect - github.com/prometheus/client_model v0.2.1-0.20210607210712-147c58e9608a // indirect - github.com/prometheus/common v0.32.1 // indirect - github.com/prometheus/procfs v0.7.3 // indirect + github.com/prometheus/client_golang v1.16.0 // indirect + github.com/prometheus/client_model v0.3.0 // indirect + github.com/prometheus/common v0.42.0 // indirect + github.com/prometheus/procfs v0.10.1 // indirect + github.com/prysmaticlabs/go-bitfield v0.0.0-20210809151128-385d8c5e3fb7 // indirect github.com/rivo/uniseg v0.2.0 // indirect - github.com/rogpeppe/go-internal v1.9.0 // indirect + github.com/rogpeppe/go-internal v1.11.0 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/tklauser/go-sysconf v0.3.12 // indirect github.com/tklauser/numcpus v0.6.1 // indirect github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect golang.org/x/mod v0.14.0 // indirect golang.org/x/net v0.18.0 // indirect - google.golang.org/protobuf v1.27.1 // indirect + golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 // indirect + google.golang.org/protobuf v1.30.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect rsc.io/tmplfunc v0.0.3 // indirect ) diff --git a/go.sum b/go.sum index bab51b1345a7..03344c9fbf79 100644 --- a/go.sum +++ b/go.sum @@ -1,36 +1,4 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= -cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= -cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= -cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= -cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= -cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= -cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= -cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= -cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= -cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= -cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= -cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= -cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= -cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= -cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= -cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= -cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= -cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= -cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= -cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= -cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= -cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= -cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= -cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= -cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= -cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= -cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= -cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= -cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= -cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= -dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/AndreasBriese/bbloom v0.0.0-20190306092124-e2d15f34fcf9/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.7.0 h1:8q4SaHjFsClSvuVne0ID/5Ka8u3fcIHyqkLjcFpNRHQ= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.7.0/go.mod h1:bjGvMhVMb+EEm3VRNQawDMUyMMjo+S5ewNjflkep/0Q= @@ -43,13 +11,11 @@ github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.2.0/go.mod h1:+6KLcKIVgx github.com/AzureAD/microsoft-authentication-library-for-go v1.0.0 h1:OBhqkivkhkMqLPymWEppkm7vgPQY2XsHoEkaMQ0AdZY= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/toml v1.3.2 h1:o7IhLm0Msx3BaB+n3Ag7L8EVlByGnpq14C4YWiu/gL8= -github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/CloudyKit/fastprinter v0.0.0-20170127035650-74b38d55f37a/go.mod h1:EFZQ978U7x8IRnstaskI3IysnWY5Ao3QgZUKOXlsAdw= -github.com/CloudyKit/jet v2.1.3-0.20180809161101-62edd43e4f88+incompatible/go.mod h1:HPYO+50pSWkPoj9Q/eq0aRGByCL6ScRlUmiEX5Zgm+w= -github.com/DataDog/zstd v1.4.5 h1:EndNeuB0l9syBZhut0wns3gV1hL8zX8LIu6ZiVHWLIQ= -github.com/DataDog/zstd v1.4.5/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t7BBo= +github.com/CloudyKit/fastprinter v0.0.0-20200109182630-33d98a066a53/go.mod h1:+3IMCy2vIlbG1XG/0ggNQv0SvxCAIpPM5b1nCz56Xno= +github.com/CloudyKit/jet/v3 v3.0.0/go.mod h1:HKQPgSJmdK8hdoAbKUUWajkHyHo4RaU5rMdUywE7VMo= +github.com/DataDog/zstd v1.5.2 h1:vUG4lAyuPCXO0TLbXvPv7EB7cNK1QV/luu55UHLrrn8= +github.com/DataDog/zstd v1.5.2/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= github.com/Joker/hpp v1.0.0/go.mod h1:8x5n+M1Hp5hC0g8okX3sR3vFQwynaX/UgSOM9MeBKzY= -github.com/Joker/jade v1.0.1-0.20190614124447-d475f43051e7/go.mod h1:6E6s8o2AE4KhCrqr6GRJjdC/gNfTdxkIXvuGZZda2VM= github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= github.com/Shopify/goreferrer v0.0.0-20181106222321-ec9c9a553398/go.mod h1:a1uqRtAwp2Xwc6WNPJEufxJ7fx3npB4UV/JOLmbu5I0= @@ -58,14 +24,13 @@ github.com/StackExchange/wmi v1.2.1/go.mod h1:rcmrprowKIVzvc+NUiLncP2uuArMWLCbu9 github.com/VictoriaMetrics/fastcache v1.12.1 h1:i0mICQuojGDL3KblA7wUNlY5lOK6a4bwt3uRKnkZU40= github.com/VictoriaMetrics/fastcache v1.12.1/go.mod h1:tX04vaqcNoQeGLD+ra5pU5sWkuxnzWhEzLwhP9w653o= github.com/ajg/form v1.5.1/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY= -github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= -github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= -github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156 h1:eMwmnE/GDgah4HI848JfFxHt+iPb26b4zyfspmqY0/8= github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156/go.mod h1:Cb/ax3seSYIx7SuZdm2G2xzfwmv3TPSk2ucNfQESPXM= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= +github.com/attestantio/go-builder-client v0.4.3 h1:K1m/PTqY01mfAPc0h+9iR2OivY3LOevbxHxEfvI4M8M= +github.com/attestantio/go-builder-client v0.4.3/go.mod h1:yeJANU1O5P3b/4+iwShz9JMcgUnZABCh5RJBtZnLiDo= +github.com/attestantio/go-eth2-client v0.19.10 h1:NLs9mcBvZpBTZ3du7Ey2NHQoj8d3UePY7pFBXX6C6qs= +github.com/attestantio/go-eth2-client v0.19.10/go.mod h1:TTz7YF6w4z6ahvxKiHuGPn6DbQn7gH6HPuWm/DEQeGE= github.com/aws/aws-sdk-go-v2 v1.21.2 h1:+LXZ0sgo8quN9UOKXXzAWRT3FWd4NxeXWOZom9pE7GA= github.com/aws/aws-sdk-go-v2 v1.21.2/go.mod h1:ErQhvNuEMhJjweavOYhxVkn2RUx7kQXVATHrjKtxIpM= github.com/aws/aws-sdk-go-v2/config v1.18.45 h1:Aka9bI7n8ysuwPeFdm77nfbyHCAKQ3z9ghB3S/38zes= @@ -93,8 +58,6 @@ github.com/aws/aws-sdk-go-v2/service/sts v1.23.2/go.mod h1:Eows6e1uQEsc4ZaHANmsP github.com/aws/smithy-go v1.15.0 h1:PS/durmlzvAFpQHDs4wi4sNNP9ExsqZh6IlfdHXgKK8= github.com/aws/smithy-go v1.15.0/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA= github.com/aymerick/raymond v2.0.3-0.20180322193309-b565731e1464+incompatible/go.mod h1:osfaiScAUVup+UC9Nfq76eWqDhXlp+4UYaA8uhTBO6g= -github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= -github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bits-and-blooms/bitset v1.10.0 h1:ePXTeiPEazB5+opbv5fr8umg2R/1NlzgDsyepwsSr88= @@ -105,33 +68,26 @@ github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 h1:q0rUy8C/TYNBQS1+CGKw68tLOF github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/cp v0.1.0 h1:SE+dxFebS7Iik5LK0tsi1k9ZCxEaFX4AjQmoyA+1dJk= github.com/cespare/cp v0.1.0/go.mod h1:SOGHArjBr4JWaSDEVpWpo/hNg6RoKrls6Oh40hiwW+s= -github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/logex v1.2.0/go.mod h1:9+9sk7u7pGNWYMkh0hdiL++6OeibzJccyQU4p4MedaY= -github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/readline v1.5.0/go.mod h1:x22KAscuvRqlLoK9CsoYsmxoXZMMFVyOl86cAH8qUic= -github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/chzyer/test v0.0.0-20210722231415-061457976a23/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cloudflare/cloudflare-go v0.79.0 h1:ErwCYDjFCYppDJlDJ/5WhsSmzegAUe2+K9qgFyQDg3M= github.com/cloudflare/cloudflare-go v0.79.0/go.mod h1:gkHQf9xEubaQPEuerBuoinR9P8bf8a05Lq0X6WKy1Oc= -github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= -github.com/cockroachdb/datadriven v1.0.0/go.mod h1:5Ib8Meh+jk1RlHIXej6Pzevx/NLlNvQB9pmSBZErGA4= +github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/cockroachdb/datadriven v1.0.2/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f h1:otljaYPt5hWxV3MUfO5dFPFiOXg9CyG5/kCfayTqsJ4= -github.com/cockroachdb/errors v1.6.1/go.mod h1:tm6FTP5G81vwJ5lC0SizQo374JNCOPrHyXGitRJoDqM= -github.com/cockroachdb/errors v1.8.1 h1:A5+txlVZfOqFBDa4mGz2bUWSp0aHElvHX2bKkdbQu+Y= -github.com/cockroachdb/errors v1.8.1/go.mod h1:qGwQn6JmZ+oMjuLwjWzUNqblqk0xl4CVV3SQbGwK7Ac= -github.com/cockroachdb/logtags v0.0.0-20190617123548-eb05cc24525f h1:o/kfcElHqOiXqcou5a3rIlMc7oJbMQkeLk0VQJ7zgqY= -github.com/cockroachdb/logtags v0.0.0-20190617123548-eb05cc24525f/go.mod h1:i/u985jwjWRlyHXQbwatDASoW0RMlZ/3i9yJHE2xLkI= +github.com/cockroachdb/errors v1.9.1 h1:yFVvsI0VxmRShfawbt/laCIDy/mtTqqnvoNgiy5bEV8= +github.com/cockroachdb/errors v1.9.1/go.mod h1:2sxOtL2WIc096WSZqZ5h8fa17rdDq9HZOZLBCor4mBk= +github.com/cockroachdb/logtags v0.0.0-20211118104740-dabe8e521a4f/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= +github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZeQy818SGhaone5OnYfxFR/+AzdY3sf5aE= +github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= github.com/cockroachdb/pebble v0.0.0-20230928194634-aa077af62593 h1:aPEJyR4rPBvDmeyi+l/FS/VtA00IWvjeFvjen1m1l1A= github.com/cockroachdb/pebble v0.0.0-20230928194634-aa077af62593/go.mod h1:6hk1eMY/u5t+Cf18q5lFMUA1Rc+Sm5I6Ra1QuPyxXCo= -github.com/cockroachdb/redact v1.0.8 h1:8QG/764wK+vmEYoOlfobpe12EQcS81ukx/a4hdVMxNw= -github.com/cockroachdb/redact v1.0.8/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= -github.com/cockroachdb/sentry-go v0.6.1-cockroachdb.2 h1:IKgmqgMQlVJIZj19CdocBeSfSaiCbEBZGKODaixqtHM= -github.com/cockroachdb/sentry-go v0.6.1-cockroachdb.2/go.mod h1:8BT+cPK6xvFOcRlk0R8eg+OTkcqI6baNH4xAkpiYVvQ= +github.com/cockroachdb/redact v1.1.3 h1:AKZds10rFSIj7qADf0g46UixK8NNLwWTNdCIGS5wfSQ= +github.com/cockroachdb/redact v1.1.3/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codegangsta/inject v0.0.0-20150114235600-33e0aa1cb7c0/go.mod h1:4Zcjuz89kmFXt9morQgcfYZAYZ5n8WHjt81YYWIwtTM= @@ -178,20 +134,23 @@ github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25Kn github.com/eknkc/amber v0.0.0-20171010120322-cdade1c07385/go.mod h1:0vRUJqYpeSZifjYj7uP3BG/gKcuzL9xWVV/Y+cK33KM= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/etcd-io/bbolt v1.3.3/go.mod h1:ZF2nL25h33cCyBtcyWeZ2/I3HQOfTP+0PIEvHjkjCrw= github.com/ethereum/c-kzg-4844 v0.4.0 h1:3MS1s4JtA868KpJxroZoepdV0ZKBp3u/O5HcZ7R3nlY= github.com/ethereum/c-kzg-4844 v0.4.0/go.mod h1:VewdlzQmpT5QSrVhbBuGoCdFJkpaJlO1aQputP83wc0= github.com/fasthttp-contrib/websocket v0.0.0-20160511215533-1f3b11f56072/go.mod h1:duJ4Jxv5lDcvg4QuQr0oowTf7dz4/CR8NtyCooz9HL8= -github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w= -github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= +github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM= +github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE= github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= +github.com/ferranbt/fastssz v0.1.3 h1:ZI+z3JH05h4kgmFXdHuR1aWYsgrg7o+Fw7/NCzM16Mo= +github.com/ferranbt/fastssz v0.1.3/go.mod h1:0Y9TEd/9XuFlh7mskMPfXiI2Dkw4Ddg9EyXt1W7MRvE= github.com/fjl/gencodec v0.0.0-20230517082657-f9840df7b83e h1:bBLctRc7kr01YGvaDfgLbTwjFNW5jdp5y5rj8XXBHfY= github.com/fjl/gencodec v0.0.0-20230517082657-f9840df7b83e/go.mod h1:AzA8Lj6YtixmJWL+wkKoBGsLWy9gFrAzi4g+5bCKwpY= github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5 h1:FtmdgXiUlNeRsoNMFlKLDt+S+6hbjVMEW6RGQ7aUf7c= github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0= -github.com/flosch/pongo2 v0.0.0-20190707114632-bbf5a6c351f4/go.mod h1:T9YF2M40nIgbVgp3rreNmTged+9HrbNTIQf1PsaIiTA= +github.com/flashbots/go-boost-utils v1.8.0 h1:z3K1hw+Fbl9AGMNQKnK7Bvf0M/rKgjfruAEvra+Z8Mg= +github.com/flashbots/go-boost-utils v1.8.0/go.mod h1:Ry1Rw8Lx5v1rpAR0+IvR4sV10jYAeQaGVM3vRD8mYdM= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= @@ -204,62 +163,49 @@ github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff/go.mod h1:x github.com/gballet/go-verkle v0.1.1-0.20231031103413-a67434b50f46 h1:BAIP2GihuqhwdILrV+7GJel5lyPV3u1+PgzrWLc0TkE= github.com/gballet/go-verkle v0.1.1-0.20231031103413-a67434b50f46/go.mod h1:QNpY22eby74jVhqH4WhDLDwxc/vqsern6pW+u2kbkpc= github.com/getkin/kin-openapi v0.53.0/go.mod h1:7Yn5whZr5kJi6t+kShccXS8ae1APpYTW6yheSwk8Yi4= +github.com/getsentry/sentry-go v0.12.0/go.mod h1:NSap0JBYWzHND8oMbyi0+XZhUalc1TBdRL1M71JZW2c= +github.com/getsentry/sentry-go v0.18.0 h1:MtBW5H9QgdcJabtZcuJG80BMOwaBpkRDZkxRkNC1sN0= +github.com/getsentry/sentry-go v0.18.0/go.mod h1:Kgon4Mby+FJ7ZWHFUAZgVaIa8sxHtnRJRLTXZr51aKQ= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gin-contrib/sse v0.0.0-20190301062529-5545eab6dad3/go.mod h1:VJ0WA2NBN22VlZ2dKZQPAPnyWw5XTlK1KymzLKsr59s= github.com/gin-gonic/gin v1.4.0/go.mod h1:OW2EZn3DO8Ln9oIKOvM++LBO+5UPHJJDH72/q/3rZdM= github.com/go-check/check v0.0.0-20180628173108-788fd7840127/go.mod h1:9ES+weclKsC9YodN5RgxqK/VD9HM9JsCSh7rNhMZE98= github.com/go-chi/chi/v5 v5.0.0/go.mod h1:BBug9lr0cqtdAhsu6R4AAdvufI0/XBzAQSsUqJpoZOs= -github.com/go-errors/errors v1.0.1 h1:LUHzmkK3GUKUrL/1gfBUxAHzcev3apQlezX/+O7ma6w= github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q= -github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= -github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= -github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= -github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= -github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= +github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA= github.com/go-martini/martini v0.0.0-20170121215854-22fa46961aab/go.mod h1:/P9AEU963A2AYjv4d1V5eVL1CQbEJq6aCNHDDjibzu8= github.com/go-ole/go-ole v1.2.5 h1:t4MGB5xEDZvXI+0rMjjsfBsD7yAgp/s9ZDkL1JndXwY= github.com/go-ole/go-ole v1.2.5/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= +github.com/go-playground/locales v0.14.0 h1:u50s323jtVGugKlcYeyzC0etD1HifMjqmJqb8WugfUU= +github.com/go-playground/universal-translator v0.18.0 h1:82dyy6p4OuJq4/CByFNOn/jYrnRPArHwAcmLoJZxyho= +github.com/go-playground/validator/v10 v10.11.1 h1:prmOlTVv+YjZjmRmNSF3VmspqJIxJWXmqUsHwfTRRkQ= github.com/go-sourcemap/sourcemap v2.1.3+incompatible h1:W1iEw64niKVGogNgBN3ePyLFfuisuzeidWPMPWmECqU= github.com/go-sourcemap/sourcemap v2.1.3+incompatible/go.mod h1:F8jJfvm2KbVjc5NqelyYJmf/v5J0dwNLS2mL4sNA1Jg= -github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo= github.com/gobwas/pool v0.2.0/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM= github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU= github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= +github.com/goccy/go-yaml v1.11.2 h1:joq77SxuyIs9zzxEjgyLBugMQ9NEgTWxXfz2wVqwAaQ= +github.com/goccy/go-yaml v1.11.2/go.mod h1:wKnAMd44+9JAAnGQpWVEgBzGt3YuTaQ4uXoHvE4m7WU= github.com/gofrs/flock v0.8.1 h1:+gYjHKf32LDeiEEFhQaotPbLuUXjY5ZqxKgXy7n59aw= github.com/gofrs/flock v0.8.1/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU= github.com/gogo/googleapis v0.0.0-20180223154316-0cd9801be74a/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= -github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/gogo/googleapis v1.4.1/go.mod h1:2lpHqI5OcWCtVElxXnPt+s8oJvMpySlOyM6xDCrzib4= github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= -github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/gogo/status v1.1.0/go.mod h1:BFv9nrluPLmrS0EmGVvLaPNmRosr9KapBYd5/hpY1WM= +github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg= github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= -github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= @@ -268,7 +214,6 @@ github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:W github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= @@ -278,47 +223,30 @@ github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb h1:PBC98N2aIaM3XXi github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golangci/lint-1 v0.0.0-20181222135242-d2cdd8c08219/go.mod h1:/X8TswGSh1pIozq4ZwCfxS0WA5JGXguxk94ar/4c87Y= github.com/gomodule/redigo v1.7.1-0.20190724094224-574c33c3df38/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4= -github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= -github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= -github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= -github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20230207041349-798e818bf904 h1:4/hN5RUoecvl+RmJRE2YxKWtnnQls6rQjjW5oV7qg2U= github.com/google/pprof v0.0.0-20230207041349-798e818bf904/go.mod h1:uglQLonpP8qtYCYyzA+8c/9qtqgA3qsXGYqCPKARAFg= -github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/subcommands v1.2.0/go.mod h1:ZjhPrFU+Olkh9WazFPsl27BQ4UPiG37m3yTrtFlrHVk= +github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= -github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= -github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= +github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/graph-gophers/graphql-go v1.3.0 h1:Eb9x/q6MFpCLz7jBCiP/WTxjSDrYLR1QY41SORZyNJ0= @@ -332,8 +260,6 @@ github.com/hashicorp/go-hclog v1.2.0 h1:La19f8d7WIlm4ogzNHB0JGqs5AUDAZ2UfCY4sJXc github.com/hashicorp/go-retryablehttp v0.7.4 h1:ZQgVdpTdAL7WpMIwLzCfbalOcSUdkDZnpUv3/+BxzFA= github.com/hashicorp/go-retryablehttp v0.7.4/go.mod h1:Jy/gPYAdjqffZ/yFGCFV2doI5wjtH1ewM9u8iYVjtX8= github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= -github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/holiman/billy v0.0.0-20230718173358-1c7e68d277a7 h1:3JQNjnMRil1yD0IfZKHF9GxxWKDJGj8I0IqOUol//sw= github.com/holiman/billy v0.0.0-20230718173358-1c7e68d277a7/go.mod h1:5GuXa7vkL8u9FkFuWdVvfR5ix8hRB7DbOAaYULamFpc= @@ -342,10 +268,11 @@ github.com/holiman/bloomfilter/v2 v2.0.3/go.mod h1:zpoh+gs7qcpqrHr3dB55AMiJwo0iU github.com/holiman/uint256 v1.2.4 h1:jUc4Nk8fm9jZabQuqr2JzednajVmBpC+oiTiXZJEApU= github.com/holiman/uint256 v1.2.4/go.mod h1:EOMSn4q6Nyt9P6efbI3bueV4e1b3dGlUCXeiRV4ng7E= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/huandu/go-clone v1.6.0 h1:HMo5uvg4wgfiy5FoGOqlFLQED/VGRm2D9Pi8g1FXPGc= +github.com/huandu/go-clone/generic v1.6.0 h1:Wgmt/fUZ28r16F2Y3APotFD59sHk1p78K0XLdbUYN5U= github.com/huin/goupnp v1.3.0 h1:UvLUlWDNpoUdYzb2TCn+MuTWtcjXKSza2n6CBdQ0xXc= github.com/huin/goupnp v1.3.0/go.mod h1:gnGPsThkYa7bFi/KWmEysQRf48l2dvR5bxr2OFckNX8= -github.com/hydrogen18/memlistener v0.0.0-20141126152155-54553eb933fb/go.mod h1:qEIFzExnS6016fRpRfxrExeVn2gbClQA99gQhnIcdhE= -github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/hydrogen18/memlistener v0.0.0-20200120041712-dcc25e7acd91/go.mod h1:qEIFzExnS6016fRpRfxrExeVn2gbClQA99gQhnIcdhE= github.com/ianlancetaylor/demangle v0.0.0-20220319035150-800ac71e25c2/go.mod h1:aYm2/VgdVmcIU8iMfdMvDMsRAQjcfZSKFby6HOFvi/w= github.com/imkira/go-interpol v1.1.0/go.mod h1:z0h2/2T3XF8kyEPpRgJ3kmNv+C43p+I/CoI+jC3w2iA= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= @@ -357,7 +284,8 @@ github.com/influxdata/line-protocol v0.0.0-20200327222509-2487e7298839 h1:W9WBk7 github.com/influxdata/line-protocol v0.0.0-20200327222509-2487e7298839/go.mod h1:xaLFMmpvUxqXtVkUJfg9QmT88cDaCJ3ZKgdZ78oO8Qo= github.com/iris-contrib/blackfriday v2.0.0+incompatible/go.mod h1:UzZ2bDEoaSGPbkg6SAB4att1aAwTmVIx/5gCVqeyUdI= github.com/iris-contrib/go.uuid v2.0.0+incompatible/go.mod h1:iz2lgM/1UnEf1kP0L/+fafWORmlnuysV2EMP8MW+qe0= -github.com/iris-contrib/i18n v0.0.0-20171121225848-987a633949d0/go.mod h1:pMCz62A0xJL6I+umB2YTlFRwWXaDFA0jy+5HzGiJjqI= +github.com/iris-contrib/jade v1.1.3/go.mod h1:H/geBymxJhShH5kecoiOCSssPX7QWYH7UaeZTSWddIk= +github.com/iris-contrib/pongo2 v0.0.1/go.mod h1:Ssh+00+3GAZqSQb30AvBRNxBx7rf0GqwkjqxNd0u65g= github.com/iris-contrib/schema v0.0.1/go.mod h1:urYA3uvUNG1TIIjOSCzHr9/LmbQo8LrOcOqfqxa4hXw= github.com/jackpal/go-nat-pmp v1.0.2 h1:KzKSgb7qkJvOUTqYl9/Hg/me3pWgBmERKrTGD7BdWus= github.com/jackpal/go-nat-pmp v1.0.2/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc= @@ -367,40 +295,30 @@ github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9Y github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8= github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= -github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= -github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= -github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= -github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= +github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= -github.com/juju/errors v0.0.0-20181118221551-089d3ea4e4d5/go.mod h1:W54LbzXuIE0boCoNJfwqpmkKJ1O4TCTZMetAt6jGk7Q= -github.com/juju/loggo v0.0.0-20180524022052-584905176618/go.mod h1:vgyd7OREkbtVEN/8IXZe5Ooef3LQePvuBm9UWj6ZL8U= -github.com/juju/testing v0.0.0-20180920084828-472a3e8b2073/go.mod h1:63prj8cnj0tU0S9OHjGJn+b1h0ZghCndfnbQolrYTwA= -github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/julienschmidt/httprouter v1.3.0 h1:U0609e9tgbseu3rBINet9P48AI/D3oJs4dN7jwJOQ1U= github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88/go.mod h1:3w7q1U84EfirKl04SVQ/s7nPm1ZPhiXd34z40TNz36k= github.com/karalabe/usb v0.0.2 h1:M6QQBNxF+CQ8OFvxrT90BA0qBOXymndZnk5q235mFc4= github.com/karalabe/usb v0.0.2/go.mod h1:Od972xHfMJowv7NGVDiWVxk2zxnWgjLlJzE+F4F7AGU= -github.com/kataras/golog v0.0.9/go.mod h1:12HJgwBIZFNGL0EJnMRhmvGA0PQGx8VFwrZtM4CqbAk= -github.com/kataras/iris/v12 v12.0.1/go.mod h1:udK4vLQKkdDqMGJJVd/msuMtN6hpYJhg/lSzuxjhO+U= -github.com/kataras/neffos v0.0.10/go.mod h1:ZYmJC07hQPW67eKuzlfY7SO3bC0mw83A3j6im82hfqw= -github.com/kataras/pio v0.0.0-20190103105442-ea782b38602d/go.mod h1:NV88laa9UiiDuX9AhMbDPkGYSPugBOV6yTZB1l2K9Z0= +github.com/kataras/golog v0.0.10/go.mod h1:yJ8YKCmyL+nWjERB90Qwn+bdyBZsaQwU3bTVFgkFIp8= +github.com/kataras/iris/v12 v12.1.8/go.mod h1:LMYy4VlP67TQ3Zgriz8RE2h2kMZV2SgMYbq3UhfoFmE= +github.com/kataras/neffos v0.0.14/go.mod h1:8lqADm8PnbeFfL7CLXh1WHw53dG27MC3pgi2R1rmoTE= +github.com/kataras/pio v0.0.2/go.mod h1:hAoW0t9UmXi4R5Oyq5Z4irTbaTsOemSrDGUtaTl7Dro= +github.com/kataras/sitemap v0.0.5/go.mod h1:KY2eugMKiPwsJgx7+U103YZehfvNGOXURubcGyk0Bz8= github.com/kilic/bls12-381 v0.1.0 h1:encrdjqKMEvabVQ7qYOKu1OvhqpK4s47wDYtNiPtlp4= github.com/kilic/bls12-381 v0.1.0/go.mod h1:vDTTHJONJ6G+P2R74EhnyotQDTliQDnFEwhdmfzw1ig= -github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.8.2/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= -github.com/klauspost/compress v1.9.0/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= +github.com/klauspost/compress v1.9.7/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= github.com/klauspost/compress v1.15.15 h1:EF27CXIuDsYJ6mmvtBRlEuB2UVOqHG1tAXgZ7yIO+lw= github.com/klauspost/compress v1.15.15/go.mod h1:ZcK2JAFqKOpnBlxcLsJzYfrS9X1akm9fHZNnD9+Vo/4= github.com/klauspost/cpuid v1.2.1/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= -github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= +github.com/klauspost/cpuid/v2 v2.2.6 h1:ndNyv040zDGIDh8thGkXYjnFtiN02M1PVVF+JE/48xc= +github.com/klauspost/cpuid/v2 v2.2.6/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= @@ -412,10 +330,11 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/labstack/echo/v4 v4.1.11/go.mod h1:i541M3Fj6f76NZtHSj7TXnyM8n2gaodfvfxNnFqi74g= github.com/labstack/echo/v4 v4.2.1/go.mod h1:AA49e0DZ8kk5jTOOCKNuPR6oTnBS0dYiM4FW1e6jwpg= +github.com/labstack/echo/v4 v4.5.0/go.mod h1:czIriw4a0C1dFun+ObrXp7ok03xON0N1awStJ6ArI7Y= github.com/labstack/gommon v0.3.0/go.mod h1:MULnywXg0yavhxWKc+lOruYdAhDwPK9wf0OL7NoOu+k= github.com/leanovate/gopter v0.2.9 h1:fQjYxZaynp97ozCzfOyOuAGOU4aU/z37zf/tOujFk7c= +github.com/leodido/go-urn v1.2.1 h1:BqpAaACuzVSgi/VLzGZIobT2z4v53pjosyNd9Yv6n/w= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= @@ -423,7 +342,7 @@ github.com/matryer/moq v0.0.0-20190312154309-6cfb0558e1bd/go.mod h1:9ELz6aaclSIG github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.7/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-colorable v0.1.11/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= @@ -432,23 +351,24 @@ github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2y github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mattn/go-isatty v0.0.17 h1:BTarxUcIeDqL27Mc+vyvdWYSL28zpIhv3RoTdsLMPng= -github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= +github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-runewidth v0.0.3/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= github.com/mattn/go-runewidth v0.0.13 h1:lTGmDsbAYt5DmK6OnoV7EuIF1wEIFAcxld6ypU4OSgU= github.com/mattn/go-runewidth v0.0.13/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/mattn/goveralls v0.0.2/go.mod h1:8d1ZMHsd7fW6IRPKQh46F2WRpyib5/X4FOpevwGNQEw= -github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 h1:I0XW9+e1XWDxdcEniV4rQAIOPUGDq67JSCiRCgGCZLI= -github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= -github.com/mediocregopher/mediocre-go-lib v0.0.0-20181029021733-cb65787f37ed/go.mod h1:dSsfyI2zABAdhcbvkXqgxOxrCsbYeHCPgrZkku60dSg= -github.com/mediocregopher/radix/v3 v3.3.0/go.mod h1:EmfVyvspXz1uZEyPBMyGK+kjWiKQGvsUt6O3Pj+LDCQ= +github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= +github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= +github.com/mediocregopher/radix/v3 v3.4.2/go.mod h1:8FL3F6UQRXHXIBSPUs5h0RybMF8i4n7wVopoX3x7Bv8= github.com/microcosm-cc/bluemonday v1.0.2/go.mod h1:iVP4YcDBq+n/5fb23BhYFvIMq/leAFZyRl6bYmGDlGc= +github.com/minio/sha256-simd v1.0.1 h1:6kaan5IFmwTNynnKKpDHe6FWHohJOHhCPchzK49dzMM= +github.com/minio/sha256-simd v1.0.1/go.mod h1:Pz6AKMiUdngCLpeTL/RJY1M9rUuPMYujV5xJjtbRSN8= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/mitchellh/mapstructure v1.4.1 h1:CpVNEelQCZBooIPDn+AR3NpivK/TIKU8bDxdASFVQag= github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= +github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/pointerstructure v1.2.0 h1:O+i9nHnXS3l/9Wu7r4NrEdwA2VFTicjUEN1uBnDo34A= github.com/mitchellh/pointerstructure v1.2.0/go.mod h1:BRAsLI5zgXmw97Lf6s25bs8ohIXc3tViBH44KcwB2g4= github.com/mmcloughlin/addchain v0.4.0 h1:SobOdjm2xLj1KkXN5/n0xTIWyZA2+s99UCY1iPfkHRY= @@ -458,24 +378,22 @@ github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/moul/http2curl v1.0.0/go.mod h1:8UbvGypXm98wA/IqH45anm5Y2Z6ep6O31QGOAZ3H0fQ= -github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/naoina/go-stringutil v0.1.0 h1:rCUeRUHjBjGTSHl0VC00jUPLz8/F9dDzYI70Hzifhks= github.com/naoina/go-stringutil v0.1.0/go.mod h1:XJ2SJL9jCtBh+P9q5btrd/Ylo8XwT/h1USek5+NqSA0= github.com/naoina/toml v0.1.2-0.20170918210437-9fafd6967416 h1:shk/vn9oCoOTmwcouEdwIeOtOGA/ELRUw/GwvxwfT+0= github.com/naoina/toml v0.1.2-0.20170918210437-9fafd6967416/go.mod h1:NBIhNtsFMo3G2szEBne+bO4gS192HuIYRqfvOWb4i1E= -github.com/nats-io/nats.go v1.8.1/go.mod h1:BrFz9vVn0fU3AcH9Vn4Kd7W0NpJ651tD5omQ3M8LwxM= -github.com/nats-io/nkeys v0.0.2/go.mod h1:dab7URMsZm6Z/jp9Z5UGa87Uutgc2mVpXLC4B7TDb/4= +github.com/nats-io/jwt v0.3.0/go.mod h1:fRYCDE99xlTsqUzISS1Bi75UBJ6ljOJQOAAu5VglpSg= +github.com/nats-io/nats.go v1.9.1/go.mod h1:ZjDU1L/7fJ09jvUSRVBR2e7+RnLiiIQyqyzEE/Zbp4w= +github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= -github.com/onsi/ginkgo v1.13.0/go.mod h1:+REjRxOmWfHCjfv9TTWB1jD1Frx4XydAD3zm1lskyM0= github.com/onsi/ginkgo v1.14.0 h1:2mOpI4JVVPBN+WQRa0WKH2eXR+Ey+uK4n7Zj0aYpIQA= github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= @@ -490,58 +408,43 @@ github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4 github.com/pingcap/errors v0.11.4/go.mod h1:Oi8TUi2kEtXXLMJk9l1cGmz20kV3TaQ0usTwv5KuLY8= github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 h1:KoWmjvw+nsYOo29YJK9vDA65RGE3NrOnUtO7a+RF9HU= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= -github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prashantv/gostub v1.1.0 h1:BTyx3RfQjRHnUWaGF9oQos79AlQ5k8WNktv7VGvVH4g= -github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= -github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= -github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= -github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= -github.com/prometheus/client_golang v1.12.0 h1:C+UIj/QWtmqY13Arb8kwMt5j34/0Z2iKamrJ+ryC0Gg= -github.com/prometheus/client_golang v1.12.0/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= -github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= -github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_golang v1.16.0 h1:yk/hx9hDbrGHovbci4BY+pRMfSuuat626eFsHb7tmT8= +github.com/prometheus/client_golang v1.16.0/go.mod h1:Zsulrv/L9oM40tJ7T815tM89lFEugiJ9HzIqaAx4LKc= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.2.1-0.20210607210712-147c58e9608a h1:CmF68hwI0XsOQ5UwlBopMi2Ow4Pbg32akc4KIVCOm+Y= -github.com/prometheus/client_model v0.2.1-0.20210607210712-147c58e9608a/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w= -github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= -github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= -github.com/prometheus/common v0.32.1 h1:hWIdL3N2HoUx3B8j3YN9mWor0qhY/NlEKZEaXxuIRh4= -github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= -github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= -github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= -github.com/prometheus/procfs v0.7.3 h1:4jVXhlkAyzOScmCkXBTOLRLTz8EeU+eyjrwB/EPq0VU= -github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= +github.com/prometheus/client_model v0.3.0 h1:UBgGFHqYdG/TPFD1B1ogZywDqEkwp3fBMvqdiQ7Xew4= +github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w= +github.com/prometheus/common v0.42.0 h1:EKsfXEYo4JpWMHH5cg+KOUWeuJSov1Id8zGR8eeI1YM= +github.com/prometheus/common v0.42.0/go.mod h1:xBwqVerjNdUDjgODMpudtOMwlOwf2SaTr1yjz4b7Zbc= +github.com/prometheus/procfs v0.10.1 h1:kYK1Va/YMlutzCGazswoHKo//tZVlFpKYh+PymziUAg= +github.com/prometheus/procfs v0.10.1/go.mod h1:nwNm2aOCAYw8uTR/9bWRREkZFxAUcWzPHWJq+XBB/FM= github.com/protolambda/bls12-381-util v0.0.0-20220416220906-d8552aa452c7 h1:cZC+usqsYgHtlBaGulVnZ1hfKAi8iWtujBnRLQE698c= github.com/protolambda/bls12-381-util v0.0.0-20220416220906-d8552aa452c7/go.mod h1:IToEjHuttnUzwZI5KBSM/LOOW3qLbbrHOEfp3SbECGY= +github.com/prysmaticlabs/go-bitfield v0.0.0-20210809151128-385d8c5e3fb7 h1:0tVE4tdWQK9ZpYygoV7+vS6QkDvQVySboMVEIxBJmXw= +github.com/prysmaticlabs/go-bitfield v0.0.0-20210809151128-385d8c5e3fb7/go.mod h1:wmuf/mdK4VMD+jA9ThwcUKjg3a2XWM9cVfFYjDyY4j4= github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= -github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= -github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= +github.com/rogpeppe/go-internal v1.8.1/go.mod h1:JeRgkft04UBgHMgCIwADu4Pn6Mtm5d4nPKWu0nJ5d+o= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= +github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= +github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= github.com/rs/cors v1.7.0 h1:+88SsELBHx5r+hZ8TCkggzSstaWNbDvThkVK8H6f9ik= github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= -github.com/sclevine/agouti v3.0.0+incompatible/go.mod h1:b4WX9W9L1sfQKXeJf1mUTLZKJ48R1S7H23Ji7oFO5Bw= -github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= +github.com/schollz/closestmatch v2.1.0+incompatible/go.mod h1:RtP1ddjLong6gTkbtmuhtR2uUrrJOpYzYRvbcPAid+g= +github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible h1:Bn1aCHHRnjv4Bl16T8rcaFjYSrGrIZvpiGO6P3Q4GpU= github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= -github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= -github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= -github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= @@ -553,7 +456,6 @@ github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DM github.com/status-im/keycard-go v0.2.0 h1:QDLFswOQu1r5jsycloeQh3bVU8n/NatHHaZobtDnDzA= github.com/status-im/keycard-go v0.2.0/go.mod h1:wlp8ZLbsmrF6g6WjugPAx+IzoLrkdf9+mHxBEeo3Hbg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= @@ -569,10 +471,14 @@ github.com/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFA github.com/tklauser/go-sysconf v0.3.12/go.mod h1:Ho14jnntGE1fpdOqQEEaiKRpvIavV0hSfmBq8nJbHYI= github.com/tklauser/numcpus v0.6.1 h1:ng9scYS7az0Bk4OZLvrNXNSAO2Pxr1XXRAPyjhIx+Fk= github.com/tklauser/numcpus v0.6.1/go.mod h1:1XfjsgE2zo8GVw7POkMbHENHzVg3GzmoZ9fESEdAacY= +github.com/trailofbits/go-fuzz-utils v0.0.0-20210901195358-9657fcfd256c h1:4WU+p200eLYtBsx3M5CKXvkjVdf5SC3W9nMg37y0TFI= github.com/tyler-smith/go-bip39 v1.1.0 h1:5eUemwrMargf3BSLRRCalXT93Ns6pQJIjYQN2nyfOP8= github.com/tyler-smith/go-bip39 v1.1.0/go.mod h1:gUYDtqQw1JS3ZJ8UWVcGTGqqr6YIN3CWg+kkNaLt55U= github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= +github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= +github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= +github.com/umbracle/gohashtree v0.0.2-alpha.0.20230207094856-5b775a815c10 h1:CQh33pStIp/E30b7TxDlXfM0145bn2e8boI30IxAhTg= github.com/urfave/cli/v2 v2.25.7 h1:VAzn5oq403l5pHjc4OhD54+XGO9cdKVL/7lDjF+iKUs= github.com/urfave/cli/v2 v2.25.7/go.mod h1:8qnjx1vcq5s2/wpsqoZFndg2CE5tNFyrTvS6SinrnYQ= github.com/urfave/negroni v1.0.0/go.mod h1:Meg73S6kFm/4PpbYdq35yYWoCZ9mS/YSx+lKnmiohz4= @@ -591,197 +497,121 @@ github.com/yalp/jsonpath v0.0.0-20180802001716-5cc68e5049a0/go.mod h1:/LWChgwKmv github.com/yudai/gojsondiff v1.0.0/go.mod h1:AY32+k2cwILAkW1fbgxQ5mUmMiZFgLIV+FBNExI05xg= github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82/go.mod h1:lgjkn3NuSvDfVJdfcVVdX+jpBxNmX4rDAzaS45IcYoM= github.com/yudai/pp v2.0.1+incompatible/go.mod h1:PuxR/8QJ7cyCkFp/aUDS+JY727OFEZkTdatxwunjIkc= -github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= -go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= -go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.uber.org/automaxprocs v1.5.2 h1:2LxUOGiR3O6tw8ui5sZa2LAaHnsviZdVOUZw4fvbnME= go.uber.org/automaxprocs v1.5.2/go.mod h1:eRbA25aqJrxAbsLO0xy5jVwPt7FQnRgjW+efnwa1WM0= -golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20191227163750-53104e6ec876/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= +golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k= -golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= +golang.org/x/crypto v0.18.0 h1:PGVlW0xEltQnzFZ55hkuX5+KLyrMYhHld1YHO4AKcdc= +golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= -golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= -golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= -golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= -golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa h1:FRnLl4eNAQl8hwxVVC17teOw8kdjVDVAiFMtgUdTSRQ= golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa/go.mod h1:zk2irFbV9DP96SEBUUAy67IdHUaZuSnrz1n472HUCLE= -golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= -golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= -golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= -golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= -golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= -golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= -golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= +golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= -golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0= golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190327091125-710a502c58a2/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= -golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= +golang.org/x/net v0.0.0-20211008194852-3b03d305991f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.18.0 h1:mIYleuAkSbHh0tCv7RvjL3F6ZVbLjq4+R7zbOn3Kokg= golang.org/x/net v0.18.0/go.mod h1:/czyP5RqHAH4odGYxBJ1qz0+CE5WZ+2j1YgoEo8F2jQ= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.5.0 h1:60k92dhOjHxJkrqnwsfl8KuaHbn/5dl0lUPUklKo3qE= golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200814200057-3d37ad5750ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200826173525-f9321e4c35a6/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201101102859-da207088b7d1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220310020820-b874c991c1a5/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= -golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU= +golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= @@ -790,132 +620,46 @@ golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20201208040808-7e3f01d25324/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4= golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181221001348-537d06c36207/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190327201419-c70d86f8b7cf/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= -golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= -golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= -golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.15.0 h1:zdAyfUGbYmuVokhzVmghFl2ZJh5QhcfebBgmVPFYA+8= golang.org/x/tools v0.15.0/go.mod h1:hpksKq4dtpQWS1uQ61JkdqWM3LscIS6Slf+VVkm+wQk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= -google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= -google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= -google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= -google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= -google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= +golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 h1:+cNy6SZtPcJQH3LJVLOSmiC7MMxXNOb3PU/VUEz+EhU= +golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028/go.mod h1:NDW/Ps6MPRej6fsCIbMTohpP40sJ/P/vI1MoTEGwX90= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= -google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/genproto v0.0.0-20180518175338-11a468237815/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= -google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= -google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= -google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= google.golang.org/grpc v1.12.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= -google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= -google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= -google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= -google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -924,13 +668,11 @@ google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzi google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= -google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= +google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng= +google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -940,31 +682,25 @@ gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE= gopkg.in/go-playground/validator.v8 v8.18.2/go.mod h1:RX2a/7Ha8BgOhfk7j780h4/u/RRjR0eouCJSH80/M2Y= +gopkg.in/ini.v1 v1.51.1/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/mgo.v2 v2.0.0-20180705113604-9856a29383ce/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA= gopkg.in/natefinch/lumberjack.v2 v2.0.0 h1:1Lc07Kr7qY4U2YPouBjpCLxpiyxIVoxqXgkXLknAOE8= gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= -gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= +gopkg.in/yaml.v3 v3.0.0-20191120175047-4206685974f2/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= -honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= -rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= -rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= rsc.io/tmplfunc v0.0.3 h1:53XFQh69AfOa8Tw0Jm7t+GV7KZhOi6jzsCzTtKbMvzU= rsc.io/tmplfunc v0.0.3/go.mod h1:AG3sTPzElb1Io3Yg4voV9AGZJuleGAwaVRxL9M49PhA= diff --git a/miner/builder.go b/miner/builder.go index 26be2d98fe47..fb044e16c631 100644 --- a/miner/builder.go +++ b/miner/builder.go @@ -1,13 +1,24 @@ package miner import ( + "errors" + "fmt" "math/big" + denebBuilder "github.com/attestantio/go-builder-client/api/deneb" + builderV1 "github.com/attestantio/go-builder-client/api/v1" + "github.com/attestantio/go-eth2-client/spec/bellatrix" + "github.com/attestantio/go-eth2-client/spec/capella" + "github.com/attestantio/go-eth2-client/spec/deneb" + "github.com/attestantio/go-eth2-client/spec/phase0" + "github.com/ethereum/go-ethereum/beacon/engine" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/consensus" "github.com/ethereum/go-ethereum/core" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/params" + "github.com/flashbots/go-boost-utils/ssz" + "github.com/holiman/uint256" ) type BuilderConfig struct { @@ -19,15 +30,18 @@ type BuilderConfig struct { } type BuilderArgs struct { - ParentHash common.Hash - FeeRecipient common.Address - Extra []byte + ParentHash common.Hash + FeeRecipient common.Address + ProposerPubkey []byte + Extra []byte + Slot uint64 } type Builder struct { - env *environment - wrk *worker - args *BuilderArgs + env *environment + wrk *worker + args *BuilderArgs + block *types.Block } func NewBuilder(config *BuilderConfig, args *BuilderArgs) (*Builder, error) { @@ -94,9 +108,69 @@ func (b *Builder) BuildBlock() (*types.Block, error) { if err != nil { return nil, err } + b.block = block return block, nil } +func (b *Builder) Bid(builderPubKey phase0.BLSPubKey) (*SubmitBlockRequest, error) { + work := b.env + + if b.block == nil { + return nil, fmt.Errorf("block not built") + } + + envelope := engine.BlockToExecutableData(b.block, totalFees(b.block, work.receipts), work.sidecars) + payload, err := executableDataToDenebExecutionPayload(envelope.ExecutionPayload) + if err != nil { + return nil, err + } + + value, overflow := uint256.FromBig(envelope.BlockValue) + if overflow { + return nil, fmt.Errorf("block value %v overflows", *envelope.BlockValue) + } + var proposerPubkey [48]byte + copy(proposerPubkey[:], b.args.ProposerPubkey) + + blockBidMsg := builderV1.BidTrace{ + Slot: b.args.Slot, + ParentHash: phase0.Hash32(payload.ParentHash), + BlockHash: phase0.Hash32(payload.BlockHash), + BuilderPubkey: builderPubKey, + ProposerPubkey: phase0.BLSPubKey(proposerPubkey), + ProposerFeeRecipient: bellatrix.ExecutionAddress(b.args.FeeRecipient), + GasLimit: envelope.ExecutionPayload.GasLimit, + GasUsed: envelope.ExecutionPayload.GasUsed, + Value: value, + } + + genesisForkVersion := phase0.Version{0x00, 0x00, 0x10, 0x20} + builderSigningDomain := ssz.ComputeDomain(ssz.DomainTypeAppBuilder, genesisForkVersion, phase0.Root{}) + + root, err := ssz.ComputeSigningRoot(&blockBidMsg, builderSigningDomain) + if err != nil { + return nil, err + } + + bidRequest := SubmitBlockRequest{ + Root: phase0.Root(root), + SubmitBlockRequest: denebBuilder.SubmitBlockRequest{ + Message: &blockBidMsg, + ExecutionPayload: payload, + Signature: phase0.BLSSignature{}, + BlobsBundle: &denebBuilder.BlobsBundle{}, + }, + } + return &bidRequest, nil +} + +// SubmitBlockRequest is an extension of the builder.SubmitBlockRequest with the root +// of the bid that needs to be signed +type SubmitBlockRequest struct { + denebBuilder.SubmitBlockRequest + Root phase0.Root +} + func receiptToSimResult(receipt *types.Receipt) *types.SimulateTransactionResult { result := &types.SimulateTransactionResult{ Success: true, @@ -111,3 +185,43 @@ func receiptToSimResult(receipt *types.Receipt) *types.SimulateTransactionResult } return result } + +func executableDataToDenebExecutionPayload(data *engine.ExecutableData) (*deneb.ExecutionPayload, error) { + transactionData := make([]bellatrix.Transaction, len(data.Transactions)) + for i, tx := range data.Transactions { + transactionData[i] = bellatrix.Transaction(tx) + } + + withdrawalData := make([]*capella.Withdrawal, len(data.Withdrawals)) + for i, wd := range data.Withdrawals { + withdrawalData[i] = &capella.Withdrawal{ + Index: capella.WithdrawalIndex(wd.Index), + ValidatorIndex: phase0.ValidatorIndex(wd.Validator), + Address: bellatrix.ExecutionAddress(wd.Address), + Amount: phase0.Gwei(wd.Amount), + } + } + + baseFeePerGas := new(uint256.Int) + if baseFeePerGas.SetFromBig(data.BaseFeePerGas) { + return nil, errors.New("base fee per gas: overflow") + } + + return &deneb.ExecutionPayload{ + ParentHash: [32]byte(data.ParentHash), + FeeRecipient: [20]byte(data.FeeRecipient), + StateRoot: [32]byte(data.StateRoot), + ReceiptsRoot: [32]byte(data.ReceiptsRoot), + LogsBloom: types.BytesToBloom(data.LogsBloom), + PrevRandao: [32]byte(data.Random), + BlockNumber: data.Number, + GasLimit: data.GasLimit, + GasUsed: data.GasUsed, + Timestamp: data.Timestamp, + ExtraData: data.ExtraData, + BaseFeePerGas: baseFeePerGas, + BlockHash: [32]byte(data.BlockHash), + Transactions: transactionData, + Withdrawals: withdrawalData, + }, nil +} From 798d625a6de0b4785163fff171582da2cf0f36f8 Mon Sep 17 00:00:00 2001 From: Ferran Borreguero Date: Wed, 21 Feb 2024 10:38:29 +0000 Subject: [PATCH 08/12] Improve things --- suave/builder/api/api.go | 31 ++-- suave/builder/api/gen_buildblockargs_json.go | 86 ++++++++++ suave/builder/session_manager.go | 28 +++- suave/builder/session_manager_test.go | 164 +++++++------------ 4 files changed, 190 insertions(+), 119 deletions(-) create mode 100644 suave/builder/api/gen_buildblockargs_json.go diff --git a/suave/builder/api/api.go b/suave/builder/api/api.go index 846e079b7ce2..ac80674bb984 100644 --- a/suave/builder/api/api.go +++ b/suave/builder/api/api.go @@ -5,9 +5,12 @@ import ( "math/big" "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/core/types" ) +//go:generate go run github.com/fjl/gencodec -type BuildBlockArgs -field-override buildBlockArgsMarshaling -out gen_buildblockargs_json.go + type Bundle struct { BlockNumber *big.Int `json:"blockNumber,omitempty"` // if BlockNumber is set it must match DecryptionCondition! MaxBlock *big.Int `json:"maxBlock,omitempty"` @@ -17,16 +20,24 @@ type Bundle struct { } type BuildBlockArgs struct { - Slot uint64 - ProposerPubkey []byte - Parent common.Hash - Timestamp uint64 - FeeRecipient common.Address - GasLimit uint64 - Random common.Hash - Withdrawals []*types.Withdrawal - Extra []byte - FillPending bool + Slot uint64 `json:"slot"` + ProposerPubkey []byte `json:"proposerPubkey"` + Parent common.Hash `json:"parent"` + Timestamp uint64 `json:"timestamp"` + FeeRecipient common.Address `json:"feeRecipient"` + GasLimit uint64 `json:"gasLimit"` + Random common.Hash `json:"random"` + Withdrawals []*types.Withdrawal `json:"withdrawals"` + Extra []byte `json:"extra"` +} + +// field type overrides for gencodec +type buildBlockArgsMarshaling struct { + Slot hexutil.Uint64 + ProposerPubkey hexutil.Bytes + Timestamp hexutil.Uint64 + GasLimit hexutil.Uint64 + Extra hexutil.Bytes } type API interface { diff --git a/suave/builder/api/gen_buildblockargs_json.go b/suave/builder/api/gen_buildblockargs_json.go new file mode 100644 index 000000000000..6fb8d03d8d75 --- /dev/null +++ b/suave/builder/api/gen_buildblockargs_json.go @@ -0,0 +1,86 @@ +// Code generated by github.com/fjl/gencodec. DO NOT EDIT. + +package api + +import ( + "encoding/json" + + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/core/types" +) + +var _ = (*buildBlockArgsMarshaling)(nil) + +// MarshalJSON marshals as JSON. +func (b BuildBlockArgs) MarshalJSON() ([]byte, error) { + type BuildBlockArgs struct { + Slot hexutil.Uint64 `json:"slot"` + ProposerPubkey hexutil.Bytes `json:"proposerPubkey"` + Parent common.Hash `json:"parent"` + Timestamp hexutil.Uint64 `json:"timestamp"` + FeeRecipient common.Address `json:"feeRecipient"` + GasLimit hexutil.Uint64 `json:"gasLimit"` + Random common.Hash `json:"random"` + Withdrawals []*types.Withdrawal `json:"withdrawals"` + Extra hexutil.Bytes `json:"extra"` + } + var enc BuildBlockArgs + enc.Slot = hexutil.Uint64(b.Slot) + enc.ProposerPubkey = b.ProposerPubkey + enc.Parent = b.Parent + enc.Timestamp = hexutil.Uint64(b.Timestamp) + enc.FeeRecipient = b.FeeRecipient + enc.GasLimit = hexutil.Uint64(b.GasLimit) + enc.Random = b.Random + enc.Withdrawals = b.Withdrawals + enc.Extra = b.Extra + return json.Marshal(&enc) +} + +// UnmarshalJSON unmarshals from JSON. +func (b *BuildBlockArgs) UnmarshalJSON(input []byte) error { + type BuildBlockArgs struct { + Slot *hexutil.Uint64 `json:"slot"` + ProposerPubkey *hexutil.Bytes `json:"proposerPubkey"` + Parent *common.Hash `json:"parent"` + Timestamp *hexutil.Uint64 `json:"timestamp"` + FeeRecipient *common.Address `json:"feeRecipient"` + GasLimit *hexutil.Uint64 `json:"gasLimit"` + Random *common.Hash `json:"random"` + Withdrawals []*types.Withdrawal `json:"withdrawals"` + Extra *hexutil.Bytes `json:"extra"` + } + var dec BuildBlockArgs + if err := json.Unmarshal(input, &dec); err != nil { + return err + } + if dec.Slot != nil { + b.Slot = uint64(*dec.Slot) + } + if dec.ProposerPubkey != nil { + b.ProposerPubkey = *dec.ProposerPubkey + } + if dec.Parent != nil { + b.Parent = *dec.Parent + } + if dec.Timestamp != nil { + b.Timestamp = uint64(*dec.Timestamp) + } + if dec.FeeRecipient != nil { + b.FeeRecipient = *dec.FeeRecipient + } + if dec.GasLimit != nil { + b.GasLimit = uint64(*dec.GasLimit) + } + if dec.Random != nil { + b.Random = *dec.Random + } + if dec.Withdrawals != nil { + b.Withdrawals = dec.Withdrawals + } + if dec.Extra != nil { + b.Extra = *dec.Extra + } + return nil +} diff --git a/suave/builder/session_manager.go b/suave/builder/session_manager.go index d2c03f55969a..e81543f8ce8f 100644 --- a/suave/builder/session_manager.go +++ b/suave/builder/session_manager.go @@ -11,6 +11,7 @@ import ( "github.com/ethereum/go-ethereum/common/math" "github.com/ethereum/go-ethereum/core" "github.com/ethereum/go-ethereum/core/state" + "github.com/ethereum/go-ethereum/core/txpool" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/miner" "github.com/ethereum/go-ethereum/params" @@ -44,11 +45,12 @@ type SessionManager struct { sessions map[string]*miner.Builder sessionTimers map[string]*time.Timer sessionsLock sync.RWMutex - blockchain blockchain + blockchain *core.BlockChain + pool *txpool.TxPool config *Config } -func NewSessionManager(blockchain blockchain, config *Config) *SessionManager { +func NewSessionManager(blockchain *core.BlockChain, pool *txpool.TxPool, config *Config) *SessionManager { if config.GasCeil == 0 { config.GasCeil = 1000000000000000000 } @@ -70,12 +72,24 @@ func NewSessionManager(blockchain blockchain, config *Config) *SessionManager { sessionTimers: make(map[string]*time.Timer), blockchain: blockchain, config: config, + pool: pool, } return s } +func (s *SessionManager) BlockChain() *core.BlockChain { + return s.blockchain +} + +func (s *SessionManager) TxPool() *txpool.TxPool { + return s.pool +} + // NewSession creates a new builder session and returns the session id func (s *SessionManager) NewSession(ctx context.Context, args *api.BuildBlockArgs) (string, error) { + if args == nil { + return "", fmt.Errorf("args cannot be nil") + } // Wait for session to become available select { case <-s.sem: @@ -88,11 +102,17 @@ func (s *SessionManager) NewSession(ctx context.Context, args *api.BuildBlockArg builderCfg := &miner.BuilderConfig{ ChainConfig: s.blockchain.Config(), Engine: s.blockchain.Engine(), - // TODO + Chain: s.blockchain, + EthBackend: s, + GasCeil: s.config.GasCeil, } builderArgs := &miner.BuilderArgs{ - ParentHash: args.Parent, + ParentHash: args.Parent, + FeeRecipient: args.FeeRecipient, + ProposerPubkey: args.ProposerPubkey, + Extra: args.Extra, + Slot: args.Slot, } id := uuid.New().String()[:7] diff --git a/suave/builder/session_manager_test.go b/suave/builder/session_manager_test.go index 994c5e082fb7..533f342466b9 100644 --- a/suave/builder/session_manager_test.go +++ b/suave/builder/session_manager_test.go @@ -2,18 +2,22 @@ package builder import ( "context" - "crypto/ecdsa" "math/big" "testing" "time" + "github.com/ethereum/go-ethereum/accounts" "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/consensus" + "github.com/ethereum/go-ethereum/consensus/clique" + "github.com/ethereum/go-ethereum/core" "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/state" + "github.com/ethereum/go-ethereum/core/txpool" + "github.com/ethereum/go-ethereum/core/txpool/legacypool" "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/core/vm" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/params" + "github.com/ethereum/go-ethereum/suave/builder/api" "github.com/stretchr/testify/require" ) @@ -22,7 +26,9 @@ func TestSessionManager_SessionTimeout(t *testing.T) { SessionIdleTimeout: 500 * time.Millisecond, }) - id, err := mngr.NewSession(context.TODO(), nil) + args := &api.BuildBlockArgs{} + + id, err := mngr.NewSession(context.TODO(), args) require.NoError(t, err) time.Sleep(1 * time.Second) @@ -35,6 +41,7 @@ func TestSessionManager_MaxConcurrentSessions(t *testing.T) { t.Parallel() const d = time.Millisecond * 100 + args := &api.BuildBlockArgs{} mngr, _ := newSessionManager(t, &Config{ MaxConcurrentSessions: 1, @@ -42,7 +49,7 @@ func TestSessionManager_MaxConcurrentSessions(t *testing.T) { }) t.Run("SessionAvailable", func(t *testing.T) { - sess, err := mngr.NewSession(context.TODO(), nil) + sess, err := mngr.NewSession(context.TODO(), args) require.NoError(t, err) require.NotZero(t, sess) }) @@ -53,7 +60,7 @@ func TestSessionManager_MaxConcurrentSessions(t *testing.T) { ctx, cancel := context.WithCancel(context.Background()) cancel() - sess, err := mngr.NewSession(ctx, nil) + sess, err := mngr.NewSession(ctx, args) require.Zero(t, sess) require.ErrorIs(t, err, context.Canceled) }) @@ -62,7 +69,7 @@ func TestSessionManager_MaxConcurrentSessions(t *testing.T) { time.Sleep(d) // Wait for the session to expire. // We should be able to open a session again. - sess, err := mngr.NewSession(context.TODO(), nil) + sess, err := mngr.NewSession(context.TODO(), args) require.NoError(t, err) require.NotZero(t, sess) }) @@ -73,7 +80,8 @@ func TestSessionManager_SessionRefresh(t *testing.T) { SessionIdleTimeout: 500 * time.Millisecond, }) - id, err := mngr.NewSession(context.TODO(), nil) + args := &api.BuildBlockArgs{} + id, err := mngr.NewSession(context.TODO(), args) require.NoError(t, err) // if we query the session under the idle timeout, @@ -98,124 +106,70 @@ func TestSessionManager_StartSession(t *testing.T) { // test that the session starts and it can simulate transactions mngr, bMock := newSessionManager(t, &Config{}) - id, err := mngr.NewSession(context.TODO(), nil) + args := &api.BuildBlockArgs{} + id, err := mngr.NewSession(context.TODO(), args) require.NoError(t, err) - txn := bMock.state.newTransfer(t, common.Address{}, big.NewInt(1)) + txn := bMock.newTransfer(t, common.Address{}, big.NewInt(1)) receipt, err := mngr.AddTransaction(id, txn) require.NoError(t, err) require.NotNil(t, receipt) } -func newSessionManager(t *testing.T, cfg *Config) (*SessionManager, *blockchainMock) { +func newSessionManager(t *testing.T, cfg *Config) (*SessionManager, *testBackend) { + backend := newTestBackend(t) + if cfg == nil { cfg = &Config{} } - - state := newMockState(t) - - bMock := &blockchainMock{ - state: state, - } - return NewSessionManager(bMock, cfg), bMock + return NewSessionManager(backend.chain, backend.pool, cfg), backend } -type blockchainMock struct { - state *mockState -} - -func (b *blockchainMock) Engine() consensus.Engine { - panic("TODO") -} - -func (b *blockchainMock) GetHeader(common.Hash, uint64) *types.Header { - panic("TODO") -} - -func (b *blockchainMock) Config() *params.ChainConfig { - return b.state.chainConfig -} - -func (b *blockchainMock) CurrentHeader() *types.Header { - return &types.Header{ - Number: big.NewInt(1), - Difficulty: big.NewInt(1), - Root: b.state.stateRoot, - } -} +var ( + testBankKey, _ = crypto.GenerateKey() + testBankAddress = crypto.PubkeyToAddress(testBankKey.PublicKey) +) -func (b *blockchainMock) StateAt(root common.Hash) (*state.StateDB, error) { - return b.state.stateAt(root) +type testBackend struct { + chain *core.BlockChain + pool *txpool.TxPool } -type mockState struct { - stateRoot common.Hash - statedb state.Database - - premineKey *ecdsa.PrivateKey - premineKeyAdd common.Address - - nextNonce uint64 // figure out a better way - signer types.Signer - - chainConfig *params.ChainConfig +func (tb *testBackend) newTransfer(t *testing.T, to common.Address, amount *big.Int) *types.Transaction { + gasPrice := big.NewInt(10 * params.InitialBaseFee) + tx, _ := types.SignTx(types.NewTransaction(tb.pool.Nonce(testBankAddress), to, amount, params.TxGas, gasPrice, nil), types.HomesteadSigner{}, testBankKey) + return tx } -func newMockState(t *testing.T) *mockState { - premineKey, _ := crypto.GenerateKey() // TODO: it would be nice to have it deterministic - premineKeyAddr := crypto.PubkeyToAddress(premineKey.PublicKey) - - // create a state reference with at least one premined account - // In order to test the statedb in isolation, we are going - // to commit this pre-state to a memory database - db := state.NewDatabase(rawdb.NewMemoryDatabase()) - preState, err := state.New(types.EmptyRootHash, db, nil) - require.NoError(t, err) - - preState.AddBalance(premineKeyAddr, big.NewInt(1000000000000000000)) - - root, err := preState.Commit(1, true) - require.NoError(t, err) - - // for the sake of this test, we only need all the forks enabled - chainConfig := params.TestChainConfig +func newTestBackend(t *testing.T) *testBackend { + // code based on miner 'newTestWorker' + testTxPoolConfig := legacypool.DefaultConfig + testTxPoolConfig.Journal = "" - // Disable london so that we do not check gasFeeCap (TODO: Fix) - chainConfig.LondonBlock = big.NewInt(100) + var ( + db = rawdb.NewMemoryDatabase() + config = *params.AllCliqueProtocolChanges + ) + config.Clique = ¶ms.CliqueConfig{Period: 1, Epoch: 30000} + engine := clique.New(config.Clique, db) - return &mockState{ - statedb: db, - stateRoot: root, - premineKey: premineKey, - premineKeyAdd: premineKeyAddr, - signer: types.NewEIP155Signer(chainConfig.ChainID), - chainConfig: chainConfig, + var gspec = &core.Genesis{ + Config: &config, + Alloc: core.GenesisAlloc{testBankAddress: {Balance: big.NewInt(1000000000000000000)}}, } -} - -func (m *mockState) stateAt(root common.Hash) (*state.StateDB, error) { - return state.New(root, m.statedb, nil) -} -func (m *mockState) getNonce() uint64 { - next := m.nextNonce - m.nextNonce++ - return next -} - -func (m *mockState) newTransfer(t *testing.T, to common.Address, amount *big.Int) *types.Transaction { - tx := types.NewTransaction(m.getNonce(), to, amount, 1000000, big.NewInt(1), nil) - return m.newTxn(t, tx) -} - -func (m *mockState) newTxn(t *testing.T, tx *types.Transaction) *types.Transaction { - // sign the transaction - signature, err := crypto.Sign(m.signer.Hash(tx).Bytes(), m.premineKey) - require.NoError(t, err) + gspec.ExtraData = make([]byte, 32+common.AddressLength+crypto.SignatureLength) + copy(gspec.ExtraData[32:32+common.AddressLength], testBankAddress.Bytes()) + engine.Authorize(testBankAddress, func(account accounts.Account, s string, data []byte) ([]byte, error) { + return crypto.Sign(crypto.Keccak256(data), testBankKey) + }) - // include the signature in the transaction - tx, err = tx.WithSignature(m.signer, signature) - require.NoError(t, err) + chain, err := core.NewBlockChain(db, &core.CacheConfig{TrieDirtyDisabled: true}, gspec, nil, engine, vm.Config{}, nil, nil) + if err != nil { + t.Fatalf("core.NewBlockChain failed: %v", err) + } + pool := legacypool.New(testTxPoolConfig, chain) + txpool, _ := txpool.New(new(big.Int).SetUint64(testTxPoolConfig.PriceLimit), chain, []txpool.SubPool{pool}) - return tx + return &testBackend{chain: chain, pool: txpool} } From 2f8a64eab06101d388adf54f902d6a92f75c0494 Mon Sep 17 00:00:00 2001 From: Ferran Borreguero Date: Wed, 21 Feb 2024 11:13:17 +0000 Subject: [PATCH 09/12] Use deterministic mnemoinic for dev chain --- cmd/utils/flags.go | 13 +++++++++++++ eth/backend.go | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index 159c47ca0191..dae235d1a7ae 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -1792,6 +1792,19 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) { if err != nil { Fatalf("Failed to create developer account: %v", err) } + + // == Suave fork specific == + // When running in developer mode, we want to have a deterministic public key + // we can use to sign transactions outside geth. + // This is the private key for the mnemonic + // "test test test test test test test test test test test junk" + // which is the same used in foundry Anvil. + priv, _ := crypto.HexToECDSA("ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80") + developer, err = ks.ImportECDSA(priv, "") + if err != nil { + Fatalf("Failed to import developer account: %v", err) + } + // == End of Suave fork specific == } // Make sure the address is configured as fee recipient, otherwise // the miner will fail to start. diff --git a/eth/backend.go b/eth/backend.go index 327e0094e78a..c48a862ae046 100644 --- a/eth/backend.go +++ b/eth/backend.go @@ -318,7 +318,7 @@ func (s *Ethereum) APIs() []rpc.API { Service: backends.NewEthBackendServer(s.APIBackend), }) - sessionManager := suave_builder.NewSessionManager(s.blockchain, &suave_builder.Config{}) + sessionManager := suave_builder.NewSessionManager(s.blockchain, s.txPool, &suave_builder.Config{}) apis = append(apis, rpc.API{ Namespace: "suavex", From 84f5a665b708aa501331ba6f554f61b0f556529c Mon Sep 17 00:00:00 2001 From: Ferran Borreguero Date: Thu, 22 Feb 2024 11:45:21 +0000 Subject: [PATCH 10/12] Add more changes --- miner/builder.go | 4 ++ miner/builder_test.go | 71 ++++++++++++++++++++ miner/contracts/Example.sol | 10 +++ miner/contracts/out/Example.sol/Example.json | 1 + miner/worker_test.go | 4 ++ 5 files changed, 90 insertions(+) create mode 100644 miner/contracts/Example.sol create mode 100644 miner/contracts/out/Example.sol/Example.json diff --git a/miner/builder.go b/miner/builder.go index fb044e16c631..20c351ec0f09 100644 --- a/miner/builder.go +++ b/miner/builder.go @@ -85,9 +85,13 @@ type SBundle struct { } func (b *Builder) AddTransaction(txn *types.Transaction) (*types.SimulateTransactionResult, error) { + // If the context is not set, the logs will not be recorded + b.env.state.SetTxContext(txn.Hash(), b.env.tcount) + logs, err := b.wrk.commitTransaction(b.env, txn) if err != nil { return &types.SimulateTransactionResult{ + Error: err.Error(), Success: false, }, nil } diff --git a/miner/builder_test.go b/miner/builder_test.go index 6ef847675d7c..dc615f579c49 100644 --- a/miner/builder_test.go +++ b/miner/builder_test.go @@ -1,8 +1,16 @@ package miner import ( + "encoding/json" + "fmt" + "math/big" + "os" + "path/filepath" + "runtime" "testing" + "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/consensus/clique" "github.com/ethereum/go-ethereum/core/rawdb" "github.com/ethereum/go-ethereum/core/types" @@ -73,6 +81,29 @@ func TestBuilder_BuildBlock(t *testing.T) { require.Len(t, block.Transactions(), 1) } +func TestBuilder_ContractWithLogs(t *testing.T) { + // test that we can simulate a txn with a contract that emits events + t.Parallel() + + config, backend := newMockBuilderConfig(t) + + input, err := suaveExample1Artifact.Abi.Pack("get", big.NewInt(1)) + require.NoError(t, err) + + tx := backend.newCall(suaveExample1Addr, input) + + builder, err := NewBuilder(config, &BuilderArgs{}) + require.NoError(t, err) + + simResult, err := builder.AddTransaction(tx) + require.NoError(t, err) + require.True(t, simResult.Success) + require.Len(t, simResult.Logs, 1) + + require.Equal(t, simResult.Logs[0].Addr, suaveExample1Addr) + require.Equal(t, simResult.Logs[0].Topics[0], suaveExample1Artifact.Abi.Events["SomeEvent"].ID) +} + func newMockBuilderConfig(t *testing.T) (*BuilderConfig, *testWorkerBackend) { var ( db = rawdb.NewMemoryDatabase() @@ -93,3 +124,43 @@ func newMockBuilderConfig(t *testing.T) (*BuilderConfig, *testWorkerBackend) { } return bConfig, backend } + +func (b *testWorkerBackend) newCall(to common.Address, data []byte) *types.Transaction { + gasPrice := big.NewInt(10 * params.InitialBaseFee) + tx, _ := types.SignTx(types.NewTransaction(b.txPool.Nonce(testBankAddress), to, big.NewInt(0), 1000000, gasPrice, data), types.HomesteadSigner{}, testBankKey) + return tx +} + +var ( + suaveExample1Addr = common.Address{0x1} + suaveExample1Artifact = readContractArtifact("Example.sol/Example.json") +) + +type artifactObj struct { + Abi *abi.ABI `json:"abi"` + DeployedBytecode struct { + Object string + } `json:"deployedBytecode"` +} + +func readContractArtifact(name string) *artifactObj { + // Get the caller's file path. + _, filename, _, _ := runtime.Caller(1) + + // Resolve the directory of the caller's file. + callerDir := filepath.Dir(filename) + + // Construct the absolute path to the target file. + targetFilePath := filepath.Join(callerDir, "./contracts/out/", name) + + data, err := os.ReadFile(targetFilePath) + if err != nil { + panic(fmt.Sprintf("failed to read artifact %s: %v. Maybe you forgot to generate the artifacts? `cd suave && forge build`", name, err)) + } + + var obj artifactObj + if err := json.Unmarshal(data, &obj); err != nil { + panic(fmt.Sprintf("failed to unmarshal artifact %s: %v", name, err)) + } + return &obj +} diff --git a/miner/contracts/Example.sol b/miner/contracts/Example.sol new file mode 100644 index 000000000000..ee19421ae797 --- /dev/null +++ b/miner/contracts/Example.sol @@ -0,0 +1,10 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.13; + +contract Example { + event SomeEvent(uint256 value); + + function get(uint256 value) public { + emit SomeEvent(value); + } +} diff --git a/miner/contracts/out/Example.sol/Example.json b/miner/contracts/out/Example.sol/Example.json new file mode 100644 index 000000000000..a6d29a789a16 --- /dev/null +++ b/miner/contracts/out/Example.sol/Example.json @@ -0,0 +1 @@ +{"abi":[{"type":"function","name":"get","inputs":[{"name":"value","type":"uint256","internalType":"uint256"}],"outputs":[],"stateMutability":"nonpayable"},{"type":"event","name":"SomeEvent","inputs":[{"name":"value","type":"uint256","indexed":false,"internalType":"uint256"}],"anonymous":false}],"bytecode":{"object":"0x608060405234801561001057600080fd5b5060c28061001f6000396000f3fe6080604052348015600f57600080fd5b506004361060285760003560e01c80639507d39a14602d575b600080fd5b603c60383660046074565b603e565b005b6040518181527f379340f64b65a8890c7ea4f6d86d2359beaf41080f36a7ea64b78a2c06eee3f09060200160405180910390a150565b600060208284031215608557600080fd5b503591905056fea26469706673582212203cfea3df666a7e41bff65aa69c07e26051460f3288035e35ea606ab0614229b564736f6c63430008170033","sourceMap":"65:135:0:-:0;;;;;;;;;;;;;;;;;;;","linkReferences":{}},"deployedBytecode":{"object":"0x6080604052348015600f57600080fd5b506004361060285760003560e01c80639507d39a14602d575b600080fd5b603c60383660046074565b603e565b005b6040518181527f379340f64b65a8890c7ea4f6d86d2359beaf41080f36a7ea64b78a2c06eee3f09060200160405180910390a150565b600060208284031215608557600080fd5b503591905056fea26469706673582212203cfea3df666a7e41bff65aa69c07e26051460f3288035e35ea606ab0614229b564736f6c63430008170033","sourceMap":"65:135:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;125:73;;;;;;:::i;:::-;;:::i;:::-;;;175:16;;345:25:1;;;175:16:0;;333:2:1;318:18;175:16:0;;;;;;;125:73;:::o;14:180:1:-;73:6;126:2;114:9;105:7;101:23;97:32;94:52;;;142:1;139;132:12;94:52;-1:-1:-1;165:23:1;;14:180;-1:-1:-1;14:180:1:o","linkReferences":{}},"methodIdentifiers":{"get(uint256)":"9507d39a"},"rawMetadata":"{\"compiler\":{\"version\":\"0.8.23+commit.f704f362\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"SomeEvent\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"get\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"miner/contracts/Example.sol\":\"Example\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"miner/contracts/Example.sol\":{\"keccak256\":\"0xfadb2989315258b80dfee467dcef581e6782c5b69f59f5d7caa2886a355b62ff\",\"license\":\"UNLICENSED\",\"urls\":[\"bzz-raw://741d3e955be2a353512f12022dd091cc4ec6f05b7babf5f80e4761291defe761\",\"dweb:/ipfs/QmShqnnsLiNKQYKXdmnJmkUAxYHbs6DLNTt1JoR9VjRbH4\"]}},\"version\":1}","metadata":{"compiler":{"version":"0.8.23+commit.f704f362"},"language":"Solidity","output":{"abi":[{"inputs":[{"internalType":"uint256","name":"value","type":"uint256","indexed":false}],"type":"event","name":"SomeEvent","anonymous":false},{"inputs":[{"internalType":"uint256","name":"value","type":"uint256"}],"stateMutability":"nonpayable","type":"function","name":"get"}],"devdoc":{"kind":"dev","methods":{},"version":1},"userdoc":{"kind":"user","methods":{},"version":1}},"settings":{"remappings":[],"optimizer":{"enabled":true,"runs":200},"metadata":{"bytecodeHash":"ipfs"},"compilationTarget":{"miner/contracts/Example.sol":"Example"},"evmVersion":"paris","libraries":{}},"sources":{"miner/contracts/Example.sol":{"keccak256":"0xfadb2989315258b80dfee467dcef581e6782c5b69f59f5d7caa2886a355b62ff","urls":["bzz-raw://741d3e955be2a353512f12022dd091cc4ec6f05b7babf5f80e4761291defe761","dweb:/ipfs/QmShqnnsLiNKQYKXdmnJmkUAxYHbs6DLNTt1JoR9VjRbH4"],"license":"UNLICENSED"}},"version":1},"ast":{"absolutePath":"miner/contracts/Example.sol","id":17,"exportedSymbols":{"Example":[16]},"nodeType":"SourceUnit","src":"39:162:0","nodes":[{"id":1,"nodeType":"PragmaDirective","src":"39:24:0","nodes":[],"literals":["solidity","^","0.8",".13"]},{"id":16,"nodeType":"ContractDefinition","src":"65:135:0","nodes":[{"id":5,"nodeType":"EventDefinition","src":"88:31:0","nodes":[],"anonymous":false,"eventSelector":"379340f64b65a8890c7ea4f6d86d2359beaf41080f36a7ea64b78a2c06eee3f0","name":"SomeEvent","nameLocation":"94:9:0","parameters":{"id":4,"nodeType":"ParameterList","parameters":[{"constant":false,"id":3,"indexed":false,"mutability":"mutable","name":"value","nameLocation":"112:5:0","nodeType":"VariableDeclaration","scope":5,"src":"104:13:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":2,"name":"uint256","nodeType":"ElementaryTypeName","src":"104:7:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"}],"src":"103:15:0"}},{"id":15,"nodeType":"FunctionDefinition","src":"125:73:0","nodes":[],"body":{"id":14,"nodeType":"Block","src":"160:38:0","nodes":[],"statements":[{"eventCall":{"arguments":[{"id":11,"name":"value","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":7,"src":"185:5:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_uint256","typeString":"uint256"}],"id":10,"name":"SomeEvent","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":5,"src":"175:9:0","typeDescriptions":{"typeIdentifier":"t_function_event_nonpayable$_t_uint256_$returns$__$","typeString":"function (uint256)"}},"id":12,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"nameLocations":[],"names":[],"nodeType":"FunctionCall","src":"175:16:0","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":13,"nodeType":"EmitStatement","src":"170:21:0"}]},"functionSelector":"9507d39a","implemented":true,"kind":"function","modifiers":[],"name":"get","nameLocation":"134:3:0","parameters":{"id":8,"nodeType":"ParameterList","parameters":[{"constant":false,"id":7,"mutability":"mutable","name":"value","nameLocation":"146:5:0","nodeType":"VariableDeclaration","scope":15,"src":"138:13:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":6,"name":"uint256","nodeType":"ElementaryTypeName","src":"138:7:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"}],"src":"137:15:0"},"returnParameters":{"id":9,"nodeType":"ParameterList","parameters":[],"src":"160:0:0"},"scope":16,"stateMutability":"nonpayable","virtual":false,"visibility":"public"}],"abstract":false,"baseContracts":[],"canonicalName":"Example","contractDependencies":[],"contractKind":"contract","fullyImplemented":true,"linearizedBaseContracts":[16],"name":"Example","nameLocation":"74:7:0","scope":17,"usedErrors":[],"usedEvents":[5]}],"license":"UNLICENSED"},"id":0} \ No newline at end of file diff --git a/miner/worker_test.go b/miner/worker_test.go index 59fbbbcdca9a..7eb517c92795 100644 --- a/miner/worker_test.go +++ b/miner/worker_test.go @@ -118,6 +118,10 @@ func newTestWorkerBackend(t *testing.T, chainConfig *params.ChainConfig, engine Config: chainConfig, Alloc: core.GenesisAlloc{testBankAddress: {Balance: testBankFunds}}, } + // == SUAVE SPECIFIC == + // Add custom contracts for the genesis + gspec.Alloc[suaveExample1Addr] = core.GenesisAccount{Balance: big.NewInt(0), Code: common.FromHex(suaveExample1Artifact.DeployedBytecode.Object)} + // == END OF SUAVE SPECIFIC == switch e := engine.(type) { case *clique.Clique: gspec.ExtraData = make([]byte, 32+common.AddressLength+crypto.SignatureLength) From 1652002fad0182718e85d2fb67ad44a04764b06e Mon Sep 17 00:00:00 2001 From: Ferran Borreguero Date: Thu, 22 Feb 2024 12:25:02 +0000 Subject: [PATCH 11/12] More fixes --- core/types/suave_structs.go | 54 ++++--------------- miner/builder.go | 13 ++--- suave/builder/api/api.go | 28 +++++++++- suave/builder/api/api_client.go | 8 ++- suave/builder/api/api_server.go | 16 ++++-- suave/builder/api/api_test.go | 8 ++- suave/builder/api/gen_simulateLog_json.go | 49 +++++++++++++++++ .../builder/api/gen_simulatetxnresult_json.go | 54 +++++++++++++++++++ suave/builder/session_manager.go | 2 +- suave/core/types.go | 25 --------- 10 files changed, 173 insertions(+), 84 deletions(-) create mode 100644 suave/builder/api/gen_simulateLog_json.go create mode 100644 suave/builder/api/gen_simulatetxnresult_json.go diff --git a/core/types/suave_structs.go b/core/types/suave_structs.go index d6f4d1171d76..8e62e0ab9903 100644 --- a/core/types/suave_structs.go +++ b/core/types/suave_structs.go @@ -2,51 +2,19 @@ package types import "github.com/ethereum/go-ethereum/common" -type DataId [16]byte - // Structs type BuildBlockArgs struct { - Slot uint64 - ProposerPubkey []byte - Parent common.Hash - Timestamp uint64 - FeeRecipient common.Address - GasLimit uint64 - Random common.Hash - Withdrawals []*Withdrawal + Slot uint64 + ProposerPubkey []byte + Parent common.Hash + Timestamp uint64 + FeeRecipient common.Address + GasLimit uint64 + Random common.Hash + Withdrawals []*Withdrawal ParentBeaconBlockRoot common.Hash - Extra []byte - BeaconRoot common.Hash - FillPending bool -} - -type DataRecord struct { - Id DataId - Salt DataId - DecryptionCondition uint64 - AllowedPeekers []common.Address - AllowedStores []common.Address - Version string -} - -type HttpRequest struct { - Url string - Method string - Headers []string - Body []byte - WithFlashbotsSignature bool -} - -type SimulateTransactionResult struct { - Egp uint64 - Logs []*SimulatedLog - Success bool - Error string -} - -type SimulatedLog struct { - Data []byte - Addr common.Address - Topics []common.Hash + Extra []byte + BeaconRoot common.Hash + FillPending bool } diff --git a/miner/builder.go b/miner/builder.go index 20c351ec0f09..036e65a1cd70 100644 --- a/miner/builder.go +++ b/miner/builder.go @@ -17,6 +17,7 @@ import ( "github.com/ethereum/go-ethereum/core" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/params" + suavextypes "github.com/ethereum/go-ethereum/suave/builder/api" "github.com/flashbots/go-boost-utils/ssz" "github.com/holiman/uint256" ) @@ -84,13 +85,13 @@ type SBundle struct { RefundPercent *int `json:"percent,omitempty"` } -func (b *Builder) AddTransaction(txn *types.Transaction) (*types.SimulateTransactionResult, error) { +func (b *Builder) AddTransaction(txn *types.Transaction) (*suavextypes.SimulateTransactionResult, error) { // If the context is not set, the logs will not be recorded b.env.state.SetTxContext(txn.Hash(), b.env.tcount) logs, err := b.wrk.commitTransaction(b.env, txn) if err != nil { - return &types.SimulateTransactionResult{ + return &suavextypes.SimulateTransactionResult{ Error: err.Error(), Success: false, }, nil @@ -175,13 +176,13 @@ type SubmitBlockRequest struct { Root phase0.Root } -func receiptToSimResult(receipt *types.Receipt) *types.SimulateTransactionResult { - result := &types.SimulateTransactionResult{ +func receiptToSimResult(receipt *types.Receipt) *suavextypes.SimulateTransactionResult { + result := &suavextypes.SimulateTransactionResult{ Success: true, - Logs: []*types.SimulatedLog{}, + Logs: []*suavextypes.SimulatedLog{}, } for _, log := range receipt.Logs { - result.Logs = append(result.Logs, &types.SimulatedLog{ + result.Logs = append(result.Logs, &suavextypes.SimulatedLog{ Addr: log.Address, Topics: log.Topics, Data: log.Data, diff --git a/suave/builder/api/api.go b/suave/builder/api/api.go index ac80674bb984..adc906452750 100644 --- a/suave/builder/api/api.go +++ b/suave/builder/api/api.go @@ -9,7 +9,10 @@ import ( "github.com/ethereum/go-ethereum/core/types" ) +// TODO: Can we aggregate all the gencodec generation into a single file? //go:generate go run github.com/fjl/gencodec -type BuildBlockArgs -field-override buildBlockArgsMarshaling -out gen_buildblockargs_json.go +//go:generate go run github.com/fjl/gencodec -type SimulateTransactionResult -field-override simulateTransactionResultMarshaling -out gen_simulatetxnresult_json.go +//go:generate go run github.com/fjl/gencodec -type SimulatedLog -field-override simulateLogMarshaling -out gen_simulateLog_json.go type Bundle struct { BlockNumber *big.Int `json:"blockNumber,omitempty"` // if BlockNumber is set it must match DecryptionCondition! @@ -40,8 +43,31 @@ type buildBlockArgsMarshaling struct { Extra hexutil.Bytes } +type SimulateTransactionResult struct { + Egp uint64 `json:"egp"` + Logs []*SimulatedLog `json:"logs"` + Success bool `json:"success"` + Error string `json:"error"` +} + +// field type overrides for gencodec +type simulateTransactionResultMarshaling struct { + Egp hexutil.Uint64 +} + +type SimulatedLog struct { + Data []byte `json:"data"` + Addr common.Address `json:"addr"` + Topics []common.Hash `json:"topics"` +} + +type simulateLogMarshaling struct { + Data hexutil.Bytes +} + type API interface { NewSession(ctx context.Context, args *BuildBlockArgs) (string, error) - AddTransaction(ctx context.Context, sessionId string, tx *types.Transaction) (*types.SimulateTransactionResult, error) + AddTransaction(ctx context.Context, sessionId string, tx *types.Transaction) (*SimulateTransactionResult, error) BuildBlock(ctx context.Context, sessionId string) error + Bid(ctx context.Context, sessioId string, blsPubKey string) error } diff --git a/suave/builder/api/api_client.go b/suave/builder/api/api_client.go index f0ac7165c739..f2a71473975d 100644 --- a/suave/builder/api/api_client.go +++ b/suave/builder/api/api_client.go @@ -35,8 +35,8 @@ func (a *APIClient) NewSession(ctx context.Context, args *BuildBlockArgs) (strin return id, err } -func (a *APIClient) AddTransaction(ctx context.Context, sessionId string, tx *types.Transaction) (*types.SimulateTransactionResult, error) { - var receipt *types.SimulateTransactionResult +func (a *APIClient) AddTransaction(ctx context.Context, sessionId string, tx *types.Transaction) (*SimulateTransactionResult, error) { + var receipt *SimulateTransactionResult err := a.rpc.CallContext(ctx, &receipt, "suavex_addTransaction", sessionId, tx) return receipt, err } @@ -44,3 +44,7 @@ func (a *APIClient) AddTransaction(ctx context.Context, sessionId string, tx *ty func (a *APIClient) BuildBlock(ctx context.Context, sessionId string) error { return a.rpc.CallContext(ctx, nil, "suavex_buildBlock", sessionId) } + +func (a *APIClient) Bid(ctx context.Context, sessioId string, blsPubKey string) error { + return a.rpc.CallContext(ctx, nil, "suavex_bid", sessioId, blsPubKey) +} diff --git a/suave/builder/api/api_server.go b/suave/builder/api/api_server.go index 6ce40a61b6b4..ef0333bc9062 100644 --- a/suave/builder/api/api_server.go +++ b/suave/builder/api/api_server.go @@ -6,11 +6,14 @@ import ( "github.com/ethereum/go-ethereum/core/types" ) +var _ API = (*Server)(nil) + // SessionManager is the backend that manages the session state of the builder API. type SessionManager interface { NewSession(context.Context, *BuildBlockArgs) (string, error) - AddTransaction(sessionId string, tx *types.Transaction) (*types.SimulateTransactionResult, error) + AddTransaction(sessionId string, tx *types.Transaction) (*SimulateTransactionResult, error) BuildBlock(sessionId string) error + Bid(sessionId string, blsPubKey string) error } func NewServer(s SessionManager) *Server { @@ -28,7 +31,7 @@ func (s *Server) NewSession(ctx context.Context, args *BuildBlockArgs) (string, return s.sessionMngr.NewSession(ctx, args) } -func (s *Server) AddTransaction(ctx context.Context, sessionId string, tx *types.Transaction) (*types.SimulateTransactionResult, error) { +func (s *Server) AddTransaction(ctx context.Context, sessionId string, tx *types.Transaction) (*SimulateTransactionResult, error) { return s.sessionMngr.AddTransaction(sessionId, tx) } @@ -36,6 +39,11 @@ func (s *Server) BuildBlock(ctx context.Context, sessionId string) error { return s.sessionMngr.BuildBlock(sessionId) } +func (s *Server) Bid(ctx context.Context, sessioId string, blsPubKey string) error { + return nil +} + +// TODO: Remove type MockServer struct { } @@ -43,8 +51,8 @@ func (s *MockServer) NewSession(ctx context.Context, args *BuildBlockArgs) (stri return "", nil } -func (s *MockServer) AddTransaction(ctx context.Context, sessionId string, tx *types.Transaction) (*types.SimulateTransactionResult, error) { - return &types.SimulateTransactionResult{}, nil +func (s *MockServer) AddTransaction(ctx context.Context, sessionId string, tx *types.Transaction) (*SimulateTransactionResult, error) { + return &SimulateTransactionResult{}, nil } func (s *MockServer) BuildBlock(ctx context.Context) error { diff --git a/suave/builder/api/api_test.go b/suave/builder/api/api_test.go index 66ab9ec8f7bc..ecd97763bc7f 100644 --- a/suave/builder/api/api_test.go +++ b/suave/builder/api/api_test.go @@ -34,8 +34,8 @@ func (nullSessionManager) NewSession(ctx context.Context, args *BuildBlockArgs) return "1", ctx.Err() } -func (nullSessionManager) AddTransaction(sessionId string, tx *types.Transaction) (*types.SimulateTransactionResult, error) { - return &types.SimulateTransactionResult{Logs: []*types.SimulatedLog{}}, nil +func (nullSessionManager) AddTransaction(sessionId string, tx *types.Transaction) (*SimulateTransactionResult, error) { + return &SimulateTransactionResult{Logs: []*SimulatedLog{}}, nil } func (nullSessionManager) AddBundle(sessionId string, bundle Bundle) error { @@ -45,3 +45,7 @@ func (nullSessionManager) AddBundle(sessionId string, bundle Bundle) error { func (nullSessionManager) BuildBlock(sessionId string) error { return nil } + +func (nullSessionManager) Bid(sessioId string, blsPubKey string) error { + return nil +} diff --git a/suave/builder/api/gen_simulateLog_json.go b/suave/builder/api/gen_simulateLog_json.go new file mode 100644 index 000000000000..c6916b9a7b7b --- /dev/null +++ b/suave/builder/api/gen_simulateLog_json.go @@ -0,0 +1,49 @@ +// Code generated by github.com/fjl/gencodec. DO NOT EDIT. + +package api + +import ( + "encoding/json" + + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" +) + +var _ = (*simulateLogMarshaling)(nil) + +// MarshalJSON marshals as JSON. +func (s SimulatedLog) MarshalJSON() ([]byte, error) { + type SimulatedLog struct { + Data hexutil.Bytes `json:"data"` + Addr common.Address `json:"addr"` + Topics []common.Hash `json:"topics"` + } + var enc SimulatedLog + enc.Data = s.Data + enc.Addr = s.Addr + enc.Topics = s.Topics + return json.Marshal(&enc) +} + +// UnmarshalJSON unmarshals from JSON. +func (s *SimulatedLog) UnmarshalJSON(input []byte) error { + type SimulatedLog struct { + Data *hexutil.Bytes `json:"data"` + Addr *common.Address `json:"addr"` + Topics []common.Hash `json:"topics"` + } + var dec SimulatedLog + if err := json.Unmarshal(input, &dec); err != nil { + return err + } + if dec.Data != nil { + s.Data = *dec.Data + } + if dec.Addr != nil { + s.Addr = *dec.Addr + } + if dec.Topics != nil { + s.Topics = dec.Topics + } + return nil +} diff --git a/suave/builder/api/gen_simulatetxnresult_json.go b/suave/builder/api/gen_simulatetxnresult_json.go new file mode 100644 index 000000000000..0834996a25da --- /dev/null +++ b/suave/builder/api/gen_simulatetxnresult_json.go @@ -0,0 +1,54 @@ +// Code generated by github.com/fjl/gencodec. DO NOT EDIT. + +package api + +import ( + "encoding/json" + + "github.com/ethereum/go-ethereum/common/hexutil" +) + +var _ = (*simulateTransactionResultMarshaling)(nil) + +// MarshalJSON marshals as JSON. +func (s SimulateTransactionResult) MarshalJSON() ([]byte, error) { + type SimulateTransactionResult struct { + Egp hexutil.Uint64 `json:"egp"` + Logs []*SimulatedLog `json:"logs"` + Success bool `json:"success"` + Error string `json:"error"` + } + var enc SimulateTransactionResult + enc.Egp = hexutil.Uint64(s.Egp) + enc.Logs = s.Logs + enc.Success = s.Success + enc.Error = s.Error + return json.Marshal(&enc) +} + +// UnmarshalJSON unmarshals from JSON. +func (s *SimulateTransactionResult) UnmarshalJSON(input []byte) error { + type SimulateTransactionResult struct { + Egp *hexutil.Uint64 `json:"egp"` + Logs []*SimulatedLog `json:"logs"` + Success *bool `json:"success"` + Error *string `json:"error"` + } + var dec SimulateTransactionResult + if err := json.Unmarshal(input, &dec); err != nil { + return err + } + if dec.Egp != nil { + s.Egp = uint64(*dec.Egp) + } + if dec.Logs != nil { + s.Logs = dec.Logs + } + if dec.Success != nil { + s.Success = *dec.Success + } + if dec.Error != nil { + s.Error = *dec.Error + } + return nil +} diff --git a/suave/builder/session_manager.go b/suave/builder/session_manager.go index e81543f8ce8f..a8d1281615b7 100644 --- a/suave/builder/session_manager.go +++ b/suave/builder/session_manager.go @@ -157,7 +157,7 @@ func (s *SessionManager) getSession(sessionId string) (*miner.Builder, error) { return session, nil } -func (s *SessionManager) AddTransaction(sessionId string, tx *types.Transaction) (*types.SimulateTransactionResult, error) { +func (s *SessionManager) AddTransaction(sessionId string, tx *types.Transaction) (*api.SimulateTransactionResult, error) { builder, err := s.getSession(sessionId) if err != nil { return nil, err diff --git a/suave/core/types.go b/suave/core/types.go index 6071d84db522..aad6b50339cc 100644 --- a/suave/core/types.go +++ b/suave/core/types.go @@ -13,31 +13,6 @@ import ( var AllowedPeekerAny = common.HexToAddress("0xC8df3686b4Afb2BB53e60EAe97EF043FE03Fb829") // "*" type Bytes = hexutil.Bytes -type DataId = types.DataId - -type DataRecord struct { - Id types.DataId - Salt types.DataId - DecryptionCondition uint64 - AllowedPeekers []common.Address - AllowedStores []common.Address - Version string - CreationTx *types.Transaction - Signature []byte -} - -func (b *DataRecord) ToInnerRecord() types.DataRecord { - return types.DataRecord{ - Id: b.Id, - Salt: b.Salt, - DecryptionCondition: b.DecryptionCondition, - AllowedPeekers: b.AllowedPeekers, - AllowedStores: b.AllowedStores, - Version: b.Version, - } -} - -type MEVMBid = types.DataRecord type BuildBlockArgs = types.BuildBlockArgs From 2cd097dffb3042d669ff0a14ede7d844fea160c6 Mon Sep 17 00:00:00 2001 From: Ferran Borreguero Date: Thu, 22 Feb 2024 12:40:41 +0000 Subject: [PATCH 12/12] Expose Bid as function --- miner/builder.go | 11 ++--------- miner/builder_test.go | 20 ++++++++++++++++++++ suave/builder/api/api.go | 11 ++++++++++- suave/builder/api/api_client.go | 7 +++++-- suave/builder/api/api_server.go | 7 ++++--- suave/builder/api/api_test.go | 5 +++-- suave/builder/session_manager.go | 25 +++++++++---------------- 7 files changed, 53 insertions(+), 33 deletions(-) diff --git a/miner/builder.go b/miner/builder.go index 036e65a1cd70..578e2a09e509 100644 --- a/miner/builder.go +++ b/miner/builder.go @@ -117,7 +117,7 @@ func (b *Builder) BuildBlock() (*types.Block, error) { return block, nil } -func (b *Builder) Bid(builderPubKey phase0.BLSPubKey) (*SubmitBlockRequest, error) { +func (b *Builder) Bid(builderPubKey phase0.BLSPubKey) (*suavextypes.SubmitBlockRequest, error) { work := b.env if b.block == nil { @@ -157,7 +157,7 @@ func (b *Builder) Bid(builderPubKey phase0.BLSPubKey) (*SubmitBlockRequest, erro return nil, err } - bidRequest := SubmitBlockRequest{ + bidRequest := suavextypes.SubmitBlockRequest{ Root: phase0.Root(root), SubmitBlockRequest: denebBuilder.SubmitBlockRequest{ Message: &blockBidMsg, @@ -169,13 +169,6 @@ func (b *Builder) Bid(builderPubKey phase0.BLSPubKey) (*SubmitBlockRequest, erro return &bidRequest, nil } -// SubmitBlockRequest is an extension of the builder.SubmitBlockRequest with the root -// of the bid that needs to be signed -type SubmitBlockRequest struct { - denebBuilder.SubmitBlockRequest - Root phase0.Root -} - func receiptToSimResult(receipt *types.Receipt) *suavextypes.SimulateTransactionResult { result := &suavextypes.SimulateTransactionResult{ Success: true, diff --git a/miner/builder_test.go b/miner/builder_test.go index dc615f579c49..d0e89ff3d4b2 100644 --- a/miner/builder_test.go +++ b/miner/builder_test.go @@ -104,6 +104,26 @@ func TestBuilder_ContractWithLogs(t *testing.T) { require.Equal(t, simResult.Logs[0].Topics[0], suaveExample1Artifact.Abi.Events["SomeEvent"].ID) } +func TestBuilder_Bid(t *testing.T) { + t.Parallel() + + config, _ := newMockBuilderConfig(t) + + builder, err := NewBuilder(config, &BuilderArgs{}) + require.NoError(t, err) + + _, err = builder.Bid([48]byte{}) + require.Error(t, err, "cannot create bid without block") + + _, err = builder.BuildBlock() + require.NoError(t, err) + + req, err := builder.Bid([48]byte{}) + require.NoError(t, err) + + fmt.Println("-- req --", req) +} + func newMockBuilderConfig(t *testing.T) (*BuilderConfig, *testWorkerBackend) { var ( db = rawdb.NewMemoryDatabase() diff --git a/suave/builder/api/api.go b/suave/builder/api/api.go index adc906452750..41376fede603 100644 --- a/suave/builder/api/api.go +++ b/suave/builder/api/api.go @@ -4,6 +4,8 @@ import ( "context" "math/big" + denebBuilder "github.com/attestantio/go-builder-client/api/deneb" + "github.com/attestantio/go-eth2-client/spec/phase0" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/core/types" @@ -65,9 +67,16 @@ type simulateLogMarshaling struct { Data hexutil.Bytes } +// SubmitBlockRequest is an extension of the builder.SubmitBlockRequest with the root +// of the bid that needs to be signed +type SubmitBlockRequest struct { + denebBuilder.SubmitBlockRequest + Root phase0.Root +} + type API interface { NewSession(ctx context.Context, args *BuildBlockArgs) (string, error) AddTransaction(ctx context.Context, sessionId string, tx *types.Transaction) (*SimulateTransactionResult, error) BuildBlock(ctx context.Context, sessionId string) error - Bid(ctx context.Context, sessioId string, blsPubKey string) error + Bid(ctx context.Context, sessioId string, blsPubKey phase0.BLSPubKey) (*SubmitBlockRequest, error) } diff --git a/suave/builder/api/api_client.go b/suave/builder/api/api_client.go index f2a71473975d..9f75c04a6254 100644 --- a/suave/builder/api/api_client.go +++ b/suave/builder/api/api_client.go @@ -3,6 +3,7 @@ package api import ( "context" + "github.com/attestantio/go-eth2-client/spec/phase0" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/rpc" ) @@ -45,6 +46,8 @@ func (a *APIClient) BuildBlock(ctx context.Context, sessionId string) error { return a.rpc.CallContext(ctx, nil, "suavex_buildBlock", sessionId) } -func (a *APIClient) Bid(ctx context.Context, sessioId string, blsPubKey string) error { - return a.rpc.CallContext(ctx, nil, "suavex_bid", sessioId, blsPubKey) +func (a *APIClient) Bid(ctx context.Context, sessioId string, blsPubKey phase0.BLSPubKey) (*SubmitBlockRequest, error) { + var req *SubmitBlockRequest + err := a.rpc.CallContext(ctx, &req, "suavex_bid", sessioId, blsPubKey) + return req, err } diff --git a/suave/builder/api/api_server.go b/suave/builder/api/api_server.go index ef0333bc9062..233240bb3db3 100644 --- a/suave/builder/api/api_server.go +++ b/suave/builder/api/api_server.go @@ -3,6 +3,7 @@ package api import ( "context" + "github.com/attestantio/go-eth2-client/spec/phase0" "github.com/ethereum/go-ethereum/core/types" ) @@ -13,7 +14,7 @@ type SessionManager interface { NewSession(context.Context, *BuildBlockArgs) (string, error) AddTransaction(sessionId string, tx *types.Transaction) (*SimulateTransactionResult, error) BuildBlock(sessionId string) error - Bid(sessionId string, blsPubKey string) error + Bid(sessionId string, blsPubKey phase0.BLSPubKey) (*SubmitBlockRequest, error) } func NewServer(s SessionManager) *Server { @@ -39,8 +40,8 @@ func (s *Server) BuildBlock(ctx context.Context, sessionId string) error { return s.sessionMngr.BuildBlock(sessionId) } -func (s *Server) Bid(ctx context.Context, sessioId string, blsPubKey string) error { - return nil +func (s *Server) Bid(ctx context.Context, sessionId string, blsPubKey phase0.BLSPubKey) (*SubmitBlockRequest, error) { + return s.sessionMngr.Bid(sessionId, blsPubKey) } // TODO: Remove diff --git a/suave/builder/api/api_test.go b/suave/builder/api/api_test.go index ecd97763bc7f..0c29477ac106 100644 --- a/suave/builder/api/api_test.go +++ b/suave/builder/api/api_test.go @@ -5,6 +5,7 @@ import ( "math/big" "testing" + "github.com/attestantio/go-eth2-client/spec/phase0" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/rpc" @@ -46,6 +47,6 @@ func (nullSessionManager) BuildBlock(sessionId string) error { return nil } -func (nullSessionManager) Bid(sessioId string, blsPubKey string) error { - return nil +func (nullSessionManager) Bid(sessioId string, blsPubKey phase0.BLSPubKey) (*SubmitBlockRequest, error) { + return nil, nil } diff --git a/suave/builder/session_manager.go b/suave/builder/session_manager.go index a8d1281615b7..cef712659113 100644 --- a/suave/builder/session_manager.go +++ b/suave/builder/session_manager.go @@ -7,10 +7,10 @@ import ( "sync" "time" + "github.com/attestantio/go-eth2-client/spec/phase0" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/math" "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/state" "github.com/ethereum/go-ethereum/core/txpool" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/miner" @@ -19,21 +19,6 @@ import ( "github.com/google/uuid" ) -// blockchain is the minimum interface to the blockchain -// required to build a block -type blockchain interface { - core.ChainContext - - // Header returns the current tip of the chain - CurrentHeader() *types.Header - - // StateAt returns the state at the given root - StateAt(root common.Hash) (*state.StateDB, error) - - // Config returns the chain config - Config() *params.ChainConfig -} - type Config struct { GasCeil uint64 SessionIdleTimeout time.Duration @@ -174,6 +159,14 @@ func (s *SessionManager) BuildBlock(sessionId string) error { return err } +func (s *SessionManager) Bid(sessionId string, blsPubKey phase0.BLSPubKey) (*api.SubmitBlockRequest, error) { + builder, err := s.getSession(sessionId) + if err != nil { + return nil, err + } + return builder.Bid(blsPubKey) +} + // CalcBaseFee calculates the basefee of the header. func CalcBaseFee(config *params.ChainConfig, parent *types.Header) *big.Int { // If the current block is the first EIP-1559 block, return the InitialBaseFee.