From 35c5d582c7caac57c3916742a3b3b3191239f1e2 Mon Sep 17 00:00:00 2001 From: Jay Jie Date: Wed, 23 Oct 2024 19:43:17 -0700 Subject: [PATCH 1/8] refactor(state): abstract execution API from block executor --- block/manager.go | 47 +++++++-- execution/execute.go | 47 +++++++++ state/abci_client.go | 196 +++++++++++++++++++++++++++++++++++++ state/engine_api_client.go | 53 ++++++++++ state/executor.go | 13 ++- 5 files changed, 345 insertions(+), 11 deletions(-) create mode 100644 execution/execute.go create mode 100644 state/abci_client.go create mode 100644 state/engine_api_client.go diff --git a/block/manager.go b/block/manager.go index ae1e620aad..d0da99958f 100644 --- a/block/manager.go +++ b/block/manager.go @@ -157,6 +157,7 @@ type Manager struct { seqClient *grpc.Client lastBatchHash []byte bq *BatchQueue + execClient *state.ABCIExecutionClient } // getInitialState tries to load lastState from Store, and if it's not available it reads GenesisDoc. @@ -242,16 +243,19 @@ func NewManager( // allow buffer for the block header and protocol encoding maxBlobSize -= blockProtocolOverhead - exec := state.NewBlockExecutor(proposerAddress, genesis.ChainID, mempool, mempoolReaper, proxyApp, eventBus, maxBlobSize, logger, execMetrics) + exec := state.NewBlockExecutor(proposerAddress, genesis.ChainID, mempool, mempoolReaper, proxyApp, eventBus, maxBlobSize, logger, execMetrics, store, genesis) + execClient := state.NewABCIExecutionClient(exec) if s.LastBlockHeight+1 == uint64(genesis.InitialHeight) { //nolint:gosec - res, err := exec.InitChain(genesis) + stateRoot, _, err := execClient.InitChain(genesis.GenesisTime, uint(genesis.InitialHeight), genesis.ChainID) if err != nil { return nil, err } - if err := updateState(&s, res); err != nil { + s.AppHash = stateRoot + + // TO-DO updateState needs to be decoupled from ABCI + if err := updateState(&s, stateRoot); err != nil { return nil, err } - if err := store.UpdateState(context.Background(), s); err != nil { return nil, err } @@ -296,6 +300,7 @@ func NewManager( isProposer: isProposer, seqClient: seqClient, bq: NewBatchQueue(), + execClient: execClient, } agg.init(context.Background()) return agg, nil @@ -1435,16 +1440,38 @@ func (m *Manager) applyBlock(ctx context.Context, header *types.SignedHeader, da return m.executor.ApplyBlock(ctx, m.lastState, header, data) } -func updateState(s *types.State, res *abci.ResponseInitChain) error { +func updateState(s *types.State, stateRoot []byte) error { + initChainResponse := &abci.ResponseInitChain{ + AppHash: stateRoot, + ConsensusParams: &cmproto.ConsensusParams{ + Block: &cmproto.BlockParams{ + MaxBytes: s.ConsensusParams.Block.MaxBytes, + MaxGas: s.ConsensusParams.Block.MaxGas, + }, + Evidence: &cmproto.EvidenceParams{ + MaxAgeNumBlocks: s.ConsensusParams.Evidence.MaxAgeNumBlocks, + MaxAgeDuration: s.ConsensusParams.Evidence.MaxAgeDuration, + MaxBytes: s.ConsensusParams.Evidence.MaxBytes, + }, + Validator: &cmproto.ValidatorParams{ + PubKeyTypes: s.ConsensusParams.Validator.PubKeyTypes, + }, + Version: &cmproto.VersionParams{ + App: s.ConsensusParams.Version.App, + }, + }, + Validators: cmtypes.TM2PB.ValidatorUpdates(s.Validators), + } + // If the app did not return an app hash, we keep the one set from the genesis doc in // the state. We don't set appHash since we don't want the genesis doc app hash // recorded in the genesis block. We should probably just remove GenesisDoc.AppHash. - if len(res.AppHash) > 0 { - s.AppHash = res.AppHash + if len(initChainResponse.AppHash) > 0 { + s.AppHash = initChainResponse.AppHash } - if res.ConsensusParams != nil { - params := res.ConsensusParams + if initChainResponse.ConsensusParams != nil { + params := initChainResponse.ConsensusParams if params.Block != nil { s.ConsensusParams.Block.MaxBytes = params.Block.MaxBytes s.ConsensusParams.Block.MaxGas = params.Block.MaxGas @@ -1467,7 +1494,7 @@ func updateState(s *types.State, res *abci.ResponseInitChain) error { // We update the last results hash with the empty hash, to conform with RFC-6962. s.LastResultsHash = merkle.HashFromByteSlices(nil) - vals, err := cmtypes.PB2TM.ValidatorUpdates(res.Validators) + vals, err := cmtypes.PB2TM.ValidatorUpdates(initChainResponse.Validators) if err != nil { return err } diff --git a/execution/execute.go b/execution/execute.go new file mode 100644 index 0000000000..66092f4989 --- /dev/null +++ b/execution/execute.go @@ -0,0 +1,47 @@ +package execution + +import ( + "time" + + "github.com/rollkit/rollkit/types" +) + +/* + ****************************** + * TO-DO move to go-execution * + ****************************** + */ + +// Execute defines a common interface for interacting with the execution client. +type Execute interface { + // InitChain initializes the blockchain with genesis information. + InitChain( + genesisTime time.Time, + initialHeight uint, + chainID string, + ) ( + stateRoot types.Hash, + maxBytes uint, + err error, + ) + + // GetTxs retrieves all available transactions from the execution client's mempool. + GetTxs() ([]types.Tx, error) + + // ExecuteTxs executes a set of transactions to produce a new block header. + ExecuteTxs( + txs []types.Tx, + blockHeight uint64, + timestamp time.Time, + prevStateRoot types.Hash, + ) ( + updatedStateRoot types.Hash, + maxBytes uint64, + err error, + ) + + // SetFinal marks a block at the given height as final. + SetFinal( + blockHeight uint64, + ) error +} diff --git a/state/abci_client.go b/state/abci_client.go new file mode 100644 index 0000000000..a8174d9e75 --- /dev/null +++ b/state/abci_client.go @@ -0,0 +1,196 @@ +package state + +import ( + "context" + "fmt" + "time" + + abci "github.com/cometbft/cometbft/abci/types" + cmtypes "github.com/cometbft/cometbft/types" + "github.com/rollkit/rollkit/execution" + "github.com/rollkit/rollkit/types" +) + +/* + *********************************** + * TO-DO move to go-execution-abci * + *********************************** + */ + +type ABCIExecutionClient struct { + blockExecutor *BlockExecutor +} + +func NewABCIExecutionClient(blockExecutor *BlockExecutor) *ABCIExecutionClient { + return &ABCIExecutionClient{ + blockExecutor: blockExecutor, + } +} + +var _ execution.Execute = (*ABCIExecutionClient)(nil) + +// InitChain initializes the blockchain with genesis information. +func (c *ABCIExecutionClient) InitChain( + genesisTime time.Time, + initialHeight uint, + chainID string, +) (types.Hash, uint, error) { + genesis := &cmtypes.GenesisDoc{ + GenesisTime: genesisTime, + ChainID: chainID, + ConsensusParams: c.blockExecutor.genesis.ConsensusParams, + Validators: c.blockExecutor.genesis.Validators, + AppState: c.blockExecutor.genesis.AppState, + InitialHeight: int64(initialHeight), + } + + response, err := c.blockExecutor.InitChain(genesis) + if err != nil { + return types.Hash{}, 0, err + } + + stateRoot := types.Hash(response.AppHash) + maxBytes := response.ConsensusParams.Block.MaxBytes + return stateRoot, uint(maxBytes), nil +} + +// GetTxs retrieves all available transactions from the mempool. +func (c *ABCIExecutionClient) GetTxs() ([]types.Tx, error) { + state, err := c.blockExecutor.GetState(context.Background()) + if err != nil { + return nil, fmt.Errorf("failed to get current state: %w", err) + } + + maxBytes := state.ConsensusParams.Block.MaxBytes + if maxBytes == -1 { + maxBytes = int64(cmtypes.MaxBlockSizeBytes) + } + if maxBytes > int64(c.blockExecutor.maxBytes) { + c.blockExecutor.logger.Debug("limiting maxBytes to", "maxBytes", c.blockExecutor.maxBytes) + maxBytes = int64(c.blockExecutor.maxBytes) + } + + cmTxs := c.blockExecutor.mempool.ReapMaxTxs(int(maxBytes)) + + rollkitTxs := make([]types.Tx, len(cmTxs)) + for i, tx := range cmTxs { + rollkitTxs[i] = types.Tx(tx) + } + + return rollkitTxs, nil +} + +// ExecuteTxs executes a set of transactions to produce a new block. +func (c *ABCIExecutionClient) ExecuteTxs( + txs []types.Tx, + blockHeight uint64, + timestamp time.Time, + prevStateRoot types.Hash, +) (types.Hash, uint64, error) { + ctx := context.Background() + + state, err := c.blockExecutor.GetState(ctx) + if err != nil { + return types.Hash{}, 0, fmt.Errorf("failed to get current state: %w", err) + } + + cmTxs := fromRollkitTxs(txs) + + var lastSignature *types.Signature + var lastHeaderHash types.Hash + var lastExtendedCommit abci.ExtendedCommitInfo + + if blockHeight == uint64(c.blockExecutor.genesis.InitialHeight) { + lastSignature = &types.Signature{} + lastHeaderHash = types.Hash{} + lastExtendedCommit = abci.ExtendedCommitInfo{} + } else { + lastSignature, err = c.blockExecutor.store.GetSignature(ctx, blockHeight-1) + if err != nil { + return types.Hash{}, 0, fmt.Errorf("error while loading last commit: %w", err) + } + + lastHeader, _, err := c.blockExecutor.store.GetBlockData(ctx, blockHeight-1) + if err != nil { + return types.Hash{}, 0, fmt.Errorf("error while loading last block: %w", err) + } + lastHeaderHash = lastHeader.Hash() + + extCommit, err := c.blockExecutor.store.GetExtendedCommit(ctx, blockHeight-1) + if err != nil { + return types.Hash{}, 0, fmt.Errorf("failed to load extended commit for height %d: %w", blockHeight-1, err) + } + if extCommit != nil { + lastExtendedCommit = *extCommit + } + } + + header, data, err := c.blockExecutor.CreateBlock( + blockHeight, + lastSignature, + lastExtendedCommit, + lastHeaderHash, + state, + cmTxs, + timestamp, + ) + if err != nil { + return types.Hash{}, 0, fmt.Errorf("failed to create block: %w", err) + } + + isValid, err := c.blockExecutor.ProcessProposal(header, data, state) + if err != nil { + return types.Hash{}, 0, fmt.Errorf("failed to process proposal: %w", err) + } + if !isValid { + return types.Hash{}, 0, fmt.Errorf("proposal was not valid") + } + + newState, resp, err := c.blockExecutor.ApplyBlock(ctx, state, header, data) + if err != nil { + return types.Hash{}, 0, fmt.Errorf("failed to apply block: %w", err) + } + + appHash, _, err := c.blockExecutor.Commit(ctx, newState, header, data, resp) + if err != nil { + return types.Hash{}, 0, fmt.Errorf("failed to commit: %w", err) + } + + return types.Hash(appHash), uint64(newState.ConsensusParams.Block.MaxBytes), nil +} + +// SetFinal marks a block at the given height as final. +func (c *ABCIExecutionClient) SetFinal(blockHeight uint64) error { + ctx := context.Background() + + header, data, err := c.blockExecutor.store.GetBlockData(ctx, blockHeight) + if err != nil { + return fmt.Errorf("failed to get block data for height %d: %w", blockHeight, err) + } + + state, err := c.blockExecutor.GetState(ctx) + if err != nil { + return fmt.Errorf("failed to get current state: %w", err) + } + + resp, err := c.blockExecutor.proxyApp.FinalizeBlock(ctx, &abci.RequestFinalizeBlock{ + Hash: header.Hash(), + Height: int64(blockHeight), + Time: header.Time(), + Txs: data.Txs.ToSliceOfBytes(), + ProposerAddress: header.ProposerAddress, + NextValidatorsHash: state.Validators.Hash(), + }) + if err != nil { + return fmt.Errorf("failed to finalize block at height %d: %w", blockHeight, err) + } + + state.AppHash = resp.AppHash + if err := c.blockExecutor.store.UpdateState(ctx, state); err != nil { + return fmt.Errorf("failed to update state after finalizing block %d: %w", blockHeight, err) + } + + c.blockExecutor.logger.Info("Block finalized", "height", blockHeight, "hash", header.Hash()) + + return nil +} diff --git a/state/engine_api_client.go b/state/engine_api_client.go new file mode 100644 index 0000000000..344f637143 --- /dev/null +++ b/state/engine_api_client.go @@ -0,0 +1,53 @@ +package state + +import ( + "time" + + "github.com/rollkit/rollkit/execution" + "github.com/rollkit/rollkit/types" +) + +/* + *********************************** + * TO-DO move to go-execution-EVM * + *********************************** + */ + +type EngineAPIExecutionClient struct { +} + +// NewEngineAPIExecutionClient creates a new instance of EngineAPIExecutionClient. +func NewEngineAPIExecutionClient() *EngineAPIExecutionClient { + return &EngineAPIExecutionClient{} +} + +var _ execution.Execute = (*EngineAPIExecutionClient)(nil) + +// InitChain initializes the blockchain with genesis information. +func (c *EngineAPIExecutionClient) InitChain( + genesisTime time.Time, + initialHeight uint, + chainID string, +) (types.Hash, uint, error) { + return types.Hash{}, 0, nil +} + +// GetTxs retrieves all available transactions from the mempool. +func (c *EngineAPIExecutionClient) GetTxs() ([]types.Tx, error) { + return nil, nil +} + +// ExecuteTxs executes a set of transactions to produce a new block. +func (c *EngineAPIExecutionClient) ExecuteTxs( + txs []types.Tx, + blockHeight uint64, + timestamp time.Time, + prevStateRoot types.Hash, +) (types.Hash, uint64, error) { + return types.Hash{}, 0, nil +} + +// SetFinal marks a block at the given height as final. +func (c *EngineAPIExecutionClient) SetFinal(blockHeight uint64) error { + return nil +} diff --git a/state/executor.go b/state/executor.go index d5ce1df0db..c1e9f596ec 100644 --- a/state/executor.go +++ b/state/executor.go @@ -14,6 +14,7 @@ import ( cmtypes "github.com/cometbft/cometbft/types" "github.com/rollkit/rollkit/mempool" + "github.com/rollkit/rollkit/store" "github.com/rollkit/rollkit/third_party/log" "github.com/rollkit/rollkit/types" abciconv "github.com/rollkit/rollkit/types/abci" @@ -39,10 +40,13 @@ type BlockExecutor struct { logger log.Logger metrics *Metrics + + store store.Store // Add this field + genesis *cmtypes.GenesisDoc } // NewBlockExecutor creates new instance of BlockExecutor. -func NewBlockExecutor(proposerAddress []byte, chainID string, mempool mempool.Mempool, mempoolReaper *mempool.CListMempoolReaper, proxyApp proxy.AppConnConsensus, eventBus *cmtypes.EventBus, maxBytes uint64, logger log.Logger, metrics *Metrics) *BlockExecutor { +func NewBlockExecutor(proposerAddress []byte, chainID string, mempool mempool.Mempool, mempoolReaper *mempool.CListMempoolReaper, proxyApp proxy.AppConnConsensus, eventBus *cmtypes.EventBus, maxBytes uint64, logger log.Logger, metrics *Metrics, store store.Store, genesis *cmtypes.GenesisDoc) *BlockExecutor { return &BlockExecutor{ proposerAddress: proposerAddress, chainID: chainID, @@ -53,6 +57,8 @@ func NewBlockExecutor(proposerAddress []byte, chainID string, mempool mempool.Me maxBytes: maxBytes, logger: logger, metrics: metrics, + store: store, + genesis: genesis, } } @@ -549,3 +555,8 @@ func fromRollkitTxs(rollkitTxs types.Txs) cmtypes.Txs { } return txs } + +// GetState retrieves the current state from the store +func (e *BlockExecutor) GetState(ctx context.Context) (types.State, error) { + return e.store.GetState(ctx) +} From 459d62e782d041273f0e7e89d950a89fc01ac629 Mon Sep 17 00:00:00 2001 From: Jay Jie Date: Wed, 23 Oct 2024 19:46:16 -0700 Subject: [PATCH 2/8] chore: remove redundant GetState method on executor --- state/abci_client.go | 6 +++--- state/executor.go | 5 ----- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/state/abci_client.go b/state/abci_client.go index a8174d9e75..5cca5f6d7e 100644 --- a/state/abci_client.go +++ b/state/abci_client.go @@ -56,7 +56,7 @@ func (c *ABCIExecutionClient) InitChain( // GetTxs retrieves all available transactions from the mempool. func (c *ABCIExecutionClient) GetTxs() ([]types.Tx, error) { - state, err := c.blockExecutor.GetState(context.Background()) + state, err := c.blockExecutor.store.GetState(context.Background()) if err != nil { return nil, fmt.Errorf("failed to get current state: %w", err) } @@ -89,7 +89,7 @@ func (c *ABCIExecutionClient) ExecuteTxs( ) (types.Hash, uint64, error) { ctx := context.Background() - state, err := c.blockExecutor.GetState(ctx) + state, err := c.blockExecutor.store.GetState(ctx) if err != nil { return types.Hash{}, 0, fmt.Errorf("failed to get current state: %w", err) } @@ -168,7 +168,7 @@ func (c *ABCIExecutionClient) SetFinal(blockHeight uint64) error { return fmt.Errorf("failed to get block data for height %d: %w", blockHeight, err) } - state, err := c.blockExecutor.GetState(ctx) + state, err := c.blockExecutor.store.GetState(ctx) if err != nil { return fmt.Errorf("failed to get current state: %w", err) } diff --git a/state/executor.go b/state/executor.go index c1e9f596ec..679ec58807 100644 --- a/state/executor.go +++ b/state/executor.go @@ -555,8 +555,3 @@ func fromRollkitTxs(rollkitTxs types.Txs) cmtypes.Txs { } return txs } - -// GetState retrieves the current state from the store -func (e *BlockExecutor) GetState(ctx context.Context) (types.State, error) { - return e.store.GetState(ctx) -} From 291fc7bf6ad7fd63b9a077b0b453ac80cea8ac12 Mon Sep 17 00:00:00 2001 From: Jay Jie Date: Thu, 24 Oct 2024 16:53:48 -0700 Subject: [PATCH 3/8] feat: evm execution client implementation --- block/manager.go | 2 +- execution/execute.go | 4 +- go.mod | 23 +++- go.sum | 90 +++++++++++++-- state/abci_client.go | 6 +- state/engine_api_client.go | 231 ++++++++++++++++++++++++++++++++++--- 6 files changed, 327 insertions(+), 29 deletions(-) diff --git a/block/manager.go b/block/manager.go index d0da99958f..ff8a4e4915 100644 --- a/block/manager.go +++ b/block/manager.go @@ -246,7 +246,7 @@ func NewManager( exec := state.NewBlockExecutor(proposerAddress, genesis.ChainID, mempool, mempoolReaper, proxyApp, eventBus, maxBlobSize, logger, execMetrics, store, genesis) execClient := state.NewABCIExecutionClient(exec) if s.LastBlockHeight+1 == uint64(genesis.InitialHeight) { //nolint:gosec - stateRoot, _, err := execClient.InitChain(genesis.GenesisTime, uint(genesis.InitialHeight), genesis.ChainID) + stateRoot, _, err := execClient.InitChain(genesis.GenesisTime, uint64(genesis.InitialHeight), genesis.ChainID) if err != nil { return nil, err } diff --git a/execution/execute.go b/execution/execute.go index 66092f4989..5987e8f8e4 100644 --- a/execution/execute.go +++ b/execution/execute.go @@ -17,11 +17,11 @@ type Execute interface { // InitChain initializes the blockchain with genesis information. InitChain( genesisTime time.Time, - initialHeight uint, + initialHeight uint64, chainID string, ) ( stateRoot types.Hash, - maxBytes uint, + maxBytes uint64, err error, ) diff --git a/go.mod b/go.mod index 0abb410998..6fefbda583 100644 --- a/go.mod +++ b/go.mod @@ -38,6 +38,7 @@ require ( github.com/BurntSushi/toml v1.4.0 github.com/btcsuite/btcd/btcec/v2 v2.3.4 github.com/celestiaorg/go-header v0.6.2 + github.com/ethereum/go-ethereum v1.14.11 github.com/ipfs/go-ds-badger4 v0.1.5 github.com/mitchellh/mapstructure v1.5.0 github.com/rollkit/go-sequencing v0.2.1-0.20241010053131-3134457dc4e5 @@ -45,8 +46,11 @@ require ( require ( github.com/DataDog/zstd v1.4.5 // indirect + github.com/Microsoft/go-winio v0.6.2 // indirect + github.com/StackExchange/wmi v1.2.1 // indirect github.com/benbjohnson/clock v1.3.5 // indirect github.com/beorn7/perks v1.0.1 // indirect + github.com/bits-and-blooms/bitset v1.13.0 // indirect github.com/btcsuite/btcd/chaincfg/chainhash v1.0.2 // indirect github.com/celestiaorg/go-libp2p-messenger v0.2.0 // indirect github.com/cespare/xxhash v1.1.0 // indirect @@ -54,15 +58,20 @@ require ( github.com/cockroachdb/errors v1.11.3 // indirect github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce // indirect github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect - github.com/cockroachdb/pebble v1.1.1 // indirect + github.com/cockroachdb/pebble v1.1.2 // indirect github.com/cockroachdb/redact v1.1.5 // indirect github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect github.com/cometbft/cometbft-db v0.11.0 // indirect + github.com/consensys/bavard v0.1.13 // indirect + github.com/consensys/gnark-crypto v0.12.1 // indirect github.com/containerd/cgroups v1.1.0 // indirect github.com/coreos/go-systemd/v22 v22.5.0 // indirect github.com/cpuguy83/go-md2man/v2 v2.0.4 // indirect + github.com/crate-crypto/go-ipa v0.0.0-20240223125850-b1e8a79f509c // indirect + github.com/crate-crypto/go-kzg-4844 v1.0.0 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/davidlazar/go-crypto v0.0.0-20200604182044-b73af7476f6c // indirect + github.com/deckarep/golang-set/v2 v2.6.0 // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect github.com/dgraph-io/badger/v2 v2.2007.4 // indirect github.com/dgraph-io/badger/v4 v4.2.1-0.20231013074411-fb1b00959581 // indirect @@ -71,6 +80,8 @@ require ( github.com/docker/go-units v0.5.0 // indirect github.com/dustin/go-humanize v1.0.1 // indirect github.com/elastic/gosigar v0.14.3 // indirect + github.com/ethereum/c-kzg-4844 v1.0.0 // indirect + github.com/ethereum/go-verkle v0.1.1-0.20240829091221-dffa7562dbe9 // indirect github.com/filecoin-project/go-jsonrpc v0.6.0 // indirect github.com/flynn/noise v1.1.0 // indirect github.com/francoispqt/gojay v1.2.13 // indirect @@ -80,12 +91,13 @@ require ( github.com/go-logfmt/logfmt v0.6.0 // indirect github.com/go-logr/logr v1.4.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect + github.com/go-ole/go-ole v1.3.0 // indirect github.com/go-task/slim-sprig/v3 v3.0.0 // indirect github.com/godbus/dbus/v5 v5.1.0 // indirect github.com/golang/glog v1.2.2 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/protobuf v1.5.4 // indirect - github.com/golang/snappy v0.0.4 // indirect + github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb // indirect github.com/google/btree v1.1.2 // indirect github.com/google/flatbuffers v1.12.1 // indirect github.com/google/go-cmp v0.6.0 // indirect @@ -99,6 +111,7 @@ require ( github.com/hashicorp/golang-lru v1.0.2 // indirect github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect github.com/hashicorp/hcl v1.0.0 // indirect + github.com/holiman/uint256 v1.3.1 // indirect github.com/huin/goupnp v1.3.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/ipfs/boxo v0.22.0 // indirect @@ -136,6 +149,7 @@ require ( github.com/mikioh/tcpopt v0.0.0-20190314235656-172688c1accc // indirect github.com/minio/highwayhash v1.0.2 // indirect github.com/minio/sha256-simd v1.0.1 // indirect + github.com/mmcloughlin/addchain v0.4.0 // indirect github.com/mr-tron/base58 v1.2.0 // indirect github.com/multiformats/go-base32 v0.1.0 // indirect github.com/multiformats/go-base36 v0.2.0 // indirect @@ -185,6 +199,7 @@ require ( github.com/sagikazarmark/locafero v0.4.0 // indirect github.com/sagikazarmark/slog-shim v0.1.0 // indirect github.com/sasha-s/go-deadlock v0.3.1 // indirect + github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible // indirect github.com/sourcegraph/conc v0.3.0 // indirect github.com/spaolacci/murmur3 v1.1.0 // indirect github.com/spf13/afero v1.11.0 // indirect @@ -192,7 +207,10 @@ require ( github.com/spf13/pflag v1.0.5 // indirect github.com/stretchr/objx v0.5.2 // indirect github.com/subosito/gotenv v1.6.0 // indirect + github.com/supranational/blst v0.3.13 // indirect github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 // indirect + github.com/tklauser/go-sysconf v0.3.12 // indirect + github.com/tklauser/numcpus v0.6.1 // indirect github.com/whyrusleeping/go-keyspace v0.0.0-20160322163242-5b898ac5add1 // indirect github.com/wlynxg/anet v0.0.4 // indirect go.etcd.io/bbolt v1.3.10 // indirect @@ -217,4 +235,5 @@ require ( gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect lukechampine.com/blake3 v1.3.0 // indirect + rsc.io/tmplfunc v0.0.3 // indirect ) diff --git a/go.sum b/go.sum index 83af281415..4f1f1a657a 100644 --- a/go.sum +++ b/go.sum @@ -100,8 +100,8 @@ github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF0 github.com/Masterminds/sprig v2.15.0+incompatible/go.mod h1:y6hNFY5UBTIWBxnzTeuNhlNS5hqE0NB0E6fgfo2Br3o= github.com/Masterminds/sprig v2.22.0+incompatible/go.mod h1:y6hNFY5UBTIWBxnzTeuNhlNS5hqE0NB0E6fgfo2Br3o= github.com/Microsoft/go-winio v0.5.2/go.mod h1:WpS1mjBmmwHBEWmogvA2mj8546UReBk4v8QkMxJ6pZY= -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/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY= +github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU= github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 h1:TngWCqHvy9oXAN6lEVMRuU21PR1EtLVZJmdB18Gu3Rw= github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5/go.mod h1:lmUJ/7eu/Q8D7ML55dXQrVaamCz2vxCfdQBasLZfHKk= github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE= @@ -109,6 +109,10 @@ github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAE github.com/OpenPeeDeeP/depguard v1.1.0/go.mod h1:JtAMzWkmFEzDPyAd+W0NHl1lvpQKTvT9jnRVsohBKpc= github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= +github.com/StackExchange/wmi v1.2.1 h1:VIkavFPXSjcnS+O8yTq7NI32k0R5Aj+v39y29VYDOSA= +github.com/StackExchange/wmi v1.2.1/go.mod h1:rcmrprowKIVzvc+NUiLncP2uuArMWLCbu9SBzvHz7e8= +github.com/VictoriaMetrics/fastcache v1.12.2 h1:N0y9ASrJ0F6h0QaC3o6uJb3NIZ9VKLjCM7NQbSmF7WI= +github.com/VictoriaMetrics/fastcache v1.12.2/go.mod h1:AmC+Nzz1+3G2eCPapF6UcsnkThDcMsQicp4xDukwJYI= github.com/VividCortex/gohistogram v1.0.0 h1:6+hBz+qvs0JOrrNhhmR7lFxo5sINxBCGXrdtl/UvroE= github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g= github.com/Workiva/go-datastructures v1.0.53/go.mod h1:1yZL+zfsztete+ePzZz/Zb1/t5BnDuE2Ya2MMGhzP6A= @@ -161,6 +165,8 @@ github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+Ce 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/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= +github.com/bits-and-blooms/bitset v1.13.0 h1:bAQ9OPNFYbGHV6Nez0tmNI0RiEu7/hxlYJRUA0wFAVE= +github.com/bits-and-blooms/bitset v1.13.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8= github.com/bkielbasa/cyclop v1.2.0/go.mod h1:qOI0yy6A7dYC4Zgsa72Ppm9kONl0RoIlPbzot9mhmeI= github.com/blizzy78/varnamelen v0.8.0/go.mod h1:V9TzQZ4fLJ1DSrjVDfl89H7aMnTvKkApdHeyESmyR7k= github.com/bombsimon/wsl/v3 v3.3.0/go.mod h1:st10JtZYLE4D5sC7b8xV4zTKZwAQjCH/Hy2Pm1FNZIc= @@ -248,8 +254,8 @@ github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce h1:giXvy4KSc/6g/e github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce/go.mod h1:9/y3cnZ5GKakj/H4y9r9GTjCvAFta7KLgSHPJJYc52M= 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 v1.1.1 h1:XnKU22oiCLy2Xn8vp1re67cXg4SAasg/WDt1NtcRFaw= -github.com/cockroachdb/pebble v1.1.1/go.mod h1:4exszw1r40423ZsmkG/09AFEG83I0uDgfujJdbL6kYU= +github.com/cockroachdb/pebble v1.1.2 h1:CUh2IPtR4swHlEj48Rhfzw6l/d0qA31fItcIszQVIsA= +github.com/cockroachdb/pebble v1.1.2/go.mod h1:4exszw1r40423ZsmkG/09AFEG83I0uDgfujJdbL6kYU= github.com/cockroachdb/redact v1.1.5 h1:u1PMllDkdFfPWaNGMyLD1+so+aq3uUItthCFqzwPJ30= github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= @@ -259,6 +265,10 @@ github.com/cometbft/cometbft v0.38.12 h1:OWsLZN2KcSSFe8bet9xCn07VwhBnavPea3VyPnN github.com/cometbft/cometbft v0.38.12/go.mod h1:GPHp3/pehPqgX1930HmK1BpBLZPxB75v/dZg8Viwy+o= github.com/cometbft/cometbft-db v0.11.0 h1:M3Lscmpogx5NTbb1EGyGDaFRdsoLWrUWimFEyf7jej8= github.com/cometbft/cometbft-db v0.11.0/go.mod h1:GDPJAC/iFHNjmZZPN8V8C1yr/eyityhi2W1hz2MGKSc= +github.com/consensys/bavard v0.1.13 h1:oLhMLOFGTLdlda/kma4VOJazblc7IM5y5QPd2A/YjhQ= +github.com/consensys/bavard v0.1.13/go.mod h1:9ItSMtA/dXMAiL7BG6bqW2m3NdSEObYWoH223nGHukI= +github.com/consensys/gnark-crypto v0.12.1 h1:lHH39WuuFgVHONRl3J0LRBtuYdQTumFSDtJF7HpyG8M= +github.com/consensys/gnark-crypto v0.12.1/go.mod h1:v2Gy7L/4ZRosZ7Ivs+9SfUDr0f5UlG+EM5t7MPHiLuY= github.com/containerd/cgroups v0.0.0-20201119153540-4cbc285b3327/go.mod h1:ZJeTFisyysqgcCdecO57Dj79RfL0LNeGiFUqLYQRYLE= github.com/containerd/cgroups v1.0.3/go.mod h1:/ofk34relqNjSGyqPrmEULrO4Sc8LJhvJmWbUCUKqj8= github.com/containerd/cgroups v1.1.0 h1:v8rEWFl6EoqHB+swVNjVoCJE8o3jX7e8nqBGPLaDFBM= @@ -289,6 +299,10 @@ github.com/cpuguy83/go-md2man/v2 v2.0.1/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46t github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/cpuguy83/go-md2man/v2 v2.0.4 h1:wfIWP927BUkWJb2NmU/kNDYIBTh/ziUX91+lVfRxZq4= github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/crate-crypto/go-ipa v0.0.0-20240223125850-b1e8a79f509c h1:uQYC5Z1mdLRPrZhHjHxufI8+2UG/i25QG92j0Er9p6I= +github.com/crate-crypto/go-ipa v0.0.0-20240223125850-b1e8a79f509c/go.mod h1:geZJZH3SzKCqnz5VT0q/DyIG/tvu/dZk+VIfXicupJs= +github.com/crate-crypto/go-kzg-4844 v1.0.0 h1:TsSgHwrkTKecKJ4kadtHi4b3xHW5dCFUDFnUp1TsawI= +github.com/crate-crypto/go-kzg-4844 v1.0.0/go.mod h1:1kMhvPgI0Ky3yIa+9lFySEBUBXkYxeOi8ZF1sYioxhc= github.com/creachadair/atomicfile v0.2.6/go.mod h1:BRq8Une6ckFneYXZQ+kO7p1ZZP3I2fzVzf28JxrIkBc= github.com/creachadair/command v0.0.0-20220426235536-a748effdf6a1/go.mod h1:bAM+qFQb/KwWyCc9MLC4U1jvn3XyakqP5QRkds5T6cY= github.com/creachadair/taskgroup v0.3.2/go.mod h1:wieWwecHVzsidg2CsUnFinW1faVN4+kq+TDlRJQ0Wbk= @@ -307,6 +321,8 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8Yc github.com/davidlazar/go-crypto v0.0.0-20170701192655-dcfb0a7ac018/go.mod h1:rQYf4tfk5sSwFsnDg3qYaBxSjsD9S8+59vW0dKUgme4= github.com/davidlazar/go-crypto v0.0.0-20200604182044-b73af7476f6c h1:pFUpOrbxDR6AkioZ1ySsx5yxlDQZ8stG2b88gTPxgJU= github.com/davidlazar/go-crypto v0.0.0-20200604182044-b73af7476f6c/go.mod h1:6UhI8N9EjYm1c2odKpFpAYeR8dsBeM7PtzQhRgxRr9U= +github.com/deckarep/golang-set/v2 v2.6.0 h1:XfcQbWM1LlMB8BsJ8N9vW5ehnnPVIw0je80NsVHagjM= +github.com/deckarep/golang-set/v2 v2.6.0/go.mod h1:VAky9rY/yGXJOLEDv3OMci+7wtDpOF4IN+y82NBOac4= github.com/decred/dcrd/crypto/blake256 v1.0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5ilcvdfma9wOH6Y= github.com/decred/dcrd/crypto/blake256 v1.0.1/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 h1:rpfIENRNNilwHwZeG5+P150SMrnNEcHYvcCuK6dPZSg= @@ -365,6 +381,12 @@ github.com/envoyproxy/protoc-gen-validate v0.0.14/go.mod h1:iSmxcyjqTsJpI2R4NaDN github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/envoyproxy/protoc-gen-validate v0.6.2/go.mod h1:2t7qjJNvHPx8IjnBOzl9E9/baC+qXE/TeeyBRzgJDws= github.com/esimonov/ifshort v1.0.4/go.mod h1:Pe8zjlRrJ80+q2CxHLfEOfTwxCZ4O+MuhcHcfgNWTk0= +github.com/ethereum/c-kzg-4844 v1.0.0 h1:0X1LBXxaEtYD9xsyj9B9ctQEZIpnvVDeoBx8aHEwTNA= +github.com/ethereum/c-kzg-4844 v1.0.0/go.mod h1:VewdlzQmpT5QSrVhbBuGoCdFJkpaJlO1aQputP83wc0= +github.com/ethereum/go-ethereum v1.14.11 h1:8nFDCUUE67rPc6AKxFj7JKaOa2W/W1Rse3oS6LvvxEY= +github.com/ethereum/go-ethereum v1.14.11/go.mod h1:+l/fr42Mma+xBnhefL/+z11/hcmJ2egl+ScIVPjhc7E= +github.com/ethereum/go-verkle v0.1.1-0.20240829091221-dffa7562dbe9 h1:8NfxH2iXvJ60YRB8ChToFTUzl8awsc3cJ8CbLjGIl/A= +github.com/ethereum/go-verkle v0.1.1-0.20240829091221-dffa7562dbe9/go.mod h1:M3b90YRnzqKyyzBEWJGqj8Qff4IDeXnzFw0P9bFw3uk= github.com/ettle/strcase v0.1.1/go.mod h1:hzDLsPC7/lwKyBOywSHEP89nt2pDgdy+No1NBA9o9VY= github.com/facebookgo/ensure v0.0.0-20160127193407-b4ab57deab51/go.mod h1:Yg+htXGokKKdzcwhuNDwVvN+uBxDGXJ7G/VN1d8fa64= github.com/facebookgo/stack v0.0.0-20160209184415-751773369052/go.mod h1:UbMTZqLaRiH3MsBH8va0n7s1pQYcu3uTb8G4tygF4Zg= @@ -403,6 +425,8 @@ github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nos github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= github.com/fullstorydev/grpcurl v1.6.0/go.mod h1:ZQ+ayqbKMJNhzLmbpCiurTVlaK2M/3nqZCxaQ2Ze/sM= github.com/fzipp/gocyclo v0.6.0/go.mod h1:rXPyn8fnlpa0R2csP/31uerbiVBugk5whMdlyaLkLoA= +github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff h1:tY80oXqGNY4FhTFhk+o9oFHGINQ/+vhlm8HFzi6znCI= +github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= github.com/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps= github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= @@ -435,7 +459,10 @@ github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= +github.com/go-ole/go-ole v1.2.5/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= +github.com/go-ole/go-ole v1.3.0 h1:Dt6ye7+vXGIKZ7Xtk4s6/xVdGDQynvom7xCFEdWr6uE= +github.com/go-ole/go-ole v1.3.0/go.mod h1:5LS6F96DhAwUc7C+1HLexzMXY1xGRSryjyPPKW6zv78= github.com/go-redis/redis v6.15.8+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA= github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= @@ -462,6 +489,7 @@ github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5x github.com/godbus/dbus/v5 v5.0.6/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/godbus/dbus/v5 v5.1.0 h1:4KLkAxT3aOY8Li4FRJe/KvhoNFFxo0m6fNuFUO8QJUk= github.com/godbus/dbus/v5 v5.1.0/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= +github.com/gofrs/flock v0.8.1 h1:+gYjHKf32LDeiEEFhQaotPbLuUXjY5ZqxKgXy7n59aw= github.com/gofrs/flock v0.8.1/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU= github.com/gofrs/uuid v4.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= @@ -473,6 +501,8 @@ github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXP github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang-jwt/jwt/v4 v4.0.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= +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-sql/civil v0.0.0-20190719163853-cb61b32ac6fe/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0= github.com/golang-sql/sqlexp v0.0.0-20170517235910-f1bb20e5a188/go.mod h1:vXjM/+wXQnTPR4KqTKDgJukSZ6amVRtWMPEjE6sQoK8= github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= @@ -518,8 +548,9 @@ github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6 github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb h1:PBC98N2aIaM3XXiurYmW7fx4GZkL8feAMVq7nEjURHk= +github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golangci/check v0.0.0-20180506172741-cfe4005ccda2/go.mod h1:k9Qvh+8juN+UKMCS/3jFtGICgW8O96FVaZsaxdzDkR4= github.com/golangci/dupl v0.0.0-20180902072040-3e9179ac440a/go.mod h1:ryS0uhF+x9jgbj/N71xsEqODy9BN81/GonCZiOzirOk= github.com/golangci/go-misc v0.0.0-20220329215616-d24fe342adfe/go.mod h1:gjqyPShc/m8pEMpk0a3SeagVb0kaqvhscv+i9jI5ZhQ= @@ -587,6 +618,7 @@ github.com/google/pprof v0.0.0-20240727154555-813a5fbdbec8 h1:FKHo8hFI3A+7w0aUQu github.com/google/pprof v0.0.0-20240727154555-813a5fbdbec8/go.mod h1:K1liHPHnj73Fdn/EKuT8nrFqBihUSKXoLYU0BuatOYo= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ= +github.com/google/subcommands v1.2.0/go.mod h1:ZjhPrFU+Olkh9WazFPsl27BQ4UPiG37m3yTrtFlrHVk= github.com/google/trillian v1.3.11/go.mod h1:0tPraVHrSDkA3BO6vKX67zgLXs6SsOAbHEivX+9mPgw= github.com/google/uuid v0.0.0-20161128191214-064e2069ce9c/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -659,6 +691,8 @@ github.com/hashicorp/consul/sdk v0.8.0/go.mod h1:GBvyrGALthsZObzUGsfgHZQDXjg4lOj github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/hashicorp/go-bexpr v0.1.10 h1:9kuI5PFotCboP3dkDYFr/wi0gg0QVbSNz5oFRpxn4uE= +github.com/hashicorp/go-bexpr v0.1.10/go.mod h1:oxlubA2vC/gFVfX1A6JGp7ls7uCDlfJn732ehYYg+g0= github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= @@ -705,6 +739,12 @@ github.com/hashicorp/serf v0.9.5/go.mod h1:UWDWwZeL5cuWDJdl0C6wrvrUwEqtQ4ZKBKKEN github.com/hashicorp/serf v0.9.6/go.mod h1:TXZNMjZQijwlDvp+r0b63xZ45H7JmCmgg4gpTwn9UV4= github.com/hashicorp/serf v0.9.7/go.mod h1:TXZNMjZQijwlDvp+r0b63xZ45H7JmCmgg4gpTwn9UV4= github.com/hexops/gotextdiff v1.0.3/go.mod h1:pSWU5MAI3yDq+fZBTazCSJysOMbxWL1BSow5/V2vxeg= +github.com/holiman/billy v0.0.0-20240216141850-2abb0c79d3c4 h1:X4egAf/gcS1zATw6wn4Ej8vjuVGxeHdan+bRb2ebyv4= +github.com/holiman/billy v0.0.0-20240216141850-2abb0c79d3c4/go.mod h1:5GuXa7vkL8u9FkFuWdVvfR5ix8hRB7DbOAaYULamFpc= +github.com/holiman/bloomfilter/v2 v2.0.3 h1:73e0e/V0tCydx14a0SCYS/EWCxgwLZ18CZcZKVu0fao= +github.com/holiman/bloomfilter/v2 v2.0.3/go.mod h1:zpoh+gs7qcpqrHr3dB55AMiJwo0iURXE7ZOP9L9hSkA= +github.com/holiman/uint256 v1.3.1 h1:JfTzmih28bittyHM8z360dCjIA9dbPIBlcTI6lmctQs= +github.com/holiman/uint256 v1.3.1/go.mod h1:EOMSn4q6Nyt9P6efbI3bueV4e1b3dGlUCXeiRV4ng7E= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/huandu/xstrings v1.0.0/go.mod h1:4qWG/gcEcfX4z/mBDHJ++3ReCw9ibxbsNJbcucJdbSo= github.com/huandu/xstrings v1.2.0/go.mod h1:DvyZB1rfVYsBIigL8HwpZgxHwXozlTgGqn63UyNX5k4= @@ -862,6 +902,8 @@ github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+ github.com/kyoh86/exportloopref v0.1.8/go.mod h1:1tUcJeiioIs7VWe5gcOObrux3lb66+sBqGZrRkMwPgg= github.com/ldez/gomoddirectives v0.2.3/go.mod h1:cpgBogWITnCfRq2qGoDkKMEVSaarhdBr6g8G04uz6d0= github.com/ldez/tagliatelle v0.3.1/go.mod h1:8s6WJQwEYHbKZDsp/LjArytKOG8qaMrKQQ3mFukHs88= +github.com/leanovate/gopter v0.2.9 h1:fQjYxZaynp97ozCzfOyOuAGOU4aU/z37zf/tOujFk7c= +github.com/leanovate/gopter v0.2.9/go.mod h1:U2L/78B+KVFIx2VmW6onHJQzXtFb+p5y3y2Sh+Jxxv8= github.com/leonklingele/grouper v1.1.0/go.mod h1:uk3I3uDfi9B6PeUjsCKi6ndcf63Uy7snXgR4yDYQVDY= github.com/letsencrypt/pkcs11key/v4 v4.0.0/go.mod h1:EFUvBDay26dErnNb70Nd0/VW3tJiIbETBPTl9ATXQag= github.com/lib/pq v0.0.0-20180327071824-d34b9ff171c2/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= @@ -1027,6 +1069,8 @@ github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope 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.12/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.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= @@ -1042,6 +1086,8 @@ github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzp github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-runewidth v0.0.6/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= 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/go-sqlite3 v1.9.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= github.com/mattn/go-sqlite3 v1.14.9/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= @@ -1094,8 +1140,13 @@ github.com/mitchellh/mapstructure v1.4.2/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RR github.com/mitchellh/mapstructure v1.4.3/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/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/mitchellh/reflectwalk v1.0.1/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= +github.com/mmcloughlin/addchain v0.4.0 h1:SobOdjm2xLj1KkXN5/n0xTIWyZA2+s99UCY1iPfkHRY= +github.com/mmcloughlin/addchain v0.4.0/go.mod h1:A86O+tHqZLMNO4w6ZZ4FlVQEadcoqkyU72HC5wJ4RlU= +github.com/mmcloughlin/profile v0.1.1/go.mod h1:IhHD7q1ooxgwTgjxQYkACGA77oFTDdFVejUS1/tS/qU= github.com/moby/sys/mountinfo v0.5.0/go.mod h1:3bMD3Rg+zkqx8MRYPi7Pyb0Ie97QEBmdxbhnCLlSvSU= github.com/moby/term v0.0.0-20201216013528-df9cb8a40635/go.mod h1:FBS0z0QWA44HXygs7VXDUOGoN/1TV3RuWkLO04am3wc= github.com/moby/term v0.0.0-20210619224110-3f7ff695adc6/go.mod h1:E2VnQOmVuvZB6UYnnDB0qG5Nq/1tD9acaOpo6xmt0Kw= @@ -1210,6 +1261,7 @@ github.com/oklog/ulid/v2 v2.0.2/go.mod h1:mtBL0Qe/0HAx6/a4Z30qxVIAL1eQDweXq5lxOE github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= github.com/olekukonko/tablewriter v0.0.1/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= github.com/olekukonko/tablewriter v0.0.2/go.mod h1:rSAaSIOAGT9odnlyGlUfAJaoc5w2fSBUmeGDbRWPxyQ= +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.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= @@ -1435,6 +1487,8 @@ github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqn github.com/remyoudompheng/go-dbus v0.0.0-20121104212943-b7232d34b1d5/go.mod h1:+u151txRmLpwxBmpYn9z3d1sdJdjRPQpsXuYeY9jNls= github.com/remyoudompheng/go-liblzma v0.0.0-20190506200333-81bf2d431b96/go.mod h1:90HvCY7+oHHUKkbeMCiHt1WuFR2/hPJ9QrljDG+v6ls= github.com/remyoudompheng/go-misc v0.0.0-20190427085024-2d6ac652a50e/go.mod h1:80FQABjoFzZ2M5uEa6FUaJYEmqU2UOKojlFVak1UAwI= +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/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= @@ -1478,6 +1532,8 @@ github.com/securego/gosec/v2 v2.12.0/go.mod h1:iTpT+eKTw59bSgklBHlSnH5O2tNygHMDx github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= github.com/shazow/go-diff v0.0.0-20160112020656-b6b7b6733b8c/go.mod h1:/PevMnwAxekIXwN8qQyfc5gl2NlkB3CQlkizAbOkeBs= +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/shirou/gopsutil/v3 v3.22.6/go.mod h1:EdIubSnZhbAvBS1yJ7Xi+AShB/hxwLHOMz4MCYz7yMs= github.com/shurcooL/component v0.0.0-20170202220835-f88ec8f54cc4/go.mod h1:XhFIlyj5a1fBNx5aJTbKoIq0mNaPvOagO+HjB3EtxrY= github.com/shurcooL/events v0.0.0-20181021180414-410e4ca65f48/go.mod h1:5u70Mqkb5O5cxEA8nxTsgrgLehJeAw6Oc4Ab1c/P1HM= @@ -1507,8 +1563,8 @@ github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6Mwd github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= -github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= -github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= +github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= +github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/sivchari/containedctx v1.0.2/go.mod h1:PwZOeqm4/DLoJOqMSIJs3aKqXRX4YO+uXww087KZ7Bw= github.com/sivchari/nosnakecase v1.5.0/go.mod h1:CwDzrzPea40/GB6uynrNLiorAlgFRvRbFSgJx2Gs+QY= github.com/sivchari/tenv v1.6.0/go.mod h1:64yStXKSOxDfX47NlhVwND4dHwfZDdbp2Lyl018Icvg= @@ -1564,6 +1620,8 @@ github.com/spf13/viper v1.19.0 h1:RWq5SEjt8o25SROyN3z2OrDB9l7RPd3lwTWU8EcEdcI= github.com/spf13/viper v1.19.0/go.mod h1:GQUN9bilAbhU/jgc1bKs99f/suXKeUMct8Adx5+Ntkg= github.com/src-d/envconfig v1.0.0/go.mod h1:Q9YQZ7BKITldTBnoxsE5gOeB5y66RyPXeue/R4aaNBc= github.com/ssgreg/nlreturn/v2 v2.2.1/go.mod h1:E/iiPB78hV7Szg2YfRgyIrk1AD6JVMTRkkxBiELzh2I= +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/stbenjam/no-sprintf-host-port v0.1.1/go.mod h1:TLhvtIvONRzdmkFiio4O8LHsN9N74I+PhRquPsxpL0I= github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= @@ -1598,6 +1656,8 @@ github.com/subosito/gotenv v1.3.0/go.mod h1:YzJjq/33h7nrwdY+iHMhEOEEbW0ovIz0tB6t github.com/subosito/gotenv v1.4.0/go.mod h1:mZd6rFysKEcUhUHXJk0C/08wAgyDBFuwEYL7vWWGaGo= github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8= github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= +github.com/supranational/blst v0.3.13 h1:AYeSxdOMacwu7FBmpfloBz5pbFXDmJL33RuwnKtmTjk= +github.com/supranational/blst v0.3.13/go.mod h1:jZJtfjgudtNl4en1tzwPIV3KjUnQUvG3/j+w+fVonLw= github.com/sylvia7788/contextcheck v1.0.4/go.mod h1:vuPKJMQ7MQ91ZTqfdyreNKwZjyUg6KO+IebVyQDedZQ= github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= github.com/syndtr/goleveldb v1.0.0/go.mod h1:ZVVdQEZoIme9iO1Ch2Jdy24qqXrMMOU6lpPAyBWyWuQ= @@ -1617,7 +1677,11 @@ github.com/timakin/bodyclose v0.0.0-20210704033933-f49887972144/go.mod h1:Qimiff github.com/tinylib/msgp v1.1.5/go.mod h1:eQsjooMTnV42mHu917E26IogZ2930nFyBQdofk10Udg= github.com/tj/assert v0.0.3/go.mod h1:Ne6X72Q+TB1AteidzQncjw9PabbMp4PBMZ1k+vd1Pvk= github.com/tklauser/go-sysconf v0.3.10/go.mod h1:C8XykCvCb+Gn0oNCWPIlcb0RuglQTYaQ2hGm7jmxEFk= +github.com/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFAEVmqU= +github.com/tklauser/go-sysconf v0.3.12/go.mod h1:Ho14jnntGE1fpdOqQEEaiKRpvIavV0hSfmBq8nJbHYI= github.com/tklauser/numcpus v0.4.0/go.mod h1:1+UI3pD8NW14VMwdgJNJ1ESk2UnwhAnz5hMwiKKqXCQ= +github.com/tklauser/numcpus v0.6.1 h1:ng9scYS7az0Bk4OZLvrNXNSAO2Pxr1XXRAPyjhIx+Fk= +github.com/tklauser/numcpus v0.6.1/go.mod h1:1XfjsgE2zo8GVw7POkMbHENHzVg3GzmoZ9fESEdAacY= github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tmc/grpc-websocket-proxy v0.0.0-20200427203606-3cfed13b9966/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= @@ -1626,13 +1690,18 @@ github.com/tomasen/realip v0.0.0-20180522021738-f0c99a92ddce/go.mod h1:o8v6yHRoi github.com/tommy-muehle/go-mnd/v2 v2.5.0/go.mod h1:WsUAkMJMYww6l/ufffCD3m+P7LEvr8TnZn9lwVDlgzw= github.com/ttacon/chalk v0.0.0-20160626202418-22c06c80ed31/go.mod h1:onvgF043R+lC5RZ8IT9rBXDaEDnpnw/Cl+HFiw+v/7Q= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= +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/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= github.com/ultraware/funlen v0.0.3/go.mod h1:Dp4UiAus7Wdb9KUZsYWZEWiRzGuM2kXM1lPbfaF6xhA= github.com/ultraware/whitespace v0.0.5/go.mod h1:aVMh/gQve5Maj9hQ/hg+F75lr/X5A89uZnzAmWSineA= github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/urfave/cli v1.22.2/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= +github.com/urfave/cli v1.22.10 h1:p8Fspmz3iTctJstry1PYS3HVdllxnEzTEsgIgtxTrCk= github.com/urfave/cli v1.22.10/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= +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/uudashr/gocognit v1.0.6/go.mod h1:nAIUuVBnYU7pcninia3BHOvQkpQCeO76Uscky5BOwcY= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= github.com/valyala/fasthttp v1.30.0/go.mod h1:2rsYD01CKFrjjsvFxx75KlEUNpWNBY9JWD3K/7o2Cus= @@ -1662,6 +1731,8 @@ github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQ github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778/go.mod h1:2MuV+tbUrU1zIOPMxZ5EncGwgmMJsa+9ucAQZXxsObs= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= +github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU= +github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8= github.com/yagipy/maintidx v1.0.0/go.mod h1:0qNf/I/CCZXSMhsRsrEPDZ+DkekpKLXAJfsTACwgXLk= github.com/yeya24/promlinter v0.2.0/go.mod h1:u54lkmBOZrpEbQQ6gox2zWKKLKu2SGe+2KOiextY+IA= github.com/yudai/gojsondiff v1.0.0/go.mod h1:AY32+k2cwILAkW1fbgxQ5mUmMiZFgLIV+FBNExI05xg= @@ -2110,6 +2181,7 @@ golang.org/x/sys v0.0.0-20220624220833-87e55d714810/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220702020025-31831981b65f/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-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.1.0/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.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -2509,6 +2581,8 @@ gopkg.in/ini.v1 v1.66.4/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.66.6/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/natefinch/lumberjack.v2 v2.2.1 h1:bBRl1b0OH9s/DuPhuXpNl+VtCaJXFZ5/uEFST95x9zc= +gopkg.in/natefinch/lumberjack.v2 v2.2.1/go.mod h1:YD8tP3GAjkrDg1eZH7EGmyESg/lsYskCTPBJVb9jqSc= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/src-d/go-cli.v0 v0.0.0-20181105080154-d492247bbc0d/go.mod h1:z+K8VcOYVYcSwSjGebuDL6176A1XskgbtNl64NSg+n8= gopkg.in/src-d/go-log.v1 v1.0.1/go.mod h1:GN34hKP0g305ysm2/hctJ0Y8nWP3zxXXJ8GFabTyABE= @@ -2558,6 +2632,8 @@ rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8 rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= 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= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0/go.mod h1:hI742Nqp5OhwiqlzhgfbWU4mW4yO10fP+LoT9WOswdU= diff --git a/state/abci_client.go b/state/abci_client.go index 5cca5f6d7e..f17609821c 100644 --- a/state/abci_client.go +++ b/state/abci_client.go @@ -32,9 +32,9 @@ var _ execution.Execute = (*ABCIExecutionClient)(nil) // InitChain initializes the blockchain with genesis information. func (c *ABCIExecutionClient) InitChain( genesisTime time.Time, - initialHeight uint, + initialHeight uint64, chainID string, -) (types.Hash, uint, error) { +) (types.Hash, uint64, error) { genesis := &cmtypes.GenesisDoc{ GenesisTime: genesisTime, ChainID: chainID, @@ -51,7 +51,7 @@ func (c *ABCIExecutionClient) InitChain( stateRoot := types.Hash(response.AppHash) maxBytes := response.ConsensusParams.Block.MaxBytes - return stateRoot, uint(maxBytes), nil + return stateRoot, uint64(maxBytes), nil } // GetTxs retrieves all available transactions from the mempool. diff --git a/state/engine_api_client.go b/state/engine_api_client.go index 344f637143..5984598d1a 100644 --- a/state/engine_api_client.go +++ b/state/engine_api_client.go @@ -1,10 +1,18 @@ package state import ( + "context" + "errors" + "fmt" + "math/big" "time" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/ethclient" + "github.com/ethereum/go-ethereum/rpc" "github.com/rollkit/rollkit/execution" - "github.com/rollkit/rollkit/types" + rollkitTypes "github.com/rollkit/rollkit/types" ) /* @@ -13,12 +21,45 @@ import ( *********************************** */ +// Define necessary types and constants +type PayloadStatus string + +const ( + PayloadStatusValid PayloadStatus = "VALID" + PayloadStatusInvalid PayloadStatus = "INVALID" + PayloadStatusSyncing PayloadStatus = "SYNCING" +) + +var ( + ErrNilPayloadStatus = errors.New("nil payload status") + ErrInvalidPayloadStatus = errors.New("invalid payload status") +) + type EngineAPIExecutionClient struct { + ethClient *ethclient.Client + engineClient *rpc.Client + genesisHash common.Hash + feeRecipient common.Address } // NewEngineAPIExecutionClient creates a new instance of EngineAPIExecutionClient. -func NewEngineAPIExecutionClient() *EngineAPIExecutionClient { - return &EngineAPIExecutionClient{} +func NewEngineAPIExecutionClient(ethURL, engineURL string, genesisHash common.Hash, feeRecipient common.Address) (*EngineAPIExecutionClient, error) { + ethClient, err := ethclient.Dial(ethURL) + if err != nil { + return nil, fmt.Errorf("failed to connect to Ethereum client: %w", err) + } + + engineClient, err := rpc.Dial(engineURL) + if err != nil { + return nil, fmt.Errorf("failed to connect to Engine API: %w", err) + } + + return &EngineAPIExecutionClient{ + ethClient: ethClient, + engineClient: engineClient, + genesisHash: genesisHash, + feeRecipient: feeRecipient, + }, nil } var _ execution.Execute = (*EngineAPIExecutionClient)(nil) @@ -26,28 +67,190 @@ var _ execution.Execute = (*EngineAPIExecutionClient)(nil) // InitChain initializes the blockchain with genesis information. func (c *EngineAPIExecutionClient) InitChain( genesisTime time.Time, - initialHeight uint, + initialHeight uint64, chainID string, -) (types.Hash, uint, error) { - return types.Hash{}, 0, nil +) (rollkitTypes.Hash, uint64, error) { + ctx := context.Background() + + var forkchoiceResult map[string]interface{} + err := c.engineClient.CallContext(ctx, &forkchoiceResult, "engine_forkchoiceUpdatedV1", + map[string]interface{}{ + "headBlockHash": c.genesisHash, + "safeBlockHash": c.genesisHash, + "finalizedBlockHash": c.genesisHash, + }, + map[string]interface{}{ + "timestamp": genesisTime.Unix(), + "prevRandao": common.Hash{}, // TO-DO + "suggestedFeeRecipient": c.feeRecipient, + }, + ) + if err != nil { + return rollkitTypes.Hash{}, 0, fmt.Errorf("engine_forkchoiceUpdatedV1 failed: %w", err) + } + + payloadID, ok := forkchoiceResult["payloadId"].(string) + if !ok { + return rollkitTypes.Hash{}, 0, ErrNilPayloadStatus + } + + var payload map[string]interface{} + err = c.engineClient.CallContext(ctx, &payload, "engine_getPayloadV1", payloadID) + if err != nil { + return rollkitTypes.Hash{}, 0, fmt.Errorf("engine_getPayloadV1 failed: %w", err) + } + + stateRoot := common.HexToHash(payload["stateRoot"].(string)) + gasLimit := uint64(payload["gasLimit"].(float64)) + + var rollkitStateRoot rollkitTypes.Hash + copy(rollkitStateRoot[:], stateRoot[:]) + + return rollkitStateRoot, gasLimit, nil } -// GetTxs retrieves all available transactions from the mempool. -func (c *EngineAPIExecutionClient) GetTxs() ([]types.Tx, error) { - return nil, nil +// GetTxs retrieves transactions from the transaction pool. +func (c *EngineAPIExecutionClient) GetTxs() ([]rollkitTypes.Tx, error) { + ctx := context.Background() + + var result struct { + Pending map[string]map[string]*types.Transaction `json:"pending"` + Queued map[string]map[string]*types.Transaction `json:"queued"` + } + + err := c.ethClient.Client().CallContext(ctx, &result, "txpool_content") + if err != nil { + return nil, fmt.Errorf("failed to get tx pool content: %w", err) + } + + var txs []rollkitTypes.Tx + + for _, accountTxs := range result.Pending { + for _, tx := range accountTxs { + txBytes, err := tx.MarshalBinary() + if err != nil { + return nil, fmt.Errorf("failed to marshal transaction: %w", err) + } + txs = append(txs, rollkitTypes.Tx(txBytes)) + } + } + + for _, accountTxs := range result.Queued { + for _, tx := range accountTxs { + txBytes, err := tx.MarshalBinary() + if err != nil { + return nil, fmt.Errorf("failed to marshal transaction: %w", err) + } + txs = append(txs, rollkitTypes.Tx(txBytes)) + } + } + + return txs, nil } -// ExecuteTxs executes a set of transactions to produce a new block. +// ExecuteTxs executes the given transactions and returns the new state root and gas used. func (c *EngineAPIExecutionClient) ExecuteTxs( - txs []types.Tx, + txs []rollkitTypes.Tx, blockHeight uint64, timestamp time.Time, - prevStateRoot types.Hash, -) (types.Hash, uint64, error) { - return types.Hash{}, 0, nil + prevStateRoot rollkitTypes.Hash, +) (rollkitTypes.Hash, uint64, error) { + ctx := context.Background() + + ethTxs := make([][]byte, len(txs)) + for i, tx := range txs { + ethTxs[i] = tx + } + + prevRandao := c.derivePrevRandao(blockHeight) + + var forkchoiceResult map[string]interface{} + err := c.engineClient.CallContext(ctx, &forkchoiceResult, "engine_forkchoiceUpdatedV1", + map[string]interface{}{ + "headBlockHash": common.BytesToHash(prevStateRoot[:]), + "safeBlockHash": common.BytesToHash(prevStateRoot[:]), + "finalizedBlockHash": common.BytesToHash(prevStateRoot[:]), + }, + map[string]interface{}{ + "timestamp": timestamp.Unix(), + "prevRandao": prevRandao, + "suggestedFeeRecipient": c.feeRecipient, + }, + ) + if err != nil { + return rollkitTypes.Hash{}, 0, fmt.Errorf("engine_forkchoiceUpdatedV1 failed: %w", err) + } + + payloadID, ok := forkchoiceResult["payloadId"].(string) + if !ok { + return rollkitTypes.Hash{}, 0, ErrNilPayloadStatus + } + + var payload map[string]interface{} + err = c.engineClient.CallContext(ctx, &payload, "engine_getPayloadV1", payloadID) + if err != nil { + return rollkitTypes.Hash{}, 0, fmt.Errorf("engine_getPayloadV1 failed: %w", err) + } + + payload["transactions"] = ethTxs + + var newPayloadResult map[string]interface{} + err = c.engineClient.CallContext(ctx, &newPayloadResult, "engine_newPayloadV1", payload) + if err != nil { + return rollkitTypes.Hash{}, 0, fmt.Errorf("engine_newPayloadV1 failed: %w", err) + } + + status, ok := newPayloadResult["status"].(string) + if !ok || PayloadStatus(status) != PayloadStatusValid { + return rollkitTypes.Hash{}, 0, ErrInvalidPayloadStatus + } + + newStateRoot := common.HexToHash(payload["stateRoot"].(string)) + gasUsed := uint64(payload["gasUsed"].(float64)) + + var rollkitNewStateRoot rollkitTypes.Hash + copy(rollkitNewStateRoot[:], newStateRoot[:]) + + return rollkitNewStateRoot, gasUsed, nil } // SetFinal marks a block at the given height as final. func (c *EngineAPIExecutionClient) SetFinal(blockHeight uint64) error { + ctx := context.Background() + + block, err := c.ethClient.BlockByNumber(ctx, big.NewInt(int64(blockHeight))) + if err != nil { + return fmt.Errorf("failed to get block at height %d: %w", blockHeight, err) + } + + var result map[string]interface{} + err = c.engineClient.CallContext(ctx, &result, "engine_forkchoiceUpdatedV1", + map[string]interface{}{ + "headBlockHash": block.Hash(), + "safeBlockHash": block.Hash(), + "finalizedBlockHash": block.Hash(), + }, + nil, // No payload attributes for finalization + ) + if err != nil { + return fmt.Errorf("engine_forkchoiceUpdatedV1 failed for finalization: %w", err) + } + + payloadStatus, ok := result["payloadStatus"].(map[string]interface{}) + if !ok { + return ErrNilPayloadStatus + } + + status, ok := payloadStatus["status"].(string) + if !ok || PayloadStatus(status) != PayloadStatusValid { + return ErrInvalidPayloadStatus + } + return nil } + +// derivePrevRandao generates a deterministic prevRandao value based on block height. +func (c *EngineAPIExecutionClient) derivePrevRandao(blockHeight uint64) common.Hash { + // TO-DO + return common.BigToHash(big.NewInt(int64(blockHeight))) +} From 58b0e910d9482e43a0f3f0fd7c2e099e626a1960 Mon Sep 17 00:00:00 2001 From: Jay Jie Date: Thu, 24 Oct 2024 19:15:24 -0700 Subject: [PATCH 4/8] refactor: replace executor with execution client --- block/manager.go | 22 +- state/abci_client.go | 587 +++++++++++++++++++++++++++++++++++++++++-- state/executor.go | 557 ---------------------------------------- 3 files changed, 569 insertions(+), 597 deletions(-) delete mode 100644 state/executor.go diff --git a/block/manager.go b/block/manager.go index ff8a4e4915..b2422121f4 100644 --- a/block/manager.go +++ b/block/manager.go @@ -110,8 +110,6 @@ type Manager struct { proposerKey crypto.PrivKey - executor *state.BlockExecutor - dalc *da.DAClient // daHeight is the height of the latest processed DA block daHeight uint64 @@ -243,15 +241,12 @@ func NewManager( // allow buffer for the block header and protocol encoding maxBlobSize -= blockProtocolOverhead - exec := state.NewBlockExecutor(proposerAddress, genesis.ChainID, mempool, mempoolReaper, proxyApp, eventBus, maxBlobSize, logger, execMetrics, store, genesis) - execClient := state.NewABCIExecutionClient(exec) + execClient := state.NewABCIExecutionClient(proposerAddress, genesis.ChainID, mempool, mempoolReaper, proxyApp, eventBus, maxBlobSize, logger, execMetrics, store, genesis, &s) if s.LastBlockHeight+1 == uint64(genesis.InitialHeight) { //nolint:gosec stateRoot, _, err := execClient.InitChain(genesis.GenesisTime, uint64(genesis.InitialHeight), genesis.ChainID) if err != nil { return nil, err } - s.AppHash = stateRoot - // TO-DO updateState needs to be decoupled from ABCI if err := updateState(&s, stateRoot); err != nil { return nil, err @@ -277,7 +272,6 @@ func NewManager( genesis: genesis, lastState: s, store: store, - executor: exec, dalc: dalc, daHeight: s.DAHeight, // channels are buffered to avoid blocking on input/output operations, buffer sizes are arbitrary @@ -731,7 +725,7 @@ func (m *Manager) trySyncNextBlock(ctx context.Context, daHeight uint64) error { hHeight := h.Height() m.logger.Info("Syncing header and data", "height", hHeight) // Validate the received block before applying - if err := m.executor.Validate(m.lastState, h, d); err != nil { + if err := m.execClient.Validate(m.lastState, h, d); err != nil { return fmt.Errorf("failed to validate block: %w", err) } newState, responses, err := m.applyBlock(ctx, h, d) @@ -746,7 +740,7 @@ func (m *Manager) trySyncNextBlock(ctx context.Context, daHeight uint64) error { if err != nil { return SaveBlockError{err} } - _, _, err = m.executor.Commit(ctx, newState, h, d, responses) + _, _, err = m.execClient.Commit(ctx, newState, h, d, responses) if err != nil { return fmt.Errorf("failed to Commit: %w", err) } @@ -1146,7 +1140,7 @@ func (m *Manager) publishBlock(ctx context.Context) error { LastDataHash: lastDataHash, } // Validate the created block before storing - if err := m.executor.Validate(m.lastState, header, data); err != nil { + if err := m.execClient.Validate(m.lastState, header, data); err != nil { return fmt.Errorf("failed to validate block: %w", err) } @@ -1162,7 +1156,7 @@ func (m *Manager) publishBlock(ctx context.Context) error { } // Commit the new state and block which writes to disk on the proxy app - appHash, _, err := m.executor.Commit(ctx, newState, header, data, responses) + appHash, _, err := m.execClient.Commit(ctx, newState, header, data, responses) if err != nil { return err } @@ -1231,7 +1225,7 @@ func (m *Manager) processVoteExtension(ctx context.Context, header *types.Signed return nil } - extension, err := m.executor.ExtendVote(ctx, header, data) + extension, err := m.execClient.ExtendVote(ctx, header, data) if err != nil { return fmt.Errorf("error returned by ExtendVote: %w", err) } @@ -1431,13 +1425,13 @@ func (m *Manager) getLastBlockTime() time.Time { func (m *Manager) createBlock(height uint64, lastSignature *types.Signature, lastHeaderHash types.Hash, extendedCommit abci.ExtendedCommitInfo, txs cmtypes.Txs, timestamp time.Time) (*types.SignedHeader, *types.Data, error) { m.lastStateMtx.RLock() defer m.lastStateMtx.RUnlock() - return m.executor.CreateBlock(height, lastSignature, extendedCommit, lastHeaderHash, m.lastState, txs, timestamp) + return m.execClient.CreateBlock(height, lastSignature, extendedCommit, lastHeaderHash, m.lastState, txs, timestamp) } func (m *Manager) applyBlock(ctx context.Context, header *types.SignedHeader, data *types.Data) (types.State, *abci.ResponseFinalizeBlock, error) { m.lastStateMtx.RLock() defer m.lastStateMtx.RUnlock() - return m.executor.ApplyBlock(ctx, m.lastState, header, data) + return m.execClient.ApplyBlock(ctx, m.lastState, header, data) } func updateState(s *types.State, stateRoot []byte) error { diff --git a/state/abci_client.go b/state/abci_client.go index f17609821c..fdcd972185 100644 --- a/state/abci_client.go +++ b/state/abci_client.go @@ -1,14 +1,23 @@ package state import ( + "bytes" "context" + "errors" "fmt" "time" abci "github.com/cometbft/cometbft/abci/types" + cmbytes "github.com/cometbft/cometbft/libs/bytes" + cmproto "github.com/cometbft/cometbft/proto/tendermint/types" + "github.com/cometbft/cometbft/proxy" cmtypes "github.com/cometbft/cometbft/types" "github.com/rollkit/rollkit/execution" + "github.com/rollkit/rollkit/mempool" + "github.com/rollkit/rollkit/store" + "github.com/rollkit/rollkit/third_party/log" "github.com/rollkit/rollkit/types" + abciconv "github.com/rollkit/rollkit/types/abci" ) /* @@ -17,13 +26,44 @@ import ( *********************************** */ +// ErrEmptyValSetGenerated is returned when applying the validator changes would result in empty set. +var ErrEmptyValSetGenerated = errors.New("applying the validator changes would result in empty set") + +// ErrAddingValidatorToBased is returned when trying to add a validator to an empty validator set. +var ErrAddingValidatorToBased = errors.New("cannot add validators to empty validator set") + type ABCIExecutionClient struct { - blockExecutor *BlockExecutor + // abci specific + proxyApp proxy.AppConnConsensus + eventBus *cmtypes.EventBus + genesis *cmtypes.GenesisDoc + maxBytes uint64 + proposerAddress []byte + chainID string + + // rollkit specific + mempool mempool.Mempool + mempoolReaper *mempool.CListMempoolReaper + logger log.Logger + metrics *Metrics + state *types.State + store store.Store } -func NewABCIExecutionClient(blockExecutor *BlockExecutor) *ABCIExecutionClient { +func NewABCIExecutionClient(proposerAddress []byte, chainID string, mempool mempool.Mempool, mempoolReaper *mempool.CListMempoolReaper, proxyApp proxy.AppConnConsensus, eventBus *cmtypes.EventBus, maxBytes uint64, logger log.Logger, metrics *Metrics, store store.Store, genesis *cmtypes.GenesisDoc, state *types.State) *ABCIExecutionClient { return &ABCIExecutionClient{ - blockExecutor: blockExecutor, + proxyApp: proxyApp, + eventBus: eventBus, + genesis: genesis, + maxBytes: maxBytes, + proposerAddress: proposerAddress, + chainID: chainID, + mempool: mempool, + mempoolReaper: mempoolReaper, + logger: logger, + metrics: metrics, + store: store, + state: state, } } @@ -38,25 +78,64 @@ func (c *ABCIExecutionClient) InitChain( genesis := &cmtypes.GenesisDoc{ GenesisTime: genesisTime, ChainID: chainID, - ConsensusParams: c.blockExecutor.genesis.ConsensusParams, - Validators: c.blockExecutor.genesis.Validators, - AppState: c.blockExecutor.genesis.AppState, + ConsensusParams: c.genesis.ConsensusParams, + Validators: c.genesis.Validators, + AppState: c.genesis.AppState, InitialHeight: int64(initialHeight), } - response, err := c.blockExecutor.InitChain(genesis) + response, err := c.initChain(genesis) if err != nil { return types.Hash{}, 0, err } stateRoot := types.Hash(response.AppHash) maxBytes := response.ConsensusParams.Block.MaxBytes + return stateRoot, uint64(maxBytes), nil } +// initChain calls InitChainSync using consensus connection to app. +func (c *ABCIExecutionClient) initChain(genesis *cmtypes.GenesisDoc) (*abci.ResponseInitChain, error) { + params := genesis.ConsensusParams + + validators := make([]*cmtypes.Validator, len(genesis.Validators)) + for i, v := range genesis.Validators { + validators[i] = cmtypes.NewValidator(v.PubKey, v.Power) + } + + return c.proxyApp.InitChain(context.Background(), &abci.RequestInitChain{ + Time: genesis.GenesisTime, + ChainId: genesis.ChainID, + ConsensusParams: &cmproto.ConsensusParams{ + Block: &cmproto.BlockParams{ + MaxBytes: params.Block.MaxBytes, + MaxGas: params.Block.MaxGas, + }, + Evidence: &cmproto.EvidenceParams{ + MaxAgeNumBlocks: params.Evidence.MaxAgeNumBlocks, + MaxAgeDuration: params.Evidence.MaxAgeDuration, + MaxBytes: params.Evidence.MaxBytes, + }, + Validator: &cmproto.ValidatorParams{ + PubKeyTypes: params.Validator.PubKeyTypes, + }, + Version: &cmproto.VersionParams{ + App: params.Version.App, + }, + Abci: &cmproto.ABCIParams{ + VoteExtensionsEnableHeight: params.ABCI.VoteExtensionsEnableHeight, + }, + }, + Validators: cmtypes.TM2PB.ValidatorUpdates(cmtypes.NewValidatorSet(validators)), + AppStateBytes: genesis.AppState, + InitialHeight: genesis.InitialHeight, + }) +} + // GetTxs retrieves all available transactions from the mempool. func (c *ABCIExecutionClient) GetTxs() ([]types.Tx, error) { - state, err := c.blockExecutor.store.GetState(context.Background()) + state, err := c.store.GetState(context.Background()) if err != nil { return nil, fmt.Errorf("failed to get current state: %w", err) } @@ -65,12 +144,12 @@ func (c *ABCIExecutionClient) GetTxs() ([]types.Tx, error) { if maxBytes == -1 { maxBytes = int64(cmtypes.MaxBlockSizeBytes) } - if maxBytes > int64(c.blockExecutor.maxBytes) { - c.blockExecutor.logger.Debug("limiting maxBytes to", "maxBytes", c.blockExecutor.maxBytes) - maxBytes = int64(c.blockExecutor.maxBytes) + if maxBytes > int64(c.maxBytes) { + c.logger.Debug("limiting maxBytes to", "maxBytes", c.maxBytes) + maxBytes = int64(c.maxBytes) } - cmTxs := c.blockExecutor.mempool.ReapMaxTxs(int(maxBytes)) + cmTxs := c.mempool.ReapMaxTxs(int(maxBytes)) rollkitTxs := make([]types.Tx, len(cmTxs)) for i, tx := range cmTxs { @@ -89,7 +168,7 @@ func (c *ABCIExecutionClient) ExecuteTxs( ) (types.Hash, uint64, error) { ctx := context.Background() - state, err := c.blockExecutor.store.GetState(ctx) + state, err := c.store.GetState(ctx) if err != nil { return types.Hash{}, 0, fmt.Errorf("failed to get current state: %w", err) } @@ -100,23 +179,23 @@ func (c *ABCIExecutionClient) ExecuteTxs( var lastHeaderHash types.Hash var lastExtendedCommit abci.ExtendedCommitInfo - if blockHeight == uint64(c.blockExecutor.genesis.InitialHeight) { + if blockHeight == uint64(c.genesis.InitialHeight) { lastSignature = &types.Signature{} lastHeaderHash = types.Hash{} lastExtendedCommit = abci.ExtendedCommitInfo{} } else { - lastSignature, err = c.blockExecutor.store.GetSignature(ctx, blockHeight-1) + lastSignature, err = c.store.GetSignature(ctx, blockHeight-1) if err != nil { return types.Hash{}, 0, fmt.Errorf("error while loading last commit: %w", err) } - lastHeader, _, err := c.blockExecutor.store.GetBlockData(ctx, blockHeight-1) + lastHeader, _, err := c.store.GetBlockData(ctx, blockHeight-1) if err != nil { return types.Hash{}, 0, fmt.Errorf("error while loading last block: %w", err) } lastHeaderHash = lastHeader.Hash() - extCommit, err := c.blockExecutor.store.GetExtendedCommit(ctx, blockHeight-1) + extCommit, err := c.store.GetExtendedCommit(ctx, blockHeight-1) if err != nil { return types.Hash{}, 0, fmt.Errorf("failed to load extended commit for height %d: %w", blockHeight-1, err) } @@ -125,7 +204,7 @@ func (c *ABCIExecutionClient) ExecuteTxs( } } - header, data, err := c.blockExecutor.CreateBlock( + header, data, err := c.CreateBlock( blockHeight, lastSignature, lastExtendedCommit, @@ -138,7 +217,7 @@ func (c *ABCIExecutionClient) ExecuteTxs( return types.Hash{}, 0, fmt.Errorf("failed to create block: %w", err) } - isValid, err := c.blockExecutor.ProcessProposal(header, data, state) + isValid, err := c.ProcessProposal(header, data, state) if err != nil { return types.Hash{}, 0, fmt.Errorf("failed to process proposal: %w", err) } @@ -146,12 +225,12 @@ func (c *ABCIExecutionClient) ExecuteTxs( return types.Hash{}, 0, fmt.Errorf("proposal was not valid") } - newState, resp, err := c.blockExecutor.ApplyBlock(ctx, state, header, data) + newState, resp, err := c.ApplyBlock(ctx, state, header, data) if err != nil { return types.Hash{}, 0, fmt.Errorf("failed to apply block: %w", err) } - appHash, _, err := c.blockExecutor.Commit(ctx, newState, header, data, resp) + appHash, _, err := c.Commit(ctx, newState, header, data, resp) if err != nil { return types.Hash{}, 0, fmt.Errorf("failed to commit: %w", err) } @@ -163,17 +242,17 @@ func (c *ABCIExecutionClient) ExecuteTxs( func (c *ABCIExecutionClient) SetFinal(blockHeight uint64) error { ctx := context.Background() - header, data, err := c.blockExecutor.store.GetBlockData(ctx, blockHeight) + header, data, err := c.store.GetBlockData(ctx, blockHeight) if err != nil { return fmt.Errorf("failed to get block data for height %d: %w", blockHeight, err) } - state, err := c.blockExecutor.store.GetState(ctx) + state, err := c.store.GetState(ctx) if err != nil { return fmt.Errorf("failed to get current state: %w", err) } - resp, err := c.blockExecutor.proxyApp.FinalizeBlock(ctx, &abci.RequestFinalizeBlock{ + resp, err := c.proxyApp.FinalizeBlock(ctx, &abci.RequestFinalizeBlock{ Hash: header.Hash(), Height: int64(blockHeight), Time: header.Time(), @@ -186,11 +265,467 @@ func (c *ABCIExecutionClient) SetFinal(blockHeight uint64) error { } state.AppHash = resp.AppHash - if err := c.blockExecutor.store.UpdateState(ctx, state); err != nil { + if err := c.store.UpdateState(ctx, state); err != nil { return fmt.Errorf("failed to update state after finalizing block %d: %w", blockHeight, err) } - c.blockExecutor.logger.Info("Block finalized", "height", blockHeight, "hash", header.Hash()) + c.logger.Info("Block finalized", "height", blockHeight, "hash", header.Hash()) return nil } + +// CreateBlock reaps transactions from mempool and builds a block. +func (c *ABCIExecutionClient) CreateBlock(height uint64, lastSignature *types.Signature, lastExtendedCommit abci.ExtendedCommitInfo, lastHeaderHash types.Hash, state types.State, txs cmtypes.Txs, timestamp time.Time) (*types.SignedHeader, *types.Data, error) { + maxBytes := state.ConsensusParams.Block.MaxBytes + emptyMaxBytes := maxBytes == -1 + if emptyMaxBytes { + maxBytes = int64(cmtypes.MaxBlockSizeBytes) + } + if maxBytes > int64(c.maxBytes) { //nolint:gosec + c.logger.Debug("limiting maxBytes to", "e.maxBytes=%d", c.maxBytes) + maxBytes = int64(c.maxBytes) //nolint:gosec + } + + header := &types.SignedHeader{ + Header: types.Header{ + Version: types.Version{ + Block: state.Version.Consensus.Block, + App: state.Version.Consensus.App, + }, + BaseHeader: types.BaseHeader{ + ChainID: c.chainID, + Height: height, + Time: uint64(timestamp.UnixNano()), //nolint:gosec + }, + DataHash: make(types.Hash, 32), + ConsensusHash: make(types.Hash, 32), + AppHash: state.AppHash, + LastResultsHash: state.LastResultsHash, + ProposerAddress: c.proposerAddress, + }, + Signature: *lastSignature, + } + data := &types.Data{ + Txs: toRollkitTxs(txs), + // IntermediateStateRoots: types.IntermediateStateRoots{RawRootsList: nil}, + // Note: Temporarily remove Evidence #896 + // Evidence: types.EvidenceData{Evidence: nil}, + } + + rpp, err := c.proxyApp.PrepareProposal( + context.TODO(), + &abci.RequestPrepareProposal{ + MaxTxBytes: maxBytes, + Txs: txs.ToSliceOfBytes(), + LocalLastCommit: lastExtendedCommit, + Misbehavior: []abci.Misbehavior{}, + Height: int64(header.Height()), //nolint:gosec + Time: header.Time(), //TODO: replace with sequencer timestamp + NextValidatorsHash: state.Validators.Hash(), + ProposerAddress: c.proposerAddress, + }, + ) + if err != nil { + // The App MUST ensure that only valid (and hence 'processable') transactions + // enter the mempool. Hence, at this point, we can't have any non-processable + // transaction causing an error. + // + // Also, the App can simply skip any transaction that could cause any kind of trouble. + // Either way, we cannot recover in a meaningful way, unless we skip proposing + // this block, repair what caused the error and try again. Hence, we return an + // error for now (the production code calling this function is expected to panic). + return nil, nil, err + } + + txl := cmtypes.ToTxs(rpp.Txs) + if err := txl.Validate(maxBytes); err != nil { + return nil, nil, err + } + + data.Txs = toRollkitTxs(txl) + // Note: This is hash of an ABCI type commit equivalent of the last signature in the signed header. + header.LastCommitHash = lastSignature.GetCommitHash(&header.Header, c.proposerAddress) + header.LastHeaderHash = lastHeaderHash + + return header, data, nil +} + +// ProcessProposal calls the corresponding ABCI method on the app. +func (c *ABCIExecutionClient) ProcessProposal( + header *types.SignedHeader, + data *types.Data, + state types.State, +) (bool, error) { + resp, err := c.proxyApp.ProcessProposal(context.TODO(), &abci.RequestProcessProposal{ + Hash: header.Hash(), + Height: int64(header.Height()), //nolint:gosec + Time: header.Time(), + Txs: data.Txs.ToSliceOfBytes(), + ProposedLastCommit: abci.CommitInfo{ + Round: 0, + Votes: []abci.VoteInfo{ + { + Validator: abci.Validator{ + Address: header.Validators.GetProposer().Address, + Power: header.Validators.GetProposer().VotingPower, + }, + BlockIdFlag: cmproto.BlockIDFlagCommit, + }, + }, + }, + Misbehavior: []abci.Misbehavior{}, + ProposerAddress: c.proposerAddress, + NextValidatorsHash: state.Validators.Hash(), + }) + if err != nil { + return false, err + } + if resp.IsStatusUnknown() { + panic(fmt.Sprintf("ProcessProposal responded with status %s", resp.Status.String())) + } + + return resp.IsAccepted(), nil +} + +// ApplyBlock validates and executes the block. +func (c *ABCIExecutionClient) ApplyBlock(ctx context.Context, state types.State, header *types.SignedHeader, data *types.Data) (types.State, *abci.ResponseFinalizeBlock, error) { + isAppValid, err := c.ProcessProposal(header, data, state) + if err != nil { + return types.State{}, nil, err + } + if !isAppValid { + return types.State{}, nil, fmt.Errorf("proposal processing resulted in an invalid application state") + } + + err = c.Validate(state, header, data) + if err != nil { + return types.State{}, nil, err + } + // This makes calls to the AppClient + resp, err := c.execute(ctx, state, header, data) + if err != nil { + return types.State{}, nil, err + } + abciValUpdates := resp.ValidatorUpdates + + validatorUpdates, err := cmtypes.PB2TM.ValidatorUpdates(abciValUpdates) + if err != nil { + return state, nil, err + } + + if resp.ConsensusParamUpdates != nil { + c.metrics.ConsensusParamUpdates.Add(1) + } + + state, err = c.updateState(state, header, data, resp, validatorUpdates) + if err != nil { + return types.State{}, nil, err + } + + if state.ConsensusParams.Block.MaxBytes <= 0 { + c.logger.Error("maxBytes<=0", "state.ConsensusParams.Block", state.ConsensusParams.Block, "header", header) + } + + return state, resp, nil +} + +// ExtendVote calls the ExtendVote ABCI method on the proxy app. +func (c *ABCIExecutionClient) ExtendVote(ctx context.Context, header *types.SignedHeader, data *types.Data) ([]byte, error) { + resp, err := c.proxyApp.ExtendVote(ctx, &abci.RequestExtendVote{ + Hash: header.Hash(), + Height: int64(header.Height()), //nolint:gosec + Time: header.Time(), + Txs: data.Txs.ToSliceOfBytes(), + ProposedLastCommit: abci.CommitInfo{ + Votes: []abci.VoteInfo{{ + Validator: abci.Validator{ + Address: header.Validators.GetProposer().Address, + Power: header.Validators.GetProposer().VotingPower, + }, + BlockIdFlag: cmproto.BlockIDFlagCommit, + }}, + }, + Misbehavior: nil, + NextValidatorsHash: header.ValidatorHash, + ProposerAddress: header.ProposerAddress, + }) + if err != nil { + return nil, err + } + return resp.VoteExtension, nil +} + +// Commit commits the block +func (c *ABCIExecutionClient) Commit(ctx context.Context, state types.State, header *types.SignedHeader, data *types.Data, resp *abci.ResponseFinalizeBlock) ([]byte, uint64, error) { + appHash, retainHeight, err := c.commit(ctx, state, header, data, resp) + if err != nil { + return []byte{}, 0, err + } + + state.AppHash = appHash + + c.publishEvents(resp, header, data, state) + + return appHash, retainHeight, nil +} + +// updateConsensusParams updates the consensus parameters based on the provided updates. +func (c *ABCIExecutionClient) updateConsensusParams(height uint64, params cmtypes.ConsensusParams, consensusParamUpdates *cmproto.ConsensusParams) (cmproto.ConsensusParams, uint64, error) { + nextParams := params.Update(consensusParamUpdates) + if err := types.ConsensusParamsValidateBasic(nextParams); err != nil { + return cmproto.ConsensusParams{}, 0, fmt.Errorf("validating new consensus params: %w", err) + } + if err := nextParams.ValidateUpdate(consensusParamUpdates, int64(height)); err != nil { //nolint:gosec + return cmproto.ConsensusParams{}, 0, fmt.Errorf("updating consensus params: %w", err) + } + return nextParams.ToProto(), nextParams.Version.App, nil +} + +func (c *ABCIExecutionClient) updateState(state types.State, header *types.SignedHeader, data *types.Data, finalizeBlockResponse *abci.ResponseFinalizeBlock, validatorUpdates []*cmtypes.Validator) (types.State, error) { + height := header.Height() + if finalizeBlockResponse.ConsensusParamUpdates != nil { + nextParamsProto, appVersion, err := c.updateConsensusParams(height, types.ConsensusParamsFromProto(state.ConsensusParams), finalizeBlockResponse.ConsensusParamUpdates) + if err != nil { + return types.State{}, err + } + // Change results from this height but only applies to the next height. + state.LastHeightConsensusParamsChanged = height + 1 + state.Version.Consensus.App = appVersion + state.ConsensusParams = nextParamsProto + } + + nValSet := state.NextValidators.Copy() + lastHeightValSetChanged := state.LastHeightValidatorsChanged + + if len(nValSet.Validators) > 0 { + err := nValSet.UpdateWithChangeSet(validatorUpdates) + if err != nil { + if err.Error() != ErrEmptyValSetGenerated.Error() { + return state, err + } + nValSet = &cmtypes.ValidatorSet{ + Validators: make([]*cmtypes.Validator, 0), + Proposer: nil, + } + } + // Change results from this height but only applies to the next next height. + lastHeightValSetChanged = int64(header.Header.Height() + 1 + 1) //nolint:gosec + + if len(nValSet.Validators) > 0 { + nValSet.IncrementProposerPriority(1) + } + } + + s := types.State{ + Version: state.Version, + ChainID: state.ChainID, + InitialHeight: state.InitialHeight, + LastBlockHeight: height, + LastBlockTime: header.Time(), + LastBlockID: cmtypes.BlockID{ + Hash: cmbytes.HexBytes(header.Hash()), + // for now, we don't care about part set headers + }, + ConsensusParams: state.ConsensusParams, + LastHeightConsensusParamsChanged: state.LastHeightConsensusParamsChanged, + AppHash: finalizeBlockResponse.AppHash, + Validators: state.NextValidators.Copy(), + NextValidators: nValSet, + LastHeightValidatorsChanged: lastHeightValSetChanged, + LastValidators: state.Validators.Copy(), + } + copy(s.LastResultsHash[:], cmtypes.NewResults(finalizeBlockResponse.TxResults).Hash()) + + return s, nil +} + +func (e *ABCIExecutionClient) commit(ctx context.Context, state types.State, header *types.SignedHeader, data *types.Data, resp *abci.ResponseFinalizeBlock) ([]byte, uint64, error) { + e.mempool.Lock() + defer e.mempool.Unlock() + + err := e.mempool.FlushAppConn() + if err != nil { + return nil, 0, err + } + + commitResp, err := e.proxyApp.Commit(ctx) + if err != nil { + return nil, 0, err + } + + maxBytes := state.ConsensusParams.Block.MaxBytes + maxGas := state.ConsensusParams.Block.MaxGas + cTxs := fromRollkitTxs(data.Txs) + e.mempoolReaper.UpdateCommitedTxs(cTxs) + err = e.mempool.Update(header.Height(), cTxs, resp.TxResults, mempool.PreCheckMaxBytes(maxBytes), mempool.PostCheckMaxGas(maxGas)) + if err != nil { + return nil, 0, err + } + + return resp.AppHash, uint64(commitResp.RetainHeight), err //nolint:gosec +} + +// Validate validates the state and the block for the executor +func (e *ABCIExecutionClient) Validate(state types.State, header *types.SignedHeader, data *types.Data) error { + if err := header.ValidateBasic(); err != nil { + return err + } + if err := data.ValidateBasic(); err != nil { + return err + } + if err := types.Validate(header, data); err != nil { + return err + } + if header.Version.App != state.Version.Consensus.App || + header.Version.Block != state.Version.Consensus.Block { + return errors.New("block version mismatch") + } + if state.LastBlockHeight <= 0 && header.Height() != state.InitialHeight { + return errors.New("initial block height mismatch") + } + if state.LastBlockHeight > 0 && header.Height() != state.LastBlockHeight+1 { + return errors.New("block height mismatch") + } + if !bytes.Equal(header.AppHash[:], state.AppHash[:]) { + return errors.New("AppHash mismatch") + } + + if !bytes.Equal(header.LastResultsHash[:], state.LastResultsHash[:]) { + return errors.New("LastResultsHash mismatch") + } + + return nil +} + +func (e *ABCIExecutionClient) execute(ctx context.Context, state types.State, header *types.SignedHeader, data *types.Data) (*abci.ResponseFinalizeBlock, error) { + // Only execute if the node hasn't already shut down + select { + case <-ctx.Done(): + return nil, ctx.Err() + default: + } + abciHeader, err := abciconv.ToABCIHeaderPB(&header.Header) + if err != nil { + return nil, err + } + abciHeader.ChainID = e.chainID + abciBlock, err := abciconv.ToABCIBlock(header, data) + if err != nil { + return nil, err + } + + startTime := time.Now().UnixNano() + finalizeBlockResponse, err := e.proxyApp.FinalizeBlock(ctx, &abci.RequestFinalizeBlock{ + Hash: header.Hash(), + NextValidatorsHash: state.Validators.Hash(), + ProposerAddress: abciHeader.ProposerAddress, + Height: abciHeader.Height, + Time: abciHeader.Time, + DecidedLastCommit: abci.CommitInfo{ + Round: 0, + Votes: nil, + }, + Misbehavior: abciBlock.Evidence.Evidence.ToABCI(), + Txs: abciBlock.Txs.ToSliceOfBytes(), + }) + endTime := time.Now().UnixNano() + e.metrics.BlockProcessingTime.Observe(float64(endTime-startTime) / 1000000) + if err != nil { + e.logger.Error("error in proxyAppConn.FinalizeBlock", "err", err) + return nil, err + } + + e.logger.Info( + "finalized block", + "height", abciBlock.Height, + "num_txs_res", len(finalizeBlockResponse.TxResults), + "num_val_updates", len(finalizeBlockResponse.ValidatorUpdates), + "block_app_hash", fmt.Sprintf("%X", finalizeBlockResponse.AppHash), + ) + + // Assert that the application correctly returned tx results for each of the transactions provided in the block + if len(abciBlock.Data.Txs) != len(finalizeBlockResponse.TxResults) { + return nil, fmt.Errorf("expected tx results length to match size of transactions in block. Expected %d, got %d", len(data.Txs), len(finalizeBlockResponse.TxResults)) + } + + e.logger.Info("executed block", "height", abciHeader.Height, "app_hash", fmt.Sprintf("%X", finalizeBlockResponse.AppHash)) + + return finalizeBlockResponse, nil +} + +func (e *ABCIExecutionClient) publishEvents(resp *abci.ResponseFinalizeBlock, header *types.SignedHeader, data *types.Data, state types.State) { + if e.eventBus == nil { + return + } + + abciBlock, err := abciconv.ToABCIBlock(header, data) + if err != nil { + return + } + + if err := e.eventBus.PublishEventNewBlock(cmtypes.EventDataNewBlock{ + Block: abciBlock, + BlockID: cmtypes.BlockID{ + Hash: cmbytes.HexBytes(header.Hash()), + // for now, we don't care about part set headers + }, + ResultFinalizeBlock: *resp, + }); err != nil { + e.logger.Error("failed publishing new block", "err", err) + } + + if err := e.eventBus.PublishEventNewBlockHeader(cmtypes.EventDataNewBlockHeader{ + Header: abciBlock.Header, + }); err != nil { + e.logger.Error("failed publishing new block header", "err", err) + } + + if err := e.eventBus.PublishEventNewBlockEvents(cmtypes.EventDataNewBlockEvents{ + Height: abciBlock.Height, + Events: resp.Events, + NumTxs: int64(len(abciBlock.Txs)), + }); err != nil { + e.logger.Error("failed publishing new block events", "err", err) + } + + if len(abciBlock.Evidence.Evidence) != 0 { + for _, ev := range abciBlock.Evidence.Evidence { + if err := e.eventBus.PublishEventNewEvidence(cmtypes.EventDataNewEvidence{ + Evidence: ev, + Height: int64(header.Header.Height()), //nolint:gosec + }); err != nil { + e.logger.Error("failed publishing new evidence", "err", err) + } + } + } + + for i, tx := range abciBlock.Data.Txs { + err := e.eventBus.PublishEventTx(cmtypes.EventDataTx{ + TxResult: abci.TxResult{ + Height: abciBlock.Height, + Index: uint32(i), //nolint:gosec + Tx: tx, + Result: *(resp.TxResults[i]), + }, + }) + if err != nil { + e.logger.Error("failed publishing event TX", "err", err) + } + } +} + +func toRollkitTxs(txs cmtypes.Txs) types.Txs { + rollkitTxs := make(types.Txs, len(txs)) + for i := range txs { + rollkitTxs[i] = []byte(txs[i]) + } + return rollkitTxs +} + +func fromRollkitTxs(rollkitTxs types.Txs) cmtypes.Txs { + txs := make(cmtypes.Txs, len(rollkitTxs)) + for i := range rollkitTxs { + txs[i] = []byte(rollkitTxs[i]) + } + return txs +} diff --git a/state/executor.go b/state/executor.go deleted file mode 100644 index 679ec58807..0000000000 --- a/state/executor.go +++ /dev/null @@ -1,557 +0,0 @@ -package state - -import ( - "bytes" - "context" - "errors" - "fmt" - "time" - - abci "github.com/cometbft/cometbft/abci/types" - cmbytes "github.com/cometbft/cometbft/libs/bytes" - cmproto "github.com/cometbft/cometbft/proto/tendermint/types" - "github.com/cometbft/cometbft/proxy" - cmtypes "github.com/cometbft/cometbft/types" - - "github.com/rollkit/rollkit/mempool" - "github.com/rollkit/rollkit/store" - "github.com/rollkit/rollkit/third_party/log" - "github.com/rollkit/rollkit/types" - abciconv "github.com/rollkit/rollkit/types/abci" -) - -// ErrEmptyValSetGenerated is returned when applying the validator changes would result in empty set. -var ErrEmptyValSetGenerated = errors.New("applying the validator changes would result in empty set") - -// ErrAddingValidatorToBased is returned when trying to add a validator to an empty validator set. -var ErrAddingValidatorToBased = errors.New("cannot add validators to empty validator set") - -// BlockExecutor creates and applies blocks and maintains state. -type BlockExecutor struct { - proposerAddress []byte - chainID string - proxyApp proxy.AppConnConsensus - mempool mempool.Mempool - mempoolReaper *mempool.CListMempoolReaper - maxBytes uint64 - - eventBus *cmtypes.EventBus - - logger log.Logger - - metrics *Metrics - - store store.Store // Add this field - genesis *cmtypes.GenesisDoc -} - -// NewBlockExecutor creates new instance of BlockExecutor. -func NewBlockExecutor(proposerAddress []byte, chainID string, mempool mempool.Mempool, mempoolReaper *mempool.CListMempoolReaper, proxyApp proxy.AppConnConsensus, eventBus *cmtypes.EventBus, maxBytes uint64, logger log.Logger, metrics *Metrics, store store.Store, genesis *cmtypes.GenesisDoc) *BlockExecutor { - return &BlockExecutor{ - proposerAddress: proposerAddress, - chainID: chainID, - proxyApp: proxyApp, - mempool: mempool, - mempoolReaper: mempoolReaper, - eventBus: eventBus, - maxBytes: maxBytes, - logger: logger, - metrics: metrics, - store: store, - genesis: genesis, - } -} - -// InitChain calls InitChainSync using consensus connection to app. -func (e *BlockExecutor) InitChain(genesis *cmtypes.GenesisDoc) (*abci.ResponseInitChain, error) { - params := genesis.ConsensusParams - - validators := make([]*cmtypes.Validator, len(genesis.Validators)) - for i, v := range genesis.Validators { - validators[i] = cmtypes.NewValidator(v.PubKey, v.Power) - } - - return e.proxyApp.InitChain(context.Background(), &abci.RequestInitChain{ - Time: genesis.GenesisTime, - ChainId: genesis.ChainID, - ConsensusParams: &cmproto.ConsensusParams{ - Block: &cmproto.BlockParams{ - MaxBytes: params.Block.MaxBytes, - MaxGas: params.Block.MaxGas, - }, - Evidence: &cmproto.EvidenceParams{ - MaxAgeNumBlocks: params.Evidence.MaxAgeNumBlocks, - MaxAgeDuration: params.Evidence.MaxAgeDuration, - MaxBytes: params.Evidence.MaxBytes, - }, - Validator: &cmproto.ValidatorParams{ - PubKeyTypes: params.Validator.PubKeyTypes, - }, - Version: &cmproto.VersionParams{ - App: params.Version.App, - }, - Abci: &cmproto.ABCIParams{ - VoteExtensionsEnableHeight: params.ABCI.VoteExtensionsEnableHeight, - }, - }, - Validators: cmtypes.TM2PB.ValidatorUpdates(cmtypes.NewValidatorSet(validators)), - AppStateBytes: genesis.AppState, - InitialHeight: genesis.InitialHeight, - }) -} - -// CreateBlock reaps transactions from mempool and builds a block. -func (e *BlockExecutor) CreateBlock(height uint64, lastSignature *types.Signature, lastExtendedCommit abci.ExtendedCommitInfo, lastHeaderHash types.Hash, state types.State, txs cmtypes.Txs, timestamp time.Time) (*types.SignedHeader, *types.Data, error) { - maxBytes := state.ConsensusParams.Block.MaxBytes - emptyMaxBytes := maxBytes == -1 - if emptyMaxBytes { - maxBytes = int64(cmtypes.MaxBlockSizeBytes) - } - if maxBytes > int64(e.maxBytes) { //nolint:gosec - e.logger.Debug("limiting maxBytes to", "e.maxBytes=%d", e.maxBytes) - maxBytes = int64(e.maxBytes) //nolint:gosec - } - - header := &types.SignedHeader{ - Header: types.Header{ - Version: types.Version{ - Block: state.Version.Consensus.Block, - App: state.Version.Consensus.App, - }, - BaseHeader: types.BaseHeader{ - ChainID: e.chainID, - Height: height, - Time: uint64(timestamp.UnixNano()), //nolint:gosec - }, - DataHash: make(types.Hash, 32), - ConsensusHash: make(types.Hash, 32), - AppHash: state.AppHash, - LastResultsHash: state.LastResultsHash, - ProposerAddress: e.proposerAddress, - }, - Signature: *lastSignature, - } - data := &types.Data{ - Txs: toRollkitTxs(txs), - // IntermediateStateRoots: types.IntermediateStateRoots{RawRootsList: nil}, - // Note: Temporarily remove Evidence #896 - // Evidence: types.EvidenceData{Evidence: nil}, - } - - rpp, err := e.proxyApp.PrepareProposal( - context.TODO(), - &abci.RequestPrepareProposal{ - MaxTxBytes: maxBytes, - Txs: txs.ToSliceOfBytes(), - LocalLastCommit: lastExtendedCommit, - Misbehavior: []abci.Misbehavior{}, - Height: int64(header.Height()), //nolint:gosec - Time: header.Time(), //TODO: replace with sequencer timestamp - NextValidatorsHash: state.Validators.Hash(), - ProposerAddress: e.proposerAddress, - }, - ) - if err != nil { - // The App MUST ensure that only valid (and hence 'processable') transactions - // enter the mempool. Hence, at this point, we can't have any non-processable - // transaction causing an error. - // - // Also, the App can simply skip any transaction that could cause any kind of trouble. - // Either way, we cannot recover in a meaningful way, unless we skip proposing - // this block, repair what caused the error and try again. Hence, we return an - // error for now (the production code calling this function is expected to panic). - return nil, nil, err - } - - txl := cmtypes.ToTxs(rpp.Txs) - if err := txl.Validate(maxBytes); err != nil { - return nil, nil, err - } - - data.Txs = toRollkitTxs(txl) - // Note: This is hash of an ABCI type commit equivalent of the last signature in the signed header. - header.LastCommitHash = lastSignature.GetCommitHash(&header.Header, e.proposerAddress) - header.LastHeaderHash = lastHeaderHash - - return header, data, nil -} - -// ProcessProposal calls the corresponding ABCI method on the app. -func (e *BlockExecutor) ProcessProposal( - header *types.SignedHeader, - data *types.Data, - state types.State, -) (bool, error) { - resp, err := e.proxyApp.ProcessProposal(context.TODO(), &abci.RequestProcessProposal{ - Hash: header.Hash(), - Height: int64(header.Height()), //nolint:gosec - Time: header.Time(), - Txs: data.Txs.ToSliceOfBytes(), - ProposedLastCommit: abci.CommitInfo{ - Round: 0, - Votes: []abci.VoteInfo{ - { - Validator: abci.Validator{ - Address: header.Validators.GetProposer().Address, - Power: header.Validators.GetProposer().VotingPower, - }, - BlockIdFlag: cmproto.BlockIDFlagCommit, - }, - }, - }, - Misbehavior: []abci.Misbehavior{}, - ProposerAddress: e.proposerAddress, - NextValidatorsHash: state.Validators.Hash(), - }) - if err != nil { - return false, err - } - if resp.IsStatusUnknown() { - panic(fmt.Sprintf("ProcessProposal responded with status %s", resp.Status.String())) - } - - return resp.IsAccepted(), nil -} - -// ApplyBlock validates and executes the block. -func (e *BlockExecutor) ApplyBlock(ctx context.Context, state types.State, header *types.SignedHeader, data *types.Data) (types.State, *abci.ResponseFinalizeBlock, error) { - isAppValid, err := e.ProcessProposal(header, data, state) - if err != nil { - return types.State{}, nil, err - } - if !isAppValid { - return types.State{}, nil, fmt.Errorf("proposal processing resulted in an invalid application state") - } - - err = e.Validate(state, header, data) - if err != nil { - return types.State{}, nil, err - } - // This makes calls to the AppClient - resp, err := e.execute(ctx, state, header, data) - if err != nil { - return types.State{}, nil, err - } - abciValUpdates := resp.ValidatorUpdates - - validatorUpdates, err := cmtypes.PB2TM.ValidatorUpdates(abciValUpdates) - if err != nil { - return state, nil, err - } - - if resp.ConsensusParamUpdates != nil { - e.metrics.ConsensusParamUpdates.Add(1) - } - - state, err = e.updateState(state, header, data, resp, validatorUpdates) - if err != nil { - return types.State{}, nil, err - } - - if state.ConsensusParams.Block.MaxBytes <= 0 { - e.logger.Error("maxBytes<=0", "state.ConsensusParams.Block", state.ConsensusParams.Block, "header", header) - } - - return state, resp, nil -} - -// ExtendVote calls the ExtendVote ABCI method on the proxy app. -func (e *BlockExecutor) ExtendVote(ctx context.Context, header *types.SignedHeader, data *types.Data) ([]byte, error) { - resp, err := e.proxyApp.ExtendVote(ctx, &abci.RequestExtendVote{ - Hash: header.Hash(), - Height: int64(header.Height()), //nolint:gosec - Time: header.Time(), - Txs: data.Txs.ToSliceOfBytes(), - ProposedLastCommit: abci.CommitInfo{ - Votes: []abci.VoteInfo{{ - Validator: abci.Validator{ - Address: header.Validators.GetProposer().Address, - Power: header.Validators.GetProposer().VotingPower, - }, - BlockIdFlag: cmproto.BlockIDFlagCommit, - }}, - }, - Misbehavior: nil, - NextValidatorsHash: header.ValidatorHash, - ProposerAddress: header.ProposerAddress, - }) - if err != nil { - return nil, err - } - return resp.VoteExtension, nil -} - -// Commit commits the block -func (e *BlockExecutor) Commit(ctx context.Context, state types.State, header *types.SignedHeader, data *types.Data, resp *abci.ResponseFinalizeBlock) ([]byte, uint64, error) { - appHash, retainHeight, err := e.commit(ctx, state, header, data, resp) - if err != nil { - return []byte{}, 0, err - } - - state.AppHash = appHash - - e.publishEvents(resp, header, data, state) - - return appHash, retainHeight, nil -} - -// updateConsensusParams updates the consensus parameters based on the provided updates. -func (e *BlockExecutor) updateConsensusParams(height uint64, params cmtypes.ConsensusParams, consensusParamUpdates *cmproto.ConsensusParams) (cmproto.ConsensusParams, uint64, error) { - nextParams := params.Update(consensusParamUpdates) - if err := types.ConsensusParamsValidateBasic(nextParams); err != nil { - return cmproto.ConsensusParams{}, 0, fmt.Errorf("validating new consensus params: %w", err) - } - if err := nextParams.ValidateUpdate(consensusParamUpdates, int64(height)); err != nil { //nolint:gosec - return cmproto.ConsensusParams{}, 0, fmt.Errorf("updating consensus params: %w", err) - } - return nextParams.ToProto(), nextParams.Version.App, nil -} - -func (e *BlockExecutor) updateState(state types.State, header *types.SignedHeader, data *types.Data, finalizeBlockResponse *abci.ResponseFinalizeBlock, validatorUpdates []*cmtypes.Validator) (types.State, error) { - height := header.Height() - if finalizeBlockResponse.ConsensusParamUpdates != nil { - nextParamsProto, appVersion, err := e.updateConsensusParams(height, types.ConsensusParamsFromProto(state.ConsensusParams), finalizeBlockResponse.ConsensusParamUpdates) - if err != nil { - return types.State{}, err - } - // Change results from this height but only applies to the next height. - state.LastHeightConsensusParamsChanged = height + 1 - state.Version.Consensus.App = appVersion - state.ConsensusParams = nextParamsProto - } - - nValSet := state.NextValidators.Copy() - lastHeightValSetChanged := state.LastHeightValidatorsChanged - - if len(nValSet.Validators) > 0 { - err := nValSet.UpdateWithChangeSet(validatorUpdates) - if err != nil { - if err.Error() != ErrEmptyValSetGenerated.Error() { - return state, err - } - nValSet = &cmtypes.ValidatorSet{ - Validators: make([]*cmtypes.Validator, 0), - Proposer: nil, - } - } - // Change results from this height but only applies to the next next height. - lastHeightValSetChanged = int64(header.Header.Height() + 1 + 1) //nolint:gosec - - if len(nValSet.Validators) > 0 { - nValSet.IncrementProposerPriority(1) - } - } - - s := types.State{ - Version: state.Version, - ChainID: state.ChainID, - InitialHeight: state.InitialHeight, - LastBlockHeight: height, - LastBlockTime: header.Time(), - LastBlockID: cmtypes.BlockID{ - Hash: cmbytes.HexBytes(header.Hash()), - // for now, we don't care about part set headers - }, - ConsensusParams: state.ConsensusParams, - LastHeightConsensusParamsChanged: state.LastHeightConsensusParamsChanged, - AppHash: finalizeBlockResponse.AppHash, - Validators: state.NextValidators.Copy(), - NextValidators: nValSet, - LastHeightValidatorsChanged: lastHeightValSetChanged, - LastValidators: state.Validators.Copy(), - } - copy(s.LastResultsHash[:], cmtypes.NewResults(finalizeBlockResponse.TxResults).Hash()) - - return s, nil -} - -func (e *BlockExecutor) commit(ctx context.Context, state types.State, header *types.SignedHeader, data *types.Data, resp *abci.ResponseFinalizeBlock) ([]byte, uint64, error) { - e.mempool.Lock() - defer e.mempool.Unlock() - - err := e.mempool.FlushAppConn() - if err != nil { - return nil, 0, err - } - - commitResp, err := e.proxyApp.Commit(ctx) - if err != nil { - return nil, 0, err - } - - maxBytes := state.ConsensusParams.Block.MaxBytes - maxGas := state.ConsensusParams.Block.MaxGas - cTxs := fromRollkitTxs(data.Txs) - e.mempoolReaper.UpdateCommitedTxs(cTxs) - err = e.mempool.Update(header.Height(), cTxs, resp.TxResults, mempool.PreCheckMaxBytes(maxBytes), mempool.PostCheckMaxGas(maxGas)) - if err != nil { - return nil, 0, err - } - - return resp.AppHash, uint64(commitResp.RetainHeight), err //nolint:gosec -} - -// Validate validates the state and the block for the executor -func (e *BlockExecutor) Validate(state types.State, header *types.SignedHeader, data *types.Data) error { - if err := header.ValidateBasic(); err != nil { - return err - } - if err := data.ValidateBasic(); err != nil { - return err - } - if err := types.Validate(header, data); err != nil { - return err - } - if header.Version.App != state.Version.Consensus.App || - header.Version.Block != state.Version.Consensus.Block { - return errors.New("block version mismatch") - } - if state.LastBlockHeight <= 0 && header.Height() != state.InitialHeight { - return errors.New("initial block height mismatch") - } - if state.LastBlockHeight > 0 && header.Height() != state.LastBlockHeight+1 { - return errors.New("block height mismatch") - } - if !bytes.Equal(header.AppHash[:], state.AppHash[:]) { - return errors.New("AppHash mismatch") - } - - if !bytes.Equal(header.LastResultsHash[:], state.LastResultsHash[:]) { - return errors.New("LastResultsHash mismatch") - } - - return nil -} - -func (e *BlockExecutor) execute(ctx context.Context, state types.State, header *types.SignedHeader, data *types.Data) (*abci.ResponseFinalizeBlock, error) { - // Only execute if the node hasn't already shut down - select { - case <-ctx.Done(): - return nil, ctx.Err() - default: - } - abciHeader, err := abciconv.ToABCIHeaderPB(&header.Header) - if err != nil { - return nil, err - } - abciHeader.ChainID = e.chainID - abciBlock, err := abciconv.ToABCIBlock(header, data) - if err != nil { - return nil, err - } - - startTime := time.Now().UnixNano() - finalizeBlockResponse, err := e.proxyApp.FinalizeBlock(ctx, &abci.RequestFinalizeBlock{ - Hash: header.Hash(), - NextValidatorsHash: state.Validators.Hash(), - ProposerAddress: abciHeader.ProposerAddress, - Height: abciHeader.Height, - Time: abciHeader.Time, - DecidedLastCommit: abci.CommitInfo{ - Round: 0, - Votes: nil, - }, - Misbehavior: abciBlock.Evidence.Evidence.ToABCI(), - Txs: abciBlock.Txs.ToSliceOfBytes(), - }) - endTime := time.Now().UnixNano() - e.metrics.BlockProcessingTime.Observe(float64(endTime-startTime) / 1000000) - if err != nil { - e.logger.Error("error in proxyAppConn.FinalizeBlock", "err", err) - return nil, err - } - - e.logger.Info( - "finalized block", - "height", abciBlock.Height, - "num_txs_res", len(finalizeBlockResponse.TxResults), - "num_val_updates", len(finalizeBlockResponse.ValidatorUpdates), - "block_app_hash", fmt.Sprintf("%X", finalizeBlockResponse.AppHash), - ) - - // Assert that the application correctly returned tx results for each of the transactions provided in the block - if len(abciBlock.Data.Txs) != len(finalizeBlockResponse.TxResults) { - return nil, fmt.Errorf("expected tx results length to match size of transactions in block. Expected %d, got %d", len(data.Txs), len(finalizeBlockResponse.TxResults)) - } - - e.logger.Info("executed block", "height", abciHeader.Height, "app_hash", fmt.Sprintf("%X", finalizeBlockResponse.AppHash)) - - return finalizeBlockResponse, nil -} - -func (e *BlockExecutor) publishEvents(resp *abci.ResponseFinalizeBlock, header *types.SignedHeader, data *types.Data, state types.State) { - if e.eventBus == nil { - return - } - - abciBlock, err := abciconv.ToABCIBlock(header, data) - if err != nil { - return - } - - if err := e.eventBus.PublishEventNewBlock(cmtypes.EventDataNewBlock{ - Block: abciBlock, - BlockID: cmtypes.BlockID{ - Hash: cmbytes.HexBytes(header.Hash()), - // for now, we don't care about part set headers - }, - ResultFinalizeBlock: *resp, - }); err != nil { - e.logger.Error("failed publishing new block", "err", err) - } - - if err := e.eventBus.PublishEventNewBlockHeader(cmtypes.EventDataNewBlockHeader{ - Header: abciBlock.Header, - }); err != nil { - e.logger.Error("failed publishing new block header", "err", err) - } - - if err := e.eventBus.PublishEventNewBlockEvents(cmtypes.EventDataNewBlockEvents{ - Height: abciBlock.Height, - Events: resp.Events, - NumTxs: int64(len(abciBlock.Txs)), - }); err != nil { - e.logger.Error("failed publishing new block events", "err", err) - } - - if len(abciBlock.Evidence.Evidence) != 0 { - for _, ev := range abciBlock.Evidence.Evidence { - if err := e.eventBus.PublishEventNewEvidence(cmtypes.EventDataNewEvidence{ - Evidence: ev, - Height: int64(header.Header.Height()), //nolint:gosec - }); err != nil { - e.logger.Error("failed publishing new evidence", "err", err) - } - } - } - - for i, tx := range abciBlock.Data.Txs { - err := e.eventBus.PublishEventTx(cmtypes.EventDataTx{ - TxResult: abci.TxResult{ - Height: abciBlock.Height, - Index: uint32(i), //nolint:gosec - Tx: tx, - Result: *(resp.TxResults[i]), - }, - }) - if err != nil { - e.logger.Error("failed publishing event TX", "err", err) - } - } -} - -func toRollkitTxs(txs cmtypes.Txs) types.Txs { - rollkitTxs := make(types.Txs, len(txs)) - for i := range txs { - rollkitTxs[i] = []byte(txs[i]) - } - return rollkitTxs -} - -func fromRollkitTxs(rollkitTxs types.Txs) cmtypes.Txs { - txs := make(cmtypes.Txs, len(rollkitTxs)) - for i := range rollkitTxs { - txs[i] = []byte(rollkitTxs[i]) - } - return txs -} From 92d79a3f9a4f95593c335a66fd3d4f498ff24a32 Mon Sep 17 00:00:00 2001 From: Jay Jie Date: Thu, 24 Oct 2024 21:58:56 -0700 Subject: [PATCH 5/8] chore: move common execution interface to go-execution repo --- execution/execute.go | 47 -------------------------------------- go.mod | 5 ++++ go.sum | 2 ++ state/abci_client.go | 2 +- state/engine_api_client.go | 2 +- 5 files changed, 9 insertions(+), 49 deletions(-) delete mode 100644 execution/execute.go diff --git a/execution/execute.go b/execution/execute.go deleted file mode 100644 index 5987e8f8e4..0000000000 --- a/execution/execute.go +++ /dev/null @@ -1,47 +0,0 @@ -package execution - -import ( - "time" - - "github.com/rollkit/rollkit/types" -) - -/* - ****************************** - * TO-DO move to go-execution * - ****************************** - */ - -// Execute defines a common interface for interacting with the execution client. -type Execute interface { - // InitChain initializes the blockchain with genesis information. - InitChain( - genesisTime time.Time, - initialHeight uint64, - chainID string, - ) ( - stateRoot types.Hash, - maxBytes uint64, - err error, - ) - - // GetTxs retrieves all available transactions from the execution client's mempool. - GetTxs() ([]types.Tx, error) - - // ExecuteTxs executes a set of transactions to produce a new block header. - ExecuteTxs( - txs []types.Tx, - blockHeight uint64, - timestamp time.Time, - prevStateRoot types.Hash, - ) ( - updatedStateRoot types.Hash, - maxBytes uint64, - err error, - ) - - // SetFinal marks a block at the given height as final. - SetFinal( - blockHeight uint64, - ) error -} diff --git a/go.mod b/go.mod index 6fefbda583..29a1631892 100644 --- a/go.mod +++ b/go.mod @@ -6,6 +6,10 @@ toolchain go1.22.2 retract v0.12.0 // Published by accident +replace ( + github.com/LastL2/go-execution => github.com/LastL2/go-execution v0.0.0-20241025044830-6028e95ddb3a +) + require ( github.com/celestiaorg/utils v0.1.0 github.com/cometbft/cometbft v0.38.12 @@ -36,6 +40,7 @@ require ( require ( github.com/BurntSushi/toml v1.4.0 + github.com/LastL2/go-execution v0.0.0-00010101000000-000000000000 github.com/btcsuite/btcd/btcec/v2 v2.3.4 github.com/celestiaorg/go-header v0.6.2 github.com/ethereum/go-ethereum v1.14.11 diff --git a/go.sum b/go.sum index 4f1f1a657a..592b1d074f 100644 --- a/go.sum +++ b/go.sum @@ -94,6 +94,8 @@ github.com/GaijinEntertainment/go-exhaustruct/v2 v2.2.0/go.mod h1:n/vLeA7V+QY84i github.com/HdrHistogram/hdrhistogram-go v1.1.0/go.mod h1:yDgFjdqOqDEKOvasDdhWNXYg9BVp4O+o5f6V/ehm6Oo= github.com/HdrHistogram/hdrhistogram-go v1.1.2/go.mod h1:yDgFjdqOqDEKOvasDdhWNXYg9BVp4O+o5f6V/ehm6Oo= github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= +github.com/LastL2/go-execution v0.0.0-20241025044830-6028e95ddb3a h1:l3EnFurDODyP+abpbtfb6v/F7TQmkMIYKRVu6xygO9c= +github.com/LastL2/go-execution v0.0.0-20241025044830-6028e95ddb3a/go.mod h1:PM6JVuwMV/RZa3SYq6vznGpzcfKFy6KYaDauAPQ13qc= github.com/Masterminds/goutils v1.1.0/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= github.com/Masterminds/semver v1.4.2/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= diff --git a/state/abci_client.go b/state/abci_client.go index fdcd972185..3248f74ef3 100644 --- a/state/abci_client.go +++ b/state/abci_client.go @@ -7,12 +7,12 @@ import ( "fmt" "time" + execution "github.com/LastL2/go-execution" abci "github.com/cometbft/cometbft/abci/types" cmbytes "github.com/cometbft/cometbft/libs/bytes" cmproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/cometbft/cometbft/proxy" cmtypes "github.com/cometbft/cometbft/types" - "github.com/rollkit/rollkit/execution" "github.com/rollkit/rollkit/mempool" "github.com/rollkit/rollkit/store" "github.com/rollkit/rollkit/third_party/log" diff --git a/state/engine_api_client.go b/state/engine_api_client.go index 5984598d1a..dc5373236f 100644 --- a/state/engine_api_client.go +++ b/state/engine_api_client.go @@ -7,11 +7,11 @@ import ( "math/big" "time" + execution "github.com/LastL2/go-execution" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/ethclient" "github.com/ethereum/go-ethereum/rpc" - "github.com/rollkit/rollkit/execution" rollkitTypes "github.com/rollkit/rollkit/types" ) From 8571dc01057138b421bf118658bd1c862d7a201f Mon Sep 17 00:00:00 2001 From: Jay Jie Date: Thu, 24 Oct 2024 22:25:12 -0700 Subject: [PATCH 6/8] chore: move away execution api and client implementation --- block/manager.go | 5 +- go.mod | 31 +- go.sum | 57 ++-- state/abci_client.go | 731 ------------------------------------------- 4 files changed, 47 insertions(+), 777 deletions(-) delete mode 100644 state/abci_client.go diff --git a/block/manager.go b/block/manager.go index b2422121f4..9cdde7fdd9 100644 --- a/block/manager.go +++ b/block/manager.go @@ -26,6 +26,7 @@ import ( goheaderstore "github.com/celestiaorg/go-header/store" + execution "github.com/LastL2/go-execution-abci" "github.com/rollkit/go-sequencing" "github.com/rollkit/go-sequencing/proxy/grpc" "github.com/rollkit/rollkit/config" @@ -155,7 +156,7 @@ type Manager struct { seqClient *grpc.Client lastBatchHash []byte bq *BatchQueue - execClient *state.ABCIExecutionClient + execClient *execution.ABCIExecutionClient } // getInitialState tries to load lastState from Store, and if it's not available it reads GenesisDoc. @@ -241,7 +242,7 @@ func NewManager( // allow buffer for the block header and protocol encoding maxBlobSize -= blockProtocolOverhead - execClient := state.NewABCIExecutionClient(proposerAddress, genesis.ChainID, mempool, mempoolReaper, proxyApp, eventBus, maxBlobSize, logger, execMetrics, store, genesis, &s) + execClient := execution.NewABCIExecutionClient(proposerAddress, genesis.ChainID, mempool, mempoolReaper, proxyApp, eventBus, maxBlobSize, logger, execMetrics, store, genesis, &s) if s.LastBlockHeight+1 == uint64(genesis.InitialHeight) { //nolint:gosec stateRoot, _, err := execClient.InitChain(genesis.GenesisTime, uint64(genesis.InitialHeight), genesis.ChainID) if err != nil { diff --git a/go.mod b/go.mod index 29a1631892..fda113534f 100644 --- a/go.mod +++ b/go.mod @@ -1,18 +1,19 @@ module github.com/rollkit/rollkit -go 1.22 +go 1.22.7 -toolchain go1.22.2 +toolchain go1.22.8 retract v0.12.0 // Published by accident replace ( github.com/LastL2/go-execution => github.com/LastL2/go-execution v0.0.0-20241025044830-6028e95ddb3a + github.com/LastL2/go-execution-abci => github.com/LastL2/go-execution-abci v0.0.0-20241025051413-29b6d20dab76 ) require ( github.com/celestiaorg/utils v0.1.0 - github.com/cometbft/cometbft v0.38.12 + github.com/cometbft/cometbft v0.38.13 github.com/cosmos/gogoproto v1.7.0 github.com/go-kit/kit v0.13.0 github.com/gogo/protobuf v1.3.2 @@ -41,6 +42,7 @@ require ( require ( github.com/BurntSushi/toml v1.4.0 github.com/LastL2/go-execution v0.0.0-00010101000000-000000000000 + github.com/LastL2/go-execution-abci v0.0.0-00010101000000-000000000000 github.com/btcsuite/btcd/btcec/v2 v2.3.4 github.com/celestiaorg/go-header v0.6.2 github.com/ethereum/go-ethereum v1.14.11 @@ -58,7 +60,6 @@ require ( github.com/bits-and-blooms/bitset v1.13.0 // indirect github.com/btcsuite/btcd/chaincfg/chainhash v1.0.2 // indirect github.com/celestiaorg/go-libp2p-messenger v0.2.0 // indirect - github.com/cespare/xxhash v1.1.0 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/cockroachdb/errors v1.11.3 // indirect github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce // indirect @@ -66,7 +67,7 @@ require ( github.com/cockroachdb/pebble v1.1.2 // indirect github.com/cockroachdb/redact v1.1.5 // indirect github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect - github.com/cometbft/cometbft-db v0.11.0 // indirect + github.com/cometbft/cometbft-db v0.14.1 // indirect github.com/consensys/bavard v0.1.13 // indirect github.com/consensys/gnark-crypto v0.12.1 // indirect github.com/containerd/cgroups v1.1.0 // indirect @@ -78,10 +79,8 @@ require ( github.com/davidlazar/go-crypto v0.0.0-20200604182044-b73af7476f6c // indirect github.com/deckarep/golang-set/v2 v2.6.0 // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect - github.com/dgraph-io/badger/v2 v2.2007.4 // indirect github.com/dgraph-io/badger/v4 v4.2.1-0.20231013074411-fb1b00959581 // indirect github.com/dgraph-io/ristretto v0.1.1 // indirect - github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect github.com/docker/go-units v0.5.0 // indirect github.com/dustin/go-humanize v1.0.1 // indirect github.com/elastic/gosigar v0.14.3 // indirect @@ -103,7 +102,7 @@ require ( github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/protobuf v1.5.4 // indirect github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb // indirect - github.com/google/btree v1.1.2 // indirect + github.com/google/btree v1.1.3 // indirect github.com/google/flatbuffers v1.12.1 // indirect github.com/google/go-cmp v0.6.0 // indirect github.com/google/gopacket v1.1.19 // indirect @@ -132,7 +131,7 @@ require ( github.com/koron/go-ssdp v0.0.4 // indirect github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect - github.com/lib/pq v1.10.7 // indirect + github.com/lib/pq v1.10.9 // indirect github.com/libp2p/go-buffer-pool v0.1.0 // indirect github.com/libp2p/go-cidranger v1.1.0 // indirect github.com/libp2p/go-flow-metrics v0.1.0 // indirect @@ -145,14 +144,14 @@ require ( github.com/libp2p/go-netroute v0.2.1 // indirect github.com/libp2p/go-reuseport v0.4.0 // indirect github.com/libp2p/go-yamux/v4 v4.0.1 // indirect - github.com/linxGnu/grocksdb v1.8.12 // indirect + github.com/linxGnu/grocksdb v1.8.14 // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/marten-seemann/tcp v0.0.0-20210406111302-dfbc87cc63fd // indirect github.com/mattn/go-isatty v0.0.20 // indirect github.com/miekg/dns v1.1.62 // indirect github.com/mikioh/tcpinfo v0.0.0-20190314235526-30a79bb1804b // indirect github.com/mikioh/tcpopt v0.0.0-20190314235656-172688c1accc // indirect - github.com/minio/highwayhash v1.0.2 // indirect + github.com/minio/highwayhash v1.0.3 // indirect github.com/minio/sha256-simd v1.0.1 // indirect github.com/mmcloughlin/addchain v0.4.0 // indirect github.com/mr-tron/base58 v1.2.0 // indirect @@ -172,7 +171,7 @@ require ( github.com/opentracing/opentracing-go v1.2.0 // indirect github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58 // indirect github.com/pelletier/go-toml/v2 v2.2.2 // indirect - github.com/petermattis/goid v0.0.0-20230317030725-371a4b8eda08 // indirect + github.com/petermattis/goid v0.0.0-20240813172612-4fcff4a6cae7 // indirect github.com/pion/datachannel v1.5.8 // indirect github.com/pion/dtls/v2 v2.2.12 // indirect github.com/pion/ice/v2 v2.3.34 // indirect @@ -192,7 +191,7 @@ require ( github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/polydawn/refmt v0.89.0 // indirect github.com/prometheus/client_model v0.6.1 // indirect - github.com/prometheus/common v0.55.0 // indirect + github.com/prometheus/common v0.59.1 // indirect github.com/prometheus/procfs v0.15.1 // indirect github.com/quic-go/qpack v0.4.0 // indirect github.com/quic-go/quic-go v0.46.0 // indirect @@ -203,7 +202,7 @@ require ( github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/sagikazarmark/locafero v0.4.0 // indirect github.com/sagikazarmark/slog-shim v0.1.0 // indirect - github.com/sasha-s/go-deadlock v0.3.1 // indirect + github.com/sasha-s/go-deadlock v0.3.5 // indirect github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible // indirect github.com/sourcegraph/conc v0.3.0 // indirect github.com/spaolacci/murmur3 v1.1.0 // indirect @@ -218,7 +217,7 @@ require ( github.com/tklauser/numcpus v0.6.1 // indirect github.com/whyrusleeping/go-keyspace v0.0.0-20160322163242-5b898ac5add1 // indirect github.com/wlynxg/anet v0.0.4 // indirect - go.etcd.io/bbolt v1.3.10 // indirect + go.etcd.io/bbolt v1.4.0-alpha.0.0.20240404170359-43604f3112c5 // indirect go.opencensus.io v0.24.0 // indirect go.opentelemetry.io/otel v1.27.0 // indirect go.opentelemetry.io/otel/metric v1.27.0 // indirect @@ -235,7 +234,7 @@ require ( golang.org/x/text v0.18.0 // indirect golang.org/x/tools v0.24.0 // indirect golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 // indirect - gonum.org/v1/gonum v0.15.0 // indirect + gonum.org/v1/gonum v0.15.1 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240827150818-7e3bb234dfed // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/go.sum b/go.sum index 592b1d074f..5d22e0321e 100644 --- a/go.sum +++ b/go.sum @@ -96,6 +96,8 @@ github.com/HdrHistogram/hdrhistogram-go v1.1.2/go.mod h1:yDgFjdqOqDEKOvasDdhWNXY github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= github.com/LastL2/go-execution v0.0.0-20241025044830-6028e95ddb3a h1:l3EnFurDODyP+abpbtfb6v/F7TQmkMIYKRVu6xygO9c= github.com/LastL2/go-execution v0.0.0-20241025044830-6028e95ddb3a/go.mod h1:PM6JVuwMV/RZa3SYq6vznGpzcfKFy6KYaDauAPQ13qc= +github.com/LastL2/go-execution-abci v0.0.0-20241025051413-29b6d20dab76 h1:kxLHjmIKg40w0bVXRig19G68jIyip4bwzxchs4z3gbA= +github.com/LastL2/go-execution-abci v0.0.0-20241025051413-29b6d20dab76/go.mod h1:L4nAeWqaTqak+qitl+NSoNudjC6umsi4sI7LtflAc6A= github.com/Masterminds/goutils v1.1.0/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= github.com/Masterminds/semver v1.4.2/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= @@ -106,7 +108,6 @@ github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERo github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU= github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 h1:TngWCqHvy9oXAN6lEVMRuU21PR1EtLVZJmdB18Gu3Rw= github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5/go.mod h1:lmUJ/7eu/Q8D7ML55dXQrVaamCz2vxCfdQBasLZfHKk= -github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/OpenPeeDeeP/depguard v1.1.0/go.mod h1:JtAMzWkmFEzDPyAd+W0NHl1lvpQKTvT9jnRVsohBKpc= github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= @@ -118,8 +119,9 @@ github.com/VictoriaMetrics/fastcache v1.12.2/go.mod h1:AmC+Nzz1+3G2eCPapF6UcsnkT github.com/VividCortex/gohistogram v1.0.0 h1:6+hBz+qvs0JOrrNhhmR7lFxo5sINxBCGXrdtl/UvroE= github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g= github.com/Workiva/go-datastructures v1.0.53/go.mod h1:1yZL+zfsztete+ePzZz/Zb1/t5BnDuE2Ya2MMGhzP6A= -github.com/adlio/schema v1.3.3 h1:oBJn8I02PyTB466pZO1UZEn1TV5XLlifBSyMrmHl/1I= github.com/adlio/schema v1.3.3/go.mod h1:1EsRssiv9/Ce2CMzq5DoL7RiMshhuigQxrR4DMV9fHg= +github.com/adlio/schema v1.3.6 h1:k1/zc2jNfeiZBA5aFTRy37jlBIuCkXCm0XmvpzCKI9I= +github.com/adlio/schema v1.3.6/go.mod h1:qkxwLgPBd1FgLRHYVCmQT/rrBr3JH38J9LjmVzWNudg= github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII= github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= @@ -216,7 +218,6 @@ github.com/cenkalti/backoff/v4 v4.1.1/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInq github.com/cenkalti/backoff/v4 v4.1.3/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/census-instrumentation/opencensus-proto v0.3.0/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= 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= @@ -263,10 +264,10 @@ github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZ 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/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/cometbft/cometbft v0.38.12 h1:OWsLZN2KcSSFe8bet9xCn07VwhBnavPea3VyPnNq1bg= -github.com/cometbft/cometbft v0.38.12/go.mod h1:GPHp3/pehPqgX1930HmK1BpBLZPxB75v/dZg8Viwy+o= -github.com/cometbft/cometbft-db v0.11.0 h1:M3Lscmpogx5NTbb1EGyGDaFRdsoLWrUWimFEyf7jej8= -github.com/cometbft/cometbft-db v0.11.0/go.mod h1:GDPJAC/iFHNjmZZPN8V8C1yr/eyityhi2W1hz2MGKSc= +github.com/cometbft/cometbft v0.38.13 h1:k0ssyC8W0FfFvGpSHpojZ4JrXAANlJEIM41hjRq6OoU= +github.com/cometbft/cometbft v0.38.13/go.mod h1:NMmNysQM+T5uxTXVLMgzcvq35OVOyC7GK2/bnHqldjE= +github.com/cometbft/cometbft-db v0.14.1 h1:SxoamPghqICBAIcGpleHbmoPqy+crij/++eZz3DlerQ= +github.com/cometbft/cometbft-db v0.14.1/go.mod h1:KHP1YghilyGV/xjD5DP3+2hyigWx0WTp9X+0Gnx0RxQ= github.com/consensys/bavard v0.1.13 h1:oLhMLOFGTLdlda/kma4VOJazblc7IM5y5QPd2A/YjhQ= github.com/consensys/bavard v0.1.13/go.mod h1:9ItSMtA/dXMAiL7BG6bqW2m3NdSEObYWoH223nGHukI= github.com/consensys/gnark-crypto v0.12.1 h1:lHH39WuuFgVHONRl3J0LRBtuYdQTumFSDtJF7HpyG8M= @@ -334,8 +335,6 @@ github.com/denis-tingaikin/go-header v0.4.3/go.mod h1:0wOCWuN71D5qIgE2nz9KrKmuYB github.com/denisenkom/go-mssqldb v0.12.0/go.mod h1:iiK0YP1ZeepvmBQk/QpLEhhTNJgfzrpArPY/aFvc9yU= github.com/dgraph-io/badger v1.6.2/go.mod h1:JW2yswe3V058sS0kZ2h/AXeDSqFjxnZcRrVH//y2UQE= github.com/dgraph-io/badger/v2 v2.2007.2/go.mod h1:26P/7fbL4kUZVEVKLAKXkBXKOydDmM2p1e+NhhnBCAE= -github.com/dgraph-io/badger/v2 v2.2007.4 h1:TRWBQg8UrlUhaFdco01nO2uXwzKS7zd+HVdwV/GHc4o= -github.com/dgraph-io/badger/v2 v2.2007.4/go.mod h1:vSw/ax2qojzbN6eXHIx6KPKtCSHJN/Uz0X0VPruTIhk= github.com/dgraph-io/badger/v4 v4.2.1-0.20231013074411-fb1b00959581 h1:yy45brf1ktmnkTCZlHynP1gRlVwZ9g19oz5D9wG81v4= github.com/dgraph-io/badger/v4 v4.2.1-0.20231013074411-fb1b00959581/go.mod h1:T/uWAYxrXdaXw64ihI++9RMbKTCpKd/yE9+saARew7k= github.com/dgraph-io/ristretto v0.0.2/go.mod h1:KPxhHT9ZxKefz+PCeOGsrHpl1qZ7i70dGTu2u+Ahh6E= @@ -565,8 +564,8 @@ github.com/golangci/revgrep v0.0.0-20210930125155-c22e5001d4f2/go.mod h1:LK+zW4M github.com/golangci/unconvert v0.0.0-20180507085042-28b1c447d1f4/go.mod h1:Izgrg8RkN3rCIMLGE9CyYmU9pY2Jer6DgANEnZ/L/cQ= 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/btree v1.1.2 h1:xf4v41cLI2Z6FxbKm+8Bu+m8ifhj15JuZ9sa0jZCMUU= -github.com/google/btree v1.1.2/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4= +github.com/google/btree v1.1.3 h1:CVpQJjYgC4VbzxeGVHfvZrv1ctoYCAI8vbl07Fcxlyg= +github.com/google/btree v1.1.3/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4= github.com/google/certificate-transparency-go v1.0.21/go.mod h1:QeJfpSbVSfYc7RgB3gJFj9cbuQMMchQxrWXz8Ruopmg= github.com/google/certificate-transparency-go v1.1.1/go.mod h1:FDKqPvSXawb2ecErVRrD+nfy23RCzyl7eqVCEmlT1Zs= github.com/google/flatbuffers v1.12.1 h1:MVlul7pQNoDzWRLTw5imwYsl+usrS1TXG2H4jg6ImGw= @@ -864,7 +863,6 @@ github.com/kisielk/errcheck v1.6.1/go.mod h1:nXw/i/MfnvRHqXa7XXmQMUB0oNFGuBrNI8d github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6CZQHDETBtE9HaSEkGmuNXF86RwHhHUvq4= github.com/klauspost/compress v1.11.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= -github.com/klauspost/compress v1.12.3/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= github.com/klauspost/compress v1.13.4/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= github.com/klauspost/compress v1.13.5/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= @@ -914,8 +912,8 @@ github.com/lib/pq v1.8.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/lib/pq v1.9.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/lib/pq v1.10.4/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/lib/pq v1.10.6/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= -github.com/lib/pq v1.10.7 h1:p7ZhMD+KsSRozJr34udlUrhboJwWAgCg34+/ZZNvZZw= -github.com/lib/pq v1.10.7/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= +github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw= +github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/libp2p/go-addr-util v0.1.0/go.mod h1:6I3ZYuFr2O/9D+SoyM0zEw0EF3YkldtTX406BpdQMqw= github.com/libp2p/go-buffer-pool v0.0.1/go.mod h1:xtyIz9PMobb13WaxR6Zo1Pd1zXJKYg0a8KiIvDp3TzQ= github.com/libp2p/go-buffer-pool v0.0.2/go.mod h1:MvaB6xw5vOrDl8rYZGLFdKAuk/hRoRZd1Vi32+RXyFM= @@ -1034,8 +1032,8 @@ github.com/libp2p/go-yamux/v4 v4.0.1/go.mod h1:NWjl8ZTLOGlozrXSOZ/HlfG++39iKNnM5 github.com/libp2p/zeroconf/v2 v2.1.1/go.mod h1:fuJqLnUwZTshS3U/bMRJ3+ow/v9oid1n0DmyYyNO1Xs= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= -github.com/linxGnu/grocksdb v1.8.12 h1:1/pCztQUOa3BX/1gR3jSZDoaKFpeHFvQ1XrqZpSvZVo= -github.com/linxGnu/grocksdb v1.8.12/go.mod h1:xZCIb5Muw+nhbDK4Y5UJuOrin5MceOuiXkVUR7vp4WY= +github.com/linxGnu/grocksdb v1.8.14 h1:HTgyYalNwBSG/1qCQUIott44wU5b2Y9Kr3z7SK5OfGQ= +github.com/linxGnu/grocksdb v1.8.14/go.mod h1:QYiYypR2d4v63Wj1adOOfzglnoII0gLj3PNh4fZkcFA= github.com/lucas-clemente/quic-go v0.23.0/go.mod h1:paZuzjXCE5mj6sikVLMvqXk8lJV2AsqtJ6bDhjEfxx0= github.com/lucas-clemente/quic-go v0.25.0/go.mod h1:YtzP8bxRVCBlO77yRanE264+fY/T2U9ZlW1AaHOsMOg= github.com/lucas-clemente/quic-go v0.27.0/go.mod h1:AzgQoPda7N+3IqMMMkywBKggIFo2KT6pfnlrQ2QieeI= @@ -1116,8 +1114,9 @@ github.com/mikioh/tcpopt v0.0.0-20190314235656-172688c1accc h1:PTfri+PuQmWDqERdn github.com/mikioh/tcpopt v0.0.0-20190314235656-172688c1accc/go.mod h1:cGKTAVKx4SxOuR/czcZ/E2RSJ3sfHs8FpHhQ5CWMf9s= github.com/minio/blake2b-simd v0.0.0-20160723061019-3f5f724cb5b1/go.mod h1:pD8RvIylQ358TN4wwqatJ8rNavkEINozVn9DtGI3dfQ= github.com/minio/highwayhash v1.0.1/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLTk+kldvVxY= -github.com/minio/highwayhash v1.0.2 h1:Aak5U0nElisjDCfPSG79Tgzkn2gl66NxOMspRrKnA/g= github.com/minio/highwayhash v1.0.2/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLTk+kldvVxY= +github.com/minio/highwayhash v1.0.3 h1:kbnuUMoHYyVl7szWjSxJnxw11k2U709jqFPPmIUyD6Q= +github.com/minio/highwayhash v1.0.3/go.mod h1:GGYsuwP/fPD6Y9hMiXuapVvlIUEhFhMTh0rxU3ik1LQ= github.com/minio/sha256-simd v0.0.0-20190131020904-2d45a736cd16/go.mod h1:2FMWW+8GMoPweT6+pI63m9YE3Lmw4J71hV56Chs1E/U= github.com/minio/sha256-simd v0.0.0-20190328051042-05b4dd3047e5/go.mod h1:2FMWW+8GMoPweT6+pI63m9YE3Lmw4J71hV56Chs1E/U= github.com/minio/sha256-simd v0.1.0/go.mod h1:2FMWW+8GMoPweT6+pI63m9YE3Lmw4J71hV56Chs1E/U= @@ -1296,8 +1295,9 @@ github.com/opencontainers/image-spec v1.0.2/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zM github.com/opencontainers/image-spec v1.1.0-rc2 h1:2zx/Stx4Wc5pIPDvIxHXvXtQFW/7XWJGmnM7r3wg034= github.com/opencontainers/image-spec v1.1.0-rc2/go.mod h1:3OVijpioIKYWTqjiG0zfF6wvoJ4fAXGbjdZuI2NgsRQ= github.com/opencontainers/runc v1.1.2/go.mod h1:Tj1hFw6eFWp/o33uxGf5yF2BX5yz2Z6iptFpuvbbKqc= -github.com/opencontainers/runc v1.1.3 h1:vIXrkId+0/J2Ymu2m7VjGvbSlAId9XNRPhn2p4b+d8w= github.com/opencontainers/runc v1.1.3/go.mod h1:1J5XiS+vdZ3wCyZybsuxXZWGrgSr8fFJHLXuG2PsnNg= +github.com/opencontainers/runc v1.1.12 h1:BOIssBaW1La0/qbNZHXOOa71dZfZEQOzW7dqQf3phss= +github.com/opencontainers/runc v1.1.12/go.mod h1:S+lQwSfncpBha7XTy/5lBwWgm5+y5Ma/O44Ekby9FK8= github.com/opencontainers/runtime-spec v1.0.2/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= github.com/opencontainers/runtime-spec v1.0.3-0.20210326190908-1c3f411f0417/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= github.com/opencontainers/runtime-spec v1.2.0 h1:z97+pHb3uELt/yiAWD691HNHQIF07bE7dzrbT927iTk= @@ -1341,8 +1341,8 @@ github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9 github.com/performancecopilot/speed/v4 v4.0.0/go.mod h1:qxrSyuDGrTOWfV+uKRFhfxw6h/4HXRGUiZiufxo49BM= github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o= -github.com/petermattis/goid v0.0.0-20230317030725-371a4b8eda08 h1:hDSdbBuw3Lefr6R18ax0tZ2BJeNB3NehB3trOwYBsdU= -github.com/petermattis/goid v0.0.0-20230317030725-371a4b8eda08/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= +github.com/petermattis/goid v0.0.0-20240813172612-4fcff4a6cae7 h1:Dx7Ovyv/SFnMFw3fD4oEoeorXc6saIiQ23LrGLth0Gw= +github.com/petermattis/goid v0.0.0-20240813172612-4fcff4a6cae7/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= github.com/phayes/checkstyle v0.0.0-20170904204023-bfd46e6a821d/go.mod h1:3OzsM7FXDQlpCiw2j81fOmAwQLnZnLGXVKUzeKQXIAw= github.com/philhofer/fwd v1.1.1/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG3ZVNU= github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= @@ -1447,8 +1447,8 @@ github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9 github.com/prometheus/common v0.30.0/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= github.com/prometheus/common v0.33.0/go.mod h1:gB3sOl7P0TvJabZpLY5uQMpUqRCPPCyRLCZYc7JZTNE= -github.com/prometheus/common v0.55.0 h1:KEi6DK7lXW/m7Ig5i47x0vRzuBsHuvJdi5ee6Y3G1dc= -github.com/prometheus/common v0.55.0/go.mod h1:2SECS4xJG1kd8XF9IcM1gMX6510RAEL65zxzNImwdc8= +github.com/prometheus/common v0.59.1 h1:LXb1quJHWm1P6wq/U824uxYi4Sg0oGvNeUm1z5dJoX0= +github.com/prometheus/common v0.59.1/go.mod h1:GpWM7dewqmVYcd7SmRaiWVe9SSqjf0UrwnYnpEZNuT0= github.com/prometheus/procfs v0.0.0-20180725123919-05ee40e3a273/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= @@ -1525,8 +1525,8 @@ github.com/sagikazarmark/slog-shim v0.1.0/go.mod h1:SrcSrq8aKtyuqEI1uvTDTK1arOWR github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= github.com/sanposhiho/wastedassign/v2 v2.0.6/go.mod h1:KyZ0MWTwxxBmfwn33zh3k1dmsbF2ud9pAAGfoLfjhtI= github.com/sasha-s/go-deadlock v0.2.1-0.20190427202633-1595213edefa/go.mod h1:F73l+cr82YSh10GxyRI6qZiCgK64VaZjwesgfQ1/iLM= -github.com/sasha-s/go-deadlock v0.3.1 h1:sqv7fDNShgjcaxkO0JNcOAlr8B9+cV5Ey/OB71efZx0= -github.com/sasha-s/go-deadlock v0.3.1/go.mod h1:F73l+cr82YSh10GxyRI6qZiCgK64VaZjwesgfQ1/iLM= +github.com/sasha-s/go-deadlock v0.3.5 h1:tNCOEEDG6tBqrNDOX35j/7hL5FcFViG6awUGROb2NsU= +github.com/sasha-s/go-deadlock v0.3.5/go.mod h1:bugP6EGbdGYObIlx7pUZtWqlvo8k9H6vCBBsiChJQ5U= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/seccomp/libseccomp-golang v0.9.2-0.20210429002308-3879420cc921/go.mod h1:JA8cRccbGaA1s33RQf7Y1+q9gHmZX1yB/z9WDN1C6fg= github.com/seccomp/libseccomp-golang v0.9.2-0.20220502022130-f33da4d89646/go.mod h1:JA8cRccbGaA1s33RQf7Y1+q9gHmZX1yB/z9WDN1C6fg= @@ -1753,8 +1753,8 @@ gitlab.com/bosi/decorder v0.2.2/go.mod h1:9K1RB5+VPNQYtXtTDAzd2OEftsZb1oV0IrJrzC go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.4/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ= go.etcd.io/bbolt v1.3.6/go.mod h1:qXsaaIqmgQH0T+OPdb99Bf+PKfBBQVAdyD6TY9G8XM4= -go.etcd.io/bbolt v1.3.10 h1:+BqfJTcCzTItrop8mq/lbzL8wSGtj94UO/3U31shqG0= -go.etcd.io/bbolt v1.3.10/go.mod h1:bK3UQLPJZly7IlNmV7uVHJDxfe5aK9Ll93e/74Y9oEQ= +go.etcd.io/bbolt v1.4.0-alpha.0.0.20240404170359-43604f3112c5 h1:qxen9oVGzDdIRP6ejyAJc760RwW4SnVDiTYTzwnXuxo= +go.etcd.io/bbolt v1.4.0-alpha.0.0.20240404170359-43604f3112c5/go.mod h1:eW0HG9/oHQhvRCvb1/pIXW4cOvtDqeQK+XSi3TnwaXY= go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= go.etcd.io/etcd v0.0.0-20200513171258-e048e166ab9c/go.mod h1:xCI7ZzBfRuGgBXyXO6yfWfDmlWd35khcWpUa4L0xI/k= go.etcd.io/etcd/api/v3 v3.5.0/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs= @@ -2191,6 +2191,7 @@ golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.9.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34= golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= @@ -2348,8 +2349,8 @@ golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 h1:+cNy6SZtPcJQH3LJVLOSm golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028/go.mod h1:NDW/Ps6MPRej6fsCIbMTohpP40sJ/P/vI1MoTEGwX90= gonum.org/v1/gonum v0.0.0-20180816165407-929014505bf4/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= gonum.org/v1/gonum v0.8.2/go.mod h1:oe/vMfY3deqTw+1EZJhuvEW2iwGF1bW9wwu7XCu0+v0= -gonum.org/v1/gonum v0.15.0 h1:2lYxjRbTYyxkJxlhC+LvJIx3SsANPdRybu1tGj9/OrQ= -gonum.org/v1/gonum v0.15.0/go.mod h1:xzZVBJBtS+Mz4q0Yl2LJTk+OxOg4jiXZ7qBoM0uISGo= +gonum.org/v1/gonum v0.15.1 h1:FNy7N6OUZVUaWG9pTiD+jlhdQ3lMP+/LcTpJ6+a8sQ0= +gonum.org/v1/gonum v0.15.1/go.mod h1:eZTZuRFrzu5pcyjN5wJhcIhnUdNijYxX1T2IcrOGY0o= gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= gonum.org/v1/plot v0.0.0-20190515093506-e2840ee46a6b/go.mod h1:Wt8AAjI+ypCyYX3nZBvf6cAIx93T+c/OS2HFAYskSZc= google.golang.org/api v0.0.0-20180910000450-7ca32eb868bf/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= diff --git a/state/abci_client.go b/state/abci_client.go deleted file mode 100644 index 3248f74ef3..0000000000 --- a/state/abci_client.go +++ /dev/null @@ -1,731 +0,0 @@ -package state - -import ( - "bytes" - "context" - "errors" - "fmt" - "time" - - execution "github.com/LastL2/go-execution" - abci "github.com/cometbft/cometbft/abci/types" - cmbytes "github.com/cometbft/cometbft/libs/bytes" - cmproto "github.com/cometbft/cometbft/proto/tendermint/types" - "github.com/cometbft/cometbft/proxy" - cmtypes "github.com/cometbft/cometbft/types" - "github.com/rollkit/rollkit/mempool" - "github.com/rollkit/rollkit/store" - "github.com/rollkit/rollkit/third_party/log" - "github.com/rollkit/rollkit/types" - abciconv "github.com/rollkit/rollkit/types/abci" -) - -/* - *********************************** - * TO-DO move to go-execution-abci * - *********************************** - */ - -// ErrEmptyValSetGenerated is returned when applying the validator changes would result in empty set. -var ErrEmptyValSetGenerated = errors.New("applying the validator changes would result in empty set") - -// ErrAddingValidatorToBased is returned when trying to add a validator to an empty validator set. -var ErrAddingValidatorToBased = errors.New("cannot add validators to empty validator set") - -type ABCIExecutionClient struct { - // abci specific - proxyApp proxy.AppConnConsensus - eventBus *cmtypes.EventBus - genesis *cmtypes.GenesisDoc - maxBytes uint64 - proposerAddress []byte - chainID string - - // rollkit specific - mempool mempool.Mempool - mempoolReaper *mempool.CListMempoolReaper - logger log.Logger - metrics *Metrics - state *types.State - store store.Store -} - -func NewABCIExecutionClient(proposerAddress []byte, chainID string, mempool mempool.Mempool, mempoolReaper *mempool.CListMempoolReaper, proxyApp proxy.AppConnConsensus, eventBus *cmtypes.EventBus, maxBytes uint64, logger log.Logger, metrics *Metrics, store store.Store, genesis *cmtypes.GenesisDoc, state *types.State) *ABCIExecutionClient { - return &ABCIExecutionClient{ - proxyApp: proxyApp, - eventBus: eventBus, - genesis: genesis, - maxBytes: maxBytes, - proposerAddress: proposerAddress, - chainID: chainID, - mempool: mempool, - mempoolReaper: mempoolReaper, - logger: logger, - metrics: metrics, - store: store, - state: state, - } -} - -var _ execution.Execute = (*ABCIExecutionClient)(nil) - -// InitChain initializes the blockchain with genesis information. -func (c *ABCIExecutionClient) InitChain( - genesisTime time.Time, - initialHeight uint64, - chainID string, -) (types.Hash, uint64, error) { - genesis := &cmtypes.GenesisDoc{ - GenesisTime: genesisTime, - ChainID: chainID, - ConsensusParams: c.genesis.ConsensusParams, - Validators: c.genesis.Validators, - AppState: c.genesis.AppState, - InitialHeight: int64(initialHeight), - } - - response, err := c.initChain(genesis) - if err != nil { - return types.Hash{}, 0, err - } - - stateRoot := types.Hash(response.AppHash) - maxBytes := response.ConsensusParams.Block.MaxBytes - - return stateRoot, uint64(maxBytes), nil -} - -// initChain calls InitChainSync using consensus connection to app. -func (c *ABCIExecutionClient) initChain(genesis *cmtypes.GenesisDoc) (*abci.ResponseInitChain, error) { - params := genesis.ConsensusParams - - validators := make([]*cmtypes.Validator, len(genesis.Validators)) - for i, v := range genesis.Validators { - validators[i] = cmtypes.NewValidator(v.PubKey, v.Power) - } - - return c.proxyApp.InitChain(context.Background(), &abci.RequestInitChain{ - Time: genesis.GenesisTime, - ChainId: genesis.ChainID, - ConsensusParams: &cmproto.ConsensusParams{ - Block: &cmproto.BlockParams{ - MaxBytes: params.Block.MaxBytes, - MaxGas: params.Block.MaxGas, - }, - Evidence: &cmproto.EvidenceParams{ - MaxAgeNumBlocks: params.Evidence.MaxAgeNumBlocks, - MaxAgeDuration: params.Evidence.MaxAgeDuration, - MaxBytes: params.Evidence.MaxBytes, - }, - Validator: &cmproto.ValidatorParams{ - PubKeyTypes: params.Validator.PubKeyTypes, - }, - Version: &cmproto.VersionParams{ - App: params.Version.App, - }, - Abci: &cmproto.ABCIParams{ - VoteExtensionsEnableHeight: params.ABCI.VoteExtensionsEnableHeight, - }, - }, - Validators: cmtypes.TM2PB.ValidatorUpdates(cmtypes.NewValidatorSet(validators)), - AppStateBytes: genesis.AppState, - InitialHeight: genesis.InitialHeight, - }) -} - -// GetTxs retrieves all available transactions from the mempool. -func (c *ABCIExecutionClient) GetTxs() ([]types.Tx, error) { - state, err := c.store.GetState(context.Background()) - if err != nil { - return nil, fmt.Errorf("failed to get current state: %w", err) - } - - maxBytes := state.ConsensusParams.Block.MaxBytes - if maxBytes == -1 { - maxBytes = int64(cmtypes.MaxBlockSizeBytes) - } - if maxBytes > int64(c.maxBytes) { - c.logger.Debug("limiting maxBytes to", "maxBytes", c.maxBytes) - maxBytes = int64(c.maxBytes) - } - - cmTxs := c.mempool.ReapMaxTxs(int(maxBytes)) - - rollkitTxs := make([]types.Tx, len(cmTxs)) - for i, tx := range cmTxs { - rollkitTxs[i] = types.Tx(tx) - } - - return rollkitTxs, nil -} - -// ExecuteTxs executes a set of transactions to produce a new block. -func (c *ABCIExecutionClient) ExecuteTxs( - txs []types.Tx, - blockHeight uint64, - timestamp time.Time, - prevStateRoot types.Hash, -) (types.Hash, uint64, error) { - ctx := context.Background() - - state, err := c.store.GetState(ctx) - if err != nil { - return types.Hash{}, 0, fmt.Errorf("failed to get current state: %w", err) - } - - cmTxs := fromRollkitTxs(txs) - - var lastSignature *types.Signature - var lastHeaderHash types.Hash - var lastExtendedCommit abci.ExtendedCommitInfo - - if blockHeight == uint64(c.genesis.InitialHeight) { - lastSignature = &types.Signature{} - lastHeaderHash = types.Hash{} - lastExtendedCommit = abci.ExtendedCommitInfo{} - } else { - lastSignature, err = c.store.GetSignature(ctx, blockHeight-1) - if err != nil { - return types.Hash{}, 0, fmt.Errorf("error while loading last commit: %w", err) - } - - lastHeader, _, err := c.store.GetBlockData(ctx, blockHeight-1) - if err != nil { - return types.Hash{}, 0, fmt.Errorf("error while loading last block: %w", err) - } - lastHeaderHash = lastHeader.Hash() - - extCommit, err := c.store.GetExtendedCommit(ctx, blockHeight-1) - if err != nil { - return types.Hash{}, 0, fmt.Errorf("failed to load extended commit for height %d: %w", blockHeight-1, err) - } - if extCommit != nil { - lastExtendedCommit = *extCommit - } - } - - header, data, err := c.CreateBlock( - blockHeight, - lastSignature, - lastExtendedCommit, - lastHeaderHash, - state, - cmTxs, - timestamp, - ) - if err != nil { - return types.Hash{}, 0, fmt.Errorf("failed to create block: %w", err) - } - - isValid, err := c.ProcessProposal(header, data, state) - if err != nil { - return types.Hash{}, 0, fmt.Errorf("failed to process proposal: %w", err) - } - if !isValid { - return types.Hash{}, 0, fmt.Errorf("proposal was not valid") - } - - newState, resp, err := c.ApplyBlock(ctx, state, header, data) - if err != nil { - return types.Hash{}, 0, fmt.Errorf("failed to apply block: %w", err) - } - - appHash, _, err := c.Commit(ctx, newState, header, data, resp) - if err != nil { - return types.Hash{}, 0, fmt.Errorf("failed to commit: %w", err) - } - - return types.Hash(appHash), uint64(newState.ConsensusParams.Block.MaxBytes), nil -} - -// SetFinal marks a block at the given height as final. -func (c *ABCIExecutionClient) SetFinal(blockHeight uint64) error { - ctx := context.Background() - - header, data, err := c.store.GetBlockData(ctx, blockHeight) - if err != nil { - return fmt.Errorf("failed to get block data for height %d: %w", blockHeight, err) - } - - state, err := c.store.GetState(ctx) - if err != nil { - return fmt.Errorf("failed to get current state: %w", err) - } - - resp, err := c.proxyApp.FinalizeBlock(ctx, &abci.RequestFinalizeBlock{ - Hash: header.Hash(), - Height: int64(blockHeight), - Time: header.Time(), - Txs: data.Txs.ToSliceOfBytes(), - ProposerAddress: header.ProposerAddress, - NextValidatorsHash: state.Validators.Hash(), - }) - if err != nil { - return fmt.Errorf("failed to finalize block at height %d: %w", blockHeight, err) - } - - state.AppHash = resp.AppHash - if err := c.store.UpdateState(ctx, state); err != nil { - return fmt.Errorf("failed to update state after finalizing block %d: %w", blockHeight, err) - } - - c.logger.Info("Block finalized", "height", blockHeight, "hash", header.Hash()) - - return nil -} - -// CreateBlock reaps transactions from mempool and builds a block. -func (c *ABCIExecutionClient) CreateBlock(height uint64, lastSignature *types.Signature, lastExtendedCommit abci.ExtendedCommitInfo, lastHeaderHash types.Hash, state types.State, txs cmtypes.Txs, timestamp time.Time) (*types.SignedHeader, *types.Data, error) { - maxBytes := state.ConsensusParams.Block.MaxBytes - emptyMaxBytes := maxBytes == -1 - if emptyMaxBytes { - maxBytes = int64(cmtypes.MaxBlockSizeBytes) - } - if maxBytes > int64(c.maxBytes) { //nolint:gosec - c.logger.Debug("limiting maxBytes to", "e.maxBytes=%d", c.maxBytes) - maxBytes = int64(c.maxBytes) //nolint:gosec - } - - header := &types.SignedHeader{ - Header: types.Header{ - Version: types.Version{ - Block: state.Version.Consensus.Block, - App: state.Version.Consensus.App, - }, - BaseHeader: types.BaseHeader{ - ChainID: c.chainID, - Height: height, - Time: uint64(timestamp.UnixNano()), //nolint:gosec - }, - DataHash: make(types.Hash, 32), - ConsensusHash: make(types.Hash, 32), - AppHash: state.AppHash, - LastResultsHash: state.LastResultsHash, - ProposerAddress: c.proposerAddress, - }, - Signature: *lastSignature, - } - data := &types.Data{ - Txs: toRollkitTxs(txs), - // IntermediateStateRoots: types.IntermediateStateRoots{RawRootsList: nil}, - // Note: Temporarily remove Evidence #896 - // Evidence: types.EvidenceData{Evidence: nil}, - } - - rpp, err := c.proxyApp.PrepareProposal( - context.TODO(), - &abci.RequestPrepareProposal{ - MaxTxBytes: maxBytes, - Txs: txs.ToSliceOfBytes(), - LocalLastCommit: lastExtendedCommit, - Misbehavior: []abci.Misbehavior{}, - Height: int64(header.Height()), //nolint:gosec - Time: header.Time(), //TODO: replace with sequencer timestamp - NextValidatorsHash: state.Validators.Hash(), - ProposerAddress: c.proposerAddress, - }, - ) - if err != nil { - // The App MUST ensure that only valid (and hence 'processable') transactions - // enter the mempool. Hence, at this point, we can't have any non-processable - // transaction causing an error. - // - // Also, the App can simply skip any transaction that could cause any kind of trouble. - // Either way, we cannot recover in a meaningful way, unless we skip proposing - // this block, repair what caused the error and try again. Hence, we return an - // error for now (the production code calling this function is expected to panic). - return nil, nil, err - } - - txl := cmtypes.ToTxs(rpp.Txs) - if err := txl.Validate(maxBytes); err != nil { - return nil, nil, err - } - - data.Txs = toRollkitTxs(txl) - // Note: This is hash of an ABCI type commit equivalent of the last signature in the signed header. - header.LastCommitHash = lastSignature.GetCommitHash(&header.Header, c.proposerAddress) - header.LastHeaderHash = lastHeaderHash - - return header, data, nil -} - -// ProcessProposal calls the corresponding ABCI method on the app. -func (c *ABCIExecutionClient) ProcessProposal( - header *types.SignedHeader, - data *types.Data, - state types.State, -) (bool, error) { - resp, err := c.proxyApp.ProcessProposal(context.TODO(), &abci.RequestProcessProposal{ - Hash: header.Hash(), - Height: int64(header.Height()), //nolint:gosec - Time: header.Time(), - Txs: data.Txs.ToSliceOfBytes(), - ProposedLastCommit: abci.CommitInfo{ - Round: 0, - Votes: []abci.VoteInfo{ - { - Validator: abci.Validator{ - Address: header.Validators.GetProposer().Address, - Power: header.Validators.GetProposer().VotingPower, - }, - BlockIdFlag: cmproto.BlockIDFlagCommit, - }, - }, - }, - Misbehavior: []abci.Misbehavior{}, - ProposerAddress: c.proposerAddress, - NextValidatorsHash: state.Validators.Hash(), - }) - if err != nil { - return false, err - } - if resp.IsStatusUnknown() { - panic(fmt.Sprintf("ProcessProposal responded with status %s", resp.Status.String())) - } - - return resp.IsAccepted(), nil -} - -// ApplyBlock validates and executes the block. -func (c *ABCIExecutionClient) ApplyBlock(ctx context.Context, state types.State, header *types.SignedHeader, data *types.Data) (types.State, *abci.ResponseFinalizeBlock, error) { - isAppValid, err := c.ProcessProposal(header, data, state) - if err != nil { - return types.State{}, nil, err - } - if !isAppValid { - return types.State{}, nil, fmt.Errorf("proposal processing resulted in an invalid application state") - } - - err = c.Validate(state, header, data) - if err != nil { - return types.State{}, nil, err - } - // This makes calls to the AppClient - resp, err := c.execute(ctx, state, header, data) - if err != nil { - return types.State{}, nil, err - } - abciValUpdates := resp.ValidatorUpdates - - validatorUpdates, err := cmtypes.PB2TM.ValidatorUpdates(abciValUpdates) - if err != nil { - return state, nil, err - } - - if resp.ConsensusParamUpdates != nil { - c.metrics.ConsensusParamUpdates.Add(1) - } - - state, err = c.updateState(state, header, data, resp, validatorUpdates) - if err != nil { - return types.State{}, nil, err - } - - if state.ConsensusParams.Block.MaxBytes <= 0 { - c.logger.Error("maxBytes<=0", "state.ConsensusParams.Block", state.ConsensusParams.Block, "header", header) - } - - return state, resp, nil -} - -// ExtendVote calls the ExtendVote ABCI method on the proxy app. -func (c *ABCIExecutionClient) ExtendVote(ctx context.Context, header *types.SignedHeader, data *types.Data) ([]byte, error) { - resp, err := c.proxyApp.ExtendVote(ctx, &abci.RequestExtendVote{ - Hash: header.Hash(), - Height: int64(header.Height()), //nolint:gosec - Time: header.Time(), - Txs: data.Txs.ToSliceOfBytes(), - ProposedLastCommit: abci.CommitInfo{ - Votes: []abci.VoteInfo{{ - Validator: abci.Validator{ - Address: header.Validators.GetProposer().Address, - Power: header.Validators.GetProposer().VotingPower, - }, - BlockIdFlag: cmproto.BlockIDFlagCommit, - }}, - }, - Misbehavior: nil, - NextValidatorsHash: header.ValidatorHash, - ProposerAddress: header.ProposerAddress, - }) - if err != nil { - return nil, err - } - return resp.VoteExtension, nil -} - -// Commit commits the block -func (c *ABCIExecutionClient) Commit(ctx context.Context, state types.State, header *types.SignedHeader, data *types.Data, resp *abci.ResponseFinalizeBlock) ([]byte, uint64, error) { - appHash, retainHeight, err := c.commit(ctx, state, header, data, resp) - if err != nil { - return []byte{}, 0, err - } - - state.AppHash = appHash - - c.publishEvents(resp, header, data, state) - - return appHash, retainHeight, nil -} - -// updateConsensusParams updates the consensus parameters based on the provided updates. -func (c *ABCIExecutionClient) updateConsensusParams(height uint64, params cmtypes.ConsensusParams, consensusParamUpdates *cmproto.ConsensusParams) (cmproto.ConsensusParams, uint64, error) { - nextParams := params.Update(consensusParamUpdates) - if err := types.ConsensusParamsValidateBasic(nextParams); err != nil { - return cmproto.ConsensusParams{}, 0, fmt.Errorf("validating new consensus params: %w", err) - } - if err := nextParams.ValidateUpdate(consensusParamUpdates, int64(height)); err != nil { //nolint:gosec - return cmproto.ConsensusParams{}, 0, fmt.Errorf("updating consensus params: %w", err) - } - return nextParams.ToProto(), nextParams.Version.App, nil -} - -func (c *ABCIExecutionClient) updateState(state types.State, header *types.SignedHeader, data *types.Data, finalizeBlockResponse *abci.ResponseFinalizeBlock, validatorUpdates []*cmtypes.Validator) (types.State, error) { - height := header.Height() - if finalizeBlockResponse.ConsensusParamUpdates != nil { - nextParamsProto, appVersion, err := c.updateConsensusParams(height, types.ConsensusParamsFromProto(state.ConsensusParams), finalizeBlockResponse.ConsensusParamUpdates) - if err != nil { - return types.State{}, err - } - // Change results from this height but only applies to the next height. - state.LastHeightConsensusParamsChanged = height + 1 - state.Version.Consensus.App = appVersion - state.ConsensusParams = nextParamsProto - } - - nValSet := state.NextValidators.Copy() - lastHeightValSetChanged := state.LastHeightValidatorsChanged - - if len(nValSet.Validators) > 0 { - err := nValSet.UpdateWithChangeSet(validatorUpdates) - if err != nil { - if err.Error() != ErrEmptyValSetGenerated.Error() { - return state, err - } - nValSet = &cmtypes.ValidatorSet{ - Validators: make([]*cmtypes.Validator, 0), - Proposer: nil, - } - } - // Change results from this height but only applies to the next next height. - lastHeightValSetChanged = int64(header.Header.Height() + 1 + 1) //nolint:gosec - - if len(nValSet.Validators) > 0 { - nValSet.IncrementProposerPriority(1) - } - } - - s := types.State{ - Version: state.Version, - ChainID: state.ChainID, - InitialHeight: state.InitialHeight, - LastBlockHeight: height, - LastBlockTime: header.Time(), - LastBlockID: cmtypes.BlockID{ - Hash: cmbytes.HexBytes(header.Hash()), - // for now, we don't care about part set headers - }, - ConsensusParams: state.ConsensusParams, - LastHeightConsensusParamsChanged: state.LastHeightConsensusParamsChanged, - AppHash: finalizeBlockResponse.AppHash, - Validators: state.NextValidators.Copy(), - NextValidators: nValSet, - LastHeightValidatorsChanged: lastHeightValSetChanged, - LastValidators: state.Validators.Copy(), - } - copy(s.LastResultsHash[:], cmtypes.NewResults(finalizeBlockResponse.TxResults).Hash()) - - return s, nil -} - -func (e *ABCIExecutionClient) commit(ctx context.Context, state types.State, header *types.SignedHeader, data *types.Data, resp *abci.ResponseFinalizeBlock) ([]byte, uint64, error) { - e.mempool.Lock() - defer e.mempool.Unlock() - - err := e.mempool.FlushAppConn() - if err != nil { - return nil, 0, err - } - - commitResp, err := e.proxyApp.Commit(ctx) - if err != nil { - return nil, 0, err - } - - maxBytes := state.ConsensusParams.Block.MaxBytes - maxGas := state.ConsensusParams.Block.MaxGas - cTxs := fromRollkitTxs(data.Txs) - e.mempoolReaper.UpdateCommitedTxs(cTxs) - err = e.mempool.Update(header.Height(), cTxs, resp.TxResults, mempool.PreCheckMaxBytes(maxBytes), mempool.PostCheckMaxGas(maxGas)) - if err != nil { - return nil, 0, err - } - - return resp.AppHash, uint64(commitResp.RetainHeight), err //nolint:gosec -} - -// Validate validates the state and the block for the executor -func (e *ABCIExecutionClient) Validate(state types.State, header *types.SignedHeader, data *types.Data) error { - if err := header.ValidateBasic(); err != nil { - return err - } - if err := data.ValidateBasic(); err != nil { - return err - } - if err := types.Validate(header, data); err != nil { - return err - } - if header.Version.App != state.Version.Consensus.App || - header.Version.Block != state.Version.Consensus.Block { - return errors.New("block version mismatch") - } - if state.LastBlockHeight <= 0 && header.Height() != state.InitialHeight { - return errors.New("initial block height mismatch") - } - if state.LastBlockHeight > 0 && header.Height() != state.LastBlockHeight+1 { - return errors.New("block height mismatch") - } - if !bytes.Equal(header.AppHash[:], state.AppHash[:]) { - return errors.New("AppHash mismatch") - } - - if !bytes.Equal(header.LastResultsHash[:], state.LastResultsHash[:]) { - return errors.New("LastResultsHash mismatch") - } - - return nil -} - -func (e *ABCIExecutionClient) execute(ctx context.Context, state types.State, header *types.SignedHeader, data *types.Data) (*abci.ResponseFinalizeBlock, error) { - // Only execute if the node hasn't already shut down - select { - case <-ctx.Done(): - return nil, ctx.Err() - default: - } - abciHeader, err := abciconv.ToABCIHeaderPB(&header.Header) - if err != nil { - return nil, err - } - abciHeader.ChainID = e.chainID - abciBlock, err := abciconv.ToABCIBlock(header, data) - if err != nil { - return nil, err - } - - startTime := time.Now().UnixNano() - finalizeBlockResponse, err := e.proxyApp.FinalizeBlock(ctx, &abci.RequestFinalizeBlock{ - Hash: header.Hash(), - NextValidatorsHash: state.Validators.Hash(), - ProposerAddress: abciHeader.ProposerAddress, - Height: abciHeader.Height, - Time: abciHeader.Time, - DecidedLastCommit: abci.CommitInfo{ - Round: 0, - Votes: nil, - }, - Misbehavior: abciBlock.Evidence.Evidence.ToABCI(), - Txs: abciBlock.Txs.ToSliceOfBytes(), - }) - endTime := time.Now().UnixNano() - e.metrics.BlockProcessingTime.Observe(float64(endTime-startTime) / 1000000) - if err != nil { - e.logger.Error("error in proxyAppConn.FinalizeBlock", "err", err) - return nil, err - } - - e.logger.Info( - "finalized block", - "height", abciBlock.Height, - "num_txs_res", len(finalizeBlockResponse.TxResults), - "num_val_updates", len(finalizeBlockResponse.ValidatorUpdates), - "block_app_hash", fmt.Sprintf("%X", finalizeBlockResponse.AppHash), - ) - - // Assert that the application correctly returned tx results for each of the transactions provided in the block - if len(abciBlock.Data.Txs) != len(finalizeBlockResponse.TxResults) { - return nil, fmt.Errorf("expected tx results length to match size of transactions in block. Expected %d, got %d", len(data.Txs), len(finalizeBlockResponse.TxResults)) - } - - e.logger.Info("executed block", "height", abciHeader.Height, "app_hash", fmt.Sprintf("%X", finalizeBlockResponse.AppHash)) - - return finalizeBlockResponse, nil -} - -func (e *ABCIExecutionClient) publishEvents(resp *abci.ResponseFinalizeBlock, header *types.SignedHeader, data *types.Data, state types.State) { - if e.eventBus == nil { - return - } - - abciBlock, err := abciconv.ToABCIBlock(header, data) - if err != nil { - return - } - - if err := e.eventBus.PublishEventNewBlock(cmtypes.EventDataNewBlock{ - Block: abciBlock, - BlockID: cmtypes.BlockID{ - Hash: cmbytes.HexBytes(header.Hash()), - // for now, we don't care about part set headers - }, - ResultFinalizeBlock: *resp, - }); err != nil { - e.logger.Error("failed publishing new block", "err", err) - } - - if err := e.eventBus.PublishEventNewBlockHeader(cmtypes.EventDataNewBlockHeader{ - Header: abciBlock.Header, - }); err != nil { - e.logger.Error("failed publishing new block header", "err", err) - } - - if err := e.eventBus.PublishEventNewBlockEvents(cmtypes.EventDataNewBlockEvents{ - Height: abciBlock.Height, - Events: resp.Events, - NumTxs: int64(len(abciBlock.Txs)), - }); err != nil { - e.logger.Error("failed publishing new block events", "err", err) - } - - if len(abciBlock.Evidence.Evidence) != 0 { - for _, ev := range abciBlock.Evidence.Evidence { - if err := e.eventBus.PublishEventNewEvidence(cmtypes.EventDataNewEvidence{ - Evidence: ev, - Height: int64(header.Header.Height()), //nolint:gosec - }); err != nil { - e.logger.Error("failed publishing new evidence", "err", err) - } - } - } - - for i, tx := range abciBlock.Data.Txs { - err := e.eventBus.PublishEventTx(cmtypes.EventDataTx{ - TxResult: abci.TxResult{ - Height: abciBlock.Height, - Index: uint32(i), //nolint:gosec - Tx: tx, - Result: *(resp.TxResults[i]), - }, - }) - if err != nil { - e.logger.Error("failed publishing event TX", "err", err) - } - } -} - -func toRollkitTxs(txs cmtypes.Txs) types.Txs { - rollkitTxs := make(types.Txs, len(txs)) - for i := range txs { - rollkitTxs[i] = []byte(txs[i]) - } - return rollkitTxs -} - -func fromRollkitTxs(rollkitTxs types.Txs) cmtypes.Txs { - txs := make(cmtypes.Txs, len(rollkitTxs)) - for i := range rollkitTxs { - txs[i] = []byte(rollkitTxs[i]) - } - return txs -} From 4580ae3c6318c45e6353709f3fab41d596435ade Mon Sep 17 00:00:00 2001 From: Jay Jie Date: Thu, 24 Oct 2024 22:30:09 -0700 Subject: [PATCH 7/8] chore: remove engine api client implementation --- state/engine_api_client.go | 256 ------------------------------------- 1 file changed, 256 deletions(-) delete mode 100644 state/engine_api_client.go diff --git a/state/engine_api_client.go b/state/engine_api_client.go deleted file mode 100644 index dc5373236f..0000000000 --- a/state/engine_api_client.go +++ /dev/null @@ -1,256 +0,0 @@ -package state - -import ( - "context" - "errors" - "fmt" - "math/big" - "time" - - execution "github.com/LastL2/go-execution" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/ethclient" - "github.com/ethereum/go-ethereum/rpc" - rollkitTypes "github.com/rollkit/rollkit/types" -) - -/* - *********************************** - * TO-DO move to go-execution-EVM * - *********************************** - */ - -// Define necessary types and constants -type PayloadStatus string - -const ( - PayloadStatusValid PayloadStatus = "VALID" - PayloadStatusInvalid PayloadStatus = "INVALID" - PayloadStatusSyncing PayloadStatus = "SYNCING" -) - -var ( - ErrNilPayloadStatus = errors.New("nil payload status") - ErrInvalidPayloadStatus = errors.New("invalid payload status") -) - -type EngineAPIExecutionClient struct { - ethClient *ethclient.Client - engineClient *rpc.Client - genesisHash common.Hash - feeRecipient common.Address -} - -// NewEngineAPIExecutionClient creates a new instance of EngineAPIExecutionClient. -func NewEngineAPIExecutionClient(ethURL, engineURL string, genesisHash common.Hash, feeRecipient common.Address) (*EngineAPIExecutionClient, error) { - ethClient, err := ethclient.Dial(ethURL) - if err != nil { - return nil, fmt.Errorf("failed to connect to Ethereum client: %w", err) - } - - engineClient, err := rpc.Dial(engineURL) - if err != nil { - return nil, fmt.Errorf("failed to connect to Engine API: %w", err) - } - - return &EngineAPIExecutionClient{ - ethClient: ethClient, - engineClient: engineClient, - genesisHash: genesisHash, - feeRecipient: feeRecipient, - }, nil -} - -var _ execution.Execute = (*EngineAPIExecutionClient)(nil) - -// InitChain initializes the blockchain with genesis information. -func (c *EngineAPIExecutionClient) InitChain( - genesisTime time.Time, - initialHeight uint64, - chainID string, -) (rollkitTypes.Hash, uint64, error) { - ctx := context.Background() - - var forkchoiceResult map[string]interface{} - err := c.engineClient.CallContext(ctx, &forkchoiceResult, "engine_forkchoiceUpdatedV1", - map[string]interface{}{ - "headBlockHash": c.genesisHash, - "safeBlockHash": c.genesisHash, - "finalizedBlockHash": c.genesisHash, - }, - map[string]interface{}{ - "timestamp": genesisTime.Unix(), - "prevRandao": common.Hash{}, // TO-DO - "suggestedFeeRecipient": c.feeRecipient, - }, - ) - if err != nil { - return rollkitTypes.Hash{}, 0, fmt.Errorf("engine_forkchoiceUpdatedV1 failed: %w", err) - } - - payloadID, ok := forkchoiceResult["payloadId"].(string) - if !ok { - return rollkitTypes.Hash{}, 0, ErrNilPayloadStatus - } - - var payload map[string]interface{} - err = c.engineClient.CallContext(ctx, &payload, "engine_getPayloadV1", payloadID) - if err != nil { - return rollkitTypes.Hash{}, 0, fmt.Errorf("engine_getPayloadV1 failed: %w", err) - } - - stateRoot := common.HexToHash(payload["stateRoot"].(string)) - gasLimit := uint64(payload["gasLimit"].(float64)) - - var rollkitStateRoot rollkitTypes.Hash - copy(rollkitStateRoot[:], stateRoot[:]) - - return rollkitStateRoot, gasLimit, nil -} - -// GetTxs retrieves transactions from the transaction pool. -func (c *EngineAPIExecutionClient) GetTxs() ([]rollkitTypes.Tx, error) { - ctx := context.Background() - - var result struct { - Pending map[string]map[string]*types.Transaction `json:"pending"` - Queued map[string]map[string]*types.Transaction `json:"queued"` - } - - err := c.ethClient.Client().CallContext(ctx, &result, "txpool_content") - if err != nil { - return nil, fmt.Errorf("failed to get tx pool content: %w", err) - } - - var txs []rollkitTypes.Tx - - for _, accountTxs := range result.Pending { - for _, tx := range accountTxs { - txBytes, err := tx.MarshalBinary() - if err != nil { - return nil, fmt.Errorf("failed to marshal transaction: %w", err) - } - txs = append(txs, rollkitTypes.Tx(txBytes)) - } - } - - for _, accountTxs := range result.Queued { - for _, tx := range accountTxs { - txBytes, err := tx.MarshalBinary() - if err != nil { - return nil, fmt.Errorf("failed to marshal transaction: %w", err) - } - txs = append(txs, rollkitTypes.Tx(txBytes)) - } - } - - return txs, nil -} - -// ExecuteTxs executes the given transactions and returns the new state root and gas used. -func (c *EngineAPIExecutionClient) ExecuteTxs( - txs []rollkitTypes.Tx, - blockHeight uint64, - timestamp time.Time, - prevStateRoot rollkitTypes.Hash, -) (rollkitTypes.Hash, uint64, error) { - ctx := context.Background() - - ethTxs := make([][]byte, len(txs)) - for i, tx := range txs { - ethTxs[i] = tx - } - - prevRandao := c.derivePrevRandao(blockHeight) - - var forkchoiceResult map[string]interface{} - err := c.engineClient.CallContext(ctx, &forkchoiceResult, "engine_forkchoiceUpdatedV1", - map[string]interface{}{ - "headBlockHash": common.BytesToHash(prevStateRoot[:]), - "safeBlockHash": common.BytesToHash(prevStateRoot[:]), - "finalizedBlockHash": common.BytesToHash(prevStateRoot[:]), - }, - map[string]interface{}{ - "timestamp": timestamp.Unix(), - "prevRandao": prevRandao, - "suggestedFeeRecipient": c.feeRecipient, - }, - ) - if err != nil { - return rollkitTypes.Hash{}, 0, fmt.Errorf("engine_forkchoiceUpdatedV1 failed: %w", err) - } - - payloadID, ok := forkchoiceResult["payloadId"].(string) - if !ok { - return rollkitTypes.Hash{}, 0, ErrNilPayloadStatus - } - - var payload map[string]interface{} - err = c.engineClient.CallContext(ctx, &payload, "engine_getPayloadV1", payloadID) - if err != nil { - return rollkitTypes.Hash{}, 0, fmt.Errorf("engine_getPayloadV1 failed: %w", err) - } - - payload["transactions"] = ethTxs - - var newPayloadResult map[string]interface{} - err = c.engineClient.CallContext(ctx, &newPayloadResult, "engine_newPayloadV1", payload) - if err != nil { - return rollkitTypes.Hash{}, 0, fmt.Errorf("engine_newPayloadV1 failed: %w", err) - } - - status, ok := newPayloadResult["status"].(string) - if !ok || PayloadStatus(status) != PayloadStatusValid { - return rollkitTypes.Hash{}, 0, ErrInvalidPayloadStatus - } - - newStateRoot := common.HexToHash(payload["stateRoot"].(string)) - gasUsed := uint64(payload["gasUsed"].(float64)) - - var rollkitNewStateRoot rollkitTypes.Hash - copy(rollkitNewStateRoot[:], newStateRoot[:]) - - return rollkitNewStateRoot, gasUsed, nil -} - -// SetFinal marks a block at the given height as final. -func (c *EngineAPIExecutionClient) SetFinal(blockHeight uint64) error { - ctx := context.Background() - - block, err := c.ethClient.BlockByNumber(ctx, big.NewInt(int64(blockHeight))) - if err != nil { - return fmt.Errorf("failed to get block at height %d: %w", blockHeight, err) - } - - var result map[string]interface{} - err = c.engineClient.CallContext(ctx, &result, "engine_forkchoiceUpdatedV1", - map[string]interface{}{ - "headBlockHash": block.Hash(), - "safeBlockHash": block.Hash(), - "finalizedBlockHash": block.Hash(), - }, - nil, // No payload attributes for finalization - ) - if err != nil { - return fmt.Errorf("engine_forkchoiceUpdatedV1 failed for finalization: %w", err) - } - - payloadStatus, ok := result["payloadStatus"].(map[string]interface{}) - if !ok { - return ErrNilPayloadStatus - } - - status, ok := payloadStatus["status"].(string) - if !ok || PayloadStatus(status) != PayloadStatusValid { - return ErrInvalidPayloadStatus - } - - return nil -} - -// derivePrevRandao generates a deterministic prevRandao value based on block height. -func (c *EngineAPIExecutionClient) derivePrevRandao(blockHeight uint64) common.Hash { - // TO-DO - return common.BigToHash(big.NewInt(int64(blockHeight))) -} From 40fcc39d20f351c97480192a4f4290ee3a7c1992 Mon Sep 17 00:00:00 2001 From: Jay Jie Date: Thu, 24 Oct 2024 22:30:50 -0700 Subject: [PATCH 8/8] chore: go mod tidy --- go.mod | 20 +--------------- go.sum | 75 ---------------------------------------------------------- 2 files changed, 1 insertion(+), 94 deletions(-) diff --git a/go.mod b/go.mod index fda113534f..5e5597b9e0 100644 --- a/go.mod +++ b/go.mod @@ -41,11 +41,9 @@ require ( require ( github.com/BurntSushi/toml v1.4.0 - github.com/LastL2/go-execution v0.0.0-00010101000000-000000000000 github.com/LastL2/go-execution-abci v0.0.0-00010101000000-000000000000 github.com/btcsuite/btcd/btcec/v2 v2.3.4 github.com/celestiaorg/go-header v0.6.2 - github.com/ethereum/go-ethereum v1.14.11 github.com/ipfs/go-ds-badger4 v0.1.5 github.com/mitchellh/mapstructure v1.5.0 github.com/rollkit/go-sequencing v0.2.1-0.20241010053131-3134457dc4e5 @@ -53,11 +51,10 @@ require ( require ( github.com/DataDog/zstd v1.4.5 // indirect + github.com/LastL2/go-execution v0.0.0-00010101000000-000000000000 // indirect github.com/Microsoft/go-winio v0.6.2 // indirect - github.com/StackExchange/wmi v1.2.1 // indirect github.com/benbjohnson/clock v1.3.5 // indirect github.com/beorn7/perks v1.0.1 // indirect - github.com/bits-and-blooms/bitset v1.13.0 // indirect github.com/btcsuite/btcd/chaincfg/chainhash v1.0.2 // indirect github.com/celestiaorg/go-libp2p-messenger v0.2.0 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect @@ -68,24 +65,17 @@ require ( github.com/cockroachdb/redact v1.1.5 // indirect github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect github.com/cometbft/cometbft-db v0.14.1 // indirect - github.com/consensys/bavard v0.1.13 // indirect - github.com/consensys/gnark-crypto v0.12.1 // indirect github.com/containerd/cgroups v1.1.0 // indirect github.com/coreos/go-systemd/v22 v22.5.0 // indirect github.com/cpuguy83/go-md2man/v2 v2.0.4 // indirect - github.com/crate-crypto/go-ipa v0.0.0-20240223125850-b1e8a79f509c // indirect - github.com/crate-crypto/go-kzg-4844 v1.0.0 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/davidlazar/go-crypto v0.0.0-20200604182044-b73af7476f6c // indirect - github.com/deckarep/golang-set/v2 v2.6.0 // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect github.com/dgraph-io/badger/v4 v4.2.1-0.20231013074411-fb1b00959581 // indirect github.com/dgraph-io/ristretto v0.1.1 // indirect github.com/docker/go-units v0.5.0 // indirect github.com/dustin/go-humanize v1.0.1 // indirect github.com/elastic/gosigar v0.14.3 // indirect - github.com/ethereum/c-kzg-4844 v1.0.0 // indirect - github.com/ethereum/go-verkle v0.1.1-0.20240829091221-dffa7562dbe9 // indirect github.com/filecoin-project/go-jsonrpc v0.6.0 // indirect github.com/flynn/noise v1.1.0 // indirect github.com/francoispqt/gojay v1.2.13 // indirect @@ -95,7 +85,6 @@ require ( github.com/go-logfmt/logfmt v0.6.0 // indirect github.com/go-logr/logr v1.4.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect - github.com/go-ole/go-ole v1.3.0 // indirect github.com/go-task/slim-sprig/v3 v3.0.0 // indirect github.com/godbus/dbus/v5 v5.1.0 // indirect github.com/golang/glog v1.2.2 // indirect @@ -115,7 +104,6 @@ require ( github.com/hashicorp/golang-lru v1.0.2 // indirect github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect github.com/hashicorp/hcl v1.0.0 // indirect - github.com/holiman/uint256 v1.3.1 // indirect github.com/huin/goupnp v1.3.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/ipfs/boxo v0.22.0 // indirect @@ -153,7 +141,6 @@ require ( github.com/mikioh/tcpopt v0.0.0-20190314235656-172688c1accc // indirect github.com/minio/highwayhash v1.0.3 // indirect github.com/minio/sha256-simd v1.0.1 // indirect - github.com/mmcloughlin/addchain v0.4.0 // indirect github.com/mr-tron/base58 v1.2.0 // indirect github.com/multiformats/go-base32 v0.1.0 // indirect github.com/multiformats/go-base36 v0.2.0 // indirect @@ -203,7 +190,6 @@ require ( github.com/sagikazarmark/locafero v0.4.0 // indirect github.com/sagikazarmark/slog-shim v0.1.0 // indirect github.com/sasha-s/go-deadlock v0.3.5 // indirect - github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible // indirect github.com/sourcegraph/conc v0.3.0 // indirect github.com/spaolacci/murmur3 v1.1.0 // indirect github.com/spf13/afero v1.11.0 // indirect @@ -211,10 +197,7 @@ require ( github.com/spf13/pflag v1.0.5 // indirect github.com/stretchr/objx v0.5.2 // indirect github.com/subosito/gotenv v1.6.0 // indirect - github.com/supranational/blst v0.3.13 // indirect github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 // indirect - github.com/tklauser/go-sysconf v0.3.12 // indirect - github.com/tklauser/numcpus v0.6.1 // indirect github.com/whyrusleeping/go-keyspace v0.0.0-20160322163242-5b898ac5add1 // indirect github.com/wlynxg/anet v0.0.4 // indirect go.etcd.io/bbolt v1.4.0-alpha.0.0.20240404170359-43604f3112c5 // indirect @@ -239,5 +222,4 @@ require ( gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect lukechampine.com/blake3 v1.3.0 // indirect - rsc.io/tmplfunc v0.0.3 // indirect ) diff --git a/go.sum b/go.sum index 5d22e0321e..f8ae669e7f 100644 --- a/go.sum +++ b/go.sum @@ -112,10 +112,6 @@ github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAE github.com/OpenPeeDeeP/depguard v1.1.0/go.mod h1:JtAMzWkmFEzDPyAd+W0NHl1lvpQKTvT9jnRVsohBKpc= github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= -github.com/StackExchange/wmi v1.2.1 h1:VIkavFPXSjcnS+O8yTq7NI32k0R5Aj+v39y29VYDOSA= -github.com/StackExchange/wmi v1.2.1/go.mod h1:rcmrprowKIVzvc+NUiLncP2uuArMWLCbu9SBzvHz7e8= -github.com/VictoriaMetrics/fastcache v1.12.2 h1:N0y9ASrJ0F6h0QaC3o6uJb3NIZ9VKLjCM7NQbSmF7WI= -github.com/VictoriaMetrics/fastcache v1.12.2/go.mod h1:AmC+Nzz1+3G2eCPapF6UcsnkThDcMsQicp4xDukwJYI= github.com/VividCortex/gohistogram v1.0.0 h1:6+hBz+qvs0JOrrNhhmR7lFxo5sINxBCGXrdtl/UvroE= github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g= github.com/Workiva/go-datastructures v1.0.53/go.mod h1:1yZL+zfsztete+ePzZz/Zb1/t5BnDuE2Ya2MMGhzP6A= @@ -169,8 +165,6 @@ github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+Ce 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/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= -github.com/bits-and-blooms/bitset v1.13.0 h1:bAQ9OPNFYbGHV6Nez0tmNI0RiEu7/hxlYJRUA0wFAVE= -github.com/bits-and-blooms/bitset v1.13.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8= github.com/bkielbasa/cyclop v1.2.0/go.mod h1:qOI0yy6A7dYC4Zgsa72Ppm9kONl0RoIlPbzot9mhmeI= github.com/blizzy78/varnamelen v0.8.0/go.mod h1:V9TzQZ4fLJ1DSrjVDfl89H7aMnTvKkApdHeyESmyR7k= github.com/bombsimon/wsl/v3 v3.3.0/go.mod h1:st10JtZYLE4D5sC7b8xV4zTKZwAQjCH/Hy2Pm1FNZIc= @@ -268,10 +262,6 @@ github.com/cometbft/cometbft v0.38.13 h1:k0ssyC8W0FfFvGpSHpojZ4JrXAANlJEIM41hjRq github.com/cometbft/cometbft v0.38.13/go.mod h1:NMmNysQM+T5uxTXVLMgzcvq35OVOyC7GK2/bnHqldjE= github.com/cometbft/cometbft-db v0.14.1 h1:SxoamPghqICBAIcGpleHbmoPqy+crij/++eZz3DlerQ= github.com/cometbft/cometbft-db v0.14.1/go.mod h1:KHP1YghilyGV/xjD5DP3+2hyigWx0WTp9X+0Gnx0RxQ= -github.com/consensys/bavard v0.1.13 h1:oLhMLOFGTLdlda/kma4VOJazblc7IM5y5QPd2A/YjhQ= -github.com/consensys/bavard v0.1.13/go.mod h1:9ItSMtA/dXMAiL7BG6bqW2m3NdSEObYWoH223nGHukI= -github.com/consensys/gnark-crypto v0.12.1 h1:lHH39WuuFgVHONRl3J0LRBtuYdQTumFSDtJF7HpyG8M= -github.com/consensys/gnark-crypto v0.12.1/go.mod h1:v2Gy7L/4ZRosZ7Ivs+9SfUDr0f5UlG+EM5t7MPHiLuY= github.com/containerd/cgroups v0.0.0-20201119153540-4cbc285b3327/go.mod h1:ZJeTFisyysqgcCdecO57Dj79RfL0LNeGiFUqLYQRYLE= github.com/containerd/cgroups v1.0.3/go.mod h1:/ofk34relqNjSGyqPrmEULrO4Sc8LJhvJmWbUCUKqj8= github.com/containerd/cgroups v1.1.0 h1:v8rEWFl6EoqHB+swVNjVoCJE8o3jX7e8nqBGPLaDFBM= @@ -302,10 +292,6 @@ github.com/cpuguy83/go-md2man/v2 v2.0.1/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46t github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/cpuguy83/go-md2man/v2 v2.0.4 h1:wfIWP927BUkWJb2NmU/kNDYIBTh/ziUX91+lVfRxZq4= github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= -github.com/crate-crypto/go-ipa v0.0.0-20240223125850-b1e8a79f509c h1:uQYC5Z1mdLRPrZhHjHxufI8+2UG/i25QG92j0Er9p6I= -github.com/crate-crypto/go-ipa v0.0.0-20240223125850-b1e8a79f509c/go.mod h1:geZJZH3SzKCqnz5VT0q/DyIG/tvu/dZk+VIfXicupJs= -github.com/crate-crypto/go-kzg-4844 v1.0.0 h1:TsSgHwrkTKecKJ4kadtHi4b3xHW5dCFUDFnUp1TsawI= -github.com/crate-crypto/go-kzg-4844 v1.0.0/go.mod h1:1kMhvPgI0Ky3yIa+9lFySEBUBXkYxeOi8ZF1sYioxhc= github.com/creachadair/atomicfile v0.2.6/go.mod h1:BRq8Une6ckFneYXZQ+kO7p1ZZP3I2fzVzf28JxrIkBc= github.com/creachadair/command v0.0.0-20220426235536-a748effdf6a1/go.mod h1:bAM+qFQb/KwWyCc9MLC4U1jvn3XyakqP5QRkds5T6cY= github.com/creachadair/taskgroup v0.3.2/go.mod h1:wieWwecHVzsidg2CsUnFinW1faVN4+kq+TDlRJQ0Wbk= @@ -324,8 +310,6 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8Yc github.com/davidlazar/go-crypto v0.0.0-20170701192655-dcfb0a7ac018/go.mod h1:rQYf4tfk5sSwFsnDg3qYaBxSjsD9S8+59vW0dKUgme4= github.com/davidlazar/go-crypto v0.0.0-20200604182044-b73af7476f6c h1:pFUpOrbxDR6AkioZ1ySsx5yxlDQZ8stG2b88gTPxgJU= github.com/davidlazar/go-crypto v0.0.0-20200604182044-b73af7476f6c/go.mod h1:6UhI8N9EjYm1c2odKpFpAYeR8dsBeM7PtzQhRgxRr9U= -github.com/deckarep/golang-set/v2 v2.6.0 h1:XfcQbWM1LlMB8BsJ8N9vW5ehnnPVIw0je80NsVHagjM= -github.com/deckarep/golang-set/v2 v2.6.0/go.mod h1:VAky9rY/yGXJOLEDv3OMci+7wtDpOF4IN+y82NBOac4= github.com/decred/dcrd/crypto/blake256 v1.0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5ilcvdfma9wOH6Y= github.com/decred/dcrd/crypto/blake256 v1.0.1/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 h1:rpfIENRNNilwHwZeG5+P150SMrnNEcHYvcCuK6dPZSg= @@ -382,12 +366,6 @@ github.com/envoyproxy/protoc-gen-validate v0.0.14/go.mod h1:iSmxcyjqTsJpI2R4NaDN github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/envoyproxy/protoc-gen-validate v0.6.2/go.mod h1:2t7qjJNvHPx8IjnBOzl9E9/baC+qXE/TeeyBRzgJDws= github.com/esimonov/ifshort v1.0.4/go.mod h1:Pe8zjlRrJ80+q2CxHLfEOfTwxCZ4O+MuhcHcfgNWTk0= -github.com/ethereum/c-kzg-4844 v1.0.0 h1:0X1LBXxaEtYD9xsyj9B9ctQEZIpnvVDeoBx8aHEwTNA= -github.com/ethereum/c-kzg-4844 v1.0.0/go.mod h1:VewdlzQmpT5QSrVhbBuGoCdFJkpaJlO1aQputP83wc0= -github.com/ethereum/go-ethereum v1.14.11 h1:8nFDCUUE67rPc6AKxFj7JKaOa2W/W1Rse3oS6LvvxEY= -github.com/ethereum/go-ethereum v1.14.11/go.mod h1:+l/fr42Mma+xBnhefL/+z11/hcmJ2egl+ScIVPjhc7E= -github.com/ethereum/go-verkle v0.1.1-0.20240829091221-dffa7562dbe9 h1:8NfxH2iXvJ60YRB8ChToFTUzl8awsc3cJ8CbLjGIl/A= -github.com/ethereum/go-verkle v0.1.1-0.20240829091221-dffa7562dbe9/go.mod h1:M3b90YRnzqKyyzBEWJGqj8Qff4IDeXnzFw0P9bFw3uk= github.com/ettle/strcase v0.1.1/go.mod h1:hzDLsPC7/lwKyBOywSHEP89nt2pDgdy+No1NBA9o9VY= github.com/facebookgo/ensure v0.0.0-20160127193407-b4ab57deab51/go.mod h1:Yg+htXGokKKdzcwhuNDwVvN+uBxDGXJ7G/VN1d8fa64= github.com/facebookgo/stack v0.0.0-20160209184415-751773369052/go.mod h1:UbMTZqLaRiH3MsBH8va0n7s1pQYcu3uTb8G4tygF4Zg= @@ -426,8 +404,6 @@ github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nos github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= github.com/fullstorydev/grpcurl v1.6.0/go.mod h1:ZQ+ayqbKMJNhzLmbpCiurTVlaK2M/3nqZCxaQ2Ze/sM= github.com/fzipp/gocyclo v0.6.0/go.mod h1:rXPyn8fnlpa0R2csP/31uerbiVBugk5whMdlyaLkLoA= -github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff h1:tY80oXqGNY4FhTFhk+o9oFHGINQ/+vhlm8HFzi6znCI= -github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= github.com/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps= github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= @@ -460,10 +436,7 @@ github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= -github.com/go-ole/go-ole v1.2.5/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= -github.com/go-ole/go-ole v1.3.0 h1:Dt6ye7+vXGIKZ7Xtk4s6/xVdGDQynvom7xCFEdWr6uE= -github.com/go-ole/go-ole v1.3.0/go.mod h1:5LS6F96DhAwUc7C+1HLexzMXY1xGRSryjyPPKW6zv78= github.com/go-redis/redis v6.15.8+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA= github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= @@ -490,7 +463,6 @@ github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5x github.com/godbus/dbus/v5 v5.0.6/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/godbus/dbus/v5 v5.1.0 h1:4KLkAxT3aOY8Li4FRJe/KvhoNFFxo0m6fNuFUO8QJUk= github.com/godbus/dbus/v5 v5.1.0/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/gofrs/flock v0.8.1 h1:+gYjHKf32LDeiEEFhQaotPbLuUXjY5ZqxKgXy7n59aw= github.com/gofrs/flock v0.8.1/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU= github.com/gofrs/uuid v4.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= @@ -502,8 +474,6 @@ github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXP github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang-jwt/jwt/v4 v4.0.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= -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-sql/civil v0.0.0-20190719163853-cb61b32ac6fe/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0= github.com/golang-sql/sqlexp v0.0.0-20170517235910-f1bb20e5a188/go.mod h1:vXjM/+wXQnTPR4KqTKDgJukSZ6amVRtWMPEjE6sQoK8= github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= @@ -619,7 +589,6 @@ github.com/google/pprof v0.0.0-20240727154555-813a5fbdbec8 h1:FKHo8hFI3A+7w0aUQu github.com/google/pprof v0.0.0-20240727154555-813a5fbdbec8/go.mod h1:K1liHPHnj73Fdn/EKuT8nrFqBihUSKXoLYU0BuatOYo= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ= -github.com/google/subcommands v1.2.0/go.mod h1:ZjhPrFU+Olkh9WazFPsl27BQ4UPiG37m3yTrtFlrHVk= github.com/google/trillian v1.3.11/go.mod h1:0tPraVHrSDkA3BO6vKX67zgLXs6SsOAbHEivX+9mPgw= github.com/google/uuid v0.0.0-20161128191214-064e2069ce9c/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -692,8 +661,6 @@ github.com/hashicorp/consul/sdk v0.8.0/go.mod h1:GBvyrGALthsZObzUGsfgHZQDXjg4lOj github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= -github.com/hashicorp/go-bexpr v0.1.10 h1:9kuI5PFotCboP3dkDYFr/wi0gg0QVbSNz5oFRpxn4uE= -github.com/hashicorp/go-bexpr v0.1.10/go.mod h1:oxlubA2vC/gFVfX1A6JGp7ls7uCDlfJn732ehYYg+g0= github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= @@ -740,12 +707,6 @@ github.com/hashicorp/serf v0.9.5/go.mod h1:UWDWwZeL5cuWDJdl0C6wrvrUwEqtQ4ZKBKKEN github.com/hashicorp/serf v0.9.6/go.mod h1:TXZNMjZQijwlDvp+r0b63xZ45H7JmCmgg4gpTwn9UV4= github.com/hashicorp/serf v0.9.7/go.mod h1:TXZNMjZQijwlDvp+r0b63xZ45H7JmCmgg4gpTwn9UV4= github.com/hexops/gotextdiff v1.0.3/go.mod h1:pSWU5MAI3yDq+fZBTazCSJysOMbxWL1BSow5/V2vxeg= -github.com/holiman/billy v0.0.0-20240216141850-2abb0c79d3c4 h1:X4egAf/gcS1zATw6wn4Ej8vjuVGxeHdan+bRb2ebyv4= -github.com/holiman/billy v0.0.0-20240216141850-2abb0c79d3c4/go.mod h1:5GuXa7vkL8u9FkFuWdVvfR5ix8hRB7DbOAaYULamFpc= -github.com/holiman/bloomfilter/v2 v2.0.3 h1:73e0e/V0tCydx14a0SCYS/EWCxgwLZ18CZcZKVu0fao= -github.com/holiman/bloomfilter/v2 v2.0.3/go.mod h1:zpoh+gs7qcpqrHr3dB55AMiJwo0iURXE7ZOP9L9hSkA= -github.com/holiman/uint256 v1.3.1 h1:JfTzmih28bittyHM8z360dCjIA9dbPIBlcTI6lmctQs= -github.com/holiman/uint256 v1.3.1/go.mod h1:EOMSn4q6Nyt9P6efbI3bueV4e1b3dGlUCXeiRV4ng7E= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/huandu/xstrings v1.0.0/go.mod h1:4qWG/gcEcfX4z/mBDHJ++3ReCw9ibxbsNJbcucJdbSo= github.com/huandu/xstrings v1.2.0/go.mod h1:DvyZB1rfVYsBIigL8HwpZgxHwXozlTgGqn63UyNX5k4= @@ -902,8 +863,6 @@ github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+ github.com/kyoh86/exportloopref v0.1.8/go.mod h1:1tUcJeiioIs7VWe5gcOObrux3lb66+sBqGZrRkMwPgg= github.com/ldez/gomoddirectives v0.2.3/go.mod h1:cpgBogWITnCfRq2qGoDkKMEVSaarhdBr6g8G04uz6d0= github.com/ldez/tagliatelle v0.3.1/go.mod h1:8s6WJQwEYHbKZDsp/LjArytKOG8qaMrKQQ3mFukHs88= -github.com/leanovate/gopter v0.2.9 h1:fQjYxZaynp97ozCzfOyOuAGOU4aU/z37zf/tOujFk7c= -github.com/leanovate/gopter v0.2.9/go.mod h1:U2L/78B+KVFIx2VmW6onHJQzXtFb+p5y3y2Sh+Jxxv8= github.com/leonklingele/grouper v1.1.0/go.mod h1:uk3I3uDfi9B6PeUjsCKi6ndcf63Uy7snXgR4yDYQVDY= github.com/letsencrypt/pkcs11key/v4 v4.0.0/go.mod h1:EFUvBDay26dErnNb70Nd0/VW3tJiIbETBPTl9ATXQag= github.com/lib/pq v0.0.0-20180327071824-d34b9ff171c2/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= @@ -1069,8 +1028,6 @@ github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope 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.12/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.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= @@ -1086,8 +1043,6 @@ github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzp github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-runewidth v0.0.6/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= 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/go-sqlite3 v1.9.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= github.com/mattn/go-sqlite3 v1.14.9/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= @@ -1141,13 +1096,8 @@ github.com/mitchellh/mapstructure v1.4.2/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RR github.com/mitchellh/mapstructure v1.4.3/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/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/mitchellh/reflectwalk v1.0.1/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= -github.com/mmcloughlin/addchain v0.4.0 h1:SobOdjm2xLj1KkXN5/n0xTIWyZA2+s99UCY1iPfkHRY= -github.com/mmcloughlin/addchain v0.4.0/go.mod h1:A86O+tHqZLMNO4w6ZZ4FlVQEadcoqkyU72HC5wJ4RlU= -github.com/mmcloughlin/profile v0.1.1/go.mod h1:IhHD7q1ooxgwTgjxQYkACGA77oFTDdFVejUS1/tS/qU= github.com/moby/sys/mountinfo v0.5.0/go.mod h1:3bMD3Rg+zkqx8MRYPi7Pyb0Ie97QEBmdxbhnCLlSvSU= github.com/moby/term v0.0.0-20201216013528-df9cb8a40635/go.mod h1:FBS0z0QWA44HXygs7VXDUOGoN/1TV3RuWkLO04am3wc= github.com/moby/term v0.0.0-20210619224110-3f7ff695adc6/go.mod h1:E2VnQOmVuvZB6UYnnDB0qG5Nq/1tD9acaOpo6xmt0Kw= @@ -1262,7 +1212,6 @@ github.com/oklog/ulid/v2 v2.0.2/go.mod h1:mtBL0Qe/0HAx6/a4Z30qxVIAL1eQDweXq5lxOE github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= github.com/olekukonko/tablewriter v0.0.1/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= github.com/olekukonko/tablewriter v0.0.2/go.mod h1:rSAaSIOAGT9odnlyGlUfAJaoc5w2fSBUmeGDbRWPxyQ= -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.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= @@ -1489,8 +1438,6 @@ github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqn github.com/remyoudompheng/go-dbus v0.0.0-20121104212943-b7232d34b1d5/go.mod h1:+u151txRmLpwxBmpYn9z3d1sdJdjRPQpsXuYeY9jNls= github.com/remyoudompheng/go-liblzma v0.0.0-20190506200333-81bf2d431b96/go.mod h1:90HvCY7+oHHUKkbeMCiHt1WuFR2/hPJ9QrljDG+v6ls= github.com/remyoudompheng/go-misc v0.0.0-20190427085024-2d6ac652a50e/go.mod h1:80FQABjoFzZ2M5uEa6FUaJYEmqU2UOKojlFVak1UAwI= -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/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= @@ -1534,8 +1481,6 @@ github.com/securego/gosec/v2 v2.12.0/go.mod h1:iTpT+eKTw59bSgklBHlSnH5O2tNygHMDx github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= github.com/shazow/go-diff v0.0.0-20160112020656-b6b7b6733b8c/go.mod h1:/PevMnwAxekIXwN8qQyfc5gl2NlkB3CQlkizAbOkeBs= -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/shirou/gopsutil/v3 v3.22.6/go.mod h1:EdIubSnZhbAvBS1yJ7Xi+AShB/hxwLHOMz4MCYz7yMs= github.com/shurcooL/component v0.0.0-20170202220835-f88ec8f54cc4/go.mod h1:XhFIlyj5a1fBNx5aJTbKoIq0mNaPvOagO+HjB3EtxrY= github.com/shurcooL/events v0.0.0-20181021180414-410e4ca65f48/go.mod h1:5u70Mqkb5O5cxEA8nxTsgrgLehJeAw6Oc4Ab1c/P1HM= @@ -1622,8 +1567,6 @@ github.com/spf13/viper v1.19.0 h1:RWq5SEjt8o25SROyN3z2OrDB9l7RPd3lwTWU8EcEdcI= github.com/spf13/viper v1.19.0/go.mod h1:GQUN9bilAbhU/jgc1bKs99f/suXKeUMct8Adx5+Ntkg= github.com/src-d/envconfig v1.0.0/go.mod h1:Q9YQZ7BKITldTBnoxsE5gOeB5y66RyPXeue/R4aaNBc= github.com/ssgreg/nlreturn/v2 v2.2.1/go.mod h1:E/iiPB78hV7Szg2YfRgyIrk1AD6JVMTRkkxBiELzh2I= -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/stbenjam/no-sprintf-host-port v0.1.1/go.mod h1:TLhvtIvONRzdmkFiio4O8LHsN9N74I+PhRquPsxpL0I= github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= @@ -1658,8 +1601,6 @@ github.com/subosito/gotenv v1.3.0/go.mod h1:YzJjq/33h7nrwdY+iHMhEOEEbW0ovIz0tB6t github.com/subosito/gotenv v1.4.0/go.mod h1:mZd6rFysKEcUhUHXJk0C/08wAgyDBFuwEYL7vWWGaGo= github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8= github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= -github.com/supranational/blst v0.3.13 h1:AYeSxdOMacwu7FBmpfloBz5pbFXDmJL33RuwnKtmTjk= -github.com/supranational/blst v0.3.13/go.mod h1:jZJtfjgudtNl4en1tzwPIV3KjUnQUvG3/j+w+fVonLw= github.com/sylvia7788/contextcheck v1.0.4/go.mod h1:vuPKJMQ7MQ91ZTqfdyreNKwZjyUg6KO+IebVyQDedZQ= github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= github.com/syndtr/goleveldb v1.0.0/go.mod h1:ZVVdQEZoIme9iO1Ch2Jdy24qqXrMMOU6lpPAyBWyWuQ= @@ -1679,11 +1620,7 @@ github.com/timakin/bodyclose v0.0.0-20210704033933-f49887972144/go.mod h1:Qimiff github.com/tinylib/msgp v1.1.5/go.mod h1:eQsjooMTnV42mHu917E26IogZ2930nFyBQdofk10Udg= github.com/tj/assert v0.0.3/go.mod h1:Ne6X72Q+TB1AteidzQncjw9PabbMp4PBMZ1k+vd1Pvk= github.com/tklauser/go-sysconf v0.3.10/go.mod h1:C8XykCvCb+Gn0oNCWPIlcb0RuglQTYaQ2hGm7jmxEFk= -github.com/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFAEVmqU= -github.com/tklauser/go-sysconf v0.3.12/go.mod h1:Ho14jnntGE1fpdOqQEEaiKRpvIavV0hSfmBq8nJbHYI= github.com/tklauser/numcpus v0.4.0/go.mod h1:1+UI3pD8NW14VMwdgJNJ1ESk2UnwhAnz5hMwiKKqXCQ= -github.com/tklauser/numcpus v0.6.1 h1:ng9scYS7az0Bk4OZLvrNXNSAO2Pxr1XXRAPyjhIx+Fk= -github.com/tklauser/numcpus v0.6.1/go.mod h1:1XfjsgE2zo8GVw7POkMbHENHzVg3GzmoZ9fESEdAacY= github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tmc/grpc-websocket-proxy v0.0.0-20200427203606-3cfed13b9966/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= @@ -1692,18 +1629,13 @@ github.com/tomasen/realip v0.0.0-20180522021738-f0c99a92ddce/go.mod h1:o8v6yHRoi github.com/tommy-muehle/go-mnd/v2 v2.5.0/go.mod h1:WsUAkMJMYww6l/ufffCD3m+P7LEvr8TnZn9lwVDlgzw= github.com/ttacon/chalk v0.0.0-20160626202418-22c06c80ed31/go.mod h1:onvgF043R+lC5RZ8IT9rBXDaEDnpnw/Cl+HFiw+v/7Q= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= -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/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= github.com/ultraware/funlen v0.0.3/go.mod h1:Dp4UiAus7Wdb9KUZsYWZEWiRzGuM2kXM1lPbfaF6xhA= github.com/ultraware/whitespace v0.0.5/go.mod h1:aVMh/gQve5Maj9hQ/hg+F75lr/X5A89uZnzAmWSineA= github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/urfave/cli v1.22.2/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= -github.com/urfave/cli v1.22.10 h1:p8Fspmz3iTctJstry1PYS3HVdllxnEzTEsgIgtxTrCk= github.com/urfave/cli v1.22.10/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= -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/uudashr/gocognit v1.0.6/go.mod h1:nAIUuVBnYU7pcninia3BHOvQkpQCeO76Uscky5BOwcY= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= github.com/valyala/fasthttp v1.30.0/go.mod h1:2rsYD01CKFrjjsvFxx75KlEUNpWNBY9JWD3K/7o2Cus= @@ -1733,8 +1665,6 @@ github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQ github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778/go.mod h1:2MuV+tbUrU1zIOPMxZ5EncGwgmMJsa+9ucAQZXxsObs= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= -github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU= -github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8= github.com/yagipy/maintidx v1.0.0/go.mod h1:0qNf/I/CCZXSMhsRsrEPDZ+DkekpKLXAJfsTACwgXLk= github.com/yeya24/promlinter v0.2.0/go.mod h1:u54lkmBOZrpEbQQ6gox2zWKKLKu2SGe+2KOiextY+IA= github.com/yudai/gojsondiff v1.0.0/go.mod h1:AY32+k2cwILAkW1fbgxQ5mUmMiZFgLIV+FBNExI05xg= @@ -2183,7 +2113,6 @@ golang.org/x/sys v0.0.0-20220624220833-87e55d714810/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220702020025-31831981b65f/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-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.1.0/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.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -2584,8 +2513,6 @@ gopkg.in/ini.v1 v1.66.4/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.66.6/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/natefinch/lumberjack.v2 v2.2.1 h1:bBRl1b0OH9s/DuPhuXpNl+VtCaJXFZ5/uEFST95x9zc= -gopkg.in/natefinch/lumberjack.v2 v2.2.1/go.mod h1:YD8tP3GAjkrDg1eZH7EGmyESg/lsYskCTPBJVb9jqSc= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/src-d/go-cli.v0 v0.0.0-20181105080154-d492247bbc0d/go.mod h1:z+K8VcOYVYcSwSjGebuDL6176A1XskgbtNl64NSg+n8= gopkg.in/src-d/go-log.v1 v1.0.1/go.mod h1:GN34hKP0g305ysm2/hctJ0Y8nWP3zxXXJ8GFabTyABE= @@ -2635,8 +2562,6 @@ rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8 rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= 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= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0/go.mod h1:hI742Nqp5OhwiqlzhgfbWU4mW4yO10fP+LoT9WOswdU=