-
Notifications
You must be signed in to change notification settings - Fork 87
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
Allow multiple credentials #2640
Conversation
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.
TODOs:
-
It would nice if the trace messages included information about the
BlockForging
that traced them. I was thinking of adding an extra field to BlockForging (Text
? Or a new type family? In practice the hash of the issuer key or whatever could be used). -
In the HFC, we just "zip" them, which means that if we have 1 Byron cred and 3 Shelley creds, we'd have three threads: one with
OptCons Byron1 $ OptCons Shelley1 $ OptNil
and two withOptSkip $ OptCons Shelley2/3 $ OptNil
.
UPDATE: done
@@ -146,7 +145,7 @@ initNodeKernel args@NodeArgs { registry, cfg, tracers, maxTxCapacityOverride | |||
|
|||
st <- initInternalState args | |||
|
|||
whenJust blockForging $ forkBlockForging maxTxCapacityOverride st | |||
mapM_ (forkBlockForging maxTxCapacityOverride st) blockForging |
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.
The main change: we spawn a separate thread for each BlockForging
. This means each thread will do the same checks, including ticking the chain, which can be expensive.
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 would nice if the trace messages included information about the
BlockForging
that traced them. I was thinking of adding an extra field to BlockForging (Text
? Or a new type family? In practice the hash of the issuer key or whatever could be used).
Add a field, include it in the Byron and Shelley credentials.
ouroboros-consensus-byron-test/src/Ouroboros/Consensus/ByronDual/Node.hs
Outdated
Show resolved
Hide resolved
ouroboros-consensus-cardano/src/Ouroboros/Consensus/Cardano/Node.hs
Outdated
Show resolved
Hide resolved
7e30aac
to
9fe83d9
Compare
9fe83d9
to
09e5661
Compare
ouroboros-consensus-shelley/src/Ouroboros/Consensus/Shelley/Ledger/TPraos.hs
Outdated
Show resolved
Hide resolved
ouroboros-consensus-test/test-consensus/Test/Consensus/HardFork/Combinator.hs
Outdated
Show resolved
Hide resolved
ouroboros-consensus/src/Ouroboros/Consensus/HardFork/Combinator/AcrossEras.hs
Outdated
Show resolved
Hide resolved
ouroboros-consensus/src/Ouroboros/Consensus/HardFork/Combinator/Protocol.hs
Show resolved
Hide resolved
ouroboros-consensus/src/Ouroboros/Consensus/HardFork/Combinator/Forging.hs
Show resolved
Hide resolved
ouroboros-consensus/src/Ouroboros/Consensus/HardFork/Combinator/Forging.hs
Show resolved
Hide resolved
ouroboros-consensus/src/Ouroboros/Consensus/HardFork/Combinator/Forging.hs
Show resolved
Hide resolved
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.
Nice, this is so much better.
ef8cee5
to
dd70adb
Compare
(I'm waiting until the release has been tagged before merging this). |
For each set of credentials, a separate block forging thread is spawned. Co-authored-by: Kosyrev Serge <serge.kosyrev@iohk.io>
The Byron and Shelley credentials now include a label to be used as the `forgeLabel` field of `BlockForging`. This label will be included in the forge-related trace messages so that it is possible to see which trace messages belong to which set of credentials, when running a node with multiple sets of credentials. In practice, one could use a hash of the public key used to sign blocks (displayed in base 16).
This module was dead code that got replaced by `Ouroboros.Consensus.HardFork.Combinator.Forging`, but we forgot to remove the file itself.
dd70adb
to
6f11d25
Compare
bors merge |
Build succeeded: |
For each set of credentials, a separate block forging thread is spawned.