-
Notifications
You must be signed in to change notification settings - Fork 214
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
Adjust restoration loop to look for known certificate registrations #899
Comments
Our current definition of data Block = Block
{ header
:: !BlockHeader
, transactions
:: ![Tx]
, delegations
:: ![(ChimericAccount, PoolId)]
} deriving (Show, Eq, Ord, Generic) The definition of class IsOurs s where
isOurs
:: Address
-> s
-> (Bool, s)
-- ^ Checks whether an address is ours or not.
Of course, the above function gives us a way to recognize values of Question: how can we recognize values of |
Definitely NO 😅
We're going to need another function for that. Though, that function really is Additional reading here: https://github.com/input-output-hk/implementation-decisions/blob/e2d1bed5e617f0907bc5e12cf1c3f3302a4a7c42/text/1852-hd-chimeric.md |
@KtorZ wrote:
The applyBlock
:: Block
-> Wallet s
-> ([(Tx, TxMeta)], Wallet s) Given that Questions: 1. Do you have any preference as to how we adjust the 2. Since there's only Could we use an oracle function similar to this: data Wallet s where
Wallet :: (IsOurs s, NFData s, Show s)
=> UTxO -- Unspent tx outputs belonging to this wallet
-> BlockHeader -- Header of the latest applied block (current tip)
-> s -- Address discovery state
-> IsOurChimericAccount
-> BlockchainParameters
-> Wallet s
type IsOurChimericAccount = ChimericAccount -> Bool |
1075: Generalize `IsOurs` to work on different types of entity. r=jonathanknowles a=jonathanknowles # Issue Number #899 # Overview This PR: - [x] Generalizes the definition of the `IsOurs` type class so that it can be applied to more types of entities than Address. - [x] Adds an `IsOurs s ChimericAccount` constraint to the `Wallet` type. # Comments For the moment, we provide an instance of `IsOurs (SeqState n k) ChimericAccount` that always returns `False`. A further PR will add this implementation. Co-authored-by: Jonathan Knowles <[email protected]>
1050: Scan stake pool registrations during wallet restoration. r=KtorZ a=jonathanknowles # Issue Number #899 # Overview <!-- Detail in a few bullet points the work accomplished in this PR --> I have: - [x] Provided an implementation of `IsOurs (SeqState n k) ChimericAccount`. - [x] Adjusted the return type of `applyBlock` so that it references any stake delegation that has occurred on behalf of the specified wallet. - [x] Adjusted the definition of `restoreBlocks` so that it correctly processes the registrations returned by `applyBlocks`. - [x] Adjusted the definition of `applyBlock` to identify delegations relevant to the specified wallet, and return the final registration as part of `FilteredBlock`. - [x] Added tests to ensure that `applyBlock` does successfully discover delegations made by the wallet under test, and only that wallet. - [x] Added tests to ensure that a wallet's delegation status is correctly updated in the context of discovered delegations. <!-- 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 ✓ Acknowledge any changes required to the Wiki --> Co-authored-by: Jonathan Knowles <[email protected]> Co-authored-by: KtorZ <[email protected]>
1050: Scan stake pool registrations during wallet restoration. r=KtorZ a=jonathanknowles # Issue Number #899 # Overview <!-- Detail in a few bullet points the work accomplished in this PR --> I have: - [x] Provided an implementation of `IsOurs (SeqState n k) ChimericAccount`. - [x] Adjusted the return type of `applyBlock` so that it references any stake delegation that has occurred on behalf of the specified wallet. - [x] Adjusted the definition of `restoreBlocks` so that it correctly processes the registrations returned by `applyBlocks`. - [x] Adjusted the definition of `applyBlock` to identify delegations relevant to the specified wallet, and return the final registration as part of `FilteredBlock`. - [x] Added tests to ensure that `applyBlock` does successfully discover delegations made by the wallet under test, and only that wallet. - [x] Added tests to ensure that a wallet's delegation status is correctly updated in the context of discovered delegations. <!-- 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 ✓ Acknowledge any changes required to the Wiki --> Co-authored-by: Jonathan Knowles <[email protected]> Co-authored-by: KtorZ <[email protected]>
@KtorZ are you able to clarify the following:
In particular, are you able to give a concrete set of reproduction steps for this issue? Thanks! |
Ah! I forgot about this one, good I added a reminder ^.^ ... I'll explain in a PR, would be easier. |
1132: atomically write checkpoints, tx history and delegation certs when discovered r=KtorZ a=KtorZ # Issue Number <!-- Put here a reference to the issue this PR relates to and which requirements it tackles --> #899 # Overview <!-- Detail in a few bullet points the work accomplished in this PR --> - [ ] I have adjusted the restoration loop to atomically write checkpoints, tx history and delegation certs when discovered # Comments <!-- 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: KtorZ <[email protected]>
Great! I've moved this to the QA state. |
lgtm. |
Context
With #898, certificate registrations will now be part of blocks normally processed by the wallet layer.
Decision
Acceptance Criteria
Development plan
Generalization of existing discovery classes
PR: #1075
IsOurs
type class so that it can be applied to more types of entities than Address.IsOurs s ChimericAccount
constraint to theWallet
type.Adjust restoration loop to look for delegations from wallet's chimeric account
PR: #1050
IsOurs (SeqState n k) ChimericAccount
.applyBlock
so that it references any stake delegation that has occurred on behalf of the specified wallet.restoreBlocks
so that it correctly processes the registrations returned byapplyBlocks
.PRs
master
master
QA
PR: #1050
applyBlock
does successfully discover delegations made by the wallet under test, and only that wallet. (STAKE_POOLS_JOIN_01
)STAKE_POOLS_JOIN_01
)The text was updated successfully, but these errors were encountered: