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

Remove transaction id #221

Open
Tracked by #228
altergui opened this issue Aug 21, 2024 · 3 comments
Open
Tracked by #228

Remove transaction id #221

altergui opened this issue Aug 21, 2024 · 3 comments

Comments

@altergui
Copy link

as part of the work i'm doing on the indexer, i'm considering removing the concept of "transactionNumber", currently an incremental id that basically counts how many transactions were done since genesis.

curl 'https://api-stg.vocdoni.net/v2/chain/transactions/1497510/0' -s |jq
{
...
  "txInfo": {
    "transactionNumber": 21942, <--- this
    "transactionHash": "6624f05ede172313bd7f04afff11ab76ae3da80884cf66478afe39e2f8566789",
    "blockHeight": 1497510,
    "transactionIndex": 0,
    "transactionType": "setAccount"
  },
  "signature": "0cc28641b07cc2538c9e7e9a076efce2e713c52d0a165923ebd9415eba7124ca7522aa5bf74c54c4d57a6e0a65c2b86719827c9167f8b3579f8e74b6eb3fc47e00"
}

curl 'https://api-stg.vocdoni.net/v2/chain/transactions/1497510/0' -s | jq .txInfo.transactionNumber
21942

i'm working on this in vocdoni/vocdoni-node#1329 and it's still WIP but when it's merged will require changes in sdk and explorer, since:

this endpoint will no longer exist (will return 405)

  • GET /chain/transactions/reference/index/:index current docs

the json returned by the following paginated endpoints will change (each transaction in the list will no longer have a transactionNumber field)

  • /chain/blocks/{height}/transactions/page/{page}
  • /chain/transactions/page/{page}
  • /chain/transactions

as well as these endpoints in a similar manner (the returned json will no longer have a transactionNumber field)

  • /chain/transactions/{height}/{index}
  • /chain/transactions/reference/{hash}
@altergui
Copy link
Author

if you have any comments or early feedback already, much appreciated

@selankon
Copy link

Why to do this? Actually the explorer shows the transaction number as part of the information shown for a transaction. Is a big effort to continue maintaining this?

image

image

Is also true that on other explorers like this https://eth.blockscout.com/txs the transaction number is not shown on txs list / details.

So if you finally remove it for any reason, the explorer must be refactored

@altergui
Copy link
Author

altergui commented Sep 2, 2024

it does make the reindexing code more complex, and indeed other blockchains have no such concept, they index txs by blockHeight+blockIndex (that we also do, so it's redundant)

i've created vocdoni/vocdoni-node#1371

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants