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
Branch
herald-miner-parsing-next
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 23841
Build 47292: Build Diffecash-herald-tests
Build 47291: arc lint + arc unit

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

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

You should break after that

94

You are reinventing String.split()

123

dito

131

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.