Page MenuHomePhabricator

[herald] Improved miner parsing
ClosedPublic

Authored by bytesofman on May 30 2023, 19:46.

Details

Reviewers
Fabien
Group Reviewers
Restricted Project
Commits
rABCd637f245a649: [herald] Improved miner parsing
Summary

T2972

Improve miner parsing with new function getMinerFromCoinbaseTx

Supersedes D13875

Test Plan

npm test

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Fabien requested changes to this revision.May 31 2023, 15:19
Fabien added a subscriber: Fabien.
Fabien added inline comments.
apps/ecash-herald/constants/miners.js
64 ↗(On Diff #40503)

Test vectors do no belong in constants, but in (e.g.) test/miners.js or test/data/miners.js. This is not part of the application logic, it's a test fixture

apps/ecash-herald/src/parse.js
57 ↗(On Diff #40503)

You should break after that

94 ↗(On Diff #40503)

You are reinventing String.split()

123 ↗(On Diff #40503)

dito

131 ↗(On Diff #40503)

I don't really understand why this needs to be different from the viabtc parsing. The pattern is exactly the same afaict

This revision now requires changes to proceed.May 31 2023, 15:19
bytesofman marked 5 inline comments as done.

responding to feedback

apps/ecash-herald/src/parse.js
116 ↗(On Diff #40516)

I'm still unsure this is a good idea to make it a special case. Returning CKPool as a miner, with mined by Iceberg in the details is enough imo and will avoid this special case alltogether

apps/ecash-herald/src/parse.js
116 ↗(On Diff #40516)

Yes, this is what is currently in prod. However we've had a task open for awhile to fix it:

T3158

Most likely there is just one miner using CK pool software, and the rare blocks that don't include "iceberg" are anomalous. Since basically 100% of ck pool blocks are mined by iceberg, it makes sense to label them accordingly.

This revision is now accepted and ready to land.Jun 1 2023, 12:56
This revision was automatically updated to reflect the committed changes.