-
-
Notifications
You must be signed in to change notification settings - Fork 28
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 events to tevm #1154
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
🦋 Changeset detectedLatest commit: da87a05 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 |
WalkthroughThe changes involve updates across various packages, focusing on restructuring configuration settings, enhancing functionality, improving error handling, and updating documentation. Key updates include refining task dependencies in Changes
Poem
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 as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
This stack of pull requests is managed by Graphite. Learn more about stacking. Join @roninjin10 and the rest of your teammates on |
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 (2)
tevm/docs/index/type-aliases/Filter.md (1)
Line range hint
29-29
: Convert the bare URL to a markdown link to improve readability and comply with markdown best practices.[go-ethereum filter system](https://github.com/ethereum/go-ethereum/blob/master/eth/filters/filter_system.go#L329)packages/base-client/src/createBaseClient.js (1)
286-292
: The newreadyPromise
block is a good addition for ensuring that all components are initialized before the client becomes active.Consider adding more detailed logging within the
readyPromise
block to trace the initialization steps more clearly. This could help in debugging and maintaining the system.
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (30)
- nx.json (4 hunks)
- packages/actions/src/tevm/createTransaction.js (5 hunks)
- packages/actions/src/tevm/mineHandler.js (3 hunks)
- packages/base-client/docs/classes/ProviderRpcError.md (3 hunks)
- packages/base-client/docs/type-aliases/EIP1193EventEmitter.md (1 hunks)
- packages/base-client/docs/type-aliases/EIP1193EventMap.md (1 hunks)
- packages/base-client/docs/type-aliases/EIP1193Events.md (1 hunks)
- packages/base-client/docs/type-aliases/ProviderConnectInfo.md (1 hunks)
- packages/base-client/docs/type-aliases/ProviderMessage.md (1 hunks)
- packages/base-client/src/EIP1193EventEmitterTypes.ts (2 hunks)
- packages/base-client/src/Filter.ts (1 hunks)
- packages/base-client/src/createBaseClient.js (2 hunks)
- packages/procedures/src/requestProcedure.js (8 hunks)
- tevm/docs/index/functions/createBaseClient.md (1 hunks)
- tevm/docs/index/type-aliases/AutoMining.md (1 hunks)
- tevm/docs/index/type-aliases/BaseClient.md (1 hunks)
- tevm/docs/index/type-aliases/BaseClientOptions.md (1 hunks)
- tevm/docs/index/type-aliases/CustomPrecompile.md (1 hunks)
- tevm/docs/index/type-aliases/EIP1193EventEmitter.md (1 hunks)
- tevm/docs/index/type-aliases/EIP1193EventMap.md (1 hunks)
- tevm/docs/index/type-aliases/EIP1193Events.md (1 hunks)
- tevm/docs/index/type-aliases/Extension.md (1 hunks)
- tevm/docs/index/type-aliases/Filter.md (1 hunks)
- tevm/docs/index/type-aliases/FilterType.md (1 hunks)
- tevm/docs/index/type-aliases/Hardfork.md (1 hunks)
- tevm/docs/index/type-aliases/IntervalMining.md (1 hunks)
- tevm/docs/index/type-aliases/ManualMining.md (1 hunks)
- tevm/docs/index/type-aliases/MiningConfig.md (1 hunks)
- tevm/docs/index/variables/GENESIS_STATE.md (1 hunks)
- tevm/docs/index/variables/prefundedAccounts.md (1 hunks)
Files skipped from review due to trivial changes (16)
- packages/base-client/docs/type-aliases/EIP1193EventEmitter.md
- packages/base-client/docs/type-aliases/EIP1193Events.md
- packages/base-client/docs/type-aliases/ProviderConnectInfo.md
- packages/base-client/docs/type-aliases/ProviderMessage.md
- tevm/docs/index/functions/createBaseClient.md
- tevm/docs/index/type-aliases/AutoMining.md
- tevm/docs/index/type-aliases/CustomPrecompile.md
- tevm/docs/index/type-aliases/EIP1193EventEmitter.md
- tevm/docs/index/type-aliases/EIP1193Events.md
- tevm/docs/index/type-aliases/Extension.md
- tevm/docs/index/type-aliases/FilterType.md
- tevm/docs/index/type-aliases/Hardfork.md
- tevm/docs/index/type-aliases/IntervalMining.md
- tevm/docs/index/type-aliases/MiningConfig.md
- tevm/docs/index/variables/GENESIS_STATE.md
- tevm/docs/index/variables/prefundedAccounts.md
Additional context used
Markdownlint
tevm/docs/index/type-aliases/Filter.md
56-56: null
Bare URL usedpackages/base-client/docs/classes/ProviderRpcError.md
123-123: null
Bare URL usedtevm/docs/index/type-aliases/BaseClient.md
109-109: null
Lists should be surrounded by blank linestevm/docs/index/type-aliases/BaseClientOptions.md
72-72: Column: 1
Hard tabs
73-73: Column: 1
Hard tabs
74-74: Column: 1
Hard tabs
75-75: Column: 1
Hard tabs
76-76: Column: 1
Hard tabs
77-77: Column: 1
Hard tabs
78-78: Column: 1
Hard tabs
79-79: Column: 1
Hard tabs
80-80: Column: 1
Hard tabs
81-81: Column: 1
Hard tabs
82-82: Column: 1
Hard tabs
83-83: Column: 1
Hard tabs
84-84: Column: 1
Hard tabs
85-85: Column: 1
Hard tabs
36-36: null
Fenced code blocks should be surrounded by blank lines
137-137: null
Lists should be surrounded by blank lines
31-31: null
Fenced code blocks should have a language specified
Additional comments not posted (33)
tevm/docs/index/type-aliases/ManualMining.md (1)
19-19
: The update of the source line number correctly reflects changes in the source file.tevm/docs/index/type-aliases/Filter.md (1)
72-72
: The update of the source line number correctly reflects changes in the source file.packages/base-client/src/Filter.ts (1)
54-54
: The addition ofregisteredListeners
enhances the functionality of filters by allowing event listeners to be registered, aligning with the updated documentation.tevm/docs/index/type-aliases/EIP1193EventMap.md (1)
93-101
: The addition of thenewReceipt
method enhances the functionality of theEIP1193EventMap
by handling receipt events, aligning with the source code updates.packages/base-client/docs/type-aliases/EIP1193EventMap.md (2)
93-101
: The addition of thenewReceipt
method enhances the functionality of theEIP1193EventMap
by handling receipt events, aligning with the source code updates.
105-105
: The update to the source link correctly reflects the updated location in the source file.packages/base-client/src/EIP1193EventEmitterTypes.ts (1)
40-40
: The addition of thenewReceipt
method enhances the functionality of theEIP1193EventMap
by handling receipt events, aligning with the documentation updates.nx.json (12)
6-6
: LGTM! Caching and specifying inputs forlint:check
enhances performance.
10-11
: Well-configured dependencies forlint:package
ensure that linting occurs post-build, enhancing reliability.
15-15
: Caching forlint:deps
is a good practice for improving task execution speed.
19-19
: Standardizing inputs and enabling caching forformat:check
is beneficial for consistent formatting checks.
23-24
: Logical update totest
configuration to ensure tests run post-build, capturing the latest changes effectively.
27-28
: Ensuringtest:run
depends on the build process is a good practice for accurate and up-to-date testing.
32-33
: Configuringtest:watch
to depend on builds enhances developer experience by ensuring immediate feedback on changes.
36-38
: Enhancedtest:coverage
configuration with clear outputs and dependencies ensures accurate and efficient coverage reporting.
42-43
: Streamliningtypecheck
with specific inputs and dependencies optimizes performance and reliability.
47-48
: Comprehensive configuration forbuild:types
ensures robust and reliable type generation.
58-60
: Configuringbuild:app
to depend on up-to-date distributions and types ensures consistency and reliability in the build process.
70-72
: Optimized configuration forgenerate:docs
ensures efficient and reliable documentation generation.packages/base-client/docs/classes/ProviderRpcError.md (3)
35-35
: Updated source link for the constructor ensures accurate reference to the source code.
59-59
: Updated source link for thecode
property maintains coherence and accuracy in documentation.
69-69
: Updated source link for thedetails
property ensures accurate documentation.tevm/docs/index/type-aliases/BaseClient.md (1)
200-200
: Updated source link forBaseClient
ensures accurate reference to the source code.tevm/docs/index/type-aliases/BaseClientOptions.md (1)
171-171
: Updated source link forBaseClientOptions
ensures accurate reference to the source code.packages/actions/src/tevm/mineHandler.js (2)
24-30
: Addition ofnewBlocks
andnewReceipts
enhances the mining handler's functionality by enabling tracking of mined blocks and associated receipts.
116-129
: Emitting events for new blocks and receipts enhances the system's interactivity and ensures real-time updates are propagated.packages/actions/src/tevm/createTransaction.js (1)
Line range hint
101-128
: Addition ofpoolPromise
enhances the transaction handler's functionality by managing asynchronous operations effectively.packages/procedures/src/requestProcedure.js (6)
3-3
: Added import forethGetLogsHandler
.This import is necessary for handling the
eth_getLogs
JSON-RPC method, which is part of the new functionality introduced in this PR.
12-21
: Added multiple utility imports from@tevm/utils
.These utilities are likely used in the new functionalities added to handle various data transformations and manipulations required by the JSON-RPC methods.
1038-1089
: Handling ofeth_getFilterLogs
method.The implementation correctly retrieves the filter by ID and handles the case where the filter is not found. The error handling and the transformation of logs into the expected JSON-RPC format are well implemented.
Line range hint
1097-1116
: Added a new case foreth_newBlockFilter
.This addition supports the creation of new block filters, which is a necessary feature for clients that need to track blocks. The implementation correctly manages the lifecycle of the filter and its associated listener.
1130-1147
: Enhanced theeth_uninstallFilter
method to handle different types of filters.The update improves the robustness of filter removal by ensuring that listeners associated with the filter are correctly removed based on the filter type.
Line range hint
1172-1192
: Added handling foreth_newPendingTransactionFilter
.This addition allows clients to track new pending transactions, which is useful for applications that need to react to unconfirmed transactions. The implementation is consistent with other filter types.
|
||
/** | ||
* @param {import('@tevm/utils').EthjsLog} log | ||
*/ | ||
const listener = (log) => { | ||
const filter = client.getFilters().get(id) | ||
if (!filter) { | ||
return | ||
} | ||
filter.logs.push(log) | ||
} | ||
client.on('newLog', listener) | ||
// populate with past blocks | ||
const receiptsManager = await client.getReceiptsManager() | ||
const pastLogs = ( | ||
await receiptsManager.getLogs( | ||
_fromBlock, | ||
_toBlock, | ||
[EthjsAddress.fromString(address).bytes], | ||
topics.map((topic) => hexToBytes(topic)), | ||
) | ||
).map((res) => res.log) | ||
client.setFilter({ | ||
id, | ||
type: 'Log', | ||
created: Date.now(), | ||
logs: [], | ||
logs: pastLogs, | ||
tx: [], | ||
blocks: [], | ||
logsCriteria: { | ||
topics, | ||
address, | ||
toBlock: _toBlock, | ||
fromBlock: _fromBlock, | ||
toBlock: toBlock, | ||
fromBlock: fromBlock, | ||
}, | ||
installed: {}, | ||
err: undefined, | ||
registeredListeners: [listener], |
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.
Added a new case for eth_newFilter
in the JSON-RPC request handler.
- client.on('newLog', listener)
+ client.on('log', listener)
The event name should be corrected to match the expected event that triggers the listener. Ensure that the event 'newLog' is defined or change it to the correct event name.
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.
/** | |
* @param {import('@tevm/utils').EthjsLog} log | |
*/ | |
const listener = (log) => { | |
const filter = client.getFilters().get(id) | |
if (!filter) { | |
return | |
} | |
filter.logs.push(log) | |
} | |
client.on('newLog', listener) | |
// populate with past blocks | |
const receiptsManager = await client.getReceiptsManager() | |
const pastLogs = ( | |
await receiptsManager.getLogs( | |
_fromBlock, | |
_toBlock, | |
[EthjsAddress.fromString(address).bytes], | |
topics.map((topic) => hexToBytes(topic)), | |
) | |
).map((res) => res.log) | |
client.setFilter({ | |
id, | |
type: 'Log', | |
created: Date.now(), | |
logs: [], | |
logs: pastLogs, | |
tx: [], | |
blocks: [], | |
logsCriteria: { | |
topics, | |
address, | |
toBlock: _toBlock, | |
fromBlock: _fromBlock, | |
toBlock: toBlock, | |
fromBlock: fromBlock, | |
}, | |
installed: {}, | |
err: undefined, | |
registeredListeners: [listener], | |
/** | |
* @param {import('@tevm/utils').EthjsLog} log | |
*/ | |
const listener = (log) => { | |
const filter = client.getFilters().get(id) | |
if (!filter) { | |
return | |
} | |
filter.logs.push(log) | |
} | |
client.on('log', listener) | |
// populate with past blocks | |
const receiptsManager = await client.getReceiptsManager() | |
const pastLogs = ( | |
await receiptsManager.getLogs( | |
_fromBlock, | |
_toBlock, | |
[EthjsAddress.fromString(address).bytes], | |
topics.map((topic) => hexToBytes(topic)), | |
) | |
).map((res) => res.log) | |
client.setFilter({ | |
id, | |
type: 'Log', | |
created: Date.now(), | |
logs: pastLogs, | |
tx: [], | |
blocks: [], | |
logsCriteria: { | |
topics, | |
address, | |
toBlock: toBlock, | |
fromBlock: fromBlock, | |
}, | |
installed: {}, | |
err: undefined, | |
registeredListeners: [listener], |
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
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (3)
- packages/base-client/src/EIP1193EventEmitterTypes.ts (1 hunks)
- packages/base-client/src/Filter.ts (1 hunks)
- packages/procedures/src/requestProcedure.js (8 hunks)
Files skipped from review as they are similar to previous changes (2)
- packages/base-client/src/Filter.ts
- packages/procedures/src/requestProcedure.js
Additional comments not posted (5)
packages/base-client/src/EIP1193EventEmitterTypes.ts (5)
13-13
: LGTM! TheProviderConnectInfo
type is well-defined.
17-18
: LGTM! TheProviderMessage
type is correctly structured.
33-43
: LGTM! The additions toEIP1193EventMap
align with the PR's objectives to enhance event handling.
47-48
: LGTM! TheEIP1193Events
type provides clear methods for event management.
51-60
: LGTM! TheEIP1193EventEmitter
interface is minimal and well-documented.
code: number | ||
details: string | ||
|
||
constructor(code: number, message: string) { | ||
super(message) | ||
this.code = code | ||
this.details = message | ||
} | ||
constructor(code: number, message: string) { | ||
super(message) | ||
this.code = code | ||
this.details = message | ||
} |
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.
Consider differentiating between code
and details
in ProviderRpcError
.
- this.details = message
+ this.details = "Additional details: " + message
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.
code: number | |
details: string | |
constructor(code: number, message: string) { | |
super(message) | |
this.code = code | |
this.details = message | |
} | |
constructor(code: number, message: string) { | |
super(message) | |
this.code = code | |
this.details = message | |
} | |
code: number | |
details: string | |
constructor(code: number, message: string) { | |
super(message) | |
this.code = code | |
this.details = "Additional details: " + message | |
} |
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: 3
Outside diff range and nitpick comments (6)
tevm/docs/index/type-aliases/Filter.md (1)
Line range hint
47-63
: The documentation updates accurately reflect the changes to theFilter
type.Replace the bare URL with a markdown link for better readability.
- https://github.com/ethereum/go-ethereum/blob/master/eth/filters/filter_system.go#L329 + [Ethereum Go Filter System](https://github.com/ethereum/go-ethereum/blob/master/eth/filters/filter_system.go#L329)Tools
Markdownlint
56-56: null
Bare URL usedpackages/base-client/docs/classes/ProviderRpcError.md (1)
Line range hint
123-123
: Consider using a Markdown link with descriptive text instead of a bare URL for better readability.- https://v8.dev/docs/stack-trace-api#customizing-stack-traces + [Customizing Stack Traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces)docs/src/content/docs/reference/@tevm/base-client/classes/ProviderRpcError.md (1)
Line range hint
122-122
: Consider using a Markdown link with descriptive text instead of a bare URL for better readability.- https://v8.dev/docs/stack-trace-api#customizing-stack-traces + [Customizing Stack Traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces)tevm/docs/index/type-aliases/BaseClient.md (1)
Line range hint
109-109
: Consider adding blank lines around lists for better Markdown formatting.- let client = createMemoryClient() - console.log(client.mode) // 'normal' - client = createMemoryClient({ forkUrl: 'https://mainnet.infura.io/v3/your-api-key' }) - console.log(client.mode) // 'fork' + let client = createMemoryClient() + + console.log(client.mode) // 'normal' + + client = createMemoryClient({ forkUrl: 'https://mainnet.infura.io/v3/your-api-key' }) + + console.log(client.mode) // 'fork'tevm/docs/index/type-aliases/BaseClientOptions.md (2)
Line range hint
72-85
: Replace hard tabs with spaces to maintain consistency in Markdown files.
Line range hint
36-36
: Ensure fenced code blocks are surrounded by blank lines and specify a language for syntax highlighting.Also applies to: 137-137, 31-31
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (41)
- .changeset/famous-planets-pretend.md (1 hunks)
- docs/src/content/docs/reference/@tevm/base-client/classes/ProviderRpcError.md (3 hunks)
- docs/src/content/docs/reference/@tevm/base-client/type-aliases/EIP1193EventEmitter.md (1 hunks)
- docs/src/content/docs/reference/@tevm/base-client/type-aliases/EIP1193EventMap.md (2 hunks)
- docs/src/content/docs/reference/@tevm/base-client/type-aliases/EIP1193Events.md (1 hunks)
- docs/src/content/docs/reference/@tevm/base-client/type-aliases/Filter.md (3 hunks)
- docs/src/content/docs/reference/@tevm/base-client/type-aliases/FilterType.md (1 hunks)
- docs/src/content/docs/reference/@tevm/base-client/type-aliases/ProviderConnectInfo.md (1 hunks)
- docs/src/content/docs/reference/@tevm/base-client/type-aliases/ProviderMessage.md (1 hunks)
- docs/src/content/docs/reference/@tevm/procedures/functions/requestProcedure.md (1 hunks)
- packages/actions-types/docs/type-aliases/FilterParams.md (1 hunks)
- packages/actions-types/src/common/FilterParams.ts (1 hunks)
- packages/actions/src/eth/ethGetLogsHandler.js (2 hunks)
- packages/base-client/docs/classes/ProviderRpcError.md (3 hunks)
- packages/base-client/docs/type-aliases/EIP1193EventEmitter.md (1 hunks)
- packages/base-client/docs/type-aliases/EIP1193EventMap.md (2 hunks)
- packages/base-client/docs/type-aliases/EIP1193Events.md (1 hunks)
- packages/base-client/docs/type-aliases/Filter.md (3 hunks)
- packages/base-client/docs/type-aliases/FilterType.md (1 hunks)
- packages/base-client/docs/type-aliases/ProviderConnectInfo.md (1 hunks)
- packages/base-client/docs/type-aliases/ProviderMessage.md (1 hunks)
- packages/base-client/src/EIP1193EventEmitterTypes.ts (2 hunks)
- packages/base-client/src/Filter.ts (3 hunks)
- packages/memory-client/src/test/viem/uninstallFilter.spec.ts (1 hunks)
- packages/procedures/docs/functions/requestProcedure.md (1 hunks)
- packages/procedures/src/requestProcedure.js (9 hunks)
- tevm/docs/actions-types/type-aliases/FilterParams.md (1 hunks)
- tevm/docs/index/functions/createBaseClient.md (1 hunks)
- tevm/docs/index/type-aliases/AutoMining.md (1 hunks)
- tevm/docs/index/type-aliases/BaseClient.md (1 hunks)
- tevm/docs/index/type-aliases/BaseClientOptions.md (1 hunks)
- tevm/docs/index/type-aliases/CustomPrecompile.md (1 hunks)
- tevm/docs/index/type-aliases/EIP1193EventMap.md (2 hunks)
- tevm/docs/index/type-aliases/Extension.md (1 hunks)
- tevm/docs/index/type-aliases/Filter.md (3 hunks)
- tevm/docs/index/type-aliases/Hardfork.md (1 hunks)
- tevm/docs/index/type-aliases/IntervalMining.md (1 hunks)
- tevm/docs/index/type-aliases/ManualMining.md (1 hunks)
- tevm/docs/index/type-aliases/MiningConfig.md (1 hunks)
- tevm/docs/index/variables/GENESIS_STATE.md (1 hunks)
- tevm/docs/index/variables/prefundedAccounts.md (1 hunks)
Files skipped from review due to trivial changes (8)
- docs/src/content/docs/reference/@tevm/base-client/type-aliases/EIP1193EventEmitter.md
- docs/src/content/docs/reference/@tevm/base-client/type-aliases/EIP1193Events.md
- docs/src/content/docs/reference/@tevm/base-client/type-aliases/FilterType.md
- docs/src/content/docs/reference/@tevm/base-client/type-aliases/ProviderConnectInfo.md
- docs/src/content/docs/reference/@tevm/base-client/type-aliases/ProviderMessage.md
- packages/base-client/docs/type-aliases/FilterType.md
- packages/memory-client/src/test/viem/uninstallFilter.spec.ts
- packages/procedures/docs/functions/requestProcedure.md
Files skipped from review as they are similar to previous changes (19)
- packages/base-client/docs/type-aliases/EIP1193EventEmitter.md
- packages/base-client/docs/type-aliases/EIP1193EventMap.md
- packages/base-client/docs/type-aliases/EIP1193Events.md
- packages/base-client/docs/type-aliases/ProviderConnectInfo.md
- packages/base-client/docs/type-aliases/ProviderMessage.md
- packages/base-client/src/EIP1193EventEmitterTypes.ts
- packages/base-client/src/Filter.ts
- packages/procedures/src/requestProcedure.js
- tevm/docs/index/functions/createBaseClient.md
- tevm/docs/index/type-aliases/AutoMining.md
- tevm/docs/index/type-aliases/CustomPrecompile.md
- tevm/docs/index/type-aliases/EIP1193EventMap.md
- tevm/docs/index/type-aliases/Extension.md
- tevm/docs/index/type-aliases/Hardfork.md
- tevm/docs/index/type-aliases/IntervalMining.md
- tevm/docs/index/type-aliases/ManualMining.md
- tevm/docs/index/type-aliases/MiningConfig.md
- tevm/docs/index/variables/GENESIS_STATE.md
- tevm/docs/index/variables/prefundedAccounts.md
Additional context used
Markdownlint
tevm/docs/index/type-aliases/Filter.md
56-56: null
Bare URL usedpackages/base-client/docs/type-aliases/Filter.md
56-56: null
Bare URL useddocs/src/content/docs/reference/@tevm/base-client/type-aliases/Filter.md
55-55: null
Bare URL usedpackages/base-client/docs/classes/ProviderRpcError.md
123-123: null
Bare URL useddocs/src/content/docs/reference/@tevm/base-client/classes/ProviderRpcError.md
122-122: null
Bare URL usedtevm/docs/index/type-aliases/BaseClient.md
109-109: null
Lists should be surrounded by blank linestevm/docs/index/type-aliases/BaseClientOptions.md
72-72: Column: 1
Hard tabs
73-73: Column: 1
Hard tabs
74-74: Column: 1
Hard tabs
75-75: Column: 1
Hard tabs
76-76: Column: 1
Hard tabs
77-77: Column: 1
Hard tabs
78-78: Column: 1
Hard tabs
79-79: Column: 1
Hard tabs
80-80: Column: 1
Hard tabs
81-81: Column: 1
Hard tabs
82-82: Column: 1
Hard tabs
83-83: Column: 1
Hard tabs
84-84: Column: 1
Hard tabs
85-85: Column: 1
Hard tabs
36-36: null
Fenced code blocks should be surrounded by blank lines
137-137: null
Lists should be surrounded by blank lines
31-31: null
Fenced code blocks should have a language specified
Additional comments not posted (19)
.changeset/famous-planets-pretend.md (1)
1-5
: The changeset description accurately reflects the modifications made to theFilterParams
type.tevm/docs/actions-types/type-aliases/FilterParams.md (1)
15-29
: The documentation updates accurately reflect the changes to theFilterParams
type.packages/actions-types/docs/type-aliases/FilterParams.md (1)
15-29
: The documentation updates accurately reflect the changes to theFilterParams
type.docs/src/content/docs/reference/@tevm/procedures/functions/requestProcedure.md (1)
46-46
: The source link is correctly updated to reflect the new line number in the source code.packages/base-client/docs/type-aliases/Filter.md (2)
47-47
: Updatedlogs
type toGetFilterLogsReturnType[number][]
enhances type specificity and safety.
58-63
: AddedregisteredListeners
field to track event listeners, enhancing event management capabilities.docs/src/content/docs/reference/@tevm/base-client/type-aliases/Filter.md (2)
46-46
: Updatedlogs
type toGetFilterLogsReturnType[number][]
enhances type specificity and safety.
57-62
: AddedregisteredListeners
field to track event listeners, enhancing event management capabilities.docs/src/content/docs/reference/@tevm/base-client/type-aliases/EIP1193EventMap.md (2)
76-76
: AddednewLog
function to handle new log events, enhancing the event handling capabilities.
92-101
: AddednewReceipt
function to handle new receipt events, enhancing transaction management capabilities.packages/base-client/docs/classes/ProviderRpcError.md (3)
35-35
: Updated source reference for the constructor points to the correct location in the source code.
59-59
: Updated source reference for thecode
property points to the correct location in the source code.
69-69
: Updated source reference for thedetails
property points to the correct location in the source code.docs/src/content/docs/reference/@tevm/base-client/classes/ProviderRpcError.md (3)
34-34
: Updated source reference for the constructor points to the correct location in the source code.
58-58
: Updated source reference for thecode
property points to the correct location in the source code.
68-68
: Updated source reference for thedetails
property points to the correct location in the source code.tevm/docs/index/type-aliases/BaseClient.md (1)
200-200
: Updated source reference forBaseClient
points to the correct location in the source code.packages/actions/src/eth/ethGetLogsHandler.js (2)
67-72
: Ensure proper handling of default values forfromBlock
andtoBlock
parameters.
140-141
: Verify the handling of optionaladdress
andtopics
parameters to prevent errors when they are undefined.Verification successful
The
ethGetLogsHandler
function is defined inpackages/actions/src/eth/ethGetLogsHandler.js
and is used inpackages/procedures/src/requestProcedure.js
andpackages/procedures/src/eth/ethGetLogsProcedure.js
. The function definition and its usage indicate that theaddress
andtopics
parameters are accessed directly fromparams.filterParams
.Observations:
- The function definition in
ethGetLogsHandler.js
accessesparams.filterParams.address
andparams.filterParams.topics
directly.- The usage in
requestProcedure.js
andethGetLogsProcedure.js
passesfilterParams
withaddress
andtopics
to the handler.Verification:
- The code snippet in
ethGetLogsHandler.js
handlesaddress
andtopics
parameters with optional chaining (?.
) and default values (??
), which should prevent errors when these parameters are undefined.Conclusion:
The handling of optional
address
andtopics
parameters inethGetLogsHandler
appears to be correct, as the code uses optional chaining and default values to prevent errors when these parameters are undefined.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the handling of optional parameters in `ethGetLogsHandler`. # Test: Search for the function usage. Expect: Proper checks for undefined values. rg --type javascript $'ethGetLogsHandler'Length of output: 75
Script:
#!/bin/bash # Description: Verify the handling of optional parameters in `ethGetLogsHandler`. # Correct file type for JavaScript rg --type js 'ethGetLogsHandler'Length of output: 713
Script:
#!/bin/bash # Description: Extract the function definition and its usage for `ethGetLogsHandler`. # Extract the function definition rg --type js --context 10 'export const ethGetLogsHandler' packages/actions/src/eth/ethGetLogsHandler.js # Extract the function usage in requestProcedure.js rg --type js --context 10 'ethGetLogsHandler' packages/procedures/src/requestProcedure.js # Extract the function usage in ethGetLogsProcedure.js rg --type js --context 10 'ethGetLogsHandler' packages/procedures/src/eth/ethGetLogsProcedure.jsLength of output: 2875
readonly fromBlock?: BlockParam | ||
readonly toBlock?: BlockParam | ||
readonly address?: Address | ||
readonly topics?: ReadonlyArray<Hex> |
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.
Tip
Codebase Verification
The documentation for FilterParams
has been updated to reflect the changes. However, the search for test cases did not yield any specific test cases directly covering the optional properties of FilterParams
.
To ensure comprehensive testing, it is crucial to have test cases that specifically verify the behavior of FilterParams
with its optional properties. This includes scenarios where some or all properties are omitted.
Please verify and add test cases for FilterParams
to ensure that the optional properties are adequately tested.
- Ensure that test cases cover scenarios where
FilterParams
is used with some or all properties omitted. - Verify that the behavior of
FilterParams
is as expected when properties are optional.
Analysis chain
The modifications to make FilterParams
properties optional are correctly implemented.
Ensure that the documentation and tests are updated to reflect these changes.
The documentation for FilterParams
has been updated to reflect the changes. However, the search for test cases failed due to an unrecognized file type. Let's correct the file type and re-run the script to verify the presence of test cases for FilterParams
.
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Verify if the documentation and tests for `FilterParams` have been updated.
# Test: Search for documentation updates.
rg --type markdown 'FilterParams' --files-with-matches | xargs cat
# Test: Search for test cases covering the optional properties.
rg --type typescript 'FilterParams' --files-with-matches | xargs cat
Length of output: 76758
Script:
#!/bin/bash
# Description: Verify if the test cases for `FilterParams` have been updated.
# Test: Search for test cases covering the optional properties.
rg --type ts 'FilterParams' --files-with-matches | xargs cat
Length of output: 46395
@@ -55,6 +55,12 @@ Stores logs | |||
Criteria of the logs | |||
https://github.com/ethereum/go-ethereum/blob/master/eth/filters/filter_system.go#L329 |
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.
Consider using a Markdown link with descriptive text instead of a bare URL for better readability.
- https://github.com/ethereum/go-ethereum/blob/master/eth/filters/filter_system.go#L329
+ [Ethereum Go Filter System](https://github.com/ethereum/go-ethereum/blob/master/eth/filters/filter_system.go#L329)
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.
https://github.com/ethereum/go-ethereum/blob/master/eth/filters/filter_system.go#L329 | |
[Ethereum Go Filter System](https://github.com/ethereum/go-ethereum/blob/master/eth/filters/filter_system.go#L329) |
Tools
Markdownlint
56-56: null
Bare URL used
@@ -54,6 +54,12 @@ Stores logs | |||
Criteria of the logs | |||
https://github.com/ethereum/go-ethereum/blob/master/eth/filters/filter_system.go#L329 |
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.
Consider using a Markdown link with descriptive text instead of a bare URL for better readability.
- https://github.com/ethereum/go-ethereum/blob/master/eth/filters/filter_system.go#L329
+ [Ethereum Go Filter System](https://github.com/ethereum/go-ethereum/blob/master/eth/filters/filter_system.go#L329)
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.
https://github.com/ethereum/go-ethereum/blob/master/eth/filters/filter_system.go#L329 | |
[Ethereum Go Filter System](https://github.com/ethereum/go-ethereum/blob/master/eth/filters/filter_system.go#L329) |
Tools
Markdownlint
55-55: null
Bare URL used
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: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (6)
- .changeset/curly-hats-tickle.md (1 hunks)
- .changeset/fair-badgers-arrive.md (1 hunks)
- .changeset/forty-trees-refuse.md (1 hunks)
- .changeset/funny-drinks-brush.md (1 hunks)
- .changeset/lazy-pumas-grab.md (1 hunks)
- .changeset/lemon-camels-decide.md (1 hunks)
Files skipped from review due to trivial changes (4)
- .changeset/fair-badgers-arrive.md
- .changeset/forty-trees-refuse.md
- .changeset/funny-drinks-brush.md
- .changeset/lemon-camels-decide.md
Additional comments not posted (2)
.changeset/curly-hats-tickle.md (1)
5-5
: Clear and concise description of the patch addressing the race condition in transaction validation..changeset/lazy-pumas-grab.md (1)
5-5
: Well-documented fix for handling optional properties ineth_getLogs
.
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 - [#1154](#1154) [`693653e`](693653e) Thanks [@roninjin10](https://github.com/roninjin10)! - Updated tevmMine to events for newBlock, newReceipt, and newLog ### Patch Changes - [#1154](#1154) [`693653e`](693653e) Thanks [@roninjin10](https://github.com/roninjin10)! - Fixed race condition where a tx can fail validation but still be added to tx pool - [#1154](#1154) [`693653e`](693653e) Thanks [@roninjin10](https://github.com/roninjin10)! - Fixed bug with eth_getLogs not properly handling optional properties when undefined - Updated dependencies \[]: - @tevm/[email protected] - @tevm/[email protected] ## @tevm/[email protected] ### Minor Changes - [#1154](#1154) [`693653e`](693653e) Thanks [@roninjin10](https://github.com/roninjin10)! - Updated BaseClient to emit a 'connect' event after it is ready - [#1154](#1154) [`693653e`](693653e) Thanks [@roninjin10](https://github.com/roninjin10)! - Updated base-client log filters type to include more information such as the tx hash and block hash ## @tevm/[email protected] ### Minor Changes - [#1158](#1158) [`7b4b13e`](7b4b13e) Thanks [@roninjin10](https://github.com/roninjin10)! - Removed all test actions from MemoryClient ### Patch Changes - Updated dependencies \[[`693653e`](693653e), [`693653e`](693653e)]: - @tevm/[email protected] - @tevm/[email protected] ## @tevm/[email protected] ### Minor Changes - [#1154](#1154) [`693653e`](693653e) Thanks [@roninjin10](https://github.com/roninjin10)! - Added new JSON-RPC support eth_getFilterLogs and eth_getFilterChanges ### Patch Changes - Updated dependencies \[[`693653e`](693653e), [`693653e`](693653e), [`693653e`](693653e)]: - @tevm/[email protected] ## @tevm/[email protected] ### Patch Changes - Updated dependencies \[]: - @tevm/[email protected] - @tevm/[email protected] - @tevm/[email protected] ## @tevm/[email protected] ### Patch Changes - Updated dependencies \[[`7b4b13e`](7b4b13e)]: - @tevm/[email protected] ## @tevm/[email protected] ### Patch Changes - [#1154](#1154) [`693653e`](693653e) Thanks [@roninjin10](https://github.com/roninjin10)! - Fixed bug with filter params being required rather than optional ## @tevm/[email protected] ### Patch Changes - Updated dependencies \[[`693653e`](693653e), [`693653e`](693653e), [`693653e`](693653e), [`693653e`](693653e), [`693653e`](693653e)]: - @tevm/[email protected] - @tevm/[email protected] - @tevm/[email protected] - @tevm/[email protected] ## [email protected] ### Patch Changes - Updated dependencies \[[`7b4b13e`](7b4b13e), [`693653e`](693653e), [`693653e`](693653e), [`693653e`](693653e)]: - @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>
Description
Add event json rpc support and viem tests
Testing
Explain the quality checks that have been done on the code changes
Additional Information
Your ENS/address:
Summary by CodeRabbit
New Features
@tevm/actions
module to handle events fornewBlock
,newReceipt
, andnewLog
.eth_getFilterLogs
andeth_getFilterChanges
in@tevm/procedures
.BaseClient
in@tevm/base-client
now emits a 'connect' event after becoming ready.Bug Fixes
@tevm/actions
where a transaction could fail validation but still be added to the transaction pool.@tevm/actions
whereeth_getLogs
did not handle optional properties correctly.Documentation