mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2025-01-03 09:37:38 +00:00
Pass proper timestamp in stage senders (#8013)
This fixes "blob tx is not supported by signer", which occurred in some Hive tests.
This commit is contained in:
parent
7947fc8ad1
commit
2a4b1b3077
@ -204,6 +204,15 @@ Loop:
|
||||
continue
|
||||
}
|
||||
|
||||
var header *types.Header
|
||||
if header, err = cfg.blockReader.Header(ctx, tx, blockHash, blockNumber); err != nil {
|
||||
return err
|
||||
}
|
||||
if header == nil {
|
||||
logger.Warn(fmt.Sprintf("[%s] senders stage can't find header", logPrefix), "num", blockNumber, "hash", blockHash)
|
||||
continue
|
||||
}
|
||||
|
||||
var body *types.Body
|
||||
if body, err = cfg.blockReader.BodyWithTransactions(ctx, tx, blockHash, blockNumber); err != nil {
|
||||
return err
|
||||
@ -222,7 +231,13 @@ Loop:
|
||||
}
|
||||
break Loop
|
||||
}
|
||||
case jobs <- &senderRecoveryJob{body: body, key: k, blockNumber: blockNumber, blockHash: blockHash, index: int(blockNumber - s.BlockNumber - 1)}:
|
||||
case jobs <- &senderRecoveryJob{
|
||||
body: body,
|
||||
key: k,
|
||||
blockNumber: blockNumber,
|
||||
blockTime: header.Time,
|
||||
blockHash: blockHash,
|
||||
index: int(blockNumber - s.BlockNumber - 1)}:
|
||||
}
|
||||
}
|
||||
|
||||
@ -284,6 +299,7 @@ type senderRecoveryJob struct {
|
||||
senders []byte
|
||||
blockHash libcommon.Hash
|
||||
blockNumber uint64
|
||||
blockTime uint64
|
||||
index int
|
||||
err error
|
||||
}
|
||||
@ -307,8 +323,7 @@ func recoverSenders(ctx context.Context, logPrefix string, cryptoContext *secp25
|
||||
}
|
||||
|
||||
body := job.body
|
||||
blockTime := uint64(0) // TODO(yperbasis) proper timestamp
|
||||
signer := types.MakeSigner(config, job.blockNumber, blockTime)
|
||||
signer := types.MakeSigner(config, job.blockNumber, job.blockTime)
|
||||
job.senders = make([]byte, len(body.Transactions)*length.Addr)
|
||||
for i, tx := range body.Transactions {
|
||||
from, err := signer.SenderWithContext(cryptoContext, tx)
|
||||
|
Loading…
Reference in New Issue
Block a user