-
Notifications
You must be signed in to change notification settings - Fork 10
Misha/issue 100 time conversions #105
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
Conversation
- v1 working variant, checked on testnet
- cleanup TimeSlot module - refactoring - removing `SlotConfig` from `PABConfig`
- testnet debugging enhancements
- minor refactoring and docs
4ff096c to
d184cdb
Compare
- removing debug contract - formatting
| let lowerB = LowerBound startSlot startSlotClosure | ||
| upperB = UpperBound endSlot endSlotClosure | ||
| pure $ Interval lowerB upperB | ||
| where |
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.
These are a litttle involved, lets get some type signatures on them
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.
type signatures added
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.
I think @samuelWilliams99 ment the convertExtended and getExtClosure functions, no?
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.
Added signatures there as well and clarification comments.
| , teRawCBOR = fromRight (error "failed to unpack CBOR hex") $ unhex "84a500848258205d677265fa5bb21ce6d8c7502aca70b9316d10e958611f3c6b758f65ad9599960182582076ed2fcda860de2cbacd0f3a169058fa91eff47bc1e1e5b6d84497159fbc9300008258209405c89393ba84b14bf8d3e7ed4788cc6e2257831943b58338bee8d37a3668fc00825820a1be9565ccac4a04d2b5bf0d0167196ae467da0d88161c9c827fbe76452b24ef000d8182582076ed2fcda860de2cbacd0f3a169058fa91eff47bc1e1e5b6d84497159fbc930000018482581d600f45aaf1b2959db6e5ff94dbb1f823bf257680c3c723ac2d49f975461a3b8cc4a582581d600f45aaf1b2959db6e5ff94dbb1f823bf257680c3c723ac2d49f97546821a00150bd0a1581c1d6445ddeda578117f393848e685128f1e78ad0c4e48129c5964dc2ea14974657374546f6b656e1a000d062782581d606696936bb8ae24859d0c2e4d05584106601f58a5e9466282c8561b88821a00150bd0a1581c1d6445ddeda578117f393848e685128f1e78ad0c4e48129c5964dc2ea14974657374546f6b656e1282581d60981fc565bcf0c95c0cfa6ee6693875b60d529d87ed7082e9bf03c6a4821a00150bd0a1581c1d6445ddeda578117f393848e685128f1e78ad0c4e48129c5964dc2ea14974657374546f6b656e0f021a000320250e81581c0f45aaf1b2959db6e5ff94dbb1f823bf257680c3c723ac2d49f97546a10081825820096092b8515d75c2a2f75d6aa7c5191996755840e81deaa403dba5b690f091b65840295a93849a67cecabb8286e561c407b6bd49abf8d2da8bfb821105eae4d28ef0ef1b9ee5e8abb8fd334059f3dfc78c0a65e74057a2dc8d1d12e46842abea600ff5f6" | ||
| } | ||
|
|
||
| mockSlotRange :: |
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.
Given we're mocking this, can we get a test for it?
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.
I think it will require this to make it clean and straightforward. There is bunch of node queries required to get all arguments for conversion and they need to be mocked also if we are not calling real node.
(there will be still some parts tho, that I'm not sure how get easily atm, like EraHistory)
| QueryChainIndex :: ChainIndexQuery -> PABEffect w ChainIndexResponse | ||
| EstimateBudget :: TxFile -> PABEffect w (Either BudgetEstimationError TxBudget) | ||
| SaveBudget :: Ledger.TxId -> TxBudget -> PABEffect w () | ||
| SlotToPOSIXTime :: |
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.
I started to get a feeling that instead of introducing new effects here for each cardano-api related query, we should have a more general QueryNode that uses this (this would also make later attempts to use cardano-api instead of the cli or chain-index a bit simpler)
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.
This is great idea, I think. It will also make things more testable (e.g. like this one).
But not sure if it should be done under this PR. To make it right budget execution related logic need to be changed also.
Or maybe just change part related to slot/time conversions to QueryNode effect and leave ex-budget for separate issue?
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.
Agreed yes, let's make that a new issue (the problem with refactoring issues is that they tend to be forgotten, staying in the backlog forever, so I like to couple them with some useful feature)
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.
Made an issue #109
szg251
left a comment
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.
There are still a few small ones
| let lowerB = LowerBound startSlot startSlotClosure | ||
| upperB = UpperBound endSlot endSlotClosure | ||
| pure $ Interval lowerB upperB | ||
| where |
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.
I think @samuelWilliams99 ment the convertExtended and getExtClosure functions, no?
Related issue: #100
This PR aims to fix
time <-> slotconversions.Changes:
time -> slot,slot -> timeandtime range -> slot rangeconversionsplutus-ledgerfunctions fortime <-> slotconversions replaced with new ones, which re-use functions from ledger and should give correct conversions sustainable to slot length changespcSlotConfigremoved fromPABConfigas it is not required anymoreNew conversions were tested on public testnet with this validator.