Skip to content
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

feat: add RIP-7560 related APIs #5

Merged
merged 8 commits into from
Nov 7, 2024
Merged

Conversation

kangsorang
Copy link
Collaborator

Description

Add RIP-7560 related APIs

  • EstimateRip7560TransactionGas

  • CallRip7560Validation

- EstimateRip7560TransactionGas
- CallRip7560Validation
@kangsorang kangsorang marked this pull request as draft October 24, 2024 08:58
@kangsorang kangsorang marked this pull request as ready for review October 30, 2024 06:15
Comment on lines +66 to +74
// TODO(sm-stack): Configure RIP-7560 enabled devnet option
//header, err := headerByNumberOrHash(ctx, s.b, *blockNrOrHash)
//if err != nil {
// return nil, err
//}

//if s.b.ChainConfig().IsRIP7560(header.Number) {
// return nil, fmt.Errorf("cannot call RIP-7560 validation on pre-rip7560 block %v", header.Number)
//}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not for local devnets, but we can now uncomment this for Pioneer Alpha, right?

if err != nil {
return 0, err
}
gasLimit := totalGasLimit - st.PostOpGas

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it won't affect the result, but shouldn't it be like this?

Suggested change
gasLimit := totalGasLimit - st.PostOpGas
gasLimit := totalGasLimit - st.Gas - st.PostOpGas

@@ -352,7 +352,13 @@ func ApplyRip7560ValidationPhases(
header *types.Header,
tx *types.Transaction,
cfg vm.Config,
estimateFlag ...bool,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure, but how do you think about making the name of this flag allowSigFail, as in at abiDecodeAcceptAccount?

@@ -537,9 +582,9 @@ func (args *TransactionArgs) ToTransaction() *types.Transaction {
Sender: args.Sender,
AuthorizationData: *args.AuthorizationData,
Paymaster: args.Paymaster,
PaymasterData: *args.PaymasterData,
PaymasterData: toByte(args.PaymasterData),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just curious, what was the intention of this?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code to prevent nil pointer reference from occurring

@kangsorang kangsorang merged commit 5f71849 into apply-rollupcost Nov 7, 2024
kangsorang added a commit that referenced this pull request Nov 7, 2024
* feat: add RIP-7560 related API
- EstimateRip7560TransactionGas
- CallRip7560Validation

* fix: nil case handling for RIP-7560 transaction field

* feat: set allowSigFail operation based on estimation condition

* feat: set 7560-related default fields in transaction_args

* feat: modify response format of estimate 7560 transaction

* feat: setting defaults for nil case in ValidationGas

* feat: adjust PR review

* chore: change Rip7560PullUrl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants