-
Notifications
You must be signed in to change notification settings - Fork 6
feat: Support more transaction types #709
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
base: develop
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the consequence of changing this? Can it affect tracing old transactions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again, will this change affect tracing old transactions?
receipt := env.mustSendTransactionAndWait(types.MustSignNewTx( | ||
creator, | ||
types.NewEIP155Signer(big.NewInt(int64(env.ChainID))), | ||
env.Signer(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here is the change to test how the prague signer works for LegacyTx
ca1badd
to
67fb2bd
Compare
f62eed6
to
ce6324a
Compare
No description provided.