-
-
Notifications
You must be signed in to change notification settings - Fork 30
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
fix: allow multiple topics for eth_getLogs and eth_getFilterLogs #1473
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Skipped Deployment
|
🦋 Changeset detectedLatest commit: 76097e0 The changes in this PR will be included in the next version bump. This PR includes changesets to release 11 packages
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 |
WalkthroughThis changeset consolidates updates primarily focused on enhancing log filtering functionality and improving documentation clarity. Key modifications include updates to the Changes
Possibly related PRs
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? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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 using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 1
🧹 Outside diff range and nitpick comments (38)
.changeset/five-candles-bathe.md (1)
7-7
: Consider expanding the change description for clarity.While the current description is accurate, it could be more informative. Consider expanding it to provide more context about the change and its impact.
Here's a suggested improvement:
-Fixed eth_getLogs and eth_getFilterLogs interface to accept an array of topics +Enhanced eth_getLogs and eth_getFilterLogs interfaces to accept an array of topics, allowing for more flexible log filtering with multiple topicsThis expanded description provides more context about the nature of the change and its benefits, which can be helpful for users and maintainers reviewing the changelog.
packages/actions/src/utils/isArray.js (2)
1-6
: Enhance JSDoc clarity and precision.The JSDoc comment is well-structured, but could benefit from minor improvements:
- The description could be more precise about the function's behavior.
- The @returns tag could be more explicit about the boolean nature of the return value.
Consider applying these changes:
/** - * Type guard to check if a value is an array of type T or a single value of type T + * Type guard to determine if a value is an array (or readonly array) of type T * @template T * @param {T | T[] | readonly T[]} value - * @returns {value is T[] | readonly T[]} + * @returns {boolean} True if value is an array (or readonly array) of type T, false otherwise */This change clarifies that the function specifically checks for array types (including readonly arrays) and explicitly states the boolean nature of the return value.
7-9
: Implementation looks good, with minor suggestions.The implementation is correct and concise, effectively wrapping the built-in
Array.isArray
method. However, consider the following suggestions:
The function name
isArray
might be too generic. Consider a more specific name to avoid potential naming conflicts, e.g.,isArrayOrReadonlyArray
.In TypeScript contexts, you might want to explicitly handle readonly arrays. However, this isn't necessary for runtime behavior, as
Array.isArray
correctly identifies both regular and readonly arrays.If you decide to rename the function, here's a suggested change:
-export function isArray(value) { +export function isArrayOrReadonlyArray(value) { return Array.isArray(value) }This change would make the function name more explicit about its behavior, potentially reducing confusion for other developers using this utility.
docs/src/content/docs/reference/@tevm/actions/functions/loadStateHandler.md (1)
51-53
: Update link paths and fix indentation.The links to related type aliases have been updated, which is good for maintaining correct navigation. However, there are some formatting issues to address:
- The indentation of the unordered list items should be consistent with the rest of the document.
- The relative paths used in the links are unnecessarily long and could be simplified.
Please apply the following changes:
- 51~ - - [LoadStateParams](../../../../../../../../reference/tevm/actions/type-aliases/loadstateparams) - 52~ - - [LoadStateResult](../../../../../../../../reference/tevm/actions/type-aliases/loadstateresult) - 53~ - - [TevmLoadStateError](../../../../../../../../reference/tevm/actions/type-aliases/tevmloadstateerror) + - [LoadStateParams](/reference/tevm/actions/type-aliases/loadstateparams) + - [LoadStateResult](/reference/tevm/actions/type-aliases/loadstateresult) + - [TevmLoadStateError](/reference/tevm/actions/type-aliases/tevmloadstateerror)This will correct the indentation and simplify the link paths while maintaining their correctness.
🧰 Tools
🪛 Markdownlint
51-51: Expected: 0; Actual: 1
Unordered list indentation(MD007, ul-indent)
52-52: Expected: 0; Actual: 1
Unordered list indentation(MD007, ul-indent)
53-53: Expected: 0; Actual: 1
Unordered list indentation(MD007, ul-indent)
docs/src/content/docs/reference/@tevm/memory-client/functions/createTevmTransport.md (1)
Line range hint
50-57
: Approve path update and suggest indentation fixThe update to the relative path for the
createClient
reference improves the accuracy of the documentation. However, there's a minor indentation issue in the unordered list.To fix the indentation issue, please adjust the list items to have consistent indentation:
- - [createClient](../../../../../../../../reference/tevm/memory-client/functions/createclient) - - [Viem Client Docs](https://viem.sh/docs/clients/introduction) - - [Client Guide](https://tevm.sh/learn/clients/) - - [tevm JSON-RPC Guide](https://tevm.sh/learn/json-rpc/) - - [EIP-1193 spec](https://eips.ethereum.org/EIPS/eip-1193) - - [Ethereum jsonrpc docs](https://ethereum.org/en/developers/docs/apis/json-rpc/) - - [CreateMemoryClient Docs](https://tevm.sh/reference/tevm/memory-client/functions/creatememoryclient/) - For a batteries-included client if not worried about tree shaking + - [createClient](../../../../../../../../reference/tevm/memory-client/functions/createclient) + - [Viem Client Docs](https://viem.sh/docs/clients/introduction) + - [Client Guide](https://tevm.sh/learn/clients/) + - [tevm JSON-RPC Guide](https://tevm.sh/learn/json-rpc/) + - [EIP-1193 spec](https://eips.ethereum.org/EIPS/eip-1193) + - [Ethereum jsonrpc docs](https://ethereum.org/en/developers/docs/apis/json-rpc/) + - [CreateMemoryClient Docs](https://tevm.sh/reference/tevm/memory-client/functions/creatememoryclient/) - For a batteries-included client if not worried about tree shakingThis change ensures consistent indentation for all list items.
🧰 Tools
🪛 Markdownlint
50-50: Expected: 0; Actual: 1
Unordered list indentation(MD007, ul-indent)
51-51: Expected: 0; Actual: 1
Unordered list indentation(MD007, ul-indent)
52-52: Expected: 0; Actual: 1
Unordered list indentation(MD007, ul-indent)
53-53: Expected: 0; Actual: 1
Unordered list indentation(MD007, ul-indent)
docs/src/content/docs/reference/@tevm/actions/type-aliases/ContractResult.md (1)
60-60
: Approve the link update with a suggestion for improvement.The update to the
CallResult
link is correct and aligns with the changes mentioned in the AI-generated summary. However, the use of a long relative path ("../../../../../../../../") might be prone to errors if the file structure changes in the future.Consider using a more robust linking method that doesn't rely on such a long relative path. For example, you might be able to use a root-relative path or a custom linking system that your documentation tool supports. This would make the links more resilient to file structure changes.
docs/src/content/docs/reference/@tevm/actions/type-aliases/ContractParams.md (2)
56-57
: Consider simplifying documentation linksThe updated links to
BaseCallParams
andEncodeFunctionDataParameters
use relative paths, which is good. However, the paths are quite long and may be fragile if the documentation structure changes. Consider using shorter, more robust links if possible.For example, you might be able to use a root-relative path like
/reference/tevm/actions/type-aliases/basecallparams
instead of the current long path.🧰 Tools
🪛 Markdownlint
56-56: Expected: 0; Actual: 1
Unordered list indentation(MD007, ul-indent)
57-57: Expected: 0; Actual: 1
Unordered list indentation(MD007, ul-indent)
56-57
: Fix list item indentationThe unordered list items on lines 56-57 are not properly indented according to Markdown standards. To improve readability and consistency, please add appropriate indentation to these list items.
For example:
## See - [BaseCallParams](../../../../../../../../reference/tevm/actions/type-aliases/basecallparams) - [EncodeFunctionDataParameters](../../../../../../../../reference/tevm/utils/type-aliases/encodefunctiondataparameters)🧰 Tools
🪛 Markdownlint
56-56: Expected: 0; Actual: 1
Unordered list indentation(MD007, ul-indent)
57-57: Expected: 0; Actual: 1
Unordered list indentation(MD007, ul-indent)
docs/src/content/docs/reference/@tevm/actions/type-aliases/ContractHandler.md (1)
68-69
: Ignore Markdownlint indentation warnings for the "See" section.The static analysis tool (Markdownlint) has flagged indentation issues for the unordered list in the "See" section. However, these warnings can be safely ignored as the indentation is correct within the context of the markdown structure. The list items are properly aligned and formatted.
If you want to suppress these warnings in the future, you could consider adding a Markdownlint configuration file to the project with a rule exception for this specific case.
🧰 Tools
🪛 Markdownlint
68-68: Expected: 0; Actual: 1
Unordered list indentation(MD007, ul-indent)
69-69: Expected: 0; Actual: 1
Unordered list indentation(MD007, ul-indent)
packages/actions/src/eth/ethNewFilterHandler.js (1)
70-70
: LGTM: Enhanced topic processingThe change successfully implements the ability to handle both single topics and arrays of topics, aligning with the PR objective and Ethereum JSON-RPC API specifications. This enhancement provides more flexible log filtering capabilities.
For improved readability, consider extracting the topic processing logic into a separate function:
const processTopics = (topics) => topics?.map(topic => isArray(topic) ? topic.map(hexToBytes) : hexToBytes(topic)); // Then use it in the getLogs call receiptsManager.getLogs( _fromBlock, _toBlock, address !== undefined ? [createAddress(address).bytes] : [], processTopics(topics) );This refactoring would make the main function body cleaner and the topic processing logic more reusable.
docs/src/content/docs/reference/_media/bundler.md (1)
114-138
: Improve the example usage section for clarity and correctness.The addition of an example usage section is valuable for users. However, there are a few points that could be improved:
There's a typo in the import statement for
bundler
. It should be:import { bundler } from '@tevm/base-bundler'The example uses a
resolveTs
method, but this method isn't listed in the function's return object. Consider using one of the listed methods likeresolveTsModule
orresolveTsModuleSync
instead.To enhance understanding, consider adding brief comments explaining each step of the process.
Here's a suggested improvement for the example:
// Import necessary modules import { bundler } from '@tevm/base-bundler' import { createCache } from '@tevm/bundler-cache' import { readFile, writeFile } from 'fs/promises' import { readFileSync, writeFileSync, existsSync } from 'fs' import { createSolc } from '@tevm/solc' import { loadConfig } from '@tevm/config' // Create a file access object const fao = { readFile, writeFile, readFileSync, writeFileSync, existsSync, // Add other methods if needed } // Instantiate the bundler with required parameters const b = bundler(await loadConfig(), console, fao, await createSolc(), createCache()) // Specify the path to your Solidity contract const path = '../contracts/ERC20.sol' // Resolve the TypeScript representation of the Solidity contract const { abi, bytecode } = await b.resolveTsModule(path, __dirname, true, true)These changes will make the example more accurate and easier to understand for users.
docs/src/content/docs/reference/@tevm/contract/functions/createContract.md (1)
98-98
: LGTM: Documentation link updated correctly.The change improves the accuracy of the documentation by updating the link to the Contract type. This ensures users are directed to the correct and most up-to-date information.
Regarding the Markdownlint warning about unordered list indentation: This appears to be a false positive. The line is correctly indented under the list item, maintaining proper markdown structure.
🧰 Tools
🪛 Markdownlint
98-98: Expected: 0; Actual: 1
Unordered list indentation(MD007, ul-indent)
docs/src/content/docs/reference/@tevm/actions/type-aliases/TevmJsonRpcRequestHandler.md (1)
56-57
: Update needed for tevm_setAccount response type link.The link for
SetAccountJsonRpcRequest
has been correctly updated. However, theSetAccountJsonRpcResponse
link should also be updated to maintain consistency with the new documentation structure.Please update the response type link as follows:
-response - SetAccountJsonRpcResponse +response - [SetAccountJsonRpcResponse](../../../../../../../../reference/tevm/actions/type-aliases/setaccountjsonrpcresponse)docs/src/content/docs/reference/@tevm/actions/type-aliases/TevmJsonRpcBulkRequestHandler.md (1)
55-55
: Update the SetAccountJsonRpcResponse linkThe reference link for
SetAccountJsonRpcRequest
has been correctly updated. However, the link forSetAccountJsonRpcResponse
is missing. Consider adding it for consistency.Suggested change:
request - [SetAccountJsonRpcRequest](../../../../../../../../reference/tevm/actions/type-aliases/setaccountjsonrpcrequest) -response - SetAccountJsonRpcResponse +response - [SetAccountJsonRpcResponse](../../../../../../../../reference/tevm/actions/type-aliases/setaccountjsonrpcresponse)packages/actions/src/eth/ethGetLogsHandler.js (2)
122-123
: Consider removing the commented-out code.The commented line is being replaced by a more flexible approach. To maintain code cleanliness, it's generally better to remove unused code rather than commenting it out, especially when the change is being tracked by version control.
124-124
: LGTM: Improved topic processing to handle multiple topics.The new implementation successfully allows for both single topics and arrays of topics, aligning with the PR objectives. This change enhances the flexibility of the
eth_getLogs
andeth_getFilterLogs
methods.For improved readability, consider extracting the topic processing logic into a separate function:
const processTopics = (topics) => topics?.map((topic) => (isArray(topic) ? topic.map(hexToBytes) : hexToBytes(topic))); // Then use it in the getLogs call params.filterParams.topics && processTopics(params.filterParams.topics),This extraction would make the main function cleaner and the topic processing logic more reusable.
packages/actions/src/eth/ethGetFilterLogsProcedure.spec.ts (3)
102-116
: LGTM: Well-structured test case setup.The new test case is well-structured and correctly sets up the OR'ed topics for filtering. The use of
keccak256
andstringToHex
for topic creation is appropriate.Consider adding a brief comment explaining the purpose of
topic2
(NonExistentEvent) to clarify its role in testing OR'ed topics.
160-173
: LGTM: Comprehensive test assertions.The test assertions are thorough and well-structured:
- Error checking and log count verification are correctly implemented.
- Detailed verification of each log's structure and content is performed.
- The use of
forEach
for iterating over logs allows for precise checking of each log.Consider adding an assertion to verify that
log.removed
isfalse
for each log, to ensure consistency with the previous test case.
101-174
: Great addition to the test suite!This new test case significantly enhances the coverage of the
ethGetFilterLogsProcedure
by verifying the functionality of OR'ed topics in log filtering. The implementation is thorough, well-structured, and consistent with the existing codebase. It effectively tests the ability to filter logs based on multiple topics, which is a crucial feature for Ethereum log filtering.As the test suite grows, consider organizing related test cases into describe blocks for better readability and maintenance. For example, you could group all tests related to topic filtering under a single describe block.
docs/src/content/docs/reference/@tevm/vm/interfaces/VMOpts.md (1)
50-51
: Improved clarity and reference forcommon?
property.The changes to the
common?
property description enhance clarity by explicitly stating its purpose for changing the chain setup. The updated reference link is more specific, which is beneficial for users.Consider adding a brief explanation of what a
Common
instance represents for developers who might be unfamiliar with the concept.docs/src/content/docs/reference/@tevm/memory-client/type-aliases/MemoryClient.md (2)
38-38
: Fix unordered list indentationThe content updates in the "See" section and Actions API documentation are excellent, providing more comprehensive information and examples. However, there's a minor formatting issue with the unordered list indentation on line 38.
Please adjust the indentation of the unordered list item on line 38 to match the other items in the list. This will resolve the Markdownlint warning (MD007) and improve the overall formatting consistency.
🧰 Tools
🪛 Markdownlint
38-38: Expected: 0; Actual: 1
Unordered list indentation(MD007, ul-indent)
Line range hint
39-180
: LGTM: Comprehensive additions to documentationThe new sections on Forking, Mining Modes, HTTP usage, State Persistence, Network Support, and Composing with TEVM Contracts and Bundler greatly enhance the documentation. They provide valuable information and practical examples that will help users understand and utilize the MemoryClient more effectively.
Consider adding a table of contents at the beginning of the document to help users navigate through the various sections more easily, given the significant amount of new content added.
🧰 Tools
🪛 Markdownlint
38-38: Expected: 0; Actual: 1
Unordered list indentation(MD007, ul-indent)
39-39: Expected: 0; Actual: 1
Unordered list indentation(MD007, ul-indent)
40-40: Expected: 0; Actual: 1
Unordered list indentation(MD007, ul-indent)
41-41: Expected: 0; Actual: 1
Unordered list indentation(MD007, ul-indent)
packages/actions/src/eth/ethGetLogsHandler.spec.ts (1)
276-331
: Enhance test case for OR'ed topics filteringThe new test case "should filter logs with OR'ed topics" is well-structured and aligns with the PR objectives. It effectively demonstrates the ability to filter logs using multiple topics. However, consider the following enhancements to make the test more robust and informative:
- Add an explicit check to verify that no logs with the non-existent topic (topic2) are included in the results.
- Make the assertion on line 325 more specific, e.g.,
expect(logs).toHaveLength(2)
toexpect(logs).to.have.lengthOf(2)
or similar, depending on the testing framework.- Add a comment explaining the purpose of using a non-existent event topic in the test.
Here's a suggested improvement for the assertions:
// Verify that exactly 2 logs are returned and they both match the existing topic expect(logs).to.have.lengthOf(2, 'Expected exactly two logs') logs.forEach((log, index) => { expect(log.topics[0]).to.equal(topic1, `Log ${index} should match the existing topic`) }) // Verify that no logs match the non-existent topic const logsWithNonExistentTopic = logs.filter(log => log.topics[0] === topic2) expect(logsWithNonExistentTopic).to.be.empty('No logs should match the non-existent topic')Consider adding a comment like this before the topic creation:
// Create two topics: one for an existing event and one for a non-existent event // This helps verify that the OR'ed topic filtering correctly includes only the existing eventsdocs/src/content/docs/reference/@tevm/state/interfaces/StateManager.md (1)
Line range hint
484-491
: Approved: Added experimental warning tosaveStateRoot
methodThe addition of the experimental warning is crucial for developers. It clearly communicates that this API is not stable and should be used with caution, especially in production environments.
For consistency with the
commit
method, consider updating the comment to read "This API is considered experimental" instead of "This API is considered unstable".docs/src/content/docs/reference/@tevm/block/classes/Block.md (2)
Line range hint
55-146
: LGTM: Expandedcommon
property documentationThe detailed documentation for the
common
property greatly improves the understanding of the chain-specific data structure. The addition ofblockExplorers
andcontracts
properties with their respective types is particularly helpful.Consider adding a brief description of the
custom
property to clarify its purpose and potential usage.
Line range hint
701-796
: LGTM: Updated static methods documentationThe documentation for static methods such as
fromRLPSerializedBlock
andfromValuesArray
has been improved with the addition of return types. This change enhances the clarity of the API documentation while maintaining concise descriptions appropriate for utility methods.Consider adding brief examples of usage for these static methods to further improve the documentation's helpfulness.
docs/src/content/docs/reference/@tevm/block/classes/BlockHeader.md (3)
Line range hint
13-20
: Approve deprecation notice and suggest improvementThe deprecation notice for the constructor is a good practice. However, to make it more helpful for users, consider adding a code example demonstrating the recommended way to create a
BlockHeader
object using the static factory method.Consider adding a code example like this:
const headerData = { /* ... */ }; const opts = { /* ... */ }; const blockHeader = BlockHeader.fromHeaderData(headerData, opts);🧰 Tools
🪛 LanguageTool
[style] ~568-~568: ‘in conjunction with’ might be wordy. Consider a shorter alternative.
Context: ...tion block and should therefore be used in conjunction with [BlockHeader.cliqueIsEpochTransition](....(EN_WORDINESS_PREMIUM_IN_CONJUNCTION_WITH)
Line range hint
265-283
: Approve new properties and suggest additional contextThe addition of
parentBeaconBlockRoot
,requestsRoot
, andwithdrawalsRoot
properties is good. These likely reflect recent changes in the Ethereum protocol.Consider adding brief explanations for each new property to provide context on their purpose and when they're used. For example:
parentBeaconBlockRoot
: Used post-merge to link execution blocks to the beacon chain.requestsRoot
: [Add explanation here]withdrawalsRoot
: Related to validator withdrawals in post-merge Ethereum.🧰 Tools
🪛 LanguageTool
[style] ~568-~568: ‘in conjunction with’ might be wordy. Consider a shorter alternative.
Context: ...tion block and should therefore be used in conjunction with [BlockHeader.cliqueIsEpochTransition](....(EN_WORDINESS_PREMIUM_IN_CONJUNCTION_WITH)
Line range hint
946-984
: Approve new static factory methods and suggest improvementThe addition of
fromHeaderData
,fromRLPSerializedHeader
, andfromValuesArray
static methods is excellent. These provide clear and type-safe ways to createBlockHeader
objects from different data sources, aligning well with the constructor deprecation.Consider adding a brief example for each method to illustrate their usage, similar to the suggestion for the deprecated constructor. This would make the documentation even more user-friendly.
🧰 Tools
🪛 LanguageTool
[style] ~568-~568: ‘in conjunction with’ might be wordy. Consider a shorter alternative.
Context: ...tion block and should therefore be used in conjunction with [BlockHeader.cliqueIsEpochTransition](....(EN_WORDINESS_PREMIUM_IN_CONJUNCTION_WITH)
docs/src/content/docs/reference/@tevm/tx/classes/AccessListEIP2930Transaction.md (1)
705-710
: Great addition to the documentation!The added reference to
getMessageToSign()
for obtaining an EIP-155 compliant representation for external signing is very valuable. It helps developers understand how to properly prepare transactions for external signing, which is crucial for security and compatibility.Consider adding a brief explanation of why the EIP-155 compliant representation is important for external signing. This could further enhance developers' understanding of the topic.
docs/src/content/docs/reference/@tevm/tx/classes/BlobEIP4844Transaction.md (1)
Line range hint
1155-1166
: New methodnetworkWrapperToJson()
well documented.The addition of the
networkWrapperToJson()
static method documentation is a valuable inclusion. It provides clear information about the method's purpose, parameters, and return value.Consider adding a brief explanation or link to the
JsonBlobTxNetworkWrapper
type in the return value description to provide more context for developers unfamiliar with this specific type.docs/src/content/docs/reference/@tevm/utils/classes/AsyncEventEmitter.md (4)
Line range hint
27-98
: Properties are well-documented, but consider addingerrorMonitor
.The static properties
captureRejections
,captureRejectionSymbol
, anddefaultMaxListeners
are clearly documented with their types, descriptions, and inheritance information.Consider adding the
errorMonitor
property to the main properties section for consistency, as it's currently only mentioned in the methods section.
Line range hint
100-110
: Remove duplicate[captureRejectionSymbol]
method documentation.The
[captureRejectionSymbol]
method is documented twice with slightly different signatures. Remove the duplicate entry to avoid confusion.
Line range hint
1011-1034
: Consider removing or clearly marking the deprecatedlistenerCount
static method.The
listenerCount
static method is marked as deprecated. Consider either removing it from the documentation or clearly marking it as deprecated at the beginning of its description to prevent users from using it in new code.
Line range hint
1-1078
: Documentation is comprehensive, but minor improvements could enhance clarity.The
AsyncEventEmitter
class documentation is well-structured and provides detailed information about its inheritance, type parameters, constructor, properties, and methods. Many methods include helpful examples to illustrate their usage.To further improve the documentation:
- Ensure consistent formatting throughout, particularly for code blocks.
- Clearly mark all inherited methods and properties for easier distinction.
- Consider adding more examples for complex methods to enhance user understanding.
Overall, the documentation provides a solid reference for developers working with the
AsyncEventEmitter
class.docs/src/content/docs/reference/@tevm/state/functions/getForkClient.md (3)
Line range hint
9-11
: Consider adding more context about BaseState.The
baseState
parameter is defined, but it might be helpful to provide more context about whatBaseState
represents or link to its definition if available.
Line range hint
213-215
: Missing example usage.While the documentation is thorough, it lacks an example of how to use the
getForkClient
function. Consider adding a simple usage example to help developers understand how to implement it in their code.Here's a suggested example to add:
import { getForkClient } from '@tevm/state' import { createMemoryClient } from '@tevm/memory-client' const baseState = createMemoryClient() const forkClient = getForkClient(baseState) // Now you can use forkClient to interact with the forked state
Line range hint
1-215
: Consider adding error handling information.The documentation is comprehensive, but it doesn't mention how errors are handled or what types of errors developers might encounter when using this function. Adding a section on potential errors and how to handle them would be beneficial.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
⛔ Files ignored due to path filters (6)
packages/procedures/dist/index.cjs
is excluded by!**/dist/**
packages/procedures/dist/index.cjs.map
is excluded by!**/dist/**
,!**/*.map
packages/procedures/dist/index.d.cts
is excluded by!**/dist/**
packages/procedures/dist/index.d.ts
is excluded by!**/dist/**
packages/procedures/dist/index.js
is excluded by!**/dist/**
packages/procedures/dist/index.js.map
is excluded by!**/dist/**
,!**/*.map
📒 Files selected for processing (70)
- .changeset/five-candles-bathe.md (1 hunks)
- .vscode/settings.json (1 hunks)
- docs/src/content/docs/reference/@tevm/actions/classes/BlobGasLimitExceededError.md (3 hunks)
- docs/src/content/docs/reference/@tevm/actions/functions/ethNewFilterHandler.md (1 hunks)
- docs/src/content/docs/reference/@tevm/actions/functions/ethSendRawTransactionHandler.md (1 hunks)
- docs/src/content/docs/reference/@tevm/actions/functions/loadStateHandler.md (1 hunks)
- docs/src/content/docs/reference/@tevm/actions/type-aliases/CallHandler.md (1 hunks)
- docs/src/content/docs/reference/@tevm/actions/type-aliases/ContractHandler.md (1 hunks)
- docs/src/content/docs/reference/@tevm/actions/type-aliases/ContractParams.md (1 hunks)
- docs/src/content/docs/reference/@tevm/actions/type-aliases/ContractResult.md (1 hunks)
- docs/src/content/docs/reference/@tevm/actions/type-aliases/EthNewFilterError.md (1 hunks)
- docs/src/content/docs/reference/@tevm/actions/type-aliases/FilterParams.md (2 hunks)
- docs/src/content/docs/reference/@tevm/actions/type-aliases/LoadStateResult.md (1 hunks)
- docs/src/content/docs/reference/@tevm/actions/type-aliases/MineHandler.md (1 hunks)
- docs/src/content/docs/reference/@tevm/actions/type-aliases/TevmContractError.md (1 hunks)
- docs/src/content/docs/reference/@tevm/actions/type-aliases/TevmJsonRpcBulkRequestHandler.md (2 hunks)
- docs/src/content/docs/reference/@tevm/actions/type-aliases/TevmJsonRpcRequestHandler.md (2 hunks)
- docs/src/content/docs/reference/@tevm/actions/type-aliases/TevmLoadStateError.md (1 hunks)
- docs/src/content/docs/reference/@tevm/address/classes/Address.md (1 hunks)
- docs/src/content/docs/reference/@tevm/address/functions/create2ContractAddress.md (1 hunks)
- docs/src/content/docs/reference/@tevm/address/functions/createAddress.md (1 hunks)
- docs/src/content/docs/reference/@tevm/address/functions/createContractAddress.md (1 hunks)
- docs/src/content/docs/reference/@tevm/block/classes/Block.md (2 hunks)
- docs/src/content/docs/reference/@tevm/block/classes/BlockHeader.md (1 hunks)
- docs/src/content/docs/reference/@tevm/block/functions/executionPayloadFromBeaconPayload.md (1 hunks)
- docs/src/content/docs/reference/@tevm/block/interfaces/BlockOptions.md (4 hunks)
- docs/src/content/docs/reference/@tevm/config/defineConfig/classes/DefineConfigError.md (1 hunks)
- docs/src/content/docs/reference/@tevm/config/loadConfig/classes/LoadConfigError.md (1 hunks)
- docs/src/content/docs/reference/@tevm/config/types/type-aliases/CompilerConfig.md (1 hunks)
- docs/src/content/docs/reference/@tevm/config/types/type-aliases/ResolvedCompilerConfig.md (1 hunks)
- docs/src/content/docs/reference/@tevm/contract/functions/createContract.md (1 hunks)
- docs/src/content/docs/reference/@tevm/contract/type-aliases/CreateContractParams.md (1 hunks)
- docs/src/content/docs/reference/@tevm/memory-client/functions/createMemoryClient.md (2 hunks)
- docs/src/content/docs/reference/@tevm/memory-client/functions/createTevmTransport.md (1 hunks)
- docs/src/content/docs/reference/@tevm/memory-client/type-aliases/CreateMemoryClientFn.md (2 hunks)
- docs/src/content/docs/reference/@tevm/memory-client/type-aliases/MemoryClient.md (1 hunks)
- docs/src/content/docs/reference/@tevm/memory-client/type-aliases/MemoryClientOptions.md (2 hunks)
- docs/src/content/docs/reference/@tevm/state/functions/dumpCanonicalGenesis.md (2 hunks)
- docs/src/content/docs/reference/@tevm/state/functions/generateCanonicalGenesis.md (1 hunks)
- docs/src/content/docs/reference/@tevm/state/functions/getForkClient.md (1 hunks)
- docs/src/content/docs/reference/@tevm/state/interfaces/StateManager.md (1 hunks)
- docs/src/content/docs/reference/@tevm/test-utils/globals.md (1 hunks)
- docs/src/content/docs/reference/@tevm/test-utils/variables/BlockReader.md (1 hunks)
- docs/src/content/docs/reference/@tevm/trie/classes/Trie.md (4 hunks)
- docs/src/content/docs/reference/@tevm/tx/classes/AccessListEIP2930Transaction.md (2 hunks)
- docs/src/content/docs/reference/@tevm/tx/classes/BlobEIP4844Transaction.md (3 hunks)
- docs/src/content/docs/reference/@tevm/tx/classes/FeeMarketEIP1559Transaction.md (2 hunks)
- docs/src/content/docs/reference/@tevm/tx/functions/createImpersonatedTx.md (2 hunks)
- docs/src/content/docs/reference/@tevm/tx/interfaces/ImpersonatedTx.md (2 hunks)
- docs/src/content/docs/reference/@tevm/utils/classes/AsyncEventEmitter.md (1 hunks)
- docs/src/content/docs/reference/@tevm/utils/functions/parseAbi.md (1 hunks)
- docs/src/content/docs/reference/@tevm/utils/interfaces/GenesisState.md (1 hunks)
- docs/src/content/docs/reference/@tevm/utils/type-aliases/AbiItemType.md (1 hunks)
- docs/src/content/docs/reference/@tevm/utils/type-aliases/ExtractAbiEvent.md (1 hunks)
- docs/src/content/docs/reference/@tevm/utils/type-aliases/ExtractAbiEventNames.md (1 hunks)
- docs/src/content/docs/reference/@tevm/utils/type-aliases/ExtractAbiEvents.md (1 hunks)
- docs/src/content/docs/reference/@tevm/utils/type-aliases/ExtractAbiFunction.md (1 hunks)
- docs/src/content/docs/reference/@tevm/utils/type-aliases/ExtractAbiFunctionNames.md (1 hunks)
- docs/src/content/docs/reference/@tevm/utils/type-aliases/ParseAbi.md (1 hunks)
- docs/src/content/docs/reference/@tevm/vm/interfaces/ApplyBlockResult.md (1 hunks)
- docs/src/content/docs/reference/@tevm/vm/interfaces/BuilderOpts.md (3 hunks)
- docs/src/content/docs/reference/@tevm/vm/interfaces/RunBlockOpts.md (1 hunks)
- docs/src/content/docs/reference/@tevm/vm/interfaces/VMOpts.md (2 hunks)
- docs/src/content/docs/reference/_media/bundler.md (1 hunks)
- packages/actions/src/common/FilterParams.ts (1 hunks)
- packages/actions/src/eth/ethGetFilterLogsProcedure.spec.ts (2 hunks)
- packages/actions/src/eth/ethGetLogsHandler.js (2 hunks)
- packages/actions/src/eth/ethGetLogsHandler.spec.ts (1 hunks)
- packages/actions/src/eth/ethNewFilterHandler.js (2 hunks)
- packages/actions/src/utils/isArray.js (1 hunks)
✅ Files skipped from review due to trivial changes (32)
- docs/src/content/docs/reference/@tevm/actions/classes/BlobGasLimitExceededError.md
- docs/src/content/docs/reference/@tevm/actions/functions/ethNewFilterHandler.md
- docs/src/content/docs/reference/@tevm/actions/functions/ethSendRawTransactionHandler.md
- docs/src/content/docs/reference/@tevm/actions/type-aliases/EthNewFilterError.md
- docs/src/content/docs/reference/@tevm/actions/type-aliases/LoadStateResult.md
- docs/src/content/docs/reference/@tevm/actions/type-aliases/TevmContractError.md
- docs/src/content/docs/reference/@tevm/actions/type-aliases/TevmLoadStateError.md
- docs/src/content/docs/reference/@tevm/address/classes/Address.md
- docs/src/content/docs/reference/@tevm/address/functions/create2ContractAddress.md
- docs/src/content/docs/reference/@tevm/address/functions/createAddress.md
- docs/src/content/docs/reference/@tevm/address/functions/createContractAddress.md
- docs/src/content/docs/reference/@tevm/block/functions/executionPayloadFromBeaconPayload.md
- docs/src/content/docs/reference/@tevm/config/loadConfig/classes/LoadConfigError.md
- docs/src/content/docs/reference/@tevm/config/types/type-aliases/ResolvedCompilerConfig.md
- docs/src/content/docs/reference/@tevm/contract/type-aliases/CreateContractParams.md
- docs/src/content/docs/reference/@tevm/memory-client/functions/createMemoryClient.md
- docs/src/content/docs/reference/@tevm/memory-client/type-aliases/CreateMemoryClientFn.md
- docs/src/content/docs/reference/@tevm/state/functions/dumpCanonicalGenesis.md
- docs/src/content/docs/reference/@tevm/state/functions/generateCanonicalGenesis.md
- docs/src/content/docs/reference/@tevm/test-utils/variables/BlockReader.md
- docs/src/content/docs/reference/@tevm/tx/functions/createImpersonatedTx.md
- docs/src/content/docs/reference/@tevm/utils/functions/parseAbi.md
- docs/src/content/docs/reference/@tevm/utils/interfaces/GenesisState.md
- docs/src/content/docs/reference/@tevm/utils/type-aliases/AbiItemType.md
- docs/src/content/docs/reference/@tevm/utils/type-aliases/ExtractAbiEvent.md
- docs/src/content/docs/reference/@tevm/utils/type-aliases/ExtractAbiEventNames.md
- docs/src/content/docs/reference/@tevm/utils/type-aliases/ExtractAbiEvents.md
- docs/src/content/docs/reference/@tevm/utils/type-aliases/ExtractAbiFunction.md
- docs/src/content/docs/reference/@tevm/utils/type-aliases/ExtractAbiFunctionNames.md
- docs/src/content/docs/reference/@tevm/utils/type-aliases/ParseAbi.md
- docs/src/content/docs/reference/@tevm/vm/interfaces/ApplyBlockResult.md
- docs/src/content/docs/reference/@tevm/vm/interfaces/BuilderOpts.md
🧰 Additional context used
🪛 Markdownlint
docs/src/content/docs/reference/@tevm/actions/functions/loadStateHandler.md
51-51: Expected: 0; Actual: 1
Unordered list indentation(MD007, ul-indent)
52-52: Expected: 0; Actual: 1
Unordered list indentation(MD007, ul-indent)
53-53: Expected: 0; Actual: 1
Unordered list indentation(MD007, ul-indent)
docs/src/content/docs/reference/@tevm/actions/type-aliases/CallHandler.md
55-55: Expected: 0; Actual: 1
Unordered list indentation(MD007, ul-indent)
56-56: Expected: 0; Actual: 1
Unordered list indentation(MD007, ul-indent)
docs/src/content/docs/reference/@tevm/actions/type-aliases/ContractHandler.md
68-68: Expected: 0; Actual: 1
Unordered list indentation(MD007, ul-indent)
69-69: Expected: 0; Actual: 1
Unordered list indentation(MD007, ul-indent)
docs/src/content/docs/reference/@tevm/actions/type-aliases/ContractParams.md
56-56: Expected: 0; Actual: 1
Unordered list indentation(MD007, ul-indent)
57-57: Expected: 0; Actual: 1
Unordered list indentation(MD007, ul-indent)
docs/src/content/docs/reference/@tevm/actions/type-aliases/MineHandler.md
33-33: Expected: 0; Actual: 1
Unordered list indentation(MD007, ul-indent)
34-34: Expected: 0; Actual: 1
Unordered list indentation(MD007, ul-indent)
docs/src/content/docs/reference/@tevm/contract/functions/createContract.md
98-98: Expected: 0; Actual: 1
Unordered list indentation(MD007, ul-indent)
docs/src/content/docs/reference/@tevm/memory-client/functions/createTevmTransport.md
50-50: Expected: 0; Actual: 1
Unordered list indentation(MD007, ul-indent)
docs/src/content/docs/reference/@tevm/memory-client/type-aliases/MemoryClient.md
38-38: Expected: 0; Actual: 1
Unordered list indentation(MD007, ul-indent)
docs/src/content/docs/reference/@tevm/memory-client/type-aliases/MemoryClientOptions.md
51-51: Expected: 0; Actual: 1
Unordered list indentation(MD007, ul-indent)
52-52: Expected: 0; Actual: 1
Unordered list indentation(MD007, ul-indent)
docs/src/content/docs/reference/@tevm/trie/classes/Trie.md
293-293: (EIP-1186)[https://eips.ethereum.org/EIPS/eip-1186]
Reversed link syntax(MD011, no-reversed-links)
🪛 LanguageTool
docs/src/content/docs/reference/@tevm/block/interfaces/BlockOptions.md
[grammar] ~52-~52: There seems to be a noun/verb agreement error (not necessarily with the noun that is immediately before ‘behavior’).
Context: ...e internally copied so that tx behavior don't incidentally change on future HF change...(SINGULAR_NOUN_AGREEMENT_DONT)
docs/src/content/docs/reference/@tevm/config/types/type-aliases/CompilerConfig.md
[uncategorized] ~11-~11: Possible missing comma found.
Context: ...he solidity compiler When resolved with defaults it is a [ResolvedCompilerConfig](../../...(AI_HYDRA_LEO_MISSING_COMMA)
🔇 Additional comments (60)
.changeset/five-candles-bathe.md (1)
1-5
: LGTM: Version bumps are appropriate.The minor version bumps for "@tevm/procedures", "@tevm/actions", and "tevm" are consistent and appropriate for the described changes. This indicates new features or improvements without breaking changes, which aligns with the modification of the
eth_getLogs
andeth_getFilterLogs
interfaces.packages/actions/src/common/FilterParams.ts (2)
6-7
: LGTM: Improved comment clarity.The grammatical correction from "optionsobject" to "options object" enhances readability and adheres to proper documentation standards.
12-12
: LGTM: Enhanced flexibility for topic filtering.The updated type signature for
topics
now allows for both a single array of topics and an array of arrays of topics. This change:
- Aligns with the Ethereum JSON-RPC API specification.
- Provides more flexibility in specifying topics for filtering.
- Maintains backwards compatibility with existing code.
- Preserves immutability by using
ReadonlyArray
.To ensure consistency across the codebase, let's verify the usage of this updated type:
✅ Verification successful
Action Required: Adjust Shell Scripts for TypeScript Files
The previous shell scripts failed because
rg
does not recognize thetypescript
file type. To proceed, please run the following updated scripts that search for.ts
and.tsx
files directly:
Verified: Type signature update for
topics
is consistent across the codebase.
- The updated type allows both a single array of
Hex
and an array of arrays ofHex
fortopics
.- Aligns with the Ethereum JSON-RPC API specification.
- Maintains backward compatibility and immutability with
ReadonlyArray
.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Check for consistent usage of the updated FilterParams type # Test 1: Search for FilterParams usage echo "Searching for FilterParams usage:" rg --type typescript "FilterParams" -A 5 # Test 2: Search for topics property usage within FilterParams context echo "Searching for topics property usage within FilterParams context:" rg --type typescript "FilterParams.*topics" -A 5 # Test 3: Search for eth_getLogs and eth_getFilterLogs implementations echo "Searching for eth_getLogs and eth_getFilterLogs implementations:" rg --type typescript "eth_getLogs|eth_getFilterLogs" -A 10Length of output: 612
Script:
#!/bin/bash # Description: Check for consistent usage of the updated FilterParams type # Test 1: Search for FilterParams usage echo "Searching for FilterParams usage in .ts and .tsx files:" fd --extension ts --extension tsx --exec rg "FilterParams" -A 5 # Test 2: Search for topics property usage within FilterParams context echo "Searching for topics property usage within FilterParams context in .ts and .tsx files:" fd --extension ts --extension tsx --exec rg "FilterParams.*topics" -A 5 # Test 3: Search for eth_getLogs and eth_getFilterLogs implementations echo "Searching for eth_getLogs and eth_getFilterLogs implementations in .ts and .tsx files:" fd --extension ts --extension tsx --exec rg "eth_getLogs|eth_getFilterLogs" -A 10Length of output: 25041
docs/src/content/docs/reference/@tevm/test-utils/globals.md (1)
10-10
: LGTM: New variableBlockReader
added to the documentation.The addition of
[BlockReader]
to the list of variables is consistent with the changes mentioned in the AI summary. This update improves the documentation by including a new exported entity.docs/src/content/docs/reference/@tevm/actions/type-aliases/FilterParams.md (2)
10-10
: LGTM: Improved description clarityThe description has been corrected from "optionsobject" to "options object", which improves readability and aligns with standard terminology.
28-28
: LGTM: Enhanced type declaration for topicsThe updated type declaration for
topics
now allows for bothReadonlyArray<Hex>
andReadonlyArray<ReadonlyArray<Hex>>
. This change:
- Aligns with the PR objective of allowing multiple topics for
eth_getLogs
andeth_getFilterLogs
.- Provides more flexibility in specifying topics, supporting both simple and nested arrays of hexadecimal values.
- Is consistent with Ethereum JSON-RPC API specifications for topics.
To ensure this change is consistent across the codebase, let's verify the usage:
✅ Verification successful
To proceed with the verification, let's correct the file type used in the
rg
commands and rerun the scripts:
To proceed with the verification, let's adjust the search to target TypeScript files by their extensions:
LGTM: Enhanced type declaration for topics
The updated type declaration for
topics
now allows for bothReadonlyArray<Hex>
andReadonlyArray<ReadonlyArray<Hex>>
. This change:
- Aligns with the PR objective of allowing multiple topics for
eth_getLogs
andeth_getFilterLogs
.- Provides more flexibility in specifying topics, supporting both simple and nested arrays of hexadecimal values.
- Is consistent with Ethereum JSON-RPC API specifications for topics.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the usage of FilterParams and topics in the codebase # Test 1: Search for FilterParams usage echo "FilterParams usage:" rg --type typescript "FilterParams" -A 5 # Test 2: Search for topics declaration in other relevant files echo "\ntopics declarations:" rg --type typescript "topics.*:.*ReadonlyArray" -A 2Length of output: 269
Script:
# Description: Verify the usage of FilterParams and topics in the codebase with corrected file types # Test 1: Search for FilterParams usage echo "FilterParams usage:" rg --type ts "FilterParams" -A 5 # Test 2: Search for topics declaration in other relevant files echo "\ntopics declarations:" rg --type ts "topics.*:.*ReadonlyArray" -A 2Length of output: 12691
Script:
# Description: Verify the usage of FilterParams and topics in the codebase by targeting TypeScript files # Test 1: Search for FilterParams usage echo "FilterParams usage:" rg "FilterParams" -g "*.ts" -g "*.tsx" -A 5 # Test 2: Search for topics declaration in other relevant files echo "\ntopics declarations:" rg "topics\s*:\s*ReadonlyArray" -g "*.ts" -g "*.tsx" -A 2Length of output: 12551
.vscode/settings.json (1)
34-35
: Verify the intention of the global formatter setting.The addition of
"editor.defaultFormatter": "biomejs.biome"
as a global setting might override language-specific formatter settings, such as the existing TypeScript-specific setting. This change doesn't appear to be related to the PR objectives of enhancingeth_getLogs
andeth_getFilterLogs
functionality.Consider the following:
- Was this change intentional or accidentally committed?
- If intentional, should this setting be moved to language-specific blocks (e.g.,
"[javascript]"
,"[typescript]"
) rather than set globally?- How does this affect formatting for other file types in the project?
To check for any unintended effects, you can run:
This will help identify any potential conflicts with the new global setting.
docs/src/content/docs/reference/@tevm/memory-client/functions/createTevmTransport.md (1)
Line range hint
1-24
: LGTM: Improved documentation clarityThe changes in the function description and parameters section enhance the clarity and usefulness of the documentation. The expanded explanation of the TEVM Transport's purpose and the specification of the
options
parameter type provide valuable context for users.🧰 Tools
🪛 Markdownlint
50-50: Expected: 0; Actual: 1
Unordered list indentation(MD007, ul-indent)
51-51: Expected: 0; Actual: 1
Unordered list indentation(MD007, ul-indent)
52-52: Expected: 0; Actual: 1
Unordered list indentation(MD007, ul-indent)
53-53: Expected: 0; Actual: 1
Unordered list indentation(MD007, ul-indent)
docs/src/content/docs/reference/@tevm/actions/type-aliases/ContractResult.md (1)
Line range hint
1-62
: Excellent documentation for theContractResult
type.The documentation for the
ContractResult
type is comprehensive and well-structured. It includes:
- Clear type parameter descriptions
- A practical example demonstrating usage
- Links to related types
This level of detail greatly enhances the usability of the
ContractResult
type for developers.docs/src/content/docs/reference/@tevm/actions/type-aliases/ContractParams.md (1)
Line range hint
1-55
: Documentation improvements look great!The updates to the
ContractParams
type alias documentation are well-done. The clarified type definition, detailed parameter explanations, and the added usage example significantly enhance the understanding and usability of this type. The updated links to related types and functions also improve navigation within the documentation.🧰 Tools
🪛 Markdownlint
55-55: Expected: 0; Actual: 1
Unordered list indentation(MD007, ul-indent)
56-56: Expected: 0; Actual: 1
Unordered list indentation(MD007, ul-indent)
57-57: Expected: 0; Actual: 1
Unordered list indentation(MD007, ul-indent)
docs/src/content/docs/reference/@tevm/actions/type-aliases/ContractHandler.md (2)
Line range hint
1-67
: LGTM: Well-structured and comprehensive documentation.The documentation for the
ContractHandler
type alias is well-organized and provides clear explanations for type parameters, function parameters, return type, and usage. The inclusion of an example is particularly helpful for developers to understand how to implement theContractHandler
.🧰 Tools
🪛 Markdownlint
67-67: Expected: 0; Actual: 1
Unordered list indentation(MD007, ul-indent)
68-68: Expected: 0; Actual: 1
Unordered list indentation(MD007, ul-indent)
69-69: Expected: 0; Actual: 1
Unordered list indentation(MD007, ul-indent)
68-69
: Verify updated documentation links.The links to
ContractParams
andContractResult
have been updated, which is likely due to a reorganization of the documentation structure. These changes look good, but it's important to ensure that the new links are correct and functional.Please run the following script to verify the existence of the linked files:
✅ Verification successful
Documentation links are correct and functional.
The updated links toContractParams
andContractResult
inContractHandler.md
correctly point to their respective files in the@tevm/actions/type-aliases
directory. No issues were found.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the existence of linked documentation files # Test: Check if the ContractParams file exists fd -t f "ContractParams.md" docs/src/content/docs/reference/tevm/actions/type-aliases # Test: Check if the ContractResult file exists fd -t f "ContractResult.md" docs/src/content/docs/reference/tevm/actions/type-aliasesLength of output: 461
Script:
#!/bin/bash # Description: Locate the ContractParams.md and ContractResult.md files in the repository # Search for ContractParams.md fd -t f "ContractParams\.md" # Search for ContractResult.md fd -t f "ContractResult\.md"Length of output: 878
Script:
#!/bin/bash # Description: Verify the existence of linked documentation files in the correct directory # and identify any conflicting files in the repository. # Define the correct directory path TARGET_DIR="docs/src/content/docs/reference/@tevm/actions/type-aliases" # Check if the target directory exists if [ -d "$TARGET_DIR" ]; then echo "Directory $TARGET_DIR exists." else echo "[fd error]: Search path '$TARGET_DIR' is not a directory." fi # Verify the existence of ContractParams.md in the target directory fd -t f "ContractParams\.md" "$TARGET_DIR" # Verify the existence of ContractResult.md in the target directory fd -t f "ContractResult\.md" "$TARGET_DIR" # Search for all instances of ContractParams.md and ContractResult.md in the repository echo "Searching for all instances of ContractParams.md:" fd -t f "ContractParams\.md" echo "Searching for all instances of ContractResult.md:" fd -t f "ContractResult\.md"Length of output: 1737
🧰 Tools
🪛 Markdownlint
68-68: Expected: 0; Actual: 1
Unordered list indentation(MD007, ul-indent)
69-69: Expected: 0; Actual: 1
Unordered list indentation(MD007, ul-indent)
packages/actions/src/eth/ethNewFilterHandler.js (2)
4-4
: LGTM: New import statement forisArray
The new import statement for
isArray
is correctly added and follows the existing import style in the file. This import is necessary for the enhanced topic processing functionality.
Line range hint
1-105
: Overall assessment: Well-implemented enhancementThe changes in this file successfully implement the ability to handle multiple topics for eth_getLogs and eth_getFilterLogs, as per the PR objectives. The modifications are minimal, focused, and don't introduce unnecessary changes to the existing code structure. The implementation aligns well with Ethereum JSON-RPC API specifications for topic filtering.
To further improve the code:
- Consider adding unit tests specifically for the new topic processing logic to ensure its correctness and prevent future regressions.
- Update the function's JSDoc comments to reflect the new capability of handling array topics.
To ensure the changes don't introduce any unintended side effects, please run the following verification script:
This script will help ensure that the changes are isolated to the intended functionality and haven't inadvertently affected other parts of the codebase.
✅ Verification successful
Verification Successful: No Unintended Side Effects Detected
The verification process confirmed that the usage of
isArray
inethGetLogsHandler.js
is intentional and remains unaffected by the recent changes inethNewFilterHandler.js
. Additionally, no unintended modifications were found in other filter-related functions. The existing TODO comments inethGetFilterChangesProcedure.js
pertain to type fixes and are unrelated to this PR.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that the changes don't affect other parts of the codebase unintentionally # Test 1: Check for any unintended usage of 'isArray' in other files echo "Checking for unintended usage of 'isArray':" rg --type js "import.*isArray.*from.*utils/isArray" -g '!packages/actions/src/eth/ethNewFilterHandler.js' # Test 2: Verify that other filter-related functions haven't been unintentionally modified echo "Checking other filter-related functions:" rg --type js "function.*Filter" -g 'packages/actions/src/eth/*.js' -g '!packages/actions/src/eth/ethNewFilterHandler.js' # Test 3: Look for any TODO or FIXME comments related to topic filtering echo "Checking for TODO or FIXME comments related to topic filtering:" rg --type js "TODO|FIXME" -g 'packages/actions/src/eth/*.js' | rg -i "topic|filter"Length of output: 907
docs/src/content/docs/reference/@tevm/config/defineConfig/classes/DefineConfigError.md (1)
8-8
: Approve change with verification request.The update to the link reference for the
defineConfig
function improves the documentation's maintainability by using a shorter, more concise path. This change aligns with the PR's objective of enhancing documentation clarity.Please verify that the new link path
../../../../../../../../../reference/tevm/config/defineconfig/functions/defineconfig
is correct and functional within the documentation structure. Run the following script to check if the target file exists:docs/src/content/docs/reference/@tevm/actions/type-aliases/TevmJsonRpcRequestHandler.md (6)
46-47
: LGTM: Updated links for tevm_call request and response types.The links for
CallJsonRpcRequest
andCallJsonRpcResponse
have been updated to point to more specific paths. This change appears to be part of a documentation restructuring and improves the precision of the references.
51-52
: LGTM: Updated links for tevm_getAccount request and response types.The links for
GetAccountJsonRpcRequest
andGetAccountJsonRpcResponse
have been updated to follow the new documentation structure. These changes are consistent with the previous updates and improve the accuracy of the references.
70-71
: LGTM: Updated links for eth_blockNumber request and response types.The links for
EthBlockNumberJsonRpcRequest
andEthBlockNumberJsonRpcResponse
have been updated to follow the new documentation structure. These changes are consistent with the previous updates and improve the accuracy of the references.
75-76
: LGTM: Updated links for eth_chainId request and response types.The links for
EthChainIdJsonRpcRequest
andEthChainIdJsonRpcResponse
have been updated to follow the new documentation structure. These changes are consistent with the previous updates and improve the accuracy of the references.
80-81
: LGTM: Updated links for eth_getCode request and response types.The links for
EthGetCodeJsonRpcRequest
andEthGetCodeJsonRpcResponse
have been updated to follow the new documentation structure. These changes are consistent with the previous updates and improve the accuracy of the references.
85-86
: LGTM: Consistent updates to all remaining method links.The links for the request and response types of
eth_getStorageAt
,eth_gasPrice
, andeth_getBalance
have been updated to follow the new documentation structure. These changes are consistent with the previous updates and improve the accuracy of the references throughout the document.Overall, this update enhances the documentation by providing more precise links to the type aliases for requests and responses. The changes reflect a reorganization of the documentation structure, making it easier for developers to navigate and find specific type information.
Also applies to: 90-91, 95-96
docs/src/content/docs/reference/@tevm/actions/type-aliases/TevmJsonRpcBulkRequestHandler.md (5)
45-46
: LGTM: Updated reference links for CallJsonRpcRequest and CallJsonRpcResponseThe reference links have been updated to use relative paths, which is consistent with the current file structure. This change improves the maintainability of the documentation.
50-51
: LGTM: Updated reference links for GetAccountJsonRpcRequest and GetAccountJsonRpcResponseThe reference links have been updated consistently with the previous changes, using relative paths. This maintains the documentation structure and improves navigation.
69-70
: LGTM: Updated reference links for EthBlockNumberJsonRpcRequest and EthBlockNumberJsonRpcResponseThe reference links have been updated consistently with the previous changes, using relative paths. This maintains the documentation structure and improves navigation.
74-75
: LGTM: Updated reference links for multiple Eth JSON-RPC types*The reference links for the following types have been consistently updated:
- EthChainIdJsonRpcRequest and EthChainIdJsonRpcResponse
- EthGetCodeJsonRpcRequest and EthGetCodeJsonRpcResponse
- EthGetStorageAtJsonRpcRequest and EthGetStorageAtJsonRpcResponse
- EthGasPriceJsonRpcRequest and EthGasPriceJsonRpcResponse
- EthGetBalanceJsonRpcRequest and EthGetBalanceJsonRpcResponse
These changes maintain consistency in the documentation structure and improve navigation.
Also applies to: 79-80, 84-85, 89-90, 94-95
Line range hint
1-101
: Overall assessment: Documentation improvementsThe changes in this file primarily focus on updating reference links for various JSON-RPC request and response types. These updates improve the consistency and maintainability of the documentation by using relative paths that align with the current file structure.
A minor issue was identified with a missing link for
SetAccountJsonRpcResponse
, which has been addressed in a previous comment.These changes contribute to better navigation and a more cohesive documentation structure.
docs/src/content/docs/reference/@tevm/vm/interfaces/RunBlockOpts.md (1)
90-90
: Excellent clarification of thesetHardfork
default behavior!This change significantly improves the documentation by:
- Explicitly stating the default value (
false
).- Explaining how the hardfork is determined when using the default.
- Updating the link to the
Common
reference, which appears to be more accurate.These improvements enhance the overall clarity and usability of the documentation for developers working with the
RunBlockOpts
interface.packages/actions/src/eth/ethGetLogsHandler.js (2)
6-6
: LGTM: New import forisArray
function.The addition of the
isArray
import is appropriate for the upcoming changes in topic processing.
Line range hint
1-141
: Overall assessment: Changes successfully implement multiple topic handling.The modifications to
ethGetLogsHandler.js
effectively implement the ability to handle multiple topics foreth_getLogs
andeth_getFilterLogs
, aligning well with the PR objectives. The changes are focused and achieve the intended goal without introducing any major issues.Key points:
- The new import and use of
isArray
function enhance the flexibility of topic processing.- The implementation now correctly handles both single topics and arrays of topics.
- The changes are minimal and targeted, reducing the risk of unintended side effects.
Consider the minor suggestions for code improvement mentioned earlier to further enhance code quality and maintainability.
packages/actions/src/eth/ethGetFilterLogsProcedure.spec.ts (2)
5-5
: LGTM: New imports added for the test case.The addition of
keccak256
andstringToHex
imports from '@tevm/utils' is appropriate for the new test case.
118-158
: LGTM: Thorough test case execution.The test case execution is comprehensive:
- It correctly simulates multiple transactions that should generate logs.
- The use of
callProcedure
for transactions anddoMine
for block creation is consistent with the existing codebase.- The retrieval of filter logs using
ethGetFilterLogsProcedure
is done correctly.This approach ensures a robust test of the OR'ed topics functionality.
docs/src/content/docs/reference/@tevm/vm/interfaces/VMOpts.md (2)
233-233
: Improved clarity forsetHardfork?
default value description.The rephrasing of the default value description for the
setHardfork?
property enhances readability while maintaining the original meaning. The direct reference to theCommon
instance provides a clearer context for the default behavior.
Line range hint
1-233
: Overall documentation improvements enhance clarity and accuracy.The changes in this file successfully improve the documentation for the
VMOpts
interface. The updates to thecommon?
andsetHardfork?
properties provide clearer explanations and more accurate references, which aligns well with the PR objectives of enhancing functionality and documentation.These documentation improvements will be beneficial for developers working with the VM options, particularly in understanding how to configure the chain setup and hardforks.
docs/src/content/docs/reference/@tevm/memory-client/type-aliases/MemoryClient.md (1)
Line range hint
1-37
: LGTM: Improved type alias definition and descriptionThe updates to the type alias definition and description provide more detailed and accurate information about the
MemoryClient
. The expanded explanation of its capabilities, including support for manual and auto mining modes, and the clarification of type parameters enhance the documentation's usefulness.🧰 Tools
🪛 Markdownlint
38-38: Expected: 0; Actual: 1
Unordered list indentation(MD007, ul-indent)
39-39: Expected: 0; Actual: 1
Unordered list indentation(MD007, ul-indent)
40-40: Expected: 0; Actual: 1
Unordered list indentation(MD007, ul-indent)
41-41: Expected: 0; Actual: 1
Unordered list indentation(MD007, ul-indent)
packages/actions/src/eth/ethGetLogsHandler.spec.ts (1)
Line range hint
1-331
: LGTM! The new test case enhances coverage for OR'ed topics filteringThe addition of the "should filter logs with OR'ed topics" test case is a valuable enhancement to the
ethGetLogsHandler
spec. It effectively demonstrates the new capability to filter logs using multiple topics, which aligns well with the PR objectives.The test is well-structured and follows the established patterns in the file. With the suggested minor improvements, it will provide robust coverage for this important feature.
docs/src/content/docs/reference/@tevm/state/interfaces/StateManager.md (3)
242-242
: LGTM: Documentation update fordumpCanonicalGenesis
The update to the return type reference path reflects a restructuring of documentation links, improving navigation and consistency across the documentation.
Line range hint
301-305
: Approved: Added experimental warning tocommit
methodThe addition of the experimental warning is crucial for developers. It clearly communicates that this API is not stable and should be used with caution, especially in production environments.
Line range hint
1-491
: Overall assessment: Documentation improvementsThe changes in this file are focused on improving the documentation of the
StateManager
interface. The updates provide important information about API stability, particularly for thecommit
andsaveStateRoot
methods. These changes will help developers make informed decisions when using these APIs.docs/src/content/docs/reference/@tevm/block/classes/Block.md (3)
Line range hint
13-29
: LGTM: Constructor documentation improvedThe updated constructor documentation provides a more detailed description of each parameter, enhancing the clarity and usability of the
Block
class. This change will help developers better understand how to instantiate aBlock
object.
Line range hint
633-649
: LGTM: ImprovedfromBeaconPayloadJson
method documentationThe updated documentation for the
fromBeaconPayloadJson
method now includes the return type and provides clearer descriptions for the parameters. This change enhances the usability of the method and aligns with best practices for API documentation.
Line range hint
681-699
: LGTM: EnhancedfromExecutionPayload
method documentationThe documentation for the
fromExecutionPayload
method has been improved with the addition of the return type and clearer parameter descriptions. This change maintains consistency with other method documentation improvements and enhances the overall quality of the API documentation.docs/src/content/docs/reference/@tevm/block/classes/BlockHeader.md (2)
Line range hint
565-571
: Approve link format updateThe update to the reference link format for
BlockHeader.cliqueIsEpochTransition
improves consistency in the documentation.🧰 Tools
🪛 LanguageTool
[style] ~568-~568: ‘in conjunction with’ might be wordy. Consider a shorter alternative.
Context: ...tion block and should therefore be used in conjunction with [BlockHeader.cliqueIsEpochTransition](....(EN_WORDINESS_PREMIUM_IN_CONJUNCTION_WITH)
Line range hint
934-944
: Approve clarification ofvalidateGasLimit
methodThe updated description for the
validateGasLimit
method now clearly states that it validates the gas limit against the parent block header. This clarification improves the understanding of the method's purpose and behavior.🧰 Tools
🪛 LanguageTool
[style] ~568-~568: ‘in conjunction with’ might be wordy. Consider a shorter alternative.
Context: ...tion block and should therefore be used in conjunction with [BlockHeader.cliqueIsEpochTransition](....(EN_WORDINESS_PREMIUM_IN_CONJUNCTION_WITH)
docs/src/content/docs/reference/@tevm/tx/classes/AccessListEIP2930Transaction.md (1)
640-642
: Excellent addition to the documentation!The added reference to
getMessageToSign()
for obtaining a tx hash for signing purposes is very helpful. It clarifies the correct method to use when a developer needs to sign a transaction, which can prevent potential misuse of thehash()
method.docs/src/content/docs/reference/@tevm/tx/classes/FeeMarketEIP1559Transaction.md (3)
659-659
: Improved method reference in documentation.The update to the
hash()
method description provides a more accurate reference to thegetMessageToSign()
method. This change enhances the clarity and correctness of the documentation.
724-729
: Consistent update to method reference.The change in the
raw()
method description aligns with the previous update, providing a correct reference to thegetMessageToSign()
method. This consistency improves the overall quality of the documentation.
659-659
: Documentation accuracy improved.The changes in this file are focused on improving the accuracy of method references in the documentation. These updates enhance the overall quality and reliability of the
FeeMarketEIP1559Transaction
class documentation. No further changes are needed.Also applies to: 724-729
docs/src/content/docs/reference/@tevm/tx/interfaces/ImpersonatedTx.md (4)
Line range hint
155-159
: New property added:isImpersonated
The addition of the
isImpersonated
property with a fixed value oftrue
is a good way to distinguish this transaction type. This allows for easy identification of impersonated transactions in the codebase.
653-657
: Updated documentation forhash()
methodThe documentation for the
hash()
method has been updated with a new line number for thegetMessageToSign
method reference. This keeps the documentation consistent with any code changes.
718-727
: Updated documentation forraw()
methodThe documentation for the
raw()
method has been updated with new line numbers for theserialize
andgetMessageToSign
method references. This maintains the accuracy of the documentation.
Line range hint
1-824
: Overall assessment of ImpersonatedTx interfaceThe changes to the
ImpersonatedTx
interface documentation are minimal and well-implemented. The addition of theisImpersonated
property provides a clear way to identify impersonated transactions. The updates to method reference links maintain the accuracy of the documentation. These changes enhance the usability and clarity of the interface without introducing any apparent issues.docs/src/content/docs/reference/@tevm/tx/classes/BlobEIP4844Transaction.md (4)
703-705
: Improved clarity inhash()
method documentation.The updated documentation for the
hash()
method now clearly distinguishes between its usage for signed transactions and the recommended approach for obtaining a hash for signing purposes. This clarification is helpful for developers and reduces potential confusion.
789-791
: Enhanced accuracy inraw()
method documentation.The updated documentation for the
raw()
method now correctly references thegetMessageToSign()
method for obtaining an EIP-155 compliant representation for external signing. This improvement provides developers with the right guidance for implementing external signing mechanisms.
1106-1110
: Improved parameter descriptions forminimalFromNetworkWrapper()
.The documentation for the
minimalFromNetworkWrapper()
static method now includes more precise type information and descriptions for its parameters. This enhancement provides developers with clearer guidance on how to use this method correctly.
Line range hint
1145-1153
: Clearer description offromSerializedBlobTxNetworkWrapper()
method.The documentation for the
fromSerializedBlobTxNetworkWrapper()
static method has been improved with a clearer description of its purpose and more precise parameter explanations. This update helps developers better understand how to use this method when working with serialized blob transactions.docs/src/content/docs/reference/@tevm/utils/classes/AsyncEventEmitter.md (3)
Line range hint
1-11
: LGTM: Class description and inheritance are well-documented.The
AsyncEventEmitter
class is correctly described as extendingEventEmitter
, and the type parameterT
is properly defined.
Line range hint
13-25
: LGTM: Constructor is well-documented.The constructor signature, including the optional
options
parameter and return type, is clearly documented.
Line range hint
636-908
: LGTM: Method overloads are well-documented.The multiple overloads for methods like
on
andonce
are clearly documented, providing users with a comprehensive understanding of the different ways these methods can be used.docs/src/content/docs/reference/@tevm/state/functions/getForkClient.md (2)
Line range hint
1-7
: LGTM: Function overview and metadata look good.The initial metadata and function overview are clear and concise. The function is correctly described as creating a public client for a fork, which aligns with its purpose.
Line range hint
13-211
: Comprehensive return type documentation.The return type is well-documented with detailed descriptions of each property. This level of detail is excellent for developers using the function.
- [CallParams](../../../../../../../../reference/tevm/actions/type-aliases/callparams) | ||
- [CallResult](../../../../../../../../reference/tevm/actions/type-aliases/callresult) |
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.
💡 Codebase verification
Incorrect relative paths detected in documentation links.
The current relative paths for CallParams
and CallResult
in CallHandler.md
are overly complex and do not correctly point to the intended files within the same directory. Please update the paths to reference the files directly:
[CallParams](./CallParams.md)
[CallResult](./CallResult.md)
This will ensure the links function correctly and improve documentation quality.
🔗 Analysis chain
Verify the updated relative paths for accuracy.
The relative paths for CallParams
and CallResult
have been updated with additional parent directory levels. While this aligns with the documentation revisions mentioned in the summary, it's crucial to ensure these paths are correct.
To verify the correctness of these paths, you can run the following script:
If you need help adjusting these paths or creating a more robust linking system for your documentation, please let me know.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Verify the existence of the referenced Markdown files
# Test: Check if the CallParams.md file exists
fd -e md -p "reference/tevm/actions/type-aliases/callparams.md"
# Test: Check if the CallResult.md file exists
fd -e md -p "reference/tevm/actions/type-aliases/callresult.md"
# If both files are found, the paths are likely correct
Length of output: 127
Script:
#!/bin/bash
# Description: Search for CallParams.md and CallResult.md anywhere in the repository
# Search for CallParams.md
fd -e md "callparams.md"
# Search for CallResult.md
fd -e md "callresult.md"
Length of output: 1880
🧰 Tools
🪛 Markdownlint
55-55: Expected: 0; Actual: 1
Unordered list indentation(MD007, ul-indent)
56-56: Expected: 0; Actual: 1
Unordered list indentation(MD007, ul-indent)
https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getlogs
each topic can be an array of Data. The correct API was being used for receiptManager.getLogs, so just needed to update eth_getLogs and eth_getFilterLogs handler to correctly pass it
Summary by CodeRabbit
New Features
Documentation
Tests