-
Notifications
You must be signed in to change notification settings - Fork 628
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
[mining] resolve mining pool conflict for block 00000000000000000003aff64602a1687539515d9e2c44dc1f8c31289901781a #3728
Conversation
98c3bdd
to
62f1540
Compare
After running this for a while I've noticed there are quite a lot of conflict (about 500+ for up to block ~525000). Most of them seems related to a conflict in the mining pool definition. For example https://mempool.space/block/0000000000000000001b9460202a7acc512630988f8204df39e5c7d605587425 is tagged to https://mempool.space/mining/pool/1thash using the coinbase address, but the tag There are multiple scenarios:
Either way in those cases I don't know how to resolve the conflict without having to do some digging. @0xB10C have you noticed those conflict in the mining pool definitions? |
Thanks for looking into this. There's also bitcoin-data/mining-pools#36 (comment) which is quite similar. Might be worth posting there too. I think that some pools merged or renamed at some point. In this case, the most recent coinbase outputs (e.g. in 688730) to the address To fix all of the 500+ mismatches likely needs some manual work. However, I'd be happy to invest some time into this (though it's not a top priority for me right now). |
…ff64602a1687539515d9e2c44dc1f8c31289901781a
… the first match to keep existing behavior
5380215
to
538d860
Compare
} | ||
return matchingPools[0]; | ||
}; | ||
if (id === '00000000000000000003aff64602a1687539515d9e2c44dc1f8c31289901781a') { |
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.
It's just wrong to hard code a single block in the code like this.
If we are to do exceptions in the matching we need a better way.
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.
What is your suggested better way?
We could move the hardcoded block ids into a dedicated file to avoid spamming the already messy blocks.ts
file. But in terms of "hardcoding" I don't really see a way around it in the example I've provided https://mempool.space/block/0000000000000000001b9460202a7acc512630988f8204df39e5c7d605587425.
An alternative approach would be to have some UX elements to show that the block cannot be assigned to a miner with certainty and simply exclude it from the stats.
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.
Aren't these very related to the whole pools json database matching. So it should be in that file or a separate file that share the same commit history. Everyone using the mining-pools repo should get the exceptions list, and it can be collaborative.
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.
That's a good suggestion. @0xB10C what do you think of this approach?
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.
I think having an exception list that we manually define is OK. It sounds like a lot of work though.
One approach I've been happy with is:
- try identifying by coinbase output address first
- if unsuccessful, try tagging by script tag
- if unsuccessful, miner is unknown
The coinbase output address is a better metric to check first as it's quite expensive to game. As a mining pool you can include arbitrary tag in the script at close to zero cost. By putting another pool's address in the output, you'd
essentially gift the coins to another pool.
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.
See comments
Closing for now. My approach is not satisfactory. @softsimon or @mononaut feel free to take on this issue if you want 👍🏻 . |
This PR adds a new mining pool conflict check when we tag blocks to their pool. The new logic is:
Testing
Restart the nodejs backend and confirm you see the following message:
For now, if there is a mining pool conflict and we did not defined a conflict resolution rule, we return the first match, this way we keep the existing behavior intact.
So to resume this PR only fixes the tag for block
00000000000000000003aff64602a1687539515d9e2c44dc1f8c31289901781a
but allows future manual fixes if needed