docs: clarify Log.index vs Log.transactionIndex JSDoc comments#5145
Open
0xAxiom wants to merge 1 commit into
Open
docs: clarify Log.index vs Log.transactionIndex JSDoc comments#51450xAxiom wants to merge 1 commit into
0xAxiom wants to merge 1 commit into
Conversation
The JSDoc for transactionIndex said "The index within the transaction of this log", which is the opposite of what the property actually represents. transactionIndex is the position of the *transaction* inside its block (JSON-RPC transactionIndex), not the log's position inside the transaction. Fix both sibling comments together so the distinction is unambiguous: index — log's position within the block (logIndex in RPC) transactionIndex — transaction's position within the block Cross-references [[Log-index]] from the transactionIndex doc so readers looking at either property can quickly orient themselves. Fixes ethers-io#4960
This was referenced Jun 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The JSDoc for
Log.transactionIndexcurrently says:This is backwards —
transactionIndexis the position of the transaction in its block (JSON-RPCtransactionIndex), not the log's position inside the transaction. Issue #4960 identified this confusion; a prior fix attempt (#4962) was closed without merging.Fix
Rewrote both sibling comments so the distinction is explicit:
indexlogIndexin JSON-RPC)transactionIndextransactionIndexin JSON-RPC)Added JSON-RPC term cross-references and a
[[Log-index]]back-link in thetransactionIndexdoc so readers can immediately orient themselves.Testing
Docs-only change; no behaviour altered.
Fixes #4960