-
Notifications
You must be signed in to change notification settings - Fork 217
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
Move slotting to separate module #1890
Conversation
62b4720
to
1d1bea8
Compare
48d3ccd
to
8a85564
Compare
1d1bea8
to
c238d9b
Compare
8a85564
to
357bb22
Compare
df09036
to
b2e34a7
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.
LGTM
import Ouroboros.Consensus.HardFork.History.EraParams | ||
( EraParams (..), noLowerBoundSafeZone ) | ||
import Ouroboros.Consensus.HardFork.History.Qry | ||
( Qry, runQuery, slotToEpoch ) | ||
import Ouroboros.Consensus.HardFork.History.Summary | ||
( Summary (..), neverForksSummary ) |
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.
Importing of Ouroboros.Consensus doesn't seem right for the cardano-wallet-core package - it is cardano-node backend specific. Is there any way to move this to the cardano-wallet-shelley package?
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.
Core already depends on ouroboros-network: https://github.com/input-output-hk/cardano-wallet/blob/315b875cd3c6a78b8c4d4e58bfec6bd4d9acffcd/lib/core/src/Ouroboros/Network/Client/Wallet.hs#L12-L20
- To avoid having
Qry
in core, we'd need to duplicate the interface - Jormungandr can satisfy the
Qry
interface
I do think it is fine.
Slightly related thread: point vs forcing jormungandr to use SlotNo
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 boundary between jormungandr and byron/shelley could also be revisited later.
-- TODO: The type should be changed to @Interpreter@ when we bump | ||
-- ouroboros-consensus. |
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 do this? Another PR?
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.
No rush. I don't think we need it until #1870 is starting.
- We will use it to correctly deal with time across hard-forks - Added tests for equivalence with old implementation
b2e34a7
to
1be1ac1
Compare
bors r+ |
Build succeeded |
1901: Use SlotNo and TimeInterpreter r=Anviking a=Anviking # Issue Number ADP-356 #1868 #1869 # Overview - [x] Add TimeInterpreter, necessary queries, and a way to run them Add tests comparing them with old implementation - [x] Fundamentally change wallet to use SlotNo instead of SlotId - Patch together cardano-wallet-jormungandr to still work, despite the binary using SlotId. - [x] Remove redundant byron code - [x] Sync progress calculation compares times now instead of slots - [x] Rename the `slot` tables to `slot_no` to force automatic migration, preventing catastrophic re-interpretation of old data # Comments - Depends on #1890 <!-- Additional comments or screenshots to attach if any --> <!-- Don't forget to: ✓ Self-review your changes to make sure nothing unexpected slipped through ✓ Assign yourself to the PR ✓ Assign one or several reviewer(s) ✓ Once created, link this PR to its corresponding ticket ✓ Assign the PR to a corresponding milestone ✓ Acknowledge any changes required to the Wiki --> Co-authored-by: Johannes Lund <[email protected]>
1901: Use SlotNo and TimeInterpreter r=Anviking a=Anviking # Issue Number ADP-356 #1868 #1869 # Overview - [x] Add TimeInterpreter, necessary queries, and a way to run them Add tests comparing them with old implementation - [x] Fundamentally change wallet to use SlotNo instead of SlotId - Patch together cardano-wallet-jormungandr to still work, despite the binary using SlotId. - [x] Remove redundant byron code - [x] Sync progress calculation compares times now instead of slots - [x] Rename the `slot` tables to `slot_no` to force automatic migration, preventing catastrophic re-interpretation of old data # Comments - Depends on #1890 <!-- Additional comments or screenshots to attach if any --> <!-- Don't forget to: ✓ Self-review your changes to make sure nothing unexpected slipped through ✓ Assign yourself to the PR ✓ Assign one or several reviewer(s) ✓ Once created, link this PR to its corresponding ticket ✓ Assign the PR to a corresponding milestone ✓ Acknowledge any changes required to the Wiki --> Co-authored-by: Johannes Lund <[email protected]>
1901: Use SlotNo and TimeInterpreter r=Anviking a=Anviking # Issue Number ADP-356 #1868 #1869 # Overview - [x] Add TimeInterpreter, necessary queries, and a way to run them Add tests comparing them with old implementation - [x] Fundamentally change wallet to use SlotNo instead of SlotId - Patch together cardano-wallet-jormungandr to still work, despite the binary using SlotId. - [x] Remove redundant byron code - [x] Sync progress calculation compares times now instead of slots - [x] Rename the `slot` tables to `slot_no` to force automatic migration, preventing catastrophic re-interpretation of old data # Comments - Depends on #1890 <!-- Additional comments or screenshots to attach if any --> <!-- Don't forget to: ✓ Self-review your changes to make sure nothing unexpected slipped through ✓ Assign yourself to the PR ✓ Assign one or several reviewer(s) ✓ Once created, link this PR to its corresponding ticket ✓ Assign the PR to a corresponding milestone ✓ Acknowledge any changes required to the Wiki --> Co-authored-by: Johannes Lund <[email protected]>
1901: Use SlotNo and TimeInterpreter r=Anviking a=Anviking # Issue Number ADP-356 #1868 #1869 # Overview - [x] Add TimeInterpreter, necessary queries, and a way to run them Add tests comparing them with old implementation - [x] Fundamentally change wallet to use SlotNo instead of SlotId - Patch together cardano-wallet-jormungandr to still work, despite the binary using SlotId. - [x] Remove redundant byron code - [x] Sync progress calculation compares times now instead of slots - [x] Rename the `slot` tables to `slot_no` to force automatic migration, preventing catastrophic re-interpretation of old data # Comments - Depends on #1890 <!-- Additional comments or screenshots to attach if any --> <!-- Don't forget to: ✓ Self-review your changes to make sure nothing unexpected slipped through ✓ Assign yourself to the PR ✓ Assign one or several reviewer(s) ✓ Once created, link this PR to its corresponding ticket ✓ Assign the PR to a corresponding milestone ✓ Acknowledge any changes required to the Wiki --> Co-authored-by: Johannes Lund <[email protected]>
1901: Use SlotNo and TimeInterpreter r=Anviking a=Anviking # Issue Number ADP-356 #1868 #1869 # Overview - [x] Add TimeInterpreter, necessary queries, and a way to run them Add tests comparing them with old implementation - [x] Fundamentally change wallet to use SlotNo instead of SlotId - Patch together cardano-wallet-jormungandr to still work, despite the binary using SlotId. - [x] Remove redundant byron code - [x] Sync progress calculation compares times now instead of slots - [x] Rename the `slot` tables to `slot_no` to force automatic migration, preventing catastrophic re-interpretation of old data # Comments - Depends on #1890 <!-- Additional comments or screenshots to attach if any --> <!-- Don't forget to: ✓ Self-review your changes to make sure nothing unexpected slipped through ✓ Assign yourself to the PR ✓ Assign one or several reviewer(s) ✓ Once created, link this PR to its corresponding ticket ✓ Assign the PR to a corresponding milestone ✓ Acknowledge any changes required to the Wiki --> Co-authored-by: Johannes Lund <[email protected]>
Issue Number
ADP-356 #1868, #1869
Overview
flatSlot
,slotAt
, etc.) to a new moduleCardano.Wallet.Primitive.Slotting
runQuery epochOf singleEraInterpreter == epochNumber . fromFlatSlot
Comments
Range
tests and slotting tests seemed unclear.Qry
/Interpreter
.