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

kaiax/builder: Introduce TxOrGen #289

Merged
merged 9 commits into from
Mar 21, 2025

Conversation

ian0371
Copy link
Collaborator

@ian0371 ian0371 commented Mar 18, 2025

Proposed changes

  • Now gasless module initializes TxGenerator hash with ApproveTx.Hash || SwapTx.Hash. Previously, hash was initialized at incorporate lazily, which resulted in TxGenerators having incorrect hashes. TxGenerator's type is reverted back to function.
  • Introduce TxOrGen; it replaces []interfaces{} array from builder. txOrGen can be evaluated to tx by GetTx(nonce).
  • Change Has(hash common.Hash) -> Has(txOrGen *TxOrGen). To find by hash, FindIdx(id common.Hash) can be used.
  • Lambda functions are introduced in worker, such as markAllTxUnexecutable.
  • Fix tests/kaia_test_account_map_test.go so txOrGen is evaluated to tx in the correct order.

Types of changes

  • Bugfix
  • New feature or enhancement
  • Others

Checklist

  • I have read the CONTRIBUTING GUIDELINES doc
  • I have read the CLA and signed by comment I have read the CLA Document and I hereby sign the CLA in first time contribute
  • Lint and unit tests pass locally with my changes ($ make test)
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)
  • Any dependent changes have been merged and published in downstream modules

@ian0371 ian0371 self-assigned this Mar 18, 2025
@ian0371 ian0371 marked this pull request as ready for review March 18, 2025 10:06
@ian0371 ian0371 merged commit d6fd9e5 into kaiachain:feat/gasless Mar 21, 2025
9 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Mar 21, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants