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

core: add new sponsored transaction type #372

Merged
merged 3 commits into from
Nov 14, 2023

Conversation

minh-bq
Copy link
Collaborator

@minh-bq minh-bq commented Oct 26, 2023

No description provided.

@minh-bq minh-bq force-pushed the feat/sponsored-tx branch 18 times, most recently from 430b5de to 6b4b7e2 Compare November 1, 2023 04:23
@minh-bq minh-bq marked this pull request as ready for review November 1, 2023 04:29
@minh-bq minh-bq force-pushed the feat/sponsored-tx branch 3 times, most recently from 77cd6a4 to 0c3665c Compare November 1, 2023 09:31
@minh-bq
Copy link
Collaborator Author

minh-bq commented Nov 1, 2023

Some txpool benchmark results:

  • All legacy tx benchmarks show no significant differences after the PR
  • Txpool insert benchmarks: the result is x2 latency in sponsored tx which is expected because most of the time in insert benchmark is spent to recover the address from signature and the sponsored tx has 2 signatures while legacy tx has only 1
BenchmarkPoolBatchInsert100-8                        195           6770191 ns/op
BenchmarkPoolBatchInsert1000-8                        18          59692743 ns/op
BenchmarkPoolBatchInsert10000-8                        2         885204212 ns/op

BenchmarkPoolBatchInsertSponsoredTx100-8              93          11686666 ns/op
BenchmarkPoolBatchInsertSponsoredTx1000-8             10         110871408 ns/op
BenchmarkPoolBatchInsertSponsoredTx10000-8             1        1148534316 ns/op
  • Txpool demotion benchmark
BenchmarkPendingDemotion100-8              60116             18177 ns/op
BenchmarkPendingDemotion1000-8              6210            178894 ns/op
BenchmarkPendingDemotion10000-8              217           4976774 ns/op

BenchmarkPendingSponsoredTxDemotion100-8           36813             30138 ns/op
BenchmarkPendingSponsoredTxDemotion1000-8           3608            360668 ns/op
BenchmarkPendingSponsoredTxDemotion10000-8           136           8353408 ns/op

@minh-bq minh-bq force-pushed the feat/sponsored-tx branch 6 times, most recently from 97b662f to b005fa4 Compare November 2, 2023 08:17
This commit adds new sponsored transaction type 0x64 (100) following EIP-2718:
Typed Transaction Envelope. The new transaction type is the same as legacy with
additional expiredTime and payer's signature field.
This commit adjust the gas check to correctly check gas fee from payer of
transaction and value from sender in txpool and in preCheck before applying
transaction.

This commit also enables EIP-2718 to support typed transaction envelop in txpool
after Miko hardfork without enabling Berlin hardfork.
@minh-bq minh-bq requested review from DNK90 and andicrypt November 7, 2023 11:23
@minh-bq minh-bq merged commit fb55b67 into axieinfinity:master Nov 14, 2023
1 check passed
@minh-bq minh-bq deleted the feat/sponsored-tx branch November 14, 2023 04:28
minh-bq added a commit to minh-bq/ronin that referenced this pull request Feb 20, 2024
* params: add Miko hardfork to enable sponsored transactions

* core/types: add new sponsored transaction types

This commit adds new sponsored transaction type 0x64 (100) following EIP-2718:
Typed Transaction Envelope. The new transaction type is the same as legacy with
additional expiredTime and payer's signature field.

* core/state, txpool: handle new sponsored transaction, adjust gas check

This commit adjust the gas check to correctly check gas fee from payer of
transaction and value from sender in txpool and in preCheck before applying
transaction.

This commit also enables EIP-2718 to support typed transaction envelop in txpool
after Miko hardfork without enabling Berlin hardfork.
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