feat: Support more transaction types#709
Conversation
8506003 to
473a1dc
Compare
e08b0ca to
0f82ba7
Compare
|
|
||
| func Signer(chainID *big.Int) types.Signer { | ||
| return types.NewEIP155Signer(chainID) | ||
| return types.NewPragueSigner(chainID) |
There was a problem hiding this comment.
What is the consequence of changing this? Can it affect tracing old transactions?
There was a problem hiding this comment.
It supports old transactions here is the snippet from https://github.com/ethereum/go-ethereum/blob/ca6e2d141b14e67d2ba826c6213e9e413148b6ec/core/types/transaction_signing.go#L279
// NewPragueSigner returns a signer that accepts
// - EIP-7702 set code transactions
// - EIP-4844 blob transactions
// - EIP-1559 dynamic fee transactions
// - EIP-2930 access list transactions,
// - EIP-155 replay protected transactions, and
// - legacy Homestead transactions.
func NewPragueSigner(chainId *big.Int) Signer {
return newModernSigner(chainId, forks.Prague)
}
And in func newModernSigner(chainID *big.Int, fork forks.Fork) Signer
it set up the legacy signer as we are doing right now
// configure legacy signer
switch {
case fork >= forks.SpuriousDragon:
s.legacy = NewEIP155Signer(chainID)
So it will use EIP155 signer for legacy tx, and other signers in the corresponding scenarios
I have change the signer of a test to get the prague signer, and it works well
| S *hexutil.Big `json:"s"` | ||
|
|
||
| // Typed-transaction metadata (EIP-2718) | ||
| Type hexutil.Uint64 `json:"type"` // 0x0,0x1,0x2,0x3 |
There was a problem hiding this comment.
Again, will this change affect tracing old transactions?
There was a problem hiding this comment.
I have added test TestSystemLegacyTxChainIDOmittedStillTraceable and TestTraceLegacyTxInMixedLegacyAndTypedBlock
| receipt := env.mustSendTransactionAndWait(types.MustSignNewTx( | ||
| creator, | ||
| types.NewEIP155Signer(big.NewInt(int64(env.ChainID))), | ||
| env.Signer(), |
There was a problem hiding this comment.
Here is the change to test how the prague signer works for LegacyTx
ca1badd to
67fb2bd
Compare
f62eed6 to
ce6324a
Compare
0d5eba0 to
52eec88
Compare
7c01039 to
b5e9f5e
Compare
No description provided.