Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Protocol ID behaviour inconsistent with docs #1455

Open
hosie opened this issue Jan 25, 2024 · 3 comments
Open

Protocol ID behaviour inconsistent with docs #1455

hosie opened this issue Jan 25, 2024 · 3 comments
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers

Comments

@hosie
Copy link
Contributor

hosie commented Jan 25, 2024

docs say

000003 - this is the event (/log) index within that transaction

However, what I observe is that the value in this segment increases across transactions and only resets to 0 on a new block. So itsems to be the event /log index within a block.

e.g. when I have 1 event per transaction, 2nd segment and 3rd segment are always equal.

"000000112840/000006/000006"
"000000112840/000005/000005"
"000000112840/000004/000004"
"000000112840/000003/000003"
"000000112840/000002/000002"
"000000112840/000001/000001"
"000000112840/000000/000000"

If I have 2 events per transaction, then I see segment 3 increase sequentially on every event and segment 2 increases by one on every other event

"000000147029/000004/000009"
"000000147029/000004/000008"
"000000147029/000003/000007"
"000000147029/000003/000006"
"000000147029/000002/000005"
"000000147029/000002/000004"
"000000147029/000001/000003"
"000000147029/000001/000002"
"000000147029/000000/000001"
"000000147029/000000/000000"

Curious if the docs are wrong or whether this is a code bug.

@EnriqueL8
Copy link
Contributor

According to different sources including web3js states that logIndex: Number - integer of the log index position in the block. null when its pending log. which means that the behaviour is correct but the documentation seems wrong. Since Firefly has a pluggable architecture to support other blockchain protocols, this value might be different.

@EnriqueL8
Copy link
Contributor

EnriqueL8 commented Jan 25, 2024

Better source is the Ethereum documentation https://ethereum.org/en/developers/docs/apis/json-rpc which states the same logIndex: QUANTITY - integer of the log index position in the block. null when its pending log.

Coupling this with the transaction index allows a user to have a unique ID for an event.

@hosie
Copy link
Contributor Author

hosie commented Jan 25, 2024

Thanks @EnriqueL8 With that behaviour, the following statement from the docs would remain true, which is very important

**The string is alphanumerically sortable as a plain string;**

@EnriqueL8 EnriqueL8 added good first issue Good for newcomers documentation Improvements or additions to documentation labels Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants