mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2025-01-03 17:44:29 +00:00
Use default crypto context - because creation of new one failing in Docker on linux host (#118)
This commit is contained in:
parent
0efa6d9a86
commit
12e69ab781
@ -40,7 +40,6 @@ type TxParsseConfig struct {
|
|||||||
// TxParseContext is object that is required to parse transactions and turn transaction payload into TxSlot objects
|
// TxParseContext is object that is required to parse transactions and turn transaction payload into TxSlot objects
|
||||||
// usage of TxContext helps avoid extra memory allocations
|
// usage of TxContext helps avoid extra memory allocations
|
||||||
type TxParseContext struct {
|
type TxParseContext struct {
|
||||||
recCtx *secp256k1.Context // Context for sender recovery
|
|
||||||
keccak1 hash.Hash
|
keccak1 hash.Hash
|
||||||
keccak2 hash.Hash
|
keccak2 hash.Hash
|
||||||
chainId, r, s, v uint256.Int // Signature values
|
chainId, r, s, v uint256.Int // Signature values
|
||||||
@ -63,7 +62,6 @@ func NewTxParseContext(chainID uint256.Int) *TxParseContext {
|
|||||||
withSender: true,
|
withSender: true,
|
||||||
keccak1: sha3.NewLegacyKeccak256(),
|
keccak1: sha3.NewLegacyKeccak256(),
|
||||||
keccak2: sha3.NewLegacyKeccak256(),
|
keccak2: sha3.NewLegacyKeccak256(),
|
||||||
recCtx: secp256k1.NewContext(),
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// behave as of London enabled
|
// behave as of London enabled
|
||||||
@ -413,7 +411,7 @@ func (ctx *TxParseContext) ParseTransaction(payload []byte, pos int, slot *TxSlo
|
|||||||
binary.BigEndian.PutUint64(ctx.sig[56:64], ctx.s[0])
|
binary.BigEndian.PutUint64(ctx.sig[56:64], ctx.s[0])
|
||||||
ctx.sig[64] = vByte
|
ctx.sig[64] = vByte
|
||||||
// recover sender
|
// recover sender
|
||||||
if _, err = secp256k1.RecoverPubkeyWithContext(ctx.recCtx, ctx.sighash[:], ctx.sig[:], ctx.buf[:0]); err != nil {
|
if _, err = secp256k1.RecoverPubkeyWithContext(secp256k1.DefaultContext, ctx.sighash[:], ctx.sig[:], ctx.buf[:0]); err != nil {
|
||||||
return 0, fmt.Errorf("%s: recovering sender from signature: %w", ParseTransactionErrorPrefix, err)
|
return 0, fmt.Errorf("%s: recovering sender from signature: %w", ParseTransactionErrorPrefix, err)
|
||||||
}
|
}
|
||||||
//apply keccak to the public key
|
//apply keccak to the public key
|
||||||
|
Loading…
Reference in New Issue
Block a user