mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2025-01-03 17:44:29 +00:00
add state check assert routine
This commit is contained in:
parent
ff451545d9
commit
b8381cfd3a
@ -66,7 +66,6 @@ var DefaultTimings = Timings{
|
||||
// SentryClient here is an interface, it is suitable for mocking in tests (mock will need
|
||||
// to implement all the functions of the SentryClient interface).
|
||||
func NewFetch(ctx context.Context, sentryClients []sentry.SentryClient, pool Pool, senders *SendersCache, stateChangesClient remote.KVClient, coreDB kv.RoDB, db kv.RwDB) *Fetch {
|
||||
pooledTxsParseCtx := NewTxParseContext()
|
||||
return &Fetch{
|
||||
ctx: ctx,
|
||||
sentryClients: sentryClients,
|
||||
@ -76,7 +75,7 @@ func NewFetch(ctx context.Context, sentryClients []sentry.SentryClient, pool Poo
|
||||
db: db,
|
||||
stateChangesClient: stateChangesClient,
|
||||
stateChangesParseCtx: NewTxParseContext(),
|
||||
pooledTxsParseCtx: pooledTxsParseCtx,
|
||||
pooledTxsParseCtx: NewTxParseContext(),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -17,6 +17,7 @@
|
||||
package txpool
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"errors"
|
||||
"fmt"
|
||||
|
||||
@ -192,6 +193,12 @@ func ParsePooledTransactions65(payload []byte, pos int, ctx *TxParseContext, txS
|
||||
}
|
||||
return 0, err
|
||||
}
|
||||
if ASSERT {
|
||||
if bytes.Equal(txSlots.txs[i].idHash[:], EmptyAddr[:]) {
|
||||
fmt.Printf("etmpy: %#v\n", txSlots.txs[i])
|
||||
panic("?????")
|
||||
}
|
||||
}
|
||||
}
|
||||
return pos, nil
|
||||
}
|
||||
|
@ -913,13 +913,6 @@ func (p *TxPool) OnNewTxs(ctx context.Context, coreDB kv.RoDB, newTxs TxSlots, s
|
||||
return err
|
||||
}
|
||||
|
||||
if ASSERT {
|
||||
for i := range p.senders.senderIDs {
|
||||
if bytes.Equal([]byte(i), EmptyAddr[:]) {
|
||||
panic(8)
|
||||
}
|
||||
}
|
||||
}
|
||||
protocolBaseFee, pendingBaseFee := p.protocolBaseFee.Load(), p.pendingBaseFee.Load()
|
||||
if protocolBaseFee == 0 || pendingBaseFee == 0 {
|
||||
return fmt.Errorf("non-zero base fee: %d,%d", protocolBaseFee, pendingBaseFee)
|
||||
|
Loading…
Reference in New Issue
Block a user