diff --git a/cmd/state/commands/opcode_tracer.go b/cmd/state/commands/opcode_tracer.go index 0a7237cca63..40c96bd768d 100644 --- a/cmd/state/commands/opcode_tracer.go +++ b/cmd/state/commands/opcode_tracer.go @@ -185,8 +185,6 @@ func (ot *opcodeTracer) CaptureTxStart(gasLimit uint64) {} func (ot *opcodeTracer) CaptureTxEnd(restGas uint64) {} -func (ot *opcodeTracer) CaptureSystemTxEnd(restGas uint64) {} - func (ot *opcodeTracer) captureStartOrEnter(from, to libcommon.Address, create bool, input []byte) { //fmt.Fprint(ot.summary, ot.lastLine) diff --git a/cmd/state/exec3/calltracer_v3.go b/cmd/state/exec3/calltracer_v3.go index b005cdaf018..8f50a1582ea 100644 --- a/cmd/state/exec3/calltracer_v3.go +++ b/cmd/state/exec3/calltracer_v3.go @@ -37,9 +37,8 @@ func (ct *CallTracer) Reset() { func (ct *CallTracer) Froms() map[libcommon.Address]struct{} { return ct.froms } func (ct *CallTracer) Tos() map[libcommon.Address]struct{} { return ct.tos } -func (ct *CallTracer) CaptureTxStart(gasLimit uint64) {} -func (ct *CallTracer) CaptureTxEnd(restGas uint64) {} -func (ct *CallTracer) CaptureSystemTxEnd(intrinsicGas uint64) {} +func (ct *CallTracer) CaptureTxStart(gasLimit uint64) {} +func (ct *CallTracer) CaptureTxEnd(restGas uint64) {} func (ct *CallTracer) CaptureStart(env *vm.EVM, from libcommon.Address, to libcommon.Address, precompile bool, create bool, input []byte, gas uint64, value *uint256.Int, code []byte) { if ct.froms == nil { ct.froms = map[libcommon.Address]struct{}{} diff --git a/cmd/state/exec3/historical_trace_worker.go b/cmd/state/exec3/historical_trace_worker.go index 0fd956b2731..ac1e4949630 100644 --- a/cmd/state/exec3/historical_trace_worker.go +++ b/cmd/state/exec3/historical_trace_worker.go @@ -138,9 +138,11 @@ func (rw *HistoricalTraceWorker) RunTxTask(txTask *state.TxTask) { rw.stateReader.SetTxNum(txTask.TxNum) rw.stateReader.ResetReadSet() rw.stateWriter = state.NewNoopWriter() + //rw.stateReader.SetTrace(true) rw.ibs.Reset() ibs := rw.ibs + //ibs.SetTrace(true) rules := txTask.Rules var err error @@ -193,7 +195,7 @@ func (rw *HistoricalTraceWorker) RunTxTask(txTask *state.TxTask) { return core.SysCallContract(contract, data, rw.execArgs.ChainConfig, ibs, header, rw.execArgs.Engine, false /* constCall */) } - _, _, _, err := rw.execArgs.Engine.Finalize(rw.execArgs.ChainConfig, types.CopyHeader(header), ibs, txTask.Txs, txTask.Uncles, txTask.BlockReceipts, txTask.Withdrawals, txTask.Requests, rw.chain, syscall, nil, 0, nil, rw.logger) + _, _, _, err := rw.execArgs.Engine.Finalize(rw.execArgs.ChainConfig, types.CopyHeader(header), ibs, txTask.Txs, txTask.Uncles, txTask.BlockReceipts, txTask.Withdrawals, txTask.Requests, rw.chain, syscall, nil, txTask.TxIndex, rw.chainTx, rw.logger) if err != nil { txTask.Error = err } @@ -202,9 +204,9 @@ func (rw *HistoricalTraceWorker) RunTxTask(txTask *state.TxTask) { return core.SysCallContract(contract, data, rw.execArgs.ChainConfig, ibs, header, rw.execArgs.Engine, false /* constCall */) } - systemCall := func(ibs *state.IntraBlockState, index int) ([]byte, bool, error) { + systemCall := func(ibs *state.IntraBlockState) ([]byte, bool, error) { - rw.taskGasPool.Reset(txTask.Tx.GetGas(), rw.execArgs.ChainConfig.GetMaxBlobGasPerBlock()) + rw.taskGasPool.Reset(txTask.Tx.GetGas(), txTask.Tx.GetBlobGas()) if tracer := rw.consumer.NewTracer(); tracer != nil { rw.vmConfig.Debug = true rw.vmConfig.Tracer = tracer @@ -212,11 +214,17 @@ func (rw *HistoricalTraceWorker) RunTxTask(txTask *state.TxTask) { rw.vmConfig.SkipAnalysis = txTask.SkipAnalysis msg := txTask.TxAsMessage ibs.SetTxContext(txTask.TxIndex, txTask.BlockNum) + msg.SetCheckNonce(!rw.vmConfig.StatelessExec) if rw.execArgs.ChainConfig.IsCancun(header.Number.Uint64(), header.Time) { rules := rw.execArgs.ChainConfig.Rules(header.Number.Uint64(), header.Time) ibs.Prepare(rules, msg.From(), txTask.EvmBlockContext.Coinbase, msg.To(), vm.ActivePrecompiles(rules), msg.AccessList(), nil) } - rw.evm.ResetBetweenBlocks(txTask.EvmBlockContext, core.NewEVMTxContext(msg), ibs, *rw.vmConfig, rules) + + txContext := core.NewEVMTxContext(msg) + if rw.vmConfig.TraceJumpDest { + txContext.TxHash = txTask.Tx.Hash() + } + rw.evm.ResetBetweenBlocks(txTask.EvmBlockContext, txContext, ibs, *rw.vmConfig, rules) // Increment the nonce for the next transaction ibs.SetNonce(msg.From(), ibs.GetNonce(msg.From())+1) ret, leftOverGas, err := rw.evm.Call( @@ -240,8 +248,9 @@ func (rw *HistoricalTraceWorker) RunTxTask(txTask *state.TxTask) { return ret, true, nil } - _, _, _, err := rw.execArgs.Engine.Finalize(rw.execArgs.ChainConfig, types.CopyHeader(header), ibs, txTask.Txs, txTask.Uncles, txTask.BlockReceipts, txTask.Withdrawals, txTask.Requests, rw.chain, syscall, systemCall, txTask.TxIndex, nil, rw.logger) + _, _, _, err := rw.execArgs.Engine.Finalize(rw.execArgs.ChainConfig, types.CopyHeader(header), ibs, txTask.Txs, txTask.Uncles, txTask.BlockReceipts, txTask.Withdrawals, txTask.Requests, rw.chain, syscall, systemCall, txTask.TxIndex, rw.chainTx, rw.logger) if err != nil { + log.Error("run system tx err", "block Number", txTask.BlockNum, "txIndex", txTask.TxIndex, "err", err) txTask.Error = err } default: @@ -271,6 +280,7 @@ func (rw *HistoricalTraceWorker) RunTxTask(txTask *state.TxTask) { // MA applytx applyRes, err := core.ApplyMessage(rw.evm, msg, rw.taskGasPool, true /* refunds */, false /* gasBailout */) if err != nil { + log.Error("run tx err", "block Number", txTask.BlockNum, "txIndex", txTask.TxIndex, "err", err) txTask.Error = err } else { txTask.Failed = applyRes.Failed() diff --git a/cmd/state/exec3/state.go b/cmd/state/exec3/state.go index ab066b81d8d..ed79bbe8f8f 100644 --- a/cmd/state/exec3/state.go +++ b/cmd/state/exec3/state.go @@ -275,7 +275,7 @@ func (rw *Worker) RunTxTaskNoLock(txTask *state.TxTask, isMining bool) { return core.SysCallContract(contract, data, rw.chainConfig, ibs, header, rw.engine, false /* constCall */) } - systemCall := func(ibs *state.IntraBlockState, index int) ([]byte, bool, error) { + systemCall := func(ibs *state.IntraBlockState) ([]byte, bool, error) { rw.taskGasPool.Reset(txTask.Tx.GetGas(), rw.chainConfig.GetMaxBlobGasPerBlock()) rw.callTracer.Reset() rw.vmCfg.SkipAnalysis = txTask.SkipAnalysis @@ -308,19 +308,6 @@ func (rw *Worker) RunTxTaskNoLock(txTask *state.TxTask, isMining bool) { txTask.TraceFroms = rw.callTracer.Froms() txTask.TraceTos = rw.callTracer.Tos() } - - if txTask.Error == nil { - txTask.BalanceIncreaseSet = ibs.BalanceIncreaseSet() - //for addr, bal := range txTask.BalanceIncreaseSet { - // fmt.Printf("BalanceIncreaseSet [%x]=>[%d]\n", addr, &bal) - //} - if err = ibs.MakeWriteSet(rules, rw.stateWriter); err != nil { - panic(err) - } - txTask.ReadLists = rw.stateReader.ReadSet() - txTask.WriteLists = rw.stateWriter.WriteSet() - txTask.AccountPrevs, txTask.AccountDels, txTask.StoragePrevs, txTask.CodePrevs = rw.stateWriter.PrevAndDels() - } return ret, true, nil } diff --git a/cmd/state/exec3/state_recon.go b/cmd/state/exec3/state_recon.go index f6a83213880..6cf37232a4f 100644 --- a/cmd/state/exec3/state_recon.go +++ b/cmd/state/exec3/state_recon.go @@ -373,7 +373,7 @@ func (rw *ReconWorker) runTxTask(txTask *state.TxTask) error { return core.SysCallContract(contract, data, rw.chainConfig, ibs, header, rw.engine, false /* constCall */) } - systemCall := func(ibs *state.IntraBlockState, index int) ([]byte, bool, error) { + systemCall := func(ibs *state.IntraBlockState) ([]byte, bool, error) { vmConfig := vm.Config{NoReceipts: true, SkipAnalysis: txTask.SkipAnalysis} msg := txTask.TxAsMessage ibs.SetTxContext(txTask.TxIndex, txTask.BlockNum) diff --git a/consensus/consensus.go b/consensus/consensus.go index 1ecfd2b72f7..04eea616fed 100644 --- a/consensus/consensus.go +++ b/consensus/consensus.go @@ -92,7 +92,7 @@ type ChainReader interface { type SystemCall func(contract libcommon.Address, data []byte) ([]byte, error) -type SystemTxCall func(ibs *state.IntraBlockState, index int) ([]byte, bool, error) +type SystemTxCall func(ibs *state.IntraBlockState) ([]byte, bool, error) // Use more options to call contract type SysCallCustom func(contract libcommon.Address, data []byte, ibs *state.IntraBlockState, header *types.Header, constCall bool) ([]byte, error) diff --git a/consensus/parlia/bohrFork.go b/consensus/parlia/bohrFork.go index c47e3c884e4..65991d7f4b3 100644 --- a/consensus/parlia/bohrFork.go +++ b/consensus/parlia/bohrFork.go @@ -32,7 +32,7 @@ func (p *Parlia) getTurnLength(chain consensus.ChainHeaderReader, header *types. } else { turnLength = defaultTurnLength } - log.Debug("getTurnLength", "turnLength", turnLength) + log.Trace("getTurnLength", "turnLength", turnLength) return &turnLength, nil } diff --git a/consensus/parlia/parlia.go b/consensus/parlia/parlia.go index da8089e1889..d284a204f06 100644 --- a/consensus/parlia/parlia.go +++ b/consensus/parlia/parlia.go @@ -19,13 +19,13 @@ import ( "github.com/erigontech/erigon/crypto/cryptopool" "github.com/erigontech/erigon/turbo/services" + "github.com/Giulio2002/bls" "github.com/erigontech/erigon-lib/chain" libcommon "github.com/erigontech/erigon-lib/common" "github.com/erigontech/erigon-lib/common/length" "github.com/erigontech/erigon/common" "github.com/erigontech/erigon/common/math" lru "github.com/hashicorp/golang-lru/arc/v2" - "github.com/prysmaticlabs/prysm/v5/crypto/bls" "github.com/willf/bitset" "github.com/erigontech/erigon-lib/common/hexutility" @@ -99,7 +99,6 @@ var ( validatorItemsCache []ValidatorItem maxElectedValidatorsCache = big.NewInt(0) - doDistributeSysReward = false ) // Various error messages to mark blocks invalid. These should be private to @@ -485,7 +484,7 @@ func (p *Parlia) verifyVoteAttestation(chain consensus.ChainHeaderReader, header continue } - voteAddr, err := bls.PublicKeyFromBytes(snap.Validators[val].VoteAddress[:]) + voteAddr, err := bls.NewPublicKeyFromBytes(snap.Validators[val].VoteAddress[:]) if err != nil { return fmt.Errorf("BLS public key converts failed: %v", err) } @@ -497,12 +496,11 @@ func (p *Parlia) verifyVoteAttestation(chain consensus.ChainHeaderReader, header return errors.New("invalid attestation, not enough validators voted") } - // Verify the aggregated signature. - aggSig, err := bls.SignatureFromBytes(attestation.AggSignature[:]) + aggSig, err := bls.NewSignatureFromBytes(attestation.AggSignature[:]) if err != nil { return fmt.Errorf("BLS signature converts failed: %v", err) } - if !aggSig.FastAggregateVerify(votedAddrs, attestation.Data.Hash()) { + if !aggSig.VerifyAggregate(attestation.Data.Hash().Bytes(), votedAddrs) { return errors.New("invalid attestation, signature verify failed") } @@ -892,7 +890,7 @@ func (p *Parlia) verifyTurnLength(chain consensus.ChainHeaderReader, header *typ return err } if turnLength != nil && *turnLength == *turnLengthFromHeader { - log.Debug("verifyTurnLength", "turnLength", *turnLength) + log.Trace("verifyTurnLength", "turnLength", *turnLength) return nil } } @@ -1042,7 +1040,13 @@ func (p *Parlia) finalize(header *types.Header, ibs *state.IntraBlockState, txs } } } - finish, err = p.distributeIncoming(header.Coinbase, ibs, header, &txs, &receipts, &systemTxs, &header.GasUsed, mining, systemTxCall, &curIndex, &txIndex) + finish, err = p.distributeToSystem(header.Coinbase, ibs, header, &txs, &receipts, &systemTxs, &header.GasUsed, mining, systemTxCall, &curIndex, &txIndex) + if err != nil || finish { + //log.Error("distributeIncoming", "block hash", header.Hash(), "error", err, "systemTxs", len(systemTxs)) + return nil, nil, nil, err + } + + finish, err = p.distributeToValidator(header.Coinbase, ibs, header, &txs, &receipts, &systemTxs, &header.GasUsed, mining, systemTxCall, &curIndex, &txIndex) if err != nil || finish { //log.Error("distributeIncoming", "block hash", header.Hash(), "error", err, "systemTxs", len(systemTxs)) return nil, nil, nil, err @@ -1352,47 +1356,6 @@ func (p *Parlia) getCurrentValidators(header *types.Header, ibs *state.IntraBloc return valSet, voteAddrmap, nil } -// distributeToValidator deposits validator reward to validator contract -func (p *Parlia) distributeIncoming(val libcommon.Address, state *state.IntraBlockState, header *types.Header, - txs *types.Transactions, receipts *types.Receipts, systemTxs *types.Transactions, - usedGas *uint64, mining bool, systemTxCall consensus.SystemTxCall, curIndex *int, txIndex *int) (bool, error) { - coinbase := header.Coinbase - balance := state.GetBalance(consensus.SystemAddress).Clone() - if balance.Cmp(u256.Num0) <= 0 && *curIndex == *txIndex { - return false, nil - } - if *curIndex == *txIndex { - doDistributeSysReward = !p.chainConfig.IsKepler(header.Number.Uint64(), header.Time) && - state.GetBalance(systemcontracts.SystemRewardContract).Cmp(maxSystemBalance) < 0 - if doDistributeSysReward { - rewards := new(uint256.Int) - rewards = rewards.Rsh(balance, systemRewardPercent) - state.SetBalance(consensus.SystemAddress, balance.Sub(balance, rewards), tracing.BalanceDecreaseGasBuy) - state.AddBalance(coinbase, rewards, tracing.BalanceDecreaseGasBuy) - if rewards.Cmp(u256.Num0) > 0 { - finish, err := p.distributeToSystem(rewards, state, header, txs, receipts, systemTxs, usedGas, mining, systemTxCall, curIndex) - if err != nil { - return true, err - } else if finish { - return finish, nil - } - } - } - } - if *curIndex != *txIndex && doDistributeSysReward { - *curIndex++ - } - if *curIndex == *txIndex { - state.SetBalance(consensus.SystemAddress, u256.Num0, tracing.BalanceDecreaseGasBuy) - state.AddBalance(coinbase, balance, tracing.BalanceDecreaseGasBuy) - //log.Debug("[parlia] distribute to validator contract", "block hash", header.Hash(), "amount", balance) - return p.distributeToValidator(balance, val, state, header, txs, receipts, systemTxs, usedGas, mining, systemTxCall, curIndex) - } - *curIndex++ - return false, nil - -} - // slash spoiled validators func (p *Parlia) slash(spoiledVal libcommon.Address, state *state.IntraBlockState, header *types.Header, txs *types.Transactions, receipts *types.Receipts, systemTxs *types.Transactions, usedGas *uint64, mining bool, @@ -1439,48 +1402,72 @@ func (p *Parlia) initContract(state *state.IntraBlockState, header *types.Header p.logger.Error("[parlia] Unable to pack tx for init validator set", "err", err) return false, err } - for i, c := range contracts { + for _, c := range contracts { p.logger.Info("Init contracts", "len(systemTxs)", len(*systemTxs), "len(txs)", len(*txs)) if *curIndex == *txIndex { - finish, err = p.applyTransaction(header.Coinbase, c, u256.Num0, data, state, header, txs, receipts, systemTxs, usedGas, mining, systemTxCall, curIndex) - if err != nil { - return false, err - } else if finish { - p.logger.Info("[parlia] init contract", "block hash", header.Hash(), "i", i, "contract", c) - return finish, nil - } + return p.applyTransaction(header.Coinbase, c, u256.Num0, data, state, header, txs, receipts, systemTxs, usedGas, mining, systemTxCall, curIndex) } *curIndex++ } return false, nil } -func (p *Parlia) distributeToSystem(amount *uint256.Int, state *state.IntraBlockState, header *types.Header, +func (p *Parlia) distributeToSystem(val libcommon.Address, ibs *state.IntraBlockState, header *types.Header, txs *types.Transactions, receipts *types.Receipts, systemTxs *types.Transactions, - usedGas *uint64, mining bool, systemTxCall consensus.SystemTxCall, curIndex *int, -) (bool, error) { - return p.applyTransaction(header.Coinbase, systemcontracts.SystemRewardContract, amount, nil, state, header, - txs, receipts, systemTxs, usedGas, mining, systemTxCall, curIndex) + usedGas *uint64, mining bool, systemTxCall consensus.SystemTxCall, curIndex, txIndex *int) (bool, error) { + if *curIndex == *txIndex { + balance := ibs.GetBalance(consensus.SystemAddress).Clone() + if balance.Cmp(u256.Num0) <= 0 { + return false, nil + } + doDistributeSysReward := !p.chainConfig.IsKepler(header.Number.Uint64(), header.Time) && + ibs.GetBalance(systemcontracts.SystemRewardContract).Cmp(maxSystemBalance) < 0 + if doDistributeSysReward { + rewards := new(uint256.Int) + rewards = rewards.Rsh(balance, systemRewardPercent) + + ibs.SetBalance(consensus.SystemAddress, balance.Sub(balance, rewards), tracing.BalanceDecreaseGasBuy) + ibs.AddBalance(val, rewards, tracing.BalanceDecreaseGasBuy) + if rewards.Cmp(u256.Num0) > 0 { + return p.applyTransaction(val, systemcontracts.SystemRewardContract, rewards, nil, ibs, header, + txs, receipts, systemTxs, usedGas, mining, systemTxCall, curIndex) + } + } + return false, nil + } + *curIndex++ + return false, nil } -// slash spoiled validators -func (p *Parlia) distributeToValidator(amount *uint256.Int, validator libcommon.Address, state *state.IntraBlockState, header *types.Header, +// distributeToValidator deposits validator reward to validator contract +func (p *Parlia) distributeToValidator(val libcommon.Address, ibs *state.IntraBlockState, header *types.Header, txs *types.Transactions, receipts *types.Receipts, systemTxs *types.Transactions, - usedGas *uint64, mining bool, systemTxCall consensus.SystemTxCall, curIndex *int, -) (bool, error) { - // method - method := "deposit" + usedGas *uint64, mining bool, systemTxCall consensus.SystemTxCall, curIndex, txIndex *int) (bool, error) { - // get packed data - data, err := p.validatorSetABI.Pack(method, - validator, - ) - if err != nil { - p.logger.Error("[parlia] Unable to pack tx for deposit", "err", err) - return true, err + if *curIndex == *txIndex { + balance := ibs.GetBalance(consensus.SystemAddress).Clone() + + if balance.Cmp(u256.Num0) <= 0 { + return false, nil + } + ibs.SetBalance(consensus.SystemAddress, u256.Num0, tracing.BalanceDecreaseGasBuy) + ibs.AddBalance(val, balance, tracing.BalanceDecreaseGasBuy) + // method + method := "deposit" + + // get packed data + data, err := p.validatorSetABI.Pack(method, + val, + ) + if err != nil { + p.logger.Error("[parlia] Unable to pack tx for deposit", "err", err) + return true, err + } + // apply message + return p.applyTransaction(val, systemcontracts.ValidatorContract, balance, data, ibs, header, txs, receipts, systemTxs, usedGas, mining, systemTxCall, curIndex) } - // apply message - return p.applyTransaction(header.Coinbase, systemcontracts.ValidatorContract, amount, data, state, header, txs, receipts, systemTxs, usedGas, mining, systemTxCall, curIndex) + *curIndex++ + return false, nil } func (p *Parlia) applyTransaction(from libcommon.Address, to libcommon.Address, value *uint256.Int, data []byte, @@ -1493,9 +1480,7 @@ func (p *Parlia) applyTransaction(from libcommon.Address, to libcommon.Address, if len(*systemTxs) == 0 { return false, errors.New("supposed to get a actual transaction, but get none") } - if actualTx == nil { - return false, errors.New("supposed to get a actual transaction, but get nil") - } + actualHash := actualTx.SigningHash(p.chainConfig.ChainID) if !bytes.Equal(actualHash.Bytes(), expectedHash.Bytes()) { return false, fmt.Errorf("expected system tx (hash %v, nonce %d, to %s, value %s, gas %d, gasPrice %s, data %s), actual tx (hash %v, nonce %d, to %s, value %s, gas %d, gasPrice %s, data %s)", @@ -1515,7 +1500,7 @@ func (p *Parlia) applyTransaction(from libcommon.Address, to libcommon.Address, hex.EncodeToString(actualTx.GetData()), ) } - _, shouldBreak, err := systemTxCall(ibs, *curIndex) + _, shouldBreak, err := systemTxCall(ibs) if err != nil { return false, err } diff --git a/core/state_transition.go b/core/state_transition.go index a8d642ff02d..4fb41d4bbc8 100644 --- a/core/state_transition.go +++ b/core/state_transition.go @@ -339,6 +339,7 @@ func (st *StateTransition) TransitionDb(refunds bool, gasBailout bool) (*evmtype var skipCheck bool if st.isParlia && st.msg.Gas() == math.MaxUint64/2 && st.gasPrice.IsZero() { skipCheck = true + st.state.AddBalance(coinbase, st.state.GetBalance(consensus.SystemAddress), tracing.BalanceChangeUnspecified) } // Check clauses 1-3 and 6, buy gas if everything is correct @@ -456,7 +457,9 @@ func (st *StateTransition) TransitionDb(refunds bool, gasBailout bool) (*evmtype if st.gasRemaining < gas { return nil, fmt.Errorf("%w: have %d, want %d", ErrIntrinsicGas, st.gasRemaining, gas) } - st.gasRemaining -= gas + if !skipCheck { + st.gasRemaining -= gas + } var bailout bool // Gas bailout (for trace_call) should only be applied if there is not sufficient balance to perform value transfer diff --git a/core/types/vote.go b/core/types/vote.go index f0c9f57427e..30425b15bf4 100644 --- a/core/types/vote.go +++ b/core/types/vote.go @@ -3,9 +3,9 @@ package types import ( "sync/atomic" + "github.com/Giulio2002/bls" libcommon "github.com/erigontech/erigon-lib/common" "github.com/pkg/errors" - "github.com/prysmaticlabs/prysm/v5/crypto/bls" ) const ( @@ -72,18 +72,18 @@ func (b BLSPublicKey) Bytes() []byte { return b[:] } // Verify vote using BLS. func (vote *VoteEnvelope) Verify() error { - blsPubKey, err := bls.PublicKeyFromBytes(vote.VoteAddress[:]) + blsPubKey, err := bls.NewPublicKeyFromBytes(vote.VoteAddress[:]) if err != nil { return errors.Wrap(err, "convert public key from bytes to bls failed") } - sig, err := bls.SignatureFromBytes(vote.Signature[:]) + sig, err := bls.NewSignatureFromBytes(vote.Signature[:]) if err != nil { return errors.Wrap(err, "invalid signature") } voteDataHash := vote.Data.Hash() - if !sig.Verify(blsPubKey, voteDataHash[:]) { + if !sig.Verify(voteDataHash[:], blsPubKey) { return errors.New("verify bls signature failed.") } return nil diff --git a/core/vm/contracts.go b/core/vm/contracts.go index a36f4d958d1..2155e2f1a70 100644 --- a/core/vm/contracts.go +++ b/core/vm/contracts.go @@ -30,8 +30,8 @@ import ( "github.com/erigontech/erigon/core/types" "github.com/erigontech/secp256k1" + "github.com/Giulio2002/bls" "github.com/erigontech/erigon/rlp" - "github.com/prysmaticlabs/prysm/v5/crypto/bls" "github.com/consensys/gnark-crypto/ecc" bls12381 "github.com/consensys/gnark-crypto/ecc/bls12-381" @@ -1485,7 +1485,7 @@ func (c *blsSignatureVerify) Run(input []byte) ([]byte, error) { copy(msg[:], msgBytes) signatureBytes := getData(input, msgHashLength, signatureLength) - sig, err := bls.SignatureFromBytes(signatureBytes) + sig, err := bls.NewSignatureFromBytes(signatureBytes) if err != nil { log.Debug("blsSignatureVerify invalid signature", "err", err) return nil, ErrExecutionReverted @@ -1495,7 +1495,7 @@ func (c *blsSignatureVerify) Run(input []byte) ([]byte, error) { pubKeys := make([]bls.PublicKey, pubKeyNumber) for i := uint64(0); i < pubKeyNumber; i++ { pubKeyBytes := getData(input, msgAndSigLength+i*singleBlsPubkeyLength, singleBlsPubkeyLength) - pubKey, err := bls.PublicKeyFromBytes(pubKeyBytes) + pubKey, err := bls.NewPublicKeyFromBytes(pubKeyBytes) if err != nil { log.Debug("blsSignatureVerify invalid pubKey", "err", err) return nil, ErrExecutionReverted @@ -1504,11 +1504,11 @@ func (c *blsSignatureVerify) Run(input []byte) ([]byte, error) { } if pubKeyNumber > 1 { - if !sig.FastAggregateVerify(pubKeys, msg) { + if !sig.VerifyAggregate(msgBytes, pubKeys) { return big0.Bytes(), nil } } else { - if !sig.Verify(pubKeys[0], msgBytes) { + if !sig.Verify(msgBytes, pubKeys[0]) { return big0.Bytes(), nil } } diff --git a/core/vm/lightclient/v2/lightclient.go b/core/vm/lightclient/v2/lightclient.go index 00e49e17128..b41012569b7 100644 --- a/core/vm/lightclient/v2/lightclient.go +++ b/core/vm/lightclient/v2/lightclient.go @@ -8,7 +8,7 @@ import ( "fmt" "github.com/cometbft/cometbft/crypto/ed25519" - "github.com/cometbft/cometbft/light" + cmtmath "github.com/cometbft/cometbft/libs/math" tmproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/cometbft/cometbft/types" ) @@ -103,7 +103,7 @@ func (cs *ConsensusState) ApplyLightBlock(block *types.LightBlock, isHertz bool) } } else { // Ensure that +`trustLevel` (default 1/3) or more of last trusted validators signed correctly. - err := cs.ValidatorSet.VerifyCommitLightTrusting(cs.ChainID, block.Commit, light.DefaultTrustLevel) + err := cs.ValidatorSet.VerifyCommitLightTrusting(cs.ChainID, block.Commit, cmtmath.Fraction{Numerator: 1, Denominator: 3}) if err != nil { return false, err } diff --git a/core/vm/logger.go b/core/vm/logger.go index b9dc5a7b218..9c2579c83eb 100644 --- a/core/vm/logger.go +++ b/core/vm/logger.go @@ -36,7 +36,6 @@ type EVMLogger interface { // Transaction level CaptureTxStart(gasLimit uint64) CaptureTxEnd(restGas uint64) - CaptureSystemTxEnd(intrinsicGas uint64) // Top call frame CaptureStart(env *EVM, from libcommon.Address, to libcommon.Address, precompile bool, create bool, input []byte, gas uint64, value *uint256.Int, code []byte) CaptureEnd(output []byte, usedGas uint64, err error) diff --git a/eth/calltracer/calltracer.go b/eth/calltracer/calltracer.go index e3eec7ea92e..8afca5f6412 100644 --- a/eth/calltracer/calltracer.go +++ b/eth/calltracer/calltracer.go @@ -43,9 +43,8 @@ func NewCallTracer() *CallTracer { } } -func (ct *CallTracer) CaptureTxStart(gasLimit uint64) {} -func (ct *CallTracer) CaptureTxEnd(restGas uint64) {} -func (ct *CallTracer) CaptureSystemTxEnd(intrinsicGas uint64) {} +func (ct *CallTracer) CaptureTxStart(gasLimit uint64) {} +func (ct *CallTracer) CaptureTxEnd(restGas uint64) {} // CaptureStart and CaptureEnter also capture SELFDESTRUCT opcode invocations func (ct *CallTracer) captureStartOrEnter(from, to libcommon.Address) { diff --git a/eth/protocols/eth/protocol_test.go b/eth/protocols/eth/protocol_test.go index 6dc0ff2b80e..956cf376af2 100644 --- a/eth/protocols/eth/protocol_test.go +++ b/eth/protocols/eth/protocol_test.go @@ -24,7 +24,7 @@ import ( types2 "github.com/erigontech/erigon-lib/types" "github.com/erigontech/erigon/params" "github.com/holiman/uint256" - "github.com/prysmaticlabs/prysm/v5/testing/require" + "github.com/stretchr/testify/require" "math/big" "testing" @@ -317,6 +317,6 @@ func TestNewBlockPacket_EncodeDecode(t *testing.T) { var actual NewBlockPacket err = rlp.DecodeBytes(enc, &actual) require.NoError(t, err) - require.DeepEqual(t, item.msg, actual) + require.Equal(t, item.msg, actual) } } diff --git a/eth/tracers/js/goja.go b/eth/tracers/js/goja.go index 7c532f43424..e3c756adf35 100644 --- a/eth/tracers/js/goja.go +++ b/eth/tracers/js/goja.go @@ -227,8 +227,6 @@ func (t *jsTracer) CaptureTxEnd(restGas uint64) { t.ctx["gasUsed"] = t.vm.ToValue(t.gasLimit - restGas) } -func (t *jsTracer) CaptureSystemTxEnd(intrinsicGas uint64) {} - // CaptureStart implements the Tracer interface to initialize the tracing operation. func (t *jsTracer) CaptureStart(env *vm.EVM, from libcommon.Address, to libcommon.Address, precompile bool, create bool, input []byte, gas uint64, value *uint256.Int, code []byte) { t.env = env diff --git a/eth/tracers/logger/access_list_tracer.go b/eth/tracers/logger/access_list_tracer.go index c0e66f580d4..57c543b4ffc 100644 --- a/eth/tracers/logger/access_list_tracer.go +++ b/eth/tracers/logger/access_list_tracer.go @@ -178,8 +178,6 @@ func (a *AccessListTracer) CaptureTxStart(gasLimit uint64) {} func (a *AccessListTracer) CaptureTxEnd(restGas uint64) {} -func (*AccessListTracer) CaptureSystemTxEnd(intrinsicGas uint64) {} - func (a *AccessListTracer) CaptureStart(env *vm.EVM, from libcommon.Address, to libcommon.Address, precompile bool, create bool, input []byte, gas uint64, value *uint256.Int, code []byte) { } diff --git a/eth/tracers/logger/json_stream.go b/eth/tracers/logger/json_stream.go index 0a28807a879..7d80e80a62a 100644 --- a/eth/tracers/logger/json_stream.go +++ b/eth/tracers/logger/json_stream.go @@ -68,8 +68,6 @@ func (l *JsonStreamLogger) CaptureTxStart(gasLimit uint64) {} func (l *JsonStreamLogger) CaptureTxEnd(restGas uint64) {} -func (l *JsonStreamLogger) CaptureSystemTxEnd(restGas uint64) {} - // CaptureStart implements the Tracer interface to initialize the tracing operation. func (l *JsonStreamLogger) CaptureStart(env *vm.EVM, from libcommon.Address, to libcommon.Address, precompile bool, create bool, input []byte, gas uint64, value *uint256.Int, code []byte) { l.env = env diff --git a/eth/tracers/logger/logger.go b/eth/tracers/logger/logger.go index e3633cfdad0..a45476c3e99 100644 --- a/eth/tracers/logger/logger.go +++ b/eth/tracers/logger/logger.go @@ -147,9 +147,6 @@ func (l *StructLogger) CaptureTxStart(gasLimit uint64) {} func (l *StructLogger) CaptureTxEnd(restGas uint64) {} -func (l *StructLogger) CaptureSystemTxEnd(intrinsicGas uint64) { -} - // CaptureStart implements the Tracer interface to initialize the tracing operation. func (l *StructLogger) CaptureStart(env *vm.EVM, from libcommon.Address, to libcommon.Address, precompile bool, create bool, input []byte, gas uint64, value *uint256.Int, code []byte) { l.env = env @@ -372,8 +369,6 @@ func (t *mdLogger) CaptureTxStart(gasLimit uint64) {} func (t *mdLogger) CaptureTxEnd(restGas uint64) {} -func (*mdLogger) CaptureSystemTxEnd(intrinsicGas uint64) {} - func (t *mdLogger) captureStartOrEnter(from, to libcommon.Address, create bool, input []byte, gas uint64, value *uint256.Int) { if !create { fmt.Fprintf(t.out, "From: `%v`\nTo: `%v`\nData: `0x%x`\nGas: `%d`\nValue `%v` wei\n", diff --git a/eth/tracers/logger/logger_json.go b/eth/tracers/logger/logger_json.go index 55e588c26cc..1d59f0e1dd6 100644 --- a/eth/tracers/logger/logger_json.go +++ b/eth/tracers/logger/logger_json.go @@ -53,8 +53,6 @@ func (l *JSONLogger) CaptureTxStart(gasLimit uint64) {} func (l *JSONLogger) CaptureTxEnd(restGas uint64) {} -func (l *JSONLogger) CaptureSystemTxEnd(intrinsicGas uint64) {} - func (l *JSONLogger) CaptureStart(env *vm.EVM, from libcommon.Address, to libcommon.Address, precompile bool, create bool, input []byte, gas uint64, value *uint256.Int, code []byte) { l.env = env } diff --git a/eth/tracers/native/call.go b/eth/tracers/native/call.go index 81699575179..06b80df0165 100644 --- a/eth/tracers/native/call.go +++ b/eth/tracers/native/call.go @@ -300,10 +300,6 @@ func (t *callTracer) CaptureTxEnd(restGas uint64) { t.logGaps = nil } -func (t *callTracer) CaptureSystemTxEnd(intrinsicGas uint64) { - t.callstack[0].GasUsed -= intrinsicGas -} - // GetResult returns the json-encoded nested list of call traces, and any // error arising from the encoding or forceful termination (via `Stop`). func (t *callTracer) GetResult() (json.RawMessage, error) { diff --git a/eth/tracers/native/mux.go b/eth/tracers/native/mux.go index b93a86bfe5c..c5748b3b444 100644 --- a/eth/tracers/native/mux.go +++ b/eth/tracers/native/mux.go @@ -118,12 +118,6 @@ func (t *muxTracer) CaptureTxEnd(restGas uint64) { } } -func (t *muxTracer) CaptureSystemTxEnd(intrinsicGas uint64) { - for _, t := range t.tracers { - t.CaptureSystemTxEnd(intrinsicGas) - } -} - // GetResult returns an empty json object. func (t *muxTracer) GetResult() (json.RawMessage, error) { resObject := make(map[string]json.RawMessage) diff --git a/eth/tracers/native/noop.go b/eth/tracers/native/noop.go index ab4fc173815..862e1a8f0f1 100644 --- a/eth/tracers/native/noop.go +++ b/eth/tracers/native/noop.go @@ -72,8 +72,6 @@ func (*noopTracer) CaptureTxStart(gasLimit uint64) {} func (*noopTracer) CaptureTxEnd(restGas uint64) {} -func (t *noopTracer) CaptureSystemTxEnd(intrinsicGas uint64) {} - // GetResult returns an empty json object. func (t *noopTracer) GetResult() (json.RawMessage, error) { return json.RawMessage(`{}`), nil diff --git a/eth/tracers/native/prestate.go b/eth/tracers/native/prestate.go index 6e053a869a0..32ffeff38b6 100644 --- a/eth/tracers/native/prestate.go +++ b/eth/tracers/native/prestate.go @@ -254,8 +254,6 @@ func (t *prestateTracer) CaptureTxEnd(restGas uint64) { } } -func (t *prestateTracer) CaptureSystemTxEnd(intrinsicGas uint64) {} - // GetResult returns the json-encoded nested list of call traces, and any // error arising from the encoding or forceful termination (via `Stop`). func (t *prestateTracer) GetResult() (json.RawMessage, error) { diff --git a/go.mod b/go.mod index 7fbe1064417..954be270c7b 100644 --- a/go.mod +++ b/go.mod @@ -77,7 +77,6 @@ require ( github.com/protolambda/ztyp v0.2.2 github.com/prysmaticlabs/go-bitfield v0.0.0-20240328144219-a1caa50c3a1e github.com/prysmaticlabs/gohashtree v0.0.4-beta.0.20240624100937-73632381301b - github.com/prysmaticlabs/prysm/v5 v5.1.0 github.com/quasilyte/go-ruleguard/dsl v0.3.22 github.com/rs/cors v1.11.1 github.com/spf13/afero v1.10.0 @@ -116,30 +115,20 @@ require ( require ( github.com/cosmos/gogoproto v1.4.1 // indirect - github.com/d4l3k/messagediff v1.2.1 // indirect github.com/elastic/go-freelru v0.13.0 // indirect github.com/erigontech/speedtest v0.0.2 // indirect - github.com/ethereum/go-ethereum v1.13.5 // indirect github.com/go-kit/kit v0.12.0 // indirect github.com/go-kit/log v0.2.1 // indirect github.com/go-logfmt/logfmt v0.5.1 // indirect github.com/go-ole/go-ole v1.3.0 // indirect github.com/golang/protobuf v1.5.4 // indirect github.com/google/uuid v1.6.0 // indirect - github.com/gtank/merlin v0.1.1 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect github.com/hashicorp/go-retryablehttp v0.7.7 // indirect - github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d // indirect - github.com/herumi/bls-eth-go-binary v1.36.1 // indirect - github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 // indirect - github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/nyaosorg/go-windows-shortcut v0.0.0-20220529122037-8b0c89bca4c4 // indirect github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5 // indirect - github.com/prysmaticlabs/fastssz v0.0.0-20240620202422-a981b8ef89d3 // indirect - github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect github.com/sasha-s/go-deadlock v0.3.1 // indirect - github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c // indirect github.com/tklauser/go-sysconf v0.3.14 // indirect github.com/tklauser/numcpus v0.8.0 // indirect github.com/yusufpapurcu/wmi v1.2.4 // indirect diff --git a/go.sum b/go.sum index d190920fe34..cebec7aff94 100644 --- a/go.sum +++ b/go.sum @@ -55,8 +55,6 @@ github.com/AskAlexSharov/bloomfilter/v2 v2.0.8 h1:eRExAhnCcGHKC4/s8bpbYHJTQfOtn/ github.com/AskAlexSharov/bloomfilter/v2 v2.0.8/go.mod h1:zpoh+gs7qcpqrHr3dB55AMiJwo0iURXE7ZOP9L9hSkA= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d h1:nalkkPQcITbvhmL4+C4cKA87NW0tfm3Kl9VXRoPywFg= -github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d/go.mod h1:URdX5+vg25ts3aCh8H5IFZybJYKWhJHYMTnf+ULtoC4= github.com/Giulio2002/bls v0.0.0-20240315151443-652e18a3d188 h1:X+7WswmEBD7DVOlAIXQiU4hok5pPcXFM7JgULHHdD/4= github.com/Giulio2002/bls v0.0.0-20240315151443-652e18a3d188/go.mod h1:nCQrFU6/QsJtLS+SBLWRn9UG2nds1f3hQKfWHCrtUqw= github.com/Masterminds/goutils v1.1.1 h1:5nUrii3FMTL5diU80unEVvNevw1nH4+ZV4DSLVJLSYI= @@ -76,8 +74,6 @@ github.com/RoaringBitmap/roaring v1.9.4 h1:yhEIoH4YezLYT04s1nHehNO64EKFTop/wBhxv github.com/RoaringBitmap/roaring v1.9.4/go.mod h1:6AXUsoIEzDTFFQCe1RbGA6uFONMhvejWj5rqITANK90= 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/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/agnivade/levenshtein v1.1.1 h1:QY8M92nrzkmr798gCo3kmMyqXFzdQVpxLlGPRBij0P8= github.com/agnivade/levenshtein v1.1.1/go.mod h1:veldBMzWxcCG2ZvUTKD2kJNRdCk5hVbJomOvKkmgYbo= github.com/ajwerner/btree v0.0.0-20211221152037-f427b3e689c0 h1:byYvvbfSo3+9efR4IeReh77gVs4PnNDR3AMOE9NJ7a0= @@ -159,8 +155,6 @@ github.com/arbovm/levenshtein v0.0.0-20160628152529-48b4e1c0c4d0 h1:jfIu9sQUG6Ig github.com/arbovm/levenshtein v0.0.0-20160628152529-48b4e1c0c4d0/go.mod h1:t2tdKJDJF9BV14lnkjHmOQgcvEKgtqs5a1N3LNdJhGE= github.com/bahlo/generic-list-go v0.2.0 h1:5sz/EEAK+ls5wF+NeqDpk5+iNdMDXrh3z3nPnH1Wvgk= github.com/bahlo/generic-list-go v0.2.0/go.mod h1:2KvAjgMlE5NNynlg/5iLrrCCZ2+5xWbdbCW3pNTGyYg= -github.com/bazelbuild/rules_go v0.23.2 h1:Wxu7JjqnF78cKZbsBsARLSXx/jlGaSLCnUV3mTlyHvM= -github.com/bazelbuild/rules_go v0.23.2/go.mod h1:MC23Dc/wkXEyk3Wpq6lCqz0ZAYOZDw2DR5y3N1q2i7M= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/benbjohnson/clock v1.3.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/benbjohnson/clock v1.3.5 h1:VvXlSJBzZpA/zum6Sj74hxwYI2DIxRWuNIoXAzHZz5o= @@ -219,8 +213,6 @@ github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDk github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= -github.com/cometbft/cometbft-db v0.7.0 h1:uBjbrBx4QzU0zOEnU8KxoDl18dMNgDh+zZRUE0ucsbo= -github.com/cometbft/cometbft-db v0.7.0/go.mod h1:yiKJIm2WKrt6x8Cyxtq9YTEcIMPcEe4XPxhgX59Fzf0= 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= @@ -234,8 +226,6 @@ github.com/coreos/go-systemd v0.0.0-20181012123002-c6f51f82210d/go.mod h1:F5haX7 github.com/coreos/go-systemd/v22 v22.1.0/go.mod h1:xO0FLkIi5MaZafQlIrOotqXZ90ih+1atmu1JpKERPPk= github.com/coreos/go-systemd/v22 v22.5.0 h1:RrqgGjYQKalulkV8NGVIfkXQf6YYmOyiJKk8iXXhfZs= github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= -github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d h1:49RLWk1j44Xu4fjHb6JFYmeUnDORVwHNkDxaQ0ctCVU= -github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y= github.com/cosmos/gogoproto v1.4.1 h1:WoyH+0/jbCTzpKNvyav5FL1ZTWsp1im1MxEpJEzKUB8= github.com/cosmos/gogoproto v1.4.1/go.mod h1:Ac9lzL4vFpBMcptJROQ6dQ4M3pOEK5Z/l0Q9p+LoCr4= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= @@ -246,11 +236,7 @@ github.com/crate-crypto/go-ipa v0.0.0-20230601170251-1830d0757c80 h1:DuBDHVjgGMP github.com/crate-crypto/go-ipa v0.0.0-20230601170251-1830d0757c80/go.mod h1:gzbVz57IDJgQ9rLQwfSk696JGWof8ftznEL9GoAv3NI= github.com/crate-crypto/go-kzg-4844 v0.7.0 h1:C0vgZRk4q4EZ/JgPfzuSoxdCq3C3mOZMBShovmncxvA= github.com/crate-crypto/go-kzg-4844 v0.7.0/go.mod h1:1kMhvPgI0Ky3yIa+9lFySEBUBXkYxeOi8ZF1sYioxhc= -github.com/creachadair/taskgroup v0.3.2 h1:zlfutDS+5XG40AOxcHDSThxKzns8Tnr9jnr6VqkYlkM= -github.com/creachadair/taskgroup v0.3.2/go.mod h1:wieWwecHVzsidg2CsUnFinW1faVN4+kq+TDlRJQ0Wbk= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/d4l3k/messagediff v1.2.1 h1:ZcAIMYsUg0EAp9X+tt8/enBE/Q8Yd5kzPynLyKptt9U= -github.com/d4l3k/messagediff v1.2.1/go.mod h1:Oozbb1TVXFac9FtSIxHBMnBCq2qeH/2KkEQxENCrlLo= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -264,13 +250,6 @@ github.com/decred/dcrd/crypto/blake256 v1.0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5il 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= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= -github.com/dgraph-io/badger v1.6.2 h1:mNw0qs90GVgGGWylh0umH5iag1j6n/PeJtNvL6KY/x8= -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/ristretto v0.0.4-0.20210318174700-74754f61e018 h1:cNcG4c2n5xanQzp2hMyxDxPYVQmZ91y4WN6fJFlndLo= -github.com/dgraph-io/ristretto v0.0.4-0.20210318174700-74754f61e018/go.mod h1:MIonLggsKgZLUSt414ExgwNtlOL5MuEoAJP514mwGe8= -github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2 h1:tdlZCpZ/P9DhczCTSixgIKmwPv6+wP5DGjqLYw5SUiA= -github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= github.com/dgryski/trifles v0.0.0-20200323201526-dd97f9abfb48 h1:fRzb/w+pyskVMQ+UbP35JkH8yB7MYb4q/qhBarqZE6g= github.com/dgryski/trifles v0.0.0-20200323201526-dd97f9abfb48/go.mod h1:if7Fbed8SFyPtHLHbg49SI7NAdJiC5WIA09pe59rfAA= github.com/dlclark/regexp2 v1.4.1-0.20201116162257-a2a8dda75c91/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc= @@ -319,10 +298,6 @@ github.com/erigontech/speedtest v0.0.2 h1:W9Cvky/8AMUtUONwkLA/dZjeQ2XfkBdYfJzvhM github.com/erigontech/speedtest v0.0.2/go.mod h1:vulsRNiM51BmSTbVtch4FWxKxx53pS2D35lZTtao0bw= github.com/erigontech/torrent v1.54.2-alpha-38 h1:0KQTLlotAWy63MuyUatAzvIYwULYMSHI51A8Jl+3TC4= github.com/erigontech/torrent v1.54.2-alpha-38/go.mod h1:QtK2WLdEz1Iy1Dh/325UltdHU0nA1xujh2rN6aov6y0= -github.com/ethereum/c-kzg-4844 v0.4.0 h1:3MS1s4JtA868KpJxroZoepdV0ZKBp3u/O5HcZ7R3nlY= -github.com/ethereum/c-kzg-4844 v0.4.0/go.mod h1:VewdlzQmpT5QSrVhbBuGoCdFJkpaJlO1aQputP83wc0= -github.com/ethereum/go-ethereum v1.13.5 h1:U6TCRciCqZRe4FPXmy1sMGxTfuk8P7u2UoinF3VbaFk= -github.com/ethereum/go-ethereum v1.13.5/go.mod h1:yMTu38GSuyxaYzQMViqNmQ1s3cE84abZexQmTgenWk0= github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM= github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE= github.com/fjl/gencodec v0.0.0-20230517082657-f9840df7b83e h1:bBLctRc7kr01YGvaDfgLbTwjFNW5jdp5y5rj8XXBHfY= @@ -330,8 +305,6 @@ github.com/fjl/gencodec v0.0.0-20230517082657-f9840df7b83e/go.mod h1:AzA8Lj6Ytix github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= github.com/flynn/noise v1.1.0 h1:KjPQoQCEFdZDiP03phOvGi11+SVVhBG2wOWAorLsstg= github.com/flynn/noise v1.1.0/go.mod h1:xbMo+0i6+IGbYdJhF31t2eR1BIU0CYc12+BNAKwUTag= -github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw= -github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= github.com/francoispqt/gojay v1.2.13 h1:d2m3sFjloqoIUQU3TsHBgj6qg/BVGlTBeHDUmyJnXKk= github.com/francoispqt/gojay v1.2.13/go.mod h1:ehT5mTG4ua4581f1++1WLG0vPdaA9HaiDsoyrBGkyDY= github.com/frankban/quicktest v1.9.0/go.mod h1:ui7WezCLWMWxVWr1GETZY3smRy0G4KWq9vcPtJmFl7Y= @@ -474,8 +447,6 @@ github.com/google/gopacket v1.1.19/go.mod h1:iJ8V8n6KS+z2U1A8pUwu8bW5SyEMkXJB8Yo github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= -github.com/google/orderedcode v0.0.1 h1:UzfcAexk9Vhv8+9pNOgRu41f16lHq725vPwnSeiG/Us= -github.com/google/orderedcode v0.0.1/go.mod h1:iVyU4/qPKHY5h/wSd6rZZCDcLJNxiWO6dvsYES2Sb20= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= @@ -512,14 +483,7 @@ github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/ad github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 h1:UH//fgunKIs4JdUbpDl1VZCDaL56wXCB/5+wF6uHfaI= github.com/grpc-ecosystem/go-grpc-middleware v1.4.0/go.mod h1:g5qyo/la0ALbONm6Vbp88Yd8NsDy6rZz+RcrMPxvld8= -github.com/grpc-ecosystem/grpc-gateway v1.5.0 h1:WcmKMm43DR7RdtlkEXQJyo5ws8iTp98CyhCCbOHMvNI= github.com/grpc-ecosystem/grpc-gateway v1.5.0/go.mod h1:RSKVYQBd5MCa4OVpNdGskqpgL2+G+NZTnrVHpWWfpdw= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0 h1:BZHcxBETFHIdVyhyEfOvn/RdU/QGdLI4y34qQGjGWO0= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0/go.mod h1:hgWBS7lorOAVIJEQMi4ZsPv9hVvWI6+ch50m39Pf2Ks= -github.com/gtank/merlin v0.1.1 h1:eQ90iG7K9pOhtereWsmyRJ6RAwcP4tHTDBHXNg+u5is= -github.com/gtank/merlin v0.1.1/go.mod h1:T86dnYJhcGOh5BjZFCJWTDeTK7XW8uE+E21Cy/bIQ+s= -github.com/gtank/ristretto255 v0.1.2 h1:JEqUCPA1NvLq5DwYtuzigd7ss8fwbYay9fi4/5uMzcc= -github.com/gtank/ristretto255 v0.1.2/go.mod h1:Ph5OpO6c7xKUGROZfWVLiJf9icMDwUeIvY4OmlYW69o= github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= github.com/hashicorp/go-hclog v1.6.3 h1:Qr2kF+eVWjTiYmU7Y31tYlP1h0q/X3Nl3tPGdaB11/k= @@ -528,14 +492,10 @@ github.com/hashicorp/go-retryablehttp v0.7.7 h1:C8hUCYzor8PIfXHa4UrZkU4VvK8o9ISH github.com/hashicorp/go-retryablehttp v0.7.7/go.mod h1:pkQpWZeYWskR+D1tR2O5OcBFOxfA7DoAO6xtkuQnHTk= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d h1:dg1dEPuWpEqDnvIw251EVy4zlP8gWbsGj4BsUKCRpYs= -github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/golang-lru/arc/v2 v2.0.7 h1:QxkVTxwColcduO+LP7eJO56r2hFiG8zEbfAAzRv52KQ= github.com/hashicorp/golang-lru/arc/v2 v2.0.7/go.mod h1:Pe7gBlGdc8clY5LJ0LpJXMt5AmgmWNH1g+oFFVUHOEc= github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k= github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= -github.com/herumi/bls-eth-go-binary v1.36.1 h1:SfLjxbO1fWkKtKS7J3Ezd1/5QXrcaTZgWynxdSe10hQ= -github.com/herumi/bls-eth-go-binary v1.36.1/go.mod h1:luAnRm3OsMQeokhGzpYmc0ZKwawY7o87PUEP11Z7r7U= github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM= github.com/hexops/gotextdiff v1.0.3/go.mod h1:pSWU5MAI3yDq+fZBTazCSJysOMbxWL1BSow5/V2vxeg= github.com/holiman/uint256 v1.2.0/go.mod h1:y4ga/t+u+Xwd7CpDgZESaRcWy0I7XMlTMA25ApIH5Jw= @@ -572,8 +532,6 @@ github.com/jbenet/go-temp-err-catcher v0.1.0/go.mod h1:0kJRvmDZXNMIiJirNPEYfhpPw github.com/jedib0t/go-pretty/v6 v6.5.9 h1:ACteMBRrrmm1gMsXe9PSTOClQ63IXDUt03H5U+UV8OU= github.com/jedib0t/go-pretty/v6 v6.5.9/go.mod h1:zbn98qrYlh95FIhwwsbIip0LYpwSG8SUOScs+v9/t0E= github.com/jellevandenhooff/dkim v0.0.0-20150330215556-f50fe3d243e1/go.mod h1:E0B/fFc00Y+Rasa88328GlI/XbtyysCtTHZS8h7IrBU= -github.com/jmhodges/levigo v1.0.0 h1:q5EC36kV79HWeTBWsod3mG11EgStG3qArTKcvlksN1U= -github.com/jmhodges/levigo v1.0.0/go.mod h1:Q6Qx+uH3RAqyK4rFQroq9RL7mdkABMcfhEI+nNuzMJQ= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= @@ -612,8 +570,6 @@ github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0 github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= 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/lib/pq v1.10.7 h1:p7ZhMD+KsSRozJr34udlUrhboJwWAgCg34+/ZZNvZZw= -github.com/lib/pq v1.10.7/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/libp2p/go-buffer-pool v0.1.0 h1:oK4mSFcQz7cTQIfqbe4MIj9gLW+mnanjyFtc6cdF0Y8= github.com/libp2p/go-buffer-pool v0.1.0/go.mod h1:N+vh8gMqimBzdKkSMVuydVDq+UV5QTWy5HSiZacSbPg= github.com/libp2p/go-flow-metrics v0.1.0 h1:0iPhMI8PskQwzh57jB9WxIuIOQ0r+15PChFGkx3Q3WM= @@ -669,12 +625,7 @@ github.com/mikioh/tcpinfo v0.0.0-20190314235526-30a79bb1804b h1:z78hV3sbSMAUoyUM github.com/mikioh/tcpinfo v0.0.0-20190314235526-30a79bb1804b/go.mod h1:lxPUiZwKoFL8DUUmalo2yJJUCxbPKtm8OKfqr2/FTNU= github.com/mikioh/tcpopt v0.0.0-20190314235656-172688c1accc h1:PTfri+PuQmWDqERdnNMiD9ZejrlswWrCpBEZgWOiTrc= github.com/mikioh/tcpopt v0.0.0-20190314235656-172688c1accc/go.mod h1:cGKTAVKx4SxOuR/czcZ/E2RSJ3sfHs8FpHhQ5CWMf9s= -github.com/mimoo/StrobeGo v0.0.0-20181016162300-f8f6d4d2b643/go.mod h1:43+3pMjjKimDBf5Kr4ZFNGbLql1zKkbImw+fZbw3geM= -github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 h1:QRUSJEgZn2Snx0EmT/QLXibWjSUDjKWvXIT19NBVp94= -github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0/go.mod h1:43+3pMjjKimDBf5Kr4ZFNGbLql1zKkbImw+fZbw3geM= github.com/minio/blake2b-simd v0.0.0-20160723061019-3f5f724cb5b1/go.mod h1:pD8RvIylQ358TN4wwqatJ8rNavkEINozVn9DtGI3dfQ= -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/sha256-simd v0.1.1-0.20190913151208-6de447530771/go.mod h1:B5e1o+1/KgNmWrSQK08Y6Z1Vb5pwIktudl0J58iy0KM= github.com/minio/sha256-simd v1.0.1 h1:6kaan5IFmwTNynnKKpDHe6FWHohJOHhCPchzK49dzMM= github.com/minio/sha256-simd v1.0.1/go.mod h1:Pz6AKMiUdngCLpeTL/RJY1M9rUuPMYujV5xJjtbRSN8= @@ -694,8 +645,6 @@ github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lN github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= -github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 h1:RWengNIwukTxcDr9M+97sNutRR1RKhG96O6jWumTTnw= -github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8= github.com/mr-tron/base58 v1.1.2/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc= github.com/mr-tron/base58 v1.2.0 h1:T/HDJBh4ZCPbU39/+c3rRvE0uKBQlU27+QI8LJ4t64o= github.com/mr-tron/base58 v1.2.0/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc= @@ -849,16 +798,10 @@ github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0leargg github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= github.com/protolambda/ztyp v0.2.2 h1:rVcL3vBu9W/aV646zF6caLS/dyn9BN8NYiuJzicLNyY= github.com/protolambda/ztyp v0.2.2/go.mod h1:9bYgKGqg3wJqT9ac1gI2hnVb0STQq7p/1lapqrqY1dU= -github.com/prysmaticlabs/fastssz v0.0.0-20240620202422-a981b8ef89d3 h1:0LZAwwHnsZFfXm4IK4rzFV4N5IVSKZKLmuBMA4kAlFk= -github.com/prysmaticlabs/fastssz v0.0.0-20240620202422-a981b8ef89d3/go.mod h1:h2OlIZD/M6wFvV3YMZbW16lFgh3Rsye00G44J2cwLyU= github.com/prysmaticlabs/go-bitfield v0.0.0-20240328144219-a1caa50c3a1e h1:ATgOe+abbzfx9kCPeXIW4fiWyDdxlwHw07j8UGhdTd4= github.com/prysmaticlabs/go-bitfield v0.0.0-20240328144219-a1caa50c3a1e/go.mod h1:wmuf/mdK4VMD+jA9ThwcUKjg3a2XWM9cVfFYjDyY4j4= github.com/prysmaticlabs/gohashtree v0.0.4-beta.0.20240624100937-73632381301b h1:VK7thFOnhxAZ/5aolr5Os4beiubuD08WiuiHyRqgwks= github.com/prysmaticlabs/gohashtree v0.0.4-beta.0.20240624100937-73632381301b/go.mod h1:HRuvtXLZ4WkaB1MItToVH2e8ZwKwZPY5/Rcby+CvvLY= -github.com/prysmaticlabs/protoc-gen-go-cast v0.0.0-20230228205207-28762a7b9294 h1:q9wE0ZZRdTUAAeyFP/w0SwBEnCqlVy2+on6X2/e+eAU= -github.com/prysmaticlabs/protoc-gen-go-cast v0.0.0-20230228205207-28762a7b9294/go.mod h1:ZVEbRdnMkGhp/pu35zq4SXxtvUwWK0J1MATtekZpH2Y= -github.com/prysmaticlabs/prysm/v5 v5.1.0 h1:TY9A6tm0v7bI1z9YH+xkDh7XH7qm4ZK8sTeyckxbj4A= -github.com/prysmaticlabs/prysm/v5 v5.1.0/go.mod h1:SWb5kE/FhtQrLS2yt+IDj+leB7IhXrcOv6lhDnU1nBY= github.com/quasilyte/go-ruleguard/dsl v0.3.22 h1:wd8zkOhSNr+I+8Qeciml08ivDt1pSXe60+5DqOpCjPE= github.com/quasilyte/go-ruleguard/dsl v0.3.22/go.mod h1:KeCP03KrjuSO0H1kTuZQCWlQPulDV6YMIXmpQss17rU= github.com/quic-go/qpack v0.4.0 h1:Cr9BXA1sQS2SmDUWjSofMPNKmvF6IiIfDRmgU0w1ZCo= @@ -870,8 +813,6 @@ github.com/quic-go/webtransport-go v0.8.0/go.mod h1:N99tjprW432Ut5ONql/aUhSLT0YV github.com/raulk/go-watchdog v1.3.0 h1:oUmdlHxdkXRJlwfG0O9omj8ukerm8MEQavSiDTEtBsk= github.com/raulk/go-watchdog v1.3.0/go.mod h1:fIvOnLbF0b0ZwkB9YU4mOW9Did//4vPZtDqv66NfsMU= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= -github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM= -github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE= github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= @@ -976,11 +917,7 @@ github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsT github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/supranational/blst v0.3.11 h1:LyU6FolezeWAhvQk0k6O/d49jqgO52MSDDfYgbeoEm4= github.com/supranational/blst v0.3.11/go.mod h1:jZJtfjgudtNl4en1tzwPIV3KjUnQUvG3/j+w+fVonLw= -github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 h1:epCh84lMvA70Z7CTTCmYQn2CKbY8j86K7/FAIr141uY= -github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc= github.com/tarm/serial v0.0.0-20180830185346-98f6abe2eb07/go.mod h1:kDXzergiv9cbyO7IOYJZWg1U88JhDg3PB6klq9Hg2pA= -github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c h1:g+WoO5jjkqGAzHWCjJB1zZfXPIAaDpzXIEJ0eS6B5Ok= -github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c/go.mod h1:ahpPrc7HpcfEWDQRZEmnXMzHY03mLDYMCxeDzy46i+8= github.com/tendermint/go-amino v0.16.0 h1:GyhmgQKvqF82e2oZeuMSp9JTN0N09emoSZlb2lyGa2E= github.com/tendermint/go-amino v0.16.0/go.mod h1:TQU0M1i/ImAo+tYpZi73AU3V/dKeCoMC9Sphe2ZwGME= github.com/thomaso-mirodin/intmath v0.0.0-20160323211736-5dc6d854e46e h1:cR8/SYRgyQCt5cNCMniB/ZScMkhI9nk8U5C7SbISXjo= @@ -1448,8 +1385,6 @@ google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20231016165738-49dd2c1f3d0b h1:+YaDE2r2OG8t/z5qmsh7Y+XXwCbvadxxZ0YY6mTdrVA= -google.golang.org/genproto v0.0.0-20231016165738-49dd2c1f3d0b/go.mod h1:CgAqfJo+Xmu0GwA0411Ht3OU3OntXwsGmrmjI8ioGXI= google.golang.org/genproto/googleapis/api v0.0.0-20240528184218-531527333157 h1:7whR9kGa5LUwFtpLm2ArCEejtnxlGeLbAyjFY8sGNFw= google.golang.org/genproto/googleapis/api v0.0.0-20240528184218-531527333157/go.mod h1:99sLkeliLXfdj2J75X3Ho+rrVCaJze0uwN7zDDkjPVU= google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117 h1:1GBuWVLM/KMVUv1t1En5Gs+gFZCNd360GGb4sSxtrhU= diff --git a/polygon/tracer/trace_bor_state_sync_txn.go b/polygon/tracer/trace_bor_state_sync_txn.go index bb2bcbcc153..c6cfe7525a9 100644 --- a/polygon/tracer/trace_bor_state_sync_txn.go +++ b/polygon/tracer/trace_bor_state_sync_txn.go @@ -77,7 +77,7 @@ func TraceBorStateSyncTxnDebugAPI( return traceBorStateSyncTxn(ctx, ibs, stateWriter, stateReceiverContract, stateSyncEvents, evm, rules, txCtx, refunds) } - return transactions.ExecuteTraceTx(blockCtx, txCtx, ibs, traceConfig, chainConfig, stream, tracer, streaming, execCb, 0) + return transactions.ExecuteTraceTx(blockCtx, txCtx, ibs, traceConfig, chainConfig, stream, tracer, streaming, execCb) } func TraceBorStateSyncTxnTraceAPI( diff --git a/turbo/jsonrpc/otterscan_default_tracer.go b/turbo/jsonrpc/otterscan_default_tracer.go index 010ce98dd7d..da6dd5c8bb1 100644 --- a/turbo/jsonrpc/otterscan_default_tracer.go +++ b/turbo/jsonrpc/otterscan_default_tracer.go @@ -34,8 +34,6 @@ func (t *DefaultTracer) CaptureTxStart(gasLimit uint64) {} func (t *DefaultTracer) CaptureTxEnd(restGas uint64) {} -func (t *DefaultTracer) CaptureSystemTxEnd(intrinsicGas uint64) {} - func (t *DefaultTracer) CaptureStart(env *vm.EVM, from common.Address, to common.Address, precompile bool, create bool, input []byte, gas uint64, value *uint256.Int, code []byte) { } diff --git a/turbo/jsonrpc/overlay_create_tracer.go b/turbo/jsonrpc/overlay_create_tracer.go index 741dee57222..29be53228a8 100644 --- a/turbo/jsonrpc/overlay_create_tracer.go +++ b/turbo/jsonrpc/overlay_create_tracer.go @@ -34,9 +34,8 @@ type OverlayCreateTracer struct { } // Transaction level -func (ct *OverlayCreateTracer) CaptureTxStart(gasLimit uint64) {} -func (ct *OverlayCreateTracer) CaptureTxEnd(restGas uint64) {} -func (ot *OverlayCreateTracer) CaptureSystemTxEnd(restGas uint64) {} +func (ct *OverlayCreateTracer) CaptureTxStart(gasLimit uint64) {} +func (ct *OverlayCreateTracer) CaptureTxEnd(restGas uint64) {} // Top call frame func (ct *OverlayCreateTracer) CaptureStart(env *vm.EVM, from libcommon.Address, to libcommon.Address, precompile bool, create bool, input []byte, gas uint64, value *uint256.Int, code []byte) { diff --git a/turbo/jsonrpc/trace_adhoc.go b/turbo/jsonrpc/trace_adhoc.go index baac13d726b..e49cc0644cf 100644 --- a/turbo/jsonrpc/trace_adhoc.go +++ b/turbo/jsonrpc/trace_adhoc.go @@ -283,8 +283,6 @@ func (ot *OeTracer) CaptureTxStart(gasLimit uint64) {} func (ot *OeTracer) CaptureTxEnd(restGas uint64) {} -func (ot *OeTracer) CaptureSystemTxEnd(intrinsicGas uint64) {} - func (ot *OeTracer) captureStartOrEnter(deep bool, typ vm.OpCode, from libcommon.Address, to libcommon.Address, precompile bool, create bool, input []byte, gas uint64, value *uint256.Int, code []byte) { //fmt.Printf("captureStartOrEnter deep %t, typ %s, from %x, to %x, create %t, input %x, gas %d, value %d, precompile %t\n", deep, typ.String(), from, to, create, input, gas, value, precompile) if ot.r.VmTrace != nil { diff --git a/turbo/jsonrpc/tracing.go b/turbo/jsonrpc/tracing.go index 904c5d58a85..2ae1aff5b0e 100644 --- a/turbo/jsonrpc/tracing.go +++ b/turbo/jsonrpc/tracing.go @@ -22,8 +22,6 @@ import ( "fmt" "time" - "github.com/erigontech/erigon/consensus" - "github.com/holiman/uint256" jsoniter "github.com/json-iterator/go" @@ -193,13 +191,7 @@ func (api *PrivateDebugAPIImpl) traceBlock(ctx context.Context, blockNrOrHash rp api.evmCallTimeout, ) } else { - var intrinsicGas uint64 - if posa, ok := api.engine().(consensus.PoSA); ok { - if isSystem, _ := posa.IsSystemTransaction(txn, block.Header()); isSystem { - intrinsicGas, _ = core.IntrinsicGas(msg.Data(), msg.AccessList(), false, true, true, false, 0) - } - } - err = transactions.TraceTx(ctx, msg, blockCtx, txCtx, ibs, config, chainConfig, stream, api.evmCallTimeout, intrinsicGas) + err = transactions.TraceTx(ctx, msg, blockCtx, txCtx, ibs, config, chainConfig, stream, api.evmCallTimeout) } if err == nil { err = ibs.FinalizeTx(rules, state.NewNoopWriter()) @@ -336,14 +328,8 @@ func (api *PrivateDebugAPIImpl) TraceTransaction(ctx context.Context, hash commo api.evmCallTimeout, ) } - var intrinsicGas uint64 - if posa, ok := api.engine().(consensus.PoSA); ok { - if isSystem, _ := posa.IsSystemTransaction(txn, block.Header()); isSystem { - intrinsicGas, _ = core.IntrinsicGas(msg.Data(), msg.AccessList(), false, true, true, false, 0) - } - } // Trace the transaction and return - return transactions.TraceTx(ctx, msg, blockCtx, txCtx, ibs, config, chainConfig, stream, api.evmCallTimeout, intrinsicGas) + return transactions.TraceTx(ctx, msg, blockCtx, txCtx, ibs, config, chainConfig, stream, api.evmCallTimeout) } // TraceCall implements debug_traceCall. Returns Geth style call traces. @@ -411,7 +397,7 @@ func (api *PrivateDebugAPIImpl) TraceCall(ctx context.Context, args ethapi.CallA blockCtx := transactions.NewEVMBlockContext(engine, header, blockNrOrHash.RequireCanonical, dbtx, api._blockReader, chainConfig) txCtx := core.NewEVMTxContext(msg) // Trace the transaction and return - return transactions.TraceTx(ctx, msg, blockCtx, txCtx, ibs, config, chainConfig, stream, api.evmCallTimeout, 0) + return transactions.TraceTx(ctx, msg, blockCtx, txCtx, ibs, config, chainConfig, stream, api.evmCallTimeout) } func (api *PrivateDebugAPIImpl) TraceCallMany(ctx context.Context, bundles []Bundle, simulateContext StateContext, config *tracersConfig.TraceConfig, stream *jsoniter.Stream) error { @@ -574,7 +560,7 @@ func (api *PrivateDebugAPIImpl) TraceCallMany(ctx context.Context, bundles []Bun txCtx = core.NewEVMTxContext(msg) ibs := evm.IntraBlockState().(*state.IntraBlockState) ibs.SetTxContext(txnIndex, blockCtx.BlockNumber) - err = transactions.TraceTx(ctx, msg, blockCtx, txCtx, evm.IntraBlockState(), config, chainConfig, stream, api.evmCallTimeout, 0) + err = transactions.TraceTx(ctx, msg, blockCtx, txCtx, evm.IntraBlockState(), config, chainConfig, stream, api.evmCallTimeout) if err != nil { stream.WriteArrayEnd() stream.WriteArrayEnd() diff --git a/turbo/shards/events.go b/turbo/shards/events.go index 9d571211ce4..dff2c7e8c12 100644 --- a/turbo/shards/events.go +++ b/turbo/shards/events.go @@ -243,5 +243,11 @@ func (r *RecentLogs) Add(receipts types.Receipts) { } r.mu.Lock() defer r.mu.Unlock() - r.receipts[receipts[0].BlockNumber.Uint64()] = receipts + // find non-nil receipt + for _, receipt := range receipts { + if receipt != nil { + r.receipts[receipts[0].BlockNumber.Uint64()] = receipts + return + } + } } diff --git a/turbo/transactions/tracing.go b/turbo/transactions/tracing.go index 34b38d31876..a1af71bc043 100644 --- a/turbo/transactions/tracing.go +++ b/turbo/transactions/tracing.go @@ -103,7 +103,6 @@ func TraceTx( chainConfig *chain.Config, stream *jsoniter.Stream, callTimeout time.Duration, - intrinsicGas uint64, ) error { tracer, streaming, cancel, err := AssembleTracer(ctx, config, txCtx.TxHash, stream, callTimeout) if err != nil { @@ -118,7 +117,7 @@ func TraceTx( return core.ApplyMessage(evm, message, gp, refunds, false /* gasBailout */) } - return ExecuteTraceTx(blockCtx, txCtx, ibs, config, chainConfig, stream, tracer, streaming, execCb, intrinsicGas) + return ExecuteTraceTx(blockCtx, txCtx, ibs, config, chainConfig, stream, tracer, streaming, execCb) } func AssembleTracer( @@ -176,7 +175,6 @@ func ExecuteTraceTx( tracer vm.EVMLogger, streaming bool, execCb func(evm *vm.EVM, refunds bool) (*evmtypes.ExecutionResult, error), - intrinsicGas uint64, ) error { // Run the transaction with tracing enabled. evm := vm.NewEVM(blockCtx, txCtx, ibs, chainConfig, vm.Config{Debug: true, Tracer: tracer, NoBaseFee: true}) @@ -193,7 +191,6 @@ func ExecuteTraceTx( } result, err := execCb(evm, refunds) - tracer.CaptureSystemTxEnd(intrinsicGas) if err != nil { if streaming { stream.WriteArrayEnd() @@ -208,7 +205,7 @@ func ExecuteTraceTx( stream.WriteArrayEnd() stream.WriteMore() stream.WriteObjectField("gas") - stream.WriteUint64(result.UsedGas - intrinsicGas) + stream.WriteUint64(result.UsedGas) stream.WriteMore() stream.WriteObjectField("failed") stream.WriteBool(result.Failed())