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 maxPriorityFeePerGas and maxFeePerGas #1198

Merged

Conversation

roninjin10
Copy link
Collaborator

@roninjin10 roninjin10 commented Jun 13, 2024

Description

Concise description of proposed changes

Testing

Explain the quality checks that have been done on the code changes

Additional Information

Your ENS/address:

Summary by CodeRabbit

  • New Features

    • Added support for setting maxFeePerGas and maxPriorityFeePerGas for EIP-1559 transactions across various modules.
  • Documentation

    • Updated documentation to reflect new fields maxFeePerGas and maxPriorityFeePerGas.
    • Added documentation for new error classes InvalidMaxFeePerGasError and InvalidMaxPriorityFeePerGasError.
  • Bug Fixes

    • Improved error handling for gas price validations.
  • Tests

    • Added tests to validate the new parameters maxFeePerGas and maxPriorityFeePerGas.

Copy link

vercel bot commented Jun 13, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
tevm-monorepo-tevm 🛑 Canceled (Inspect) Jun 13, 2024 9:11pm

@roninjin10 roninjin10 mentioned this pull request Jun 13, 2024
1 task
Copy link
Contributor

coderabbitai bot commented Jun 13, 2024

Warning

Rate limit exceeded

@roninjin10 has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 50 minutes and 23 seconds before requesting another review.

How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

Commits

Files that changed from the base of the PR and between 77c7a73 and 366a900.

Walkthrough

The code update introduces support for maxFeePerGas and maxPriorityFeePerGas within the @tevm module series, enhancing EIP-1559 transactions. The changes span module functions, documentation, error handling, and parameter validation to incorporate these new fee parameters. This enhancement allows for more granular fee adjustments and transaction optimization.

Changes

File Group/Path Change Summary
Modules
packages/actions/.../BaseCallParams.ts, zBaseCallParams.js Added maxFeePerGas and maxPriorityFeePerGas parameters for EIP-1559 transactions
packages/actions/.../validateBaseCallParams.js Added validation for maxFeePerGas and maxPriorityFeePerGas
packages/actions/.../callHandler.js, createTransaction.js Refactored to handle maxFeePerGas and maxPriorityFeePerGas in transaction creation and validation
packages/actions/src/internal/evmInputToImpersonatedTx.js Enhanced function to accept and process maxFeePerGas and maxPriorityFeePerGas
Tests
packages/actions/.../validateBaseCallParams.spec.ts, zBaseCallParams.spec.ts Added tests for maxFeePerGas and maxPriorityFeePerGas parameters
Errors
packages/errors/.../InvalidMaxFeePerGasError.md, ...PriorityFeePerGasError.md` Introduced error classes for invalid maxFeePerGas and maxPriorityFeePerGas
Documentation
packages/actions/docs/.../BaseCallParams.md, .../validateBaseCallParams.md` Updated documentation to reflect new fee parameters and improved error handling

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant TEVM_Module
    participant Transaction_Handler
    participant Validator

    User->>+TEVM_Module: Initiates transaction with maxFeePerGas and maxPriorityFeePerGas
    TEVM_Module->>+Transaction_Handler: Passes fee parameters to createTransaction
    Transaction_Handler->>+Validator: Validates maxFeePerGas and maxPriorityFeePerGas
    Validator-->>-Transaction_Handler: Validation Result
    Transaction_Handler-->>-TEVM_Module: Transaction Created/Rejected
    TEVM_Module-->>-User: Transaction Response
Loading

Poem

Amidst the code where structures weave,
We now enhance the fees that grieve.
Max fee per gas, a charge so wise,
Priority fee makes transactions rise.
EIP-1559, we heed the call,
Precision in transactions, best of all.
🌟✨ Code now glows with a brilliant sheen,
For every rabbit, a digital dream! 🐰💻


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Collaborator Author

roninjin10 commented Jun 13, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @roninjin10 and the rest of your teammates on Graphite Graphite

@roninjin10 roninjin10 force-pushed the 06-13-_sparkles_feat_add_maxpriorityfeepergas_and_maxfeepergas branch from 04ac982 to 72a2cff Compare June 13, 2024 19:21
Copy link

changeset-bot bot commented Jun 13, 2024

🦋 Changeset detected

Latest commit: 366a900

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 18 packages
Name Type
@tevm/actions Minor
@tevm/tx Minor
@tevm/vm Minor
@tevm/viem Minor
@tevm/decorators Minor
@tevm/procedures Minor
@tevm/server Minor
tevm Minor
@tevm/base-client Minor
@tevm/block Minor
@tevm/receipt-manager Minor
@tevm/txpool Minor
@tevm/ethers Minor
@tevm/memory-client Minor
@tevm/blockchain Minor
@tevm/http-client Minor
@tevm/precompiles Minor
@tevm/evm Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Base automatically changed from 06-13-_bug_fix_validate_params_bugs to main June 13, 2024 19:26
@roninjin10 roninjin10 force-pushed the 06-13-_sparkles_feat_add_maxpriorityfeepergas_and_maxfeepergas branch from 72a2cff to 5a81864 Compare June 13, 2024 19:28
@roninjin10 roninjin10 marked this pull request as ready for review June 13, 2024 19:29
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

Outside diff range and nitpick comments (3)
packages/actions/src/internal/evmInputToImpersonatedTx.js (1)

10-11: Ensure proper documentation for the new parameters maxFeePerGas and maxPriorityFeePerGas.

Consider adding more detailed descriptions for these parameters to help developers understand their usage better.

packages/actions/src/BaseCall/BaseCallParams.ts (1)

71-72: Explain the future fix for the gasPrice option in more detail.

While the note about gasPrice being ignored in the context of EIP-1559 transactions is clear, it would be beneficial to provide more specifics on the planned future fix.

packages/actions/src/Call/callHandler.js (1)

Line range hint 313-329: Re-run the transaction with adjusted parameters upon specific errors.

Consider simplifying this error handling block to enhance maintainability. Multiple nested conditions and error-specific logic can be refactored into a more modular approach.

- if (e.message.includes('block has a different hardfork than the vm') ||
-     e.message.includes("the tx doesn't have the correct nonce.") ||
-     e.message.includes("sender doesn't have enough funds to send tx.") ||
-     e.message.includes("sender doesn't have enough funds to send tx. The upfront cost is")) {
+ const specificErrors = [
+     'block has a different hardfork than the vm',
+     "the tx doesn't have the correct nonce.",
+     "sender doesn't have enough funds to send tx.",
+     "sender doesn't have enough funds to send tx. The upfront cost is"
+ ];
+ if (specificErrors.some(error => e.message.includes(error))) {

This change groups similar error checks into a single condition, making the code cleaner and easier to understand.

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between fbf5192 and 77c7a73.

Files ignored due to path filters (3)
  • bundler-packages/resolutions/src/__snapshots__/moduleFactory.spec.ts.snap is excluded by !**/*.snap
  • packages/actions/src/BaseCall/__snapshots__/validateBaseCallParams.spec.ts.snap is excluded by !**/*.snap
  • packages/actions/src/Call/__snapshots__/callHandler.spec.ts.snap is excluded by !**/*.snap
Files selected for processing (18)
  • .changeset/big-horses-end.md (1 hunks)
  • .changeset/long-islands-behave.md (1 hunks)
  • packages/actions/docs/functions/validateBaseCallParams.md (1 hunks)
  • packages/actions/docs/type-aliases/BaseCallParams.md (2 hunks)
  • packages/actions/src/BaseCall/BaseCallParams.ts (1 hunks)
  • packages/actions/src/BaseCall/validateBaseCallParams.js (2 hunks)
  • packages/actions/src/BaseCall/validateBaseCallParams.spec.ts (5 hunks)
  • packages/actions/src/BaseCall/zBaseCallParams.js (1 hunks)
  • packages/actions/src/BaseCall/zBaseCallParams.spec.ts (1 hunks)
  • packages/actions/src/Call/callHandler.js (6 hunks)
  • packages/actions/src/Call/callHandler.spec.ts (4 hunks)
  • packages/actions/src/CreateTransaction/createTransaction.js (2 hunks)
  • packages/actions/src/SetAccount/setAccountHandler.js (1 hunks)
  • packages/actions/src/internal/evmInputToImpersonatedTx.js (3 hunks)
  • packages/errors/src/index.ts (2 hunks)
  • packages/errors/src/input/InvalidMaxFeePerGaserror.js (1 hunks)
  • packages/errors/src/input/InvalidMaxPriorityFeePerGas.js (1 hunks)
  • packages/errors/src/input/index.ts (1 hunks)
Files not reviewed due to errors (1)
  • packages/actions/src/Call/callHandler.spec.ts (no review received)
Files skipped from review due to trivial changes (1)
  • .changeset/long-islands-behave.md
Additional context used
LanguageTool
packages/actions/docs/functions/validateBaseCallParams.md

[uncategorized] ~13-~13: Possible missing comma found. (AI_HYDRA_LEO_MISSING_COMMA)
Context: ...lidateBaseCallParamsError`[] can break on a minor release Validates that the para...

packages/actions/docs/type-aliases/BaseCallParams.md

[uncategorized] ~31-~31: A comma might be missing here. (AI_EN_LECTOR_MISSING_PUNCTUATION_COMMA)
Context: ...the context of that blocks state. To do that fork that block number first. #### Exa...


[style] ~90-~90: Consider shortening this phrase to just ‘whether’, unless you mean ‘regardless of whether’. (WHETHER)
Context: ...| "always" | "never" | boolean Whether or not to update the state or run call in a dr...


[style] ~96-~96: The adverb ‘Always’ is usually put between ‘will’ and ‘still’. (ADVERB_WORD_ORDER)
Context: ...n-success-false: alias for never` Always will still not include the transaction if it's not...


[uncategorized] ~98-~98: Possible missing comma found. (AI_HYDRA_LEO_MISSING_COMMA)
Context: ...if it's not valid to be included in the chain such as the gas limit being too low. If...


[grammar] ~99-~99: The usual collocation for “returned” is “to”, not “in”. (RETURN_IN_THE)
Context: ... a tx is submitted the txHash will be returned in the response. The tx will not be includ...


[uncategorized] ~113-~113: If this is a compound adjective that modifies the following noun, use a hyphen. (EN_COMPOUND_ADJECTIVE_INTERNAL)
Context: ...tional readonly**depth**:number` Low level control over the EVM call depth. Useful...


[uncategorized] ~123-~123: A comma may be missing after the conjunctive/linking adverb ‘Otherwise’. (SENT_START_CONJUNCTIVE_LINKING_ADVERB_COMMA)
Context: ...dresses seperately using those options. Otherwise both are set to the from address ###...


[uncategorized] ~143-~143: If this is a compound adjective that modifies the following noun, use a hyphen. (EN_COMPOUND_ADJECTIVE_INTERNAL)
Context: ...al readonly**gasRefund**:bigint Low level control Refund counter. Defaults to0`...


[style] ~152-~152: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym. (ENGLISH_WORD_REPEAT_BEGINNING_RULE)
Context: ... that can be spent on gas for the call. This is the maximum amount of ether that can...


[typographical] ~166-~166: The word “otherwise” is an adverb that can’t be used like a conjunction, and therefore needs to be separated from the sentence. (THUS_SENTENCE)
Context: ...ess. This defaults to from address if set otherwise it defaults to the zero address ### se...


[uncategorized] ~166-~166: A period might be missing here. (AI_EN_LECTOR_MISSING_PUNCTUATION_PERIOD)
Context: ...f set otherwise it defaults to the zero address ### selfdestruct? > optional `reado...


[style] ~186-~186: ‘prior to’ might be wordy. Consider a shorter alternative. (EN_WORDINESS_PREMIUM_PRIOR_TO)
Context: ...some state to be ephemerally overridden prior to executing the call. Each address maps t...


[grammar] ~191-~191: One modal verb seems to be obsolete here. Consider rephrasing this sentence. (DO_XX_MD_VB)
Context: ...e that simply returns internal state or does pre-defined validations can be kept off chain and fed to the node o...


[uncategorized] ~217-~217: This verb may not be in the correct form. Consider using a different form for this context. (AI_EN_LECTOR_REPLACEMENT_VERB_FORM)
Context: ... to the zero address. To is not set for create transactions but required for most tran...

Markdownlint
packages/actions/docs/type-aliases/BaseCallParams.md

12-12: null (MD032, blanks-around-lists)
Lists should be surrounded by blank lines


92-92: null (MD032, blanks-around-lists)
Lists should be surrounded by blank lines

Additional comments not posted (19)
.changeset/big-horses-end.md (1)

1-7: The changeset accurately describes the modifications related to maxFeePerGas and maxPriorityFeePerGas. The versioning as 'minor' is appropriate given the feature addition.

packages/actions/src/BaseCall/zBaseCallParams.spec.ts (1)

14-15: The test cases for maxFeePerGas and maxPriorityFeePerGas are correctly implemented and ensure the schema handles these new parameters appropriately.

packages/actions/docs/functions/validateBaseCallParams.md (1)

26-26: The documentation link is correctly updated to reflect the source code line change. The static analysis hint about a missing comma is a false positive as this is part of a markdown document, not a syntax-sensitive codebase.

packages/actions/src/internal/evmInputToImpersonatedTx.js (1)

28-31: Review the logic for setting _maxFeePerGas.

Verification successful

The logic for setting _maxFeePerGas appears to be correctly implemented, as it falls back to baseFeePerGas when _maxFeePerGas is less than baseFeePerGas.

  • Location: packages/actions/src/internal/evmInputToImpersonatedTx.js
Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Ensure that the fallback logic for `_maxFeePerGas` is correctly setting the value based on `baseFeePerGas`.

# Test: Search for the usage of `_maxFeePerGas` and `baseFeePerGas`. Expect: Correct fallback logic implementation.
rg --type javascript $'_maxFeePerGas = baseFeePerGas'

Length of output: 89



Script:

#!/bin/bash
# Description: Ensure that the fallback logic for `_maxFeePerGas` is correctly setting the value based on `baseFeePerGas`.

# Test: Search for the usage of `_maxFeePerGas` and `baseFeePerGas`. Expect: Correct fallback logic implementation.
rg '_maxFeePerGas = baseFeePerGas' --glob '*.js'

Length of output: 141

packages/errors/src/input/InvalidMaxFeePerGaserror.js (1)

1-59: Validate the implementation of InvalidMaxFeePerGasError.

The structure and implementation of the error class appear correct and align with the existing patterns for error handling in the codebase.

packages/errors/src/input/InvalidMaxPriorityFeePerGas.js (1)

1-59: Validate the implementation of InvalidMaxPriorityFeePerGasError.

The structure and implementation of this error class are consistent with the project's standards and effectively handle errors related to maxPriorityFeePerGas.

packages/actions/src/BaseCall/zBaseCallParams.js (1)

52-61: Review the addition of maxFeePerGas and maxPriorityFeePerGas to the Zod schema.

The schema extensions for maxFeePerGas and maxPriorityFeePerGas are well-defined and align with the goals of supporting EIP-1559 transactions.

packages/actions/src/BaseCall/validateBaseCallParams.js (2)

16-18: Properly imported new error types for handling maxPriorityFeePerGas and maxFeePerGas.


134-144: Excellent addition of validation logic for maxFeePerGas and maxPriorityFeePerGas. Ensure the error messages are clear and informative for better user experience.

packages/errors/src/index.ts (2)

24-25: Successfully exported new error types related to transaction fees. This will facilitate better error handling in transaction processes.


48-49: Types for the new error parameters are correctly defined and exported, ensuring type safety and clarity in error handling.

packages/actions/src/CreateTransaction/createTransaction.js (1)

21-22: Added parameters maxFeePerGas and maxPriorityFeePerGas to the function signature. Ensure that all upstream calls to this function are updated to pass these new parameters.

Verification successful

The function call to createTransaction in callHandler.js correctly includes the new parameters maxFeePerGas and maxPriorityFeePerGas.

  • packages/actions/src/Call/callHandler.js:
    • Line: const txRes = await createTransaction(client)({
Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify all function calls to `createTransaction` match the new signature.

# Test: Search for the function usage. Expect: Only occurances of the new signature.
rg --type javascript $'createTransaction'

Length of output: 75



Script:

#!/bin/bash
# Description: Verify all function calls to `createTransaction` match the new signature.

# Test: Search for the function usage. Expect: Only occurrences of the new signature.
rg --type js $'createTransaction'

Length of output: 4272



Script:

#!/bin/bash
# Description: Verify all function calls to `createTransaction` match the new signature with parameters `maxFeePerGas` and `maxPriorityFeePerGas`.

# Test: Search for function calls and check for correct parameters.
rg --type js $'createTransaction('

Length of output: 122



Script:

#!/bin/bash
# Description: Verify all function calls to `createTransaction` match the new signature with parameters `maxFeePerGas` and `maxPriorityFeePerGas`.

# Test: Search for function calls and check for correct parameters.
rg --type js 'createTransaction\('

Length of output: 128



Script:

#!/bin/bash
# Description: Extract lines around the function call to `createTransaction` to verify parameters.

# Test: Extract lines around the function call in `callHandler.js`.
rg --type js -A 5 -B 5 'createTransaction\(client\)({' packages/actions/src/Call/callHandler.js

Length of output: 230



Script:

#!/bin/bash
# Description: Extract lines around the function call to `createTransaction` to verify parameters.

# Test: Extract lines around the function call in `callHandler.js`.
rg --type js -A 5 -B 5 'createTransaction\(client\)\({' packages/actions/src/Call/callHandler.js

Length of output: 222



Script:

#!/bin/bash
# Description: Extract lines around the function call to `createTransaction` to verify parameters.

# Test: Extract lines around the function call in `callHandler.js`.
rg --type js -A 5 -B 5 'createTransaction\(client\)' packages/actions/src/Call/callHandler.js

Length of output: 455

packages/actions/src/BaseCall/validateBaseCallParams.spec.ts (4)

15-16: Correctly import new error types.

The import statements for InvalidMaxFeePerGasError and InvalidMaxPriorityFeePerGasError are correctly added to support the new validation logic.


103-103: Add tests for new parameters in valid scenarios.

The addition of maxFeePerGas and maxPriorityFeePerGas to the test cases for valid parameters is correctly implemented, ensuring that these new fields are tested under expected conditions.

Also applies to: 140-140


163-164: Add tests for new parameters in invalid scenarios.

The inclusion of test cases for invalid maxFeePerGas and maxPriorityFeePerGas values is crucial for ensuring robust parameter validation.


200-201: Ensure new errors are caught in tests.

The tests correctly check for instances of InvalidMaxFeePerGasError and InvalidMaxPriorityFeePerGasError, which is essential for robust error handling.

packages/actions/src/Call/callHandler.js (3)

Line range hint 209-222: Integrate the new EIP-1559 parameters maxFeePerGas and maxPriorityFeePerGas into transaction creation.

The addition of maxFeePerGas and maxPriorityFeePerGas parameters in the transaction creation process aligns with the EIP-1559 standards, allowing dynamic fee management. Ensure that all dependent functions correctly handle these new parameters.


230-230: Handle low gas price error effectively.

The addition of error handling for scenarios where the gas price is too low is crucial for maintaining transaction integrity and preventing transactions from being stuck due to insufficient gas fees.


446-452: Ensure transaction creation respects the new EIP-1559 parameters.

Properly passing maxPriorityFeePerGas and maxFeePerGas to the createTransaction function ensures that these parameters are respected during transaction creation, aligning with the EIP-1559 features.

Comment on lines +23 to +24
export * from './InvalidMaxFeePerGaserror.js'
export * from './InvalidMaxPriorityFeePerGas.js'
Copy link
Contributor

Choose a reason for hiding this comment

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

The export statements for InvalidMaxFeePerGasError and InvalidMaxPriorityFeePerGasError are correctly added. However, there's a typographical error in the file name InvalidMaxFeePerGaserror.js. It should be InvalidMaxFeePerGasError.js to maintain consistency and case sensitivity.

- export * from './InvalidMaxFeePerGaserror.js'
+ export * from './InvalidMaxFeePerGasError.js'
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
export * from './InvalidMaxFeePerGaserror.js'
export * from './InvalidMaxPriorityFeePerGas.js'
export * from './InvalidMaxFeePerGasError.js'
export * from './InvalidMaxPriorityFeePerGas.js'

Comment on lines +75 to +84
/**
* The maximum fee per gas for the EIP-1559 tx. This is the maximum amount of ether that can be spent on gas
* for the call. This is the maximum amount of ether that can be spent on gas for the call.
* This is the maximum amount of ether that can be spent on gas for the call.
*/
readonly maxFeePerGas?: bigint
/**
* The maximum priority fee per gas for the EIP-1559 tx.
*/
readonly maxPriorityFeePerGas?: bigint
Copy link
Contributor

Choose a reason for hiding this comment

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

Ensure consistency in the description of new parameters.

The descriptions for maxFeePerGas and maxPriorityFeePerGas are somewhat redundant. Consider simplifying to improve clarity and reduce repetition.

- The maximum fee per gas for the EIP-1559 tx. This is the maximum amount of ether that can be spent on gas for the call. This is the maximum amount of ether that can be spent on gas for the call. This is the maximum amount of ether that can be spent on gas for the call.
+ The maximum fee per gas for the EIP-1559 tx, representing the total amount of ether that can be spent on gas.
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
/**
* The maximum fee per gas for the EIP-1559 tx. This is the maximum amount of ether that can be spent on gas
* for the call. This is the maximum amount of ether that can be spent on gas for the call.
* This is the maximum amount of ether that can be spent on gas for the call.
*/
readonly maxFeePerGas?: bigint
/**
* The maximum priority fee per gas for the EIP-1559 tx.
*/
readonly maxPriorityFeePerGas?: bigint
/**
* The maximum fee per gas for the EIP-1559 tx, representing the total amount of ether that can be spent on gas.
*/
readonly maxFeePerGas?: bigint
/**
* The maximum priority fee per gas for the EIP-1559 tx.
*/
readonly maxPriorityFeePerGas?: bigint

Comment on lines +147 to +160
### maxFeePerGas?

> `optional` `readonly` **maxFeePerGas**: `bigint`

The maximum fee per gas for the EIP-1559 tx. This is the maximum amount of ether that can be spent on gas
for the call. This is the maximum amount of ether that can be spent on gas for the call.
This is the maximum amount of ether that can be spent on gas for the call.

### maxPriorityFeePerGas?

> `optional` `readonly` **maxPriorityFeePerGas**: `bigint`

The maximum priority fee per gas for the EIP-1559 tx.

Copy link
Contributor

Choose a reason for hiding this comment

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

Clarify documentation for new parameters.

The documentation for maxFeePerGas and maxPriorityFeePerGas is verbose and repetitive. Simplify the text to enhance readability and clarity.

- The maximum fee per gas for the EIP-1559 tx. This is the maximum amount of ether that can be spent on gas for the call. This is the maximum amount of ether that can be spent on gas for the call. This is the maximum amount of ether that can be spent on gas for the call.
+ The maximum fee per gas for the EIP-1559 tx, representing the total amount of ether that can be spent on gas.
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
### maxFeePerGas?
> `optional` `readonly` **maxFeePerGas**: `bigint`
The maximum fee per gas for the EIP-1559 tx. This is the maximum amount of ether that can be spent on gas
for the call. This is the maximum amount of ether that can be spent on gas for the call.
This is the maximum amount of ether that can be spent on gas for the call.
### maxPriorityFeePerGas?
> `optional` `readonly` **maxPriorityFeePerGas**: `bigint`
The maximum priority fee per gas for the EIP-1559 tx.
### maxFeePerGas?
> `optional` `readonly` **maxFeePerGas**: `bigint`
The maximum fee per gas for the EIP-1559 tx, representing the total amount of ether that can be spent on gas.
### maxPriorityFeePerGas?
> `optional` `readonly` **maxPriorityFeePerGas**: `bigint`
The maximum priority fee per gas for the EIP-1559 tx.
Tools
LanguageTool

[style] ~152-~152: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym. (ENGLISH_WORD_REPEAT_BEGINNING_RULE)
Context: ... that can be spent on gas for the call. This is the maximum amount of ether that can...

@roninjin10 roninjin10 force-pushed the 06-13-_sparkles_feat_add_maxpriorityfeepergas_and_maxfeepergas branch from 315af5f to 366a900 Compare June 13, 2024 20:48
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 9

Outside diff range and nitpick comments (14)
packages/errors/docs/classes/InvalidParamsError.md (2)

Line range hint 30-30: Remove duplicate headings to maintain document clarity.

- ## Param

Line range hint 285-285: Enclose the URL in angle brackets to prevent it from being interpreted as plain text.

- https://v8.dev/docs/stack-trace-api#customizing-stack-traces
+ <https://v8.dev/docs/stack-trace-api#customizing-stack-traces>
packages/errors/docs/classes/InvalidMaxPriorityFeePerGasError.md (3)

30-30: Consider consolidating the Param sections to avoid duplicate headings.

## Param
- A human-readable error message.
- Additional parameters for the InvalidMaxPriorityFeePerGasError.
Tools
Markdownlint

30-30: null (MD024, no-duplicate-heading)
Multiple headings with the same content


350-350: Check if the duplicate heading for captureStackTrace is necessary or if it can be combined into a single section.

### captureStackTrace(targetObject, constructorOpt)
> `static` **captureStackTrace**(`targetObject`, `constructorOpt`?): `void`
Create .stack property on a target object
##### Parameters**targetObject**: `object`**constructorOpt?**: `Function`
##### Returns
`void`
##### Inherited from
[`InvalidParamsError`](InvalidParamsError.md).[`captureStackTrace`](InvalidParamsError.md#capturestacktrace)
##### Source
node_modules/.pnpm/[email protected]/node_modules/bun-types/globals.d.ts:1613
Tools
Markdownlint

350-350: null (MD024, no-duplicate-heading)
Multiple headings with the same content


260-260: Please wrap the bare URL with angle brackets to adhere to Markdown best practices.

#### See
<https://v8.dev/docs/stack-trace-api#customizing-stack-traces>
Tools
Markdownlint

260-260: null (MD034, no-bare-urls)
Bare URL used

docs/src/content/docs/reference/@tevm/errors/classes/InvalidParamsError.md (3)

Line range hint 29-29: Consider consolidating the Param sections to avoid duplicate headings.

## Param
- A human-readable error message.
- Additional parameters for the BaseError.

Line range hint 374-374: Check if the duplicate heading for captureStackTrace is necessary or if it can be combined into a single section.

### captureStackTrace(targetObject, constructorOpt)
> `static` **captureStackTrace**(`targetObject`, `constructorOpt`?): `void`
Create .stack property on a target object
##### Parameters**targetObject**: `object`**constructorOpt?**: `Function`
##### Returns
`void`
##### Inherited from
[`BaseError`](/reference/tevm/errors/classes/baseerror/).[`captureStackTrace`](/reference/tevm/errors/classes/baseerror/#capturestacktrace)
##### Source
node_modules/.pnpm/[email protected]/node_modules/bun-types/globals.d.ts:1613

Line range hint 284-284: Please wrap the bare URL with angle brackets to adhere to Markdown best practices.

#### See
<https://v8.dev/docs/stack-trace-api#customizing-stack-traces>
docs/src/content/docs/reference/@tevm/errors/classes/InvalidMaxFeePerGasError.md (3)

29-29: Consider consolidating the Param sections to avoid duplicate headings.

## Param
- A human-readable error message.
- Additional parameters for the InvalidMaxFeePerGasError.
Tools
Markdownlint

29-29: null (MD024, no-duplicate-heading)
Multiple headings with the same content


349-349: Check if the duplicate heading for captureStackTrace is necessary or if it can be combined into a single section.

### captureStackTrace(targetObject, constructorOpt)
> `static` **captureStackTrace**(`targetObject`, `constructorOpt`?): `void`
Create .stack property on a target object
##### Parameters**targetObject**: `object`**constructorOpt?**: `Function`
##### Returns
`void`
##### Inherited from
[`InvalidParamsError`](/reference/tevm/errors/classes/invalidparamserror/).[`captureStackTrace`](/reference/tevm/errors/classes/invalidparamserror/#capturestacktrace)
##### Source
node_modules/.pnpm/[email protected]/node_modules/bun-types/globals.d.ts:1613
Tools
Markdownlint

349-349: null (MD024, no-duplicate-heading)
Multiple headings with the same content


259-259: Please wrap the bare URL with angle brackets to adhere to Markdown best practices.

#### See
<https://v8.dev/docs/stack-trace-api#customizing-stack-traces>
Tools
Markdownlint

259-259: null (MD034, no-bare-urls)
Bare URL used

docs/src/content/docs/reference/@tevm/errors/classes/InvalidMaxPriorityFeePerGasError.md (3)

29-29: Consider consolidating the Param sections to avoid duplicate headings.

## Param
- A human-readable error message.
- Additional parameters for the InvalidMaxPriorityFeePerGasError.
Tools
Markdownlint

29-29: null (MD024, no-duplicate-heading)
Multiple headings with the same content


349-349: Check if the duplicate heading for captureStackTrace is necessary or if it can be combined into a single section.

### captureStackTrace(targetObject, constructorOpt)
> `static` **captureStackTrace**(`targetObject`, `constructorOpt`?): `void`
Create .stack property on a target object
##### Parameters**targetObject**: `object`**constructorOpt?**: `Function`
##### Returns
`void`
##### Inherited from
[`InvalidParamsError`](/reference/tevm/errors/classes/invalidparamserror/).[`captureStackTrace`](/reference/tevm/errors/classes/invalidparamserror/#capturestacktrace)
##### Source
node_modules/.pnpm/[email protected]/node_modules/bun-types/globals.d.ts:1613
Tools
Markdownlint

349-349: null (MD024, no-duplicate-heading)
Multiple headings with the same content


259-259: Please wrap the bare URL with angle brackets to adhere to Markdown best practices.

#### See
<https://v8.dev/docs/stack-trace-api#customizing-stack-traces>
Tools
Markdownlint

259-259: null (MD034, no-bare-urls)
Bare URL used

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 77c7a73 and 315af5f.

Files ignored due to path filters (1)
  • bundler-packages/resolutions/src/__snapshots__/moduleFactory.spec.ts.snap is excluded by !**/*.snap
Files selected for processing (25)
  • docs/src/content/docs/reference/@tevm/actions/functions/validateBaseCallParams-1.md (1 hunks)
  • docs/src/content/docs/reference/@tevm/actions/functions/validateBaseCallParams.md (1 hunks)
  • docs/src/content/docs/reference/@tevm/actions/type-aliases/BaseCallParams-1.md (2 hunks)
  • docs/src/content/docs/reference/@tevm/actions/type-aliases/BaseCallParams.md (2 hunks)
  • docs/src/content/docs/reference/@tevm/errors/classes/InvalidMaxFeePerGasError.md (1 hunks)
  • docs/src/content/docs/reference/@tevm/errors/classes/InvalidMaxPriorityFeePerGasError.md (1 hunks)
  • docs/src/content/docs/reference/@tevm/errors/classes/InvalidParamsError.md (1 hunks)
  • docs/src/content/docs/reference/@tevm/errors/globals.md (2 hunks)
  • docs/src/content/docs/reference/@tevm/errors/interfaces/InvalidMaxFeePerGasErrorParameters.md (1 hunks)
  • docs/src/content/docs/reference/@tevm/errors/interfaces/InvalidMaxPriorityFeePerGasErrorParameters.md (1 hunks)
  • packages/actions/docs/functions/validateBaseCallParams.md (1 hunks)
  • packages/actions/src/BaseCall/validateBaseCallParams.js (2 hunks)
  • packages/actions/src/BaseCall/validateBaseCallParams.spec.ts (5 hunks)
  • packages/errors/docs/classes/InvalidMaxFeePerGasError.md (1 hunks)
  • packages/errors/docs/classes/InvalidMaxPriorityFeePerGasError.md (1 hunks)
  • packages/errors/docs/classes/InvalidParamsError.md (1 hunks)
  • packages/errors/docs/globals.md (2 hunks)
  • packages/errors/docs/interfaces/InvalidMaxFeePerGasErrorParameters.md (1 hunks)
  • packages/errors/docs/interfaces/InvalidMaxPriorityFeePerGasErrorParameters.md (1 hunks)
  • tevm/docs/errors/README.md (2 hunks)
  • tevm/docs/errors/classes/InvalidMaxFeePerGasError.md (1 hunks)
  • tevm/docs/errors/classes/InvalidMaxPriorityFeePerGasError.md (1 hunks)
  • tevm/docs/errors/classes/InvalidParamsError.md (1 hunks)
  • tevm/docs/errors/type-aliases/InvalidMaxFeePerGasErrorParameters.md (1 hunks)
  • tevm/docs/errors/type-aliases/InvalidMaxPriorityFeePerGasErrorParameters.md (1 hunks)
Files skipped from review due to trivial changes (5)
  • docs/src/content/docs/reference/@tevm/errors/interfaces/InvalidMaxPriorityFeePerGasErrorParameters.md
  • packages/actions/src/BaseCall/validateBaseCallParams.js
  • packages/errors/docs/interfaces/InvalidMaxPriorityFeePerGasErrorParameters.md
  • tevm/docs/errors/type-aliases/InvalidMaxFeePerGasErrorParameters.md
  • tevm/docs/errors/type-aliases/InvalidMaxPriorityFeePerGasErrorParameters.md
Files skipped from review as they are similar to previous changes (1)
  • packages/actions/src/BaseCall/validateBaseCallParams.spec.ts
Additional context used
LanguageTool
docs/src/content/docs/reference/@tevm/actions/functions/validateBaseCallParams.md

[uncategorized] ~12-~12: Possible missing comma found. (AI_HYDRA_LEO_MISSING_COMMA)
Context: ...lidateBaseCallParamsError`[] can break on a minor release Validates that the para...

docs/src/content/docs/reference/@tevm/actions/functions/validateBaseCallParams-1.md

[uncategorized] ~12-~12: Possible missing comma found. (AI_HYDRA_LEO_MISSING_COMMA)
Context: ...lidateBaseCallParamsError`[] can break on a minor release Validates that the para...

packages/actions/docs/functions/validateBaseCallParams.md

[uncategorized] ~13-~13: Possible missing comma found. (AI_HYDRA_LEO_MISSING_COMMA)
Context: ...lidateBaseCallParamsError`[] can break on a minor release Validates that the para...

docs/src/content/docs/reference/@tevm/actions/type-aliases/BaseCallParams.md

[uncategorized] ~30-~30: It seems likely that a singular genitive (’s) apostrophe is missing. (AI_HYDRA_LEO_APOSTROPHE_S_XS)
Context: ...ock will not run in the context of that blocks state. To do that fork that block numbe...


[uncategorized] ~30-~30: Possible missing comma found. (AI_HYDRA_LEO_MISSING_COMMA)
Context: ...the context of that blocks state. To do that fork that block number first. #### Exa...


[style] ~89-~89: Consider shortening this phrase to just ‘whether’, unless you mean ‘regardless of whether’. (WHETHER)
Context: ...| "always" | "never" | boolean Whether or not to update the state or run call in a dr...


[style] ~95-~95: The adverb ‘Always’ is usually put between ‘will’ and ‘still’. (ADVERB_WORD_ORDER)
Context: ...n-success-false: alias for never` Always will still not include the transaction if it's not...


[uncategorized] ~97-~97: Possible missing comma found. (AI_HYDRA_LEO_MISSING_COMMA)
Context: ...if it's not valid to be included in the chain such as the gas limit being too low. If...


[grammar] ~98-~98: The usual collocation for “returned” is “to”, not “in”. (RETURN_IN_THE)
Context: ... a tx is submitted the txHash will be returned in the response. The tx will not be includ...


[uncategorized] ~112-~112: If this is a compound adjective that modifies the following noun, use a hyphen. (EN_COMPOUND_ADJECTIVE_INTERNAL)
Context: ...tional readonly**depth**:number` Low level control over the EVM call depth. Useful...


[uncategorized] ~122-~122: A comma may be missing after the conjunctive/linking adverb ‘Otherwise’. (SENT_START_CONJUNCTIVE_LINKING_ADVERB_COMMA)
Context: ...dresses seperately using those options. Otherwise both are set to the from address ###...


[uncategorized] ~142-~142: If this is a compound adjective that modifies the following noun, use a hyphen. (EN_COMPOUND_ADJECTIVE_INTERNAL)
Context: ...al readonly**gasRefund**:bigint Low level control Refund counter. Defaults to0`...


[style] ~151-~151: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym. (ENGLISH_WORD_REPEAT_BEGINNING_RULE)
Context: ... that can be spent on gas for the call. This is the maximum amount of ether that can...


[typographical] ~165-~165: The word “otherwise” is an adverb that can’t be used like a conjunction, and therefore needs to be separated from the sentence. (THUS_SENTENCE)
Context: ...ess. This defaults to from address if set otherwise it defaults to the zero address ### se...


[style] ~185-~185: ‘prior to’ might be wordy. Consider a shorter alternative. (EN_WORDINESS_PREMIUM_PRIOR_TO)
Context: ...some state to be ephemerally overridden prior to executing the call. Each address maps t...


[grammar] ~190-~190: One modal verb seems to be obsolete here. Consider rephrasing this sentence. (DO_XX_MD_VB)
Context: ...e that simply returns internal state or does pre-defined validations can be kept off chain and fed to the node o...

docs/src/content/docs/reference/@tevm/actions/type-aliases/BaseCallParams-1.md

[uncategorized] ~30-~30: It seems likely that a singular genitive (’s) apostrophe is missing. (AI_HYDRA_LEO_APOSTROPHE_S_XS)
Context: ...ock will not run in the context of that blocks state. To do that fork that block numbe...


[uncategorized] ~30-~30: Possible missing comma found. (AI_HYDRA_LEO_MISSING_COMMA)
Context: ...the context of that blocks state. To do that fork that block number first. #### Exa...


[style] ~89-~89: Consider shortening this phrase to just ‘whether’, unless you mean ‘regardless of whether’. (WHETHER)
Context: ...| "always" | "never" | boolean Whether or not to update the state or run call in a dr...


[style] ~95-~95: The adverb ‘Always’ is usually put between ‘will’ and ‘still’. (ADVERB_WORD_ORDER)
Context: ...n-success-false: alias for never` Always will still not include the transaction if it's not...


[uncategorized] ~97-~97: Possible missing comma found. (AI_HYDRA_LEO_MISSING_COMMA)
Context: ...if it's not valid to be included in the chain such as the gas limit being too low. If...


[grammar] ~98-~98: The usual collocation for “returned” is “to”, not “in”. (RETURN_IN_THE)
Context: ... a tx is submitted the txHash will be returned in the response. The tx will not be includ...


[uncategorized] ~112-~112: If this is a compound adjective that modifies the following noun, use a hyphen. (EN_COMPOUND_ADJECTIVE_INTERNAL)
Context: ...tional readonly**depth**:number` Low level control over the EVM call depth. Useful...


[uncategorized] ~122-~122: A comma may be missing after the conjunctive/linking adverb ‘Otherwise’. (SENT_START_CONJUNCTIVE_LINKING_ADVERB_COMMA)
Context: ...dresses seperately using those options. Otherwise both are set to the from address ###...


[uncategorized] ~142-~142: If this is a compound adjective that modifies the following noun, use a hyphen. (EN_COMPOUND_ADJECTIVE_INTERNAL)
Context: ...al readonly**gasRefund**:bigint Low level control Refund counter. Defaults to0`...


[style] ~151-~151: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym. (ENGLISH_WORD_REPEAT_BEGINNING_RULE)
Context: ... that can be spent on gas for the call. This is the maximum amount of ether that can...


[typographical] ~165-~165: The word “otherwise” is an adverb that can’t be used like a conjunction, and therefore needs to be separated from the sentence. (THUS_SENTENCE)
Context: ...ess. This defaults to from address if set otherwise it defaults to the zero address ### se...


[style] ~185-~185: ‘prior to’ might be wordy. Consider a shorter alternative. (EN_WORDINESS_PREMIUM_PRIOR_TO)
Context: ...some state to be ephemerally overridden prior to executing the call. Each address maps t...


[grammar] ~190-~190: One modal verb seems to be obsolete here. Consider rephrasing this sentence. (DO_XX_MD_VB)
Context: ...e that simply returns internal state or does pre-defined validations can be kept off chain and fed to the node o...

Markdownlint
tevm/docs/errors/classes/InvalidParamsError.md

30-30: null (MD024, no-duplicate-heading)
Multiple headings with the same content


375-375: null (MD024, no-duplicate-heading)
Multiple headings with the same content


285-285: null (MD034, no-bare-urls)
Bare URL used

docs/src/content/docs/reference/@tevm/actions/type-aliases/BaseCallParams.md

11-11: null (MD032, blanks-around-lists)
Lists should be surrounded by blank lines


91-91: null (MD032, blanks-around-lists)
Lists should be surrounded by blank lines

docs/src/content/docs/reference/@tevm/actions/type-aliases/BaseCallParams-1.md

11-11: null (MD032, blanks-around-lists)
Lists should be surrounded by blank lines


91-91: null (MD032, blanks-around-lists)
Lists should be surrounded by blank lines

tevm/docs/errors/classes/InvalidMaxFeePerGasError.md

30-30: null (MD024, no-duplicate-heading)
Multiple headings with the same content


350-350: null (MD024, no-duplicate-heading)
Multiple headings with the same content


260-260: null (MD034, no-bare-urls)
Bare URL used

tevm/docs/errors/classes/InvalidMaxPriorityFeePerGasError.md

30-30: null (MD024, no-duplicate-heading)
Multiple headings with the same content


350-350: null (MD024, no-duplicate-heading)
Multiple headings with the same content


260-260: null (MD034, no-bare-urls)
Bare URL used

packages/errors/docs/classes/InvalidParamsError.md

30-30: null (MD024, no-duplicate-heading)
Multiple headings with the same content


375-375: null (MD024, no-duplicate-heading)
Multiple headings with the same content


285-285: null (MD034, no-bare-urls)
Bare URL used

packages/errors/docs/classes/InvalidMaxFeePerGasError.md

30-30: null (MD024, no-duplicate-heading)
Multiple headings with the same content


350-350: null (MD024, no-duplicate-heading)
Multiple headings with the same content


260-260: null (MD034, no-bare-urls)
Bare URL used

packages/errors/docs/classes/InvalidMaxPriorityFeePerGasError.md

30-30: null (MD024, no-duplicate-heading)
Multiple headings with the same content


350-350: null (MD024, no-duplicate-heading)
Multiple headings with the same content


260-260: null (MD034, no-bare-urls)
Bare URL used

docs/src/content/docs/reference/@tevm/errors/classes/InvalidParamsError.md

29-29: null (MD024, no-duplicate-heading)
Multiple headings with the same content


374-374: null (MD024, no-duplicate-heading)
Multiple headings with the same content


284-284: null (MD034, no-bare-urls)
Bare URL used

docs/src/content/docs/reference/@tevm/errors/classes/InvalidMaxFeePerGasError.md

29-29: null (MD024, no-duplicate-heading)
Multiple headings with the same content


349-349: null (MD024, no-duplicate-heading)
Multiple headings with the same content


259-259: null (MD034, no-bare-urls)
Bare URL used

docs/src/content/docs/reference/@tevm/errors/classes/InvalidMaxPriorityFeePerGasError.md

29-29: null (MD024, no-duplicate-heading)
Multiple headings with the same content


349-349: null (MD024, no-duplicate-heading)
Multiple headings with the same content


259-259: null (MD034, no-bare-urls)
Bare URL used

Additional comments not posted (11)
docs/src/content/docs/reference/@tevm/actions/functions/validateBaseCallParams.md (1)

25-25: Check the source link accuracy and ensure it points to the correct line in the codebase reflecting the latest changes.

Verification successful

The documentation link correctly points to the line where the validateBaseCallParams function is defined.

  • Location: docs/src/content/docs/reference/@tevm/actions/functions/validateBaseCallParams.md
  • Code: [packages/actions/src/BaseCall/validateBaseCallParams.js:32](https://github.com/evmts/tevm-monorepo/blob/main/packages/actions/src/BaseCall/validateBaseCallParams.js#L32)
Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify that the source link points to the correct line number in the validateBaseCallParams.js file.
# Expected: Link points to the exact line where the function is defined or modified.

cat packages/actions/src/BaseCall/validateBaseCallParams.js | sed -n 32p

Length of output: 126

docs/src/content/docs/reference/@tevm/actions/functions/validateBaseCallParams-1.md (1)

25-25: Confirm the necessity of this file in the documentation structure, as it appears similar to validateBaseCallParams.md.

packages/actions/docs/functions/validateBaseCallParams.md (1)

26-26: Check the source link accuracy and ensure it points to the correct line in the codebase reflecting the latest changes.

Verification successful

The source link in the documentation correctly points to the line where the validateBaseCallParams function is defined.

  • The link points to line 32 of validateBaseCallParams.js, which is where the function is exported.
Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify that the source link points to the correct line number in the validateBaseCallParams.js file.
# Expected: Link points to the exact line where the function is defined or modified.

cat packages/actions/src/BaseCall/validateBaseCallParams.js | sed -n 32p

Length of output: 126

docs/src/content/docs/reference/@tevm/errors/interfaces/InvalidMaxFeePerGasErrorParameters.md (1)

12-12: Clarify the type of cause in the documentation to ensure it aligns with the implementation in the source code.

Verification successful

The BaseError class was successfully located, and it indeed takes an args parameter which can include a cause property. This aligns with the documentation stating that cause can be undefined, BaseError, or Error.

  • packages/errors/src/ethereum/BaseError.js
  • experimental/viem-effect/src-viem/errors/base.ts

The documentation for InvalidMaxFeePerGasError is accurate with respect to the type of cause.

Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the type of `cause` in the InvalidMaxFeePerGasError class implementation.
# Expected: Type of `cause` matches the documentation.

ast-grep --lang javascript --pattern $'class InvalidMaxFeePerGasError {
  constructor($_, $_) {
    this.cause = $_
  }
}'

Length of output: 123



Script:

#!/bin/bash
# Locate the InvalidMaxFeePerGasError class and inspect its constructor to verify the type of `cause`.
ast-grep --lang javascript --pattern 'class InvalidMaxFeePerGasError {
  constructor($$$) {
    $$$
  }
}'

Length of output: 108



Script:

#!/bin/bash
# Search for the InvalidMaxFeePerGasError class definition in the entire repository and extract relevant details.
rg 'class InvalidMaxFeePerGasError' --context 10

Length of output: 2348



Script:

#!/bin/bash
# Locate the InvalidParamsError class and inspect its constructor to verify how args and cause are handled.
rg 'class InvalidParamsError' --context 10

Length of output: 2154



Script:

#!/bin/bash
# Locate the BaseError class and inspect its constructor to verify how args and cause are handled.
rg 'class BaseError' --context 10

Length of output: 7052

tevm/docs/errors/classes/InvalidParamsError.md (1)

62-63: The addition of InvalidMaxFeePerGasError and InvalidMaxPriorityFeePerGasError to the list of extended errors is appropriate given the context of handling new types of transaction errors in EIP-1559.

docs/src/content/docs/reference/@tevm/actions/type-aliases/BaseCallParams.md (1)

136-137: Clarify the documentation around the gasPrice being ignored in the context of EIP-1559 transactions. It might be helpful to explain why this behavior occurs and under what conditions the gasPrice will be considered again.

packages/errors/docs/globals.md (2)

64-65: The addition of InvalidMaxFeePerGasError and InvalidMaxPriorityFeePerGasError to the error classes list is consistent with the PR's objectives to handle new error types for EIP-1559 transaction parameters.


165-166: The corresponding parameters for the new error classes InvalidMaxFeePerGasErrorParameters and InvalidMaxPriorityFeePerGasErrorParameters have been correctly added. This ensures that the error handling is robust and can be customized based on the error context.

tevm/docs/errors/README.md (1)

68-69: The new error classes InvalidMaxFeePerGasError and InvalidMaxPriorityFeePerGasError have been added to the index. This ensures users can easily find documentation related to these new errors introduced for handling EIP-1559 transaction parameters.

docs/src/content/docs/reference/@tevm/errors/globals.md (2)

65-66: The addition of InvalidMaxFeePerGasError and InvalidMaxPriorityFeePerGasError to the list of error classes is well-documented. This update is crucial for developers to understand the new error types associated with EIP-1559 features.


166-167: The parameters for the new error classes, InvalidMaxFeePerGasErrorParameters and InvalidMaxPriorityFeePerGasErrorParameters, have been correctly documented. This detailed documentation is essential for developers to implement and handle these errors appropriately.

@roninjin10 roninjin10 merged commit 4650d32 into main Jun 13, 2024
15 of 16 checks passed
@roninjin10 roninjin10 deleted the 06-13-_sparkles_feat_add_maxpriorityfeepergas_and_maxfeepergas branch June 13, 2024 20:55
roninjin10 pushed a commit that referenced this pull request Jun 13, 2024
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.

⚠️⚠️⚠️⚠️⚠️⚠️

`main` is currently in **pre mode** so this branch has prereleases
rather than normal releases. If you want to exit prereleases, run
`changeset pre exit` on `main`.

⚠️⚠️⚠️⚠️⚠️⚠️

# Releases
## @tevm/[email protected]

### Minor Changes

- [#1198](#1198)
[`4650d32`](4650d32)
Thanks [@roninjin10](https://github.com/roninjin10)! - Added support for
setting maxFeePerGas and maxPriorityFeePerGas

- [#1198](#1198)
[`4650d32`](4650d32)
Thanks [@roninjin10](https://github.com/roninjin10)! - Added support for
passing in maxFeePerGas and maxPriorityFeePerGas to tevmCall
tevmContract tevmDeploy and tevmScript

### Patch Changes

- [#1197](#1197)
[`fbf5192`](fbf5192)
Thanks [@roninjin10](https://github.com/roninjin10)! - Fixed bug where
tevmCall and related methods would improperly validate params such as
depth and value. Previously it would not throw a validation error if
these numbers are negative

- [#1197](#1197)
[`fbf5192`](fbf5192)
Thanks [@roninjin10](https://github.com/roninjin10)! - Fixed bug where
validation errors of nested structures like arrays would sometimes get
swallowed by tevmCall and related methods

- Updated dependencies
\[[`4650d32`](4650d32)]:
    -   @tevm/[email protected]
    -   @tevm/[email protected]
    -   @tevm/[email protected]
    -   @tevm/[email protected]
    -   @tevm/[email protected]
    -   @tevm/[email protected]
    -   @tevm/[email protected]

## @tevm/[email protected]

### Minor Changes

- [#1198](#1198)
[`4650d32`](4650d32)
Thanks [@roninjin10](https://github.com/roninjin10)! - Added support for
setting maxFeePerGas and maxPriorityFeePerGas

## @tevm/[email protected]

### Minor Changes

- [#1198](#1198)
[`4650d32`](4650d32)
Thanks [@roninjin10](https://github.com/roninjin10)! - Added support for
setting maxFeePerGas and maxPriorityFeePerGas

### Patch Changes

- Updated dependencies
\[[`4650d32`](4650d32)]:
    -   @tevm/[email protected]
    -   @tevm/[email protected]
    -   @tevm/[email protected]
    -   @tevm/[email protected]

## @tevm/[email protected]

### Patch Changes

-   Updated dependencies \[]:
    -   @tevm/[email protected]
    -   @tevm/[email protected]
    -   @tevm/[email protected]
    -   @tevm/[email protected]

## @tevm/[email protected]

### Patch Changes

-   Updated dependencies \[]:
    -   @tevm/[email protected]
    -   @tevm/[email protected]

## @tevm/[email protected]

### Patch Changes

- Updated dependencies
\[[`4650d32`](4650d32)]:
    -   @tevm/[email protected]
    -   @tevm/[email protected]
    -   @tevm/[email protected]
    -   @tevm/[email protected]
    -   @tevm/[email protected]
    -   @tevm/[email protected]
    -   @tevm/[email protected]

## @tevm/[email protected]

### Patch Changes

- Updated dependencies
\[[`4650d32`](4650d32)]:
    -   @tevm/[email protected]

## @tevm/[email protected]

### Patch Changes

-   Updated dependencies \[]:
    -   @tevm/[email protected]

## @tevm/[email protected]

### Patch Changes

- Updated dependencies
\[[`4650d32`](4650d32),
[`4650d32`](4650d32),
[`fbf5192`](fbf5192),
[`fbf5192`](fbf5192)]:
    -   @tevm/[email protected]
    -   @tevm/[email protected]
    -   @tevm/[email protected]

## @tevm/[email protected]

### Patch Changes

-   Updated dependencies \[]:
    -   @tevm/[email protected]

## @tevm/[email protected]

### Patch Changes

-   Updated dependencies \[]:
    -   @tevm/[email protected]
    -   @tevm/[email protected]

## @tevm/[email protected]

### Patch Changes

-   Updated dependencies \[]:
    -   @tevm/[email protected]
    -   @tevm/[email protected]
    -   @tevm/[email protected]
    -   @tevm/[email protected]

## @tevm/[email protected]

### Patch Changes

-   Updated dependencies \[]:
    -   @tevm/[email protected]
    -   @tevm/[email protected]

## @tevm/[email protected]

### Patch Changes

- Updated dependencies
\[[`4650d32`](4650d32),
[`4650d32`](4650d32),
[`fbf5192`](fbf5192),
[`fbf5192`](fbf5192)]:
    -   @tevm/[email protected]
    -   @tevm/[email protected]
    -   @tevm/[email protected]
    -   @tevm/[email protected]
    -   @tevm/[email protected]
    -   @tevm/[email protected]

## @tevm/[email protected]

### Patch Changes

- Updated dependencies
\[[`4650d32`](4650d32)]:
    -   @tevm/[email protected]
    -   @tevm/[email protected]
    -   @tevm/[email protected]

## @tevm/[email protected]

### Patch Changes

-   Updated dependencies \[]:
    -   @tevm/[email protected]

## @tevm/[email protected]

### Patch Changes

- Updated dependencies
\[[`4650d32`](4650d32)]:
    -   @tevm/[email protected]
    -   @tevm/[email protected]
    -   @tevm/[email protected]

## [email protected]

### Patch Changes

- [#1195](#1195)
[`c58a6e5`](c58a6e5)
Thanks [@roninjin10](https://github.com/roninjin10)! - Fixed bug with
bad export"

- Updated dependencies
\[[`4650d32`](4650d32),
[`4650d32`](4650d32),
[`fbf5192`](fbf5192),
[`fbf5192`](fbf5192)]:
    -   @tevm/[email protected]
    -   @tevm/[email protected]
    -   @tevm/[email protected]
    -   @tevm/[email protected]
    -   @tevm/[email protected]
    -   @tevm/[email protected]
    -   @tevm/[email protected]
    -   @tevm/[email protected]
    -   @tevm/[email protected]
    -   @tevm/[email protected]

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
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.

1 participant