Commit Graph

11795 Commits (fafff095db1a4a99f9a2f93935a7ff993a41388b)

Author SHA1 Message Date
derekpierre f5eb270e90 Add integration and acceptance test to ensure that cached values work for decryption, and that even without a populated cache decryption can still occur. 2024-02-13 10:53:03 -05:00
derekpierre 0351c7726e Incorporate caching of validators list into _resolve_validators() method - much simpler set up that cleans up usages of resolve_validators() everywhere else. 2024-02-13 10:53:03 -05:00
derekpierre 31e1c18a69 Add ability to clear the cache values for a specific ritual - for now it beneficial for testing; perhaps can be good for future revoke functionality. 2024-02-13 10:53:03 -05:00
derekpierre 083df6664f Fix missing return statement for getting decryption share. 2024-02-13 10:53:03 -05:00
derekpierre b674732f71 Utilize DKGStorage cache more effectively to obtain validators, aggregated transcript, and decryption share for a ritual - this will reduce RPC calls, and additional computations. 2024-02-13 10:53:03 -05:00
derekpierre 0c23e1727f Update tests now that transcript bytes are no longer stored in dkg storage - it was only used in tests. 2024-02-13 10:53:03 -05:00
derekpierre f767865131 Remove storage of node's transcript bytes for each ritual - it isn't used
Allow caching of list of validators used in round 1 - allows potential reuse for round 2, and during threshold decryption if needed.
Allow caching of node's decryption share for a completed ritual - allows for reuse for the same ritual.
Use named constants as key values for entries in DKGStorage - just simpler.
2024-02-13 10:53:03 -05:00
derekpierre 6fe1a9462c Update typehint for method to derive decryption share. 2024-02-13 10:53:03 -05:00
derekpierre ddc1b454e5 Use `nucypher-contracts:main` as the canonical source for contract registries.
Add test to ensure github raw path is actually correct.
2024-02-13 10:53:03 -05:00
Kieran Prasch 6e1113aa2d newsfrag for PR #3420 2024-02-13 10:53:03 -05:00
Kieran Prasch 35845d9185 Updates remote regstry source url to reference the main branch on nucypher/nuypher github. 2024-02-13 10:53:03 -05:00
KPrasch b50e754c31 Correction of ABI ordering inside the registry for future diff preservation 2024-02-13 10:53:03 -05:00
derekpierre 77c4c3f338 Add dev newsfragment for #3414. 2024-02-13 10:53:03 -05:00
derekpierre 42e12f2d2f Ignore lynx providers whose nodes are not running. 2024-02-13 10:53:03 -05:00
KPrasch 972ebd31d0 newsfrag for PR #3410 2024-02-13 10:53:03 -05:00
KPrasch b9d9119756 removes the /node_metadata GET endpoint. 2024-02-13 10:53:03 -05:00
KPrasch 00e8eff231 Update nucypher/blockchain/eth/agents.py
Co-authored-by: piotr-roslaniec <39299780+piotr-roslaniec@users.noreply.github.com>
2024-02-13 10:53:03 -05:00
KPrasch fed7edcc9d updates embeded registry to sync with nucypher-contracts v0.19.0 2024-02-13 10:53:03 -05:00
KPrasch 2a4d99cb1f Update tests/acceptance/ape-config.yaml 2024-02-13 10:53:03 -05:00
derekpierre f8609a3d01 Add test for updated tx receipt processing logic which removes the txhash from dkg storage whenever the pending tx hash is determined to have been actually mined, either successfully (status=1) or not.
If the tx is already mined then the Coordinator contract should be the source of truth for how to proceed.
2024-02-13 10:53:03 -05:00
derekpierre 651f2601ad Once a receipt is obtained clear the tx hash from the dkg storage utility. 2024-02-13 10:53:03 -05:00
derekpierre 077a2f4234 Perform all phase checks in one function including pending tx.
For pending tx we don't currently care about the receipt - we will care soon for retry/replacement functionality but that is expected to be handled by a separate task.
2024-02-13 10:53:03 -05:00
derekpierre 00788e9001 Remove use of index within Participant struct - we don't specifically use it. 2024-02-13 10:53:03 -05:00
derekpierre c84060b2bd Include 0 as a value for testing participant pagination - a page size of 0 indicates that all participants should be returned without needing to know the number of participants there are. 2024-02-13 10:53:03 -05:00
derekpierre e1a74366a0 Don't obtain entire ritual when only specific participant information is needed for determining participation state. 2024-02-13 10:53:03 -05:00
derekpierre 6c56dd2d9b Simplify search for participant for post_aggregation in MockCoordinatorAgent. 2024-02-13 10:53:03 -05:00
derekpierre f2dff32a33 Add type hint to aggregate_transcripts call. 2024-02-13 10:53:03 -05:00
derekpierre 84dc5b96bb Max results can be 0, but it should not be negative. 2024-02-13 10:53:03 -05:00
derekpierre 5939e6a00c Raise RuntimeError whenever round 1 called for a ritual that the node is not participating in - participation state should have prevented call to perform_round_1.
Use dkg_size value on Ritual instead of length of providers.
Some code cleanup with comments.
2024-02-13 10:53:03 -05:00
derekpierre 9709ad7466 Fix inner function names to make linter happy. 2024-02-13 10:53:03 -05:00
KPrasch ee472163eb Return dkg phase fetching to operator as methods; Respond to RFCs in PR #3419
Co-Authored-By: derekpierre <derek.pierre@gmail.com>
2024-02-13 10:53:03 -05:00
derekpierre fad20719fc Add acceptant test for various pagination combinations for obtaining participants for a ritual. 2024-02-13 10:53:03 -05:00
derekpierre 89fa5a2d88 Make get_participants non-public since it is really an internal function used when getting a ritual object - it is never/should never be called separately. 2024-02-13 10:53:03 -05:00
derekpierre 6df1c037b7 Reduce public scope of rituals object on MockCoordinatorAgent. We don't really want anything changing state directly. 2024-02-13 10:53:03 -05:00
KPrasch 38c26d81aa respond to RFCs in PR #3419 2024-02-13 10:53:03 -05:00
Kieran Prasch eabc61deaa relocates the remaining Coordinator models to eth/models.py 2024-02-13 10:53:03 -05:00
Kieran Prasch 9b4bf00f10 updates newsfragment for PR #3419 2024-02-13 10:53:03 -05:00
Kieran Prasch a3d8cb00e9 linting, code cleanup, localizes Participant constructor usage. 2024-02-13 10:53:03 -05:00
KPrasch 91c8486f7a use dkg storage txhashes to determine if there is a tracked pending dkg transaction. 2024-02-13 10:53:03 -05:00
KPrasch 5f8d68fe08 bugfix: always handle transaction hashes instead of transcripts for dkg tracking. Updates mocks to return txhash instead of receipt for transcript and aggregation posting. 2024-02-13 10:53:03 -05:00
KPrasch 2a73c816be agent layer: sets by default for transcript and aggregation posting 2024-02-13 10:53:03 -05:00
KPrasch b959354b0d annotations and commentary for dkg phase preconditions. 2024-02-13 10:53:03 -05:00
KPrasch e5782c65f8 agent layer: isolates coordinator function interface exposure (abstracting page management to actors) 2024-02-13 10:53:03 -05:00
KPrasch a9e4a87e6c actor layer: isolate remotely fetched data models for dkg rounds 2024-02-13 10:53:03 -05:00
KPrasch b2db18aa86 isolates ritual pending handlers 2024-02-13 10:53:03 -05:00
KPrasch 550ce7c8c7 linting 2024-02-13 10:53:03 -05:00
derekpierre 399497befc Modified the MockCoordinatorAgent to separate state from values returned or else it gives a false sense of validated tests. For example, `get_ritual` should adhere to its API by returning Participant objects with/without transcripts.
Consequently, only transactions are allowed to modified state, and get calls only return copies of objects.
Update associated test accordingly that needed to mock return from underlying object and not copy.
2024-02-13 10:53:03 -05:00
derekpierre f80b7c939a Implement pagination to obtain participants from contract, and Remove participants as an optional parameter from get_ritual since True was the default, and False was never used. 2024-02-13 10:53:03 -05:00
derekpierre aaeeb0db10 Check whether ritual is active before checking whether the node is a participant in it. 2024-02-13 10:53:03 -05:00
derekpierre 623c4356a9 Obtain transcript if checking whether it has already been set for round 1, or else it will always be assumed to not be set. 2024-02-13 10:53:03 -05:00