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

scriptPubKey "type": "pubkey" without address prevents first indexing of explorer #447

Closed
silkroadnomad opened this issue Mar 10, 2021 · 3 comments

Comments

@silkroadnomad
Copy link

silkroadnomad commented Mar 10, 2021

I tried syncing our blockchain and found an output with scriptPubKey "type": "pubkey".

lib/explorer.js line 500 is filtering out nonstandard and nulldata outputs and expects pubkeyhash outputs with addresses attribute.
Bildschirmfoto 2021-03-10 um 11 12 59

In our case the output doesn't have any address just as it seems the pubkey inside asm
Bildschirmfoto 2021-03-10 um 11 14 04

The input of this transaction is a coinbase transaction it seems some miner did this but the explorer script cannot interpret this.

For now I'll filter out type: "pubkey" transactions also in line 500 but I don't know if it has side effects regarding to balances or anything else. In case you want the pull request of it let me know!

@silkroadnomad silkroadnomad changed the title scriptPubKey "type": "pubkey" without address prevents first indexing of exploerrer scriptPubKey "type": "pubkey" without address prevents first indexing of exploerer Mar 10, 2021
@silkroadnomad silkroadnomad changed the title scriptPubKey "type": "pubkey" without address prevents first indexing of exploerer scriptPubKey "type": "pubkey" without address prevents first indexing of explorer Mar 10, 2021
silkroadnomad pushed a commit to Doichain/explorer that referenced this issue Mar 10, 2021
@silkroadnomad
Copy link
Author

silkroadnomad commented Mar 10, 2021

Seems like somebody else was investigating this issue already in a more sophisticated way. I'll keep my pull request open if somebody decides it is the simpler solution for now until the pull request #440 is merged.

@joeuhren
Copy link
Contributor

I double-checked and doichain-core does have the two required rpc methods for revealing those addresses: getdescriptorinfo and deriveaddresses, so in theory you should be able to take advantage of the #440 fix.

Your solution will undoubtedly cause a number of undesired effects such as incorrect balances of the addresses involved in those transactions, not to mention missing blocks/transactions to the point where nobody can search for them. The coin supply value could also be affected, depending on how you are retrieving the coin supply.

It's unclear how long it will take to merge #440, and I'm already working with someone who is happily syncing BTC with iquidus now because of it. Its up to you, but if this is for a live block explorer and not some test you are running for yourself, I might recommend merging #440 into a test explorer to make sure it works with your coin and if so, give some thought to adding it to the live explorer for now until it's merged properly. You will need to a full resync though, but at least your data should all be correct.

@uaktags
Copy link
Collaborator

uaktags commented Jul 2, 2021

I'm going to close this as its really more of a single coin (variants of a specific coin) issue. With the idea of adding modularity to explorer.js to be able to introduce coin-specific functions/checks, we should be able to fix this.

Right now the idea on the table feels sloppy but is starting to get movement. I should have a branch ready for testing in the next week or so for people to make coin modules to handle these things. I'll add a comment relating to this issue when the new item can be tracked.

@uaktags uaktags closed this as completed Jul 2, 2021
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

3 participants