Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix reading blob transaction from PoolTransaction #9632

Merged
merged 2 commits into from
Mar 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions core/types/transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,6 @@ func (t BinaryTransactions) EncodeIndex(i int, w *bytes.Buffer) {
w.Write(t[i])
}

func (tm TransactionMisc) From() *atomic.Value {
return &tm.from
}

func DecodeRLPTransaction(s *rlp.Stream, blobTxnsAreWrappedWithBlobs bool) (Transaction, error) {
kind, size, err := s.Kind()
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion erigon-lib/kv/tables.go
Original file line number Diff line number Diff line change
Expand Up @@ -693,7 +693,7 @@ var ChaindataTables = []string{

const (
RecentLocalTransaction = "RecentLocalTransaction" // sequence_u64 -> tx_hash
PoolTransaction = "PoolTransaction" // txHash -> sender_id_u64+tx_rlp
PoolTransaction = "PoolTransaction" // txHash -> sender+tx_rlp
PoolInfo = "PoolInfo" // option_key -> option_value
)

Expand Down
7 changes: 4 additions & 3 deletions erigon-lib/txpool/pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -682,14 +682,15 @@ func (p *TxPool) getCachedBlobTxnLocked(tx kv.Tx, hash []byte) (*metaTx, error)
return nil, nil
}

txn, err := tx.GetOne(kv.PoolTransaction, hash)
v, err := tx.GetOne(kv.PoolTransaction, hash)
if err != nil {
return nil, err
}
txRlp := common.Copy(v[20:])
parseCtx := types.NewTxParseContext(p.chainID)
parseCtx.WithSender(false)
txSlot := &types.TxSlot{}
parseCtx.ParseTransaction(txn, 0, txSlot, nil, false, true, nil)
parseCtx.ParseTransaction(txRlp, 0, txSlot, nil, false, true, nil)
return newMetaTx(txSlot, false, 0), nil
}

Expand Down Expand Up @@ -2065,7 +2066,7 @@ func (p *TxPool) fromDB(ctx context.Context, tx kv.Tx, coreTx kv.Tx) error {
p.lastSeenBlock.Store(lastSeenBlock)
}

// this is neccessary as otherwise best - which waits for sync events
// this is necessary as otherwise best - which waits for sync events
// may wait for ever if blocks have been process before the txpool
// starts with an empty db
lastSeenProgress, err := getExecutionProgress(coreTx)
Expand Down
Loading