-
Notifications
You must be signed in to change notification settings - Fork 6
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
R4R: metatx add from field into MetaTxSignData, so that to sign hash with from's addr #37
Conversation
It's a hard fork modification. Before and after the modification, meta transaction are decoded into different data struct.
|
Please fix failed unit tests in |
core/state_transition.go
Outdated
func TransactionToMessage(tx *types.Transaction, s types.Signer, baseFee *big.Int) (*Message, error) { | ||
metaTxParams, err := types.DecodeAndVerifyMetaTxParams(tx) | ||
func TransactionToMessage(tx *types.Transaction, s types.Signer, baseFee *big.Int, isMetaTxUpgraded bool) (*Message, error) { | ||
metaTxParams, err := types.DecodeAndVerifyMetaTxParams(tx, isMetaTxUpgraded) |
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.
Adding parameter isMetaTxUpgraded bool
to TransactionToMessage
affect so many codes. However, isMetaTxUpgraded
is just for fixing a bug in metaTx. If we need new upgrade config in TransactionToMessage
, more parameters are required.
So I suggest to add a more general parameter here, like chainConfig
. Thus, in the future, if we need more upgrade here, it is not necessary to add more parameters here.
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.
Yes we can add a configuration for easier access to the base values in case of future code changes. However, we still need to pass the corresponding real values and compare them with the configuration values. What if we change the parameter to TransactionToMessage(xxx, config params.ChainConfig, isMetaTxUpgraded bool, inters ...interface{})
?
eb393ed
to
f6e5382
Compare
26284cb
to
86ac3fd
Compare
params/config.go
Outdated
@@ -138,6 +138,7 @@ var ( | |||
MergeNetsplitBlock: big.NewInt(1735371), | |||
ShanghaiTime: newUint64(1677557088), | |||
Ethash: new(EthashConfig), | |||
MetaTxUpgradeTime: newUint64(0), // newUint64(1707152400), |
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.
please delete this config, it's useless.
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.
done
params/config.go
Outdated
@@ -682,6 +686,11 @@ func (c *ChainConfig) IsMantleBVMETHMintUpgrade(time uint64) bool { | |||
return isTimestampForked(c.BVMETHMintUpgradeTime, time) | |||
} | |||
|
|||
// IsMetaTxV2 returns whether time is either equal to the MetaTx fork time or greater. | |||
func (c *ChainConfig) IsMetaTxV2(time uint64) bool { | |||
return isMetaTxForked(c.MetaTxUpgradeTime, time) |
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.
please use isTimestampForked
instead of isMetaTxForked
and delete isMetaTxForked
76c2285
to
c4c8321
Compare
…GasPrice and BlobGasPrice
c4c8321
to
8824dc5
Compare
[R4R]-feat: merge from release/v0.5.0 to develop Core changes: - [R4R]feat: mint eth to msg.from and transfer revertable #31 - [R4R]feat: metatx add from field into MetaTxSignData, so that to sign hash with from's addr #37 - [R4R]feat: add error message when failing to forward tx to sequencer #39 - [R4R]fix: fix tx cost #41
No description provided.