-
Notifications
You must be signed in to change notification settings - Fork 22
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
Add pretty-printing of SCPEnvelope #637
Conversation
327d342
to
b39f5b3
Compare
Codecov Report
@@ Coverage Diff @@
## v0.x.x #637 +/- ##
==========================================
+ Coverage 91.31% 91.37% +0.06%
==========================================
Files 62 63 +1
Lines 4927 5101 +174
==========================================
+ Hits 4499 4661 +162
- Misses 428 440 +12
Continue to review full report at Codecov.
|
Oh great, I love linker errors. |
Move all your function-scope imports to global scope. |
b39f5b3
to
b486446
Compare
Thanks that works. But I thought this was just an issue with RDMD, not dub.. |
Ah no it did not work. :> Ok I will look into this.. |
It's actually an issue with DMD, and we use some of the dependency tracking magic in some places (also we use rdmd in |
cfa7e83
to
8f79756
Compare
The linking issue is for the |
8f79756
to
365c9dd
Compare
Ok I figured it out. Had to add |
Looks like something in the integration test suite depends from the pretty printer tho |
365c9dd
to
a961e1e
Compare
I've split the SCP pretty-printing into another module, and added several commits introducing |
a961e1e
to
4e80230
Compare
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.
Very nice, a few comments
@@ -54,6 +54,8 @@ | |||
"source/agora/common/Config.d", | |||
"source/agora/network/*", | |||
"source/agora/node/*", | |||
"source/agora/utils/PrettyPrinter.d", | |||
"source/agora/utils/SCPPrettyPrinter.d", |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
import scpd.Cpp; | ||
import scpd.types.Stellar_SCP; | ||
import scpd.types.Stellar_types : StellarHash = Hash; | ||
alias StellarValue = Value; |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
|
||
if (qset !is null) | ||
{ | ||
auto qconf = toQuorumConfig(*qset.ptr); |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
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.
One was using alias this
(shared_ptr
) and the other explicit dereference. I'll simplify it.
GCOQ...LRIJ(62,500,000), GCOQ...LRIJ(62,500,000)], enrolls: [{ utxo: 0x0000...e26f, seed: 0x4a5e...a33b, cycles: 1008, sig: 0x0000...be78 }, { utxo: 0x0000...e26f, seed: 0x4a5e...a33b, cycles: 1008, sig: 0x0000...be78 }] } }, prep: <null>, prepPrime: <null>, nc: 100, nH: 200 } }, sig: 0x0af7...b5ab }`; | ||
|
||
// with quorum mapping | ||
static immutable PrepareRes2 = `{ statement: { node: GBUV...KOEK, slotIndex: 0, pledge: SCP_PREPARE { qset: { hash: 0xfee13ea2fd956028d31b93cbf0a47ea97c6c9868b7e911b797667113ed12bf0d, quorum: QuorumConfig(2, [GBFDLGQQDDE2CAYVELVPXUXR572ZT5EOTMGJQBPTIHSLPEOEZYQQCEWN, GBYK4I37MZKLL4A2QS7VJCTDIIJK7UXWQWKXKTQ5WZGT2FPCGIVIQCY5], []) }, ballot: { counter: 42, value: { tx_set: [Type : Payment, Inputs (1): 0x0000...0000[0]:0x0000...0000 |
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.
Should we abbreviate SCP_PREPARE.qset.hash
? Also QuorumConfig
entries ?
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.
Good ideas.
4e80230
to
9b3a7b4
Compare
Update:
|
9b3a7b4
to
3f78987
Compare
I'll force push again to reorder the commits. |
4c17602
to
4f433a3
Compare
Fixed linking issues. I had to re-add PrettyPrinter to exclude files again. |
Hmm. I think I should consider changing all the @Geod24 what do you think? |
That was my original approach, however it didn't work. The details of why escape me ATM. Might be something to do with |
Oops. I pinged someone. :x |
hmm.. |
4f433a3
to
e15c293
Compare
Update: removed copying. There's still the weird compilation failure on circle-ci. |
I know how to fix it, I'll move |
e15c293
to
cd66e2a
Compare
Updated. |
It's disallowing passing rvalues.
To allow passing rvalues.
We need the ability to pass rvalues.
It will be used by PrettyPrinter, and we don't want to import the Config module just to be able to pretty-print the quorum data structure.
It includes pretty-printing for all the possible pledge types (prepare / commit / externalize / nominate), and also handles deserialization failures gracefully. It is in a separate module to avoid linking issues with the integration tests, which import into the PrettyPrinter module and should not import into SCP. Fixes bosagora#635
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.
Amazing, thanks!
I'll wait to see the report from codecov to see if every line has been covered.
Still some things left to do:
HashFmt
for this.ConsensusData
in this case is handled gracefully. But in the future when we start using hashes, we can just provide another lookup function and print out<tx not found>
when we're missing a tx that's being nominated.Fixes #635