Commit Graph

10851 Commits (c0c77b3eb67e2ef733857a6b8f9b8433d3e071df)

Author SHA1 Message Date
Kieran Prasch c0c77b3eb6 re-establish staking providers authorization 2023-09-07 18:33:06 -04:00
Kieran Prasch 0e96f5c76c modifies ape -> nucypher registry adapter function to handle both local and dependency contract ABI entries. 2023-09-07 18:33:06 -04:00
Manuel Montenegro fe75f75998 Update tests to new TACo nucypher contracts
This commit is aimed to update test to the following changes on
nucypher-contracts repo:
  - Update SimplePREApplication with TACoApplication
  - Replace ThresholdStakingForPREApplicationMock contract with
    ThresholdStakingForTACoApplicationMock
  - Use the new Coordinator contract
  - Add the deployment of StakeInfo contract

The use of these new contracts made necessary the following changes:
  - Add the deployment of a new Token for ritual fees: RitualToken. This
    contract has been added as local deployment.
  - Add the deployment of local contract ConditionNFT

Additionally, this commit updates the key character for arguments in
ape-config.yaml. From '::variable::' to <variable>, which results in a
more legible code.

Finally, this commit solves some linting and formatting issues.

Co-authored-by: LunarBytes <kieran@nucypher.com>
2023-09-07 18:32:58 -04:00
Kieran Prasch 5bdb6a8709 newsfragment for PR #3213 2023-09-07 18:27:00 -04:00
LunarBytes e5b4132ec3
Merge pull request #3222 from derekpierre/relock-post-712structs
Relock Dependencies (post eip712-structs removal)
2023-09-07 18:48:13 +02:00
derekpierre f9b3babd69 Updated acceptance tests to use the correct chain id since it seems that the latest version of ape uses a default chain id of 1337.
Some fixtures needed to move to conftest in acceptance folder.
2023-09-05 16:41:23 -04:00
derekpierre 677c6f0a95 Add dev newsfragment for #3222. 2023-09-05 13:39:07 -04:00
derekpierre ccbabde014 Use specific test account since we derive test accounts from a mnemonic - index of `0` is always the same account, so just use it. 2023-09-05 13:36:35 -04:00
derekpierre 2b52ac133e Remove unnecessary dependecy restriction(s) and relock dependencies. 2023-09-05 13:36:35 -04:00
Derek Pierre e39a1ab888
Merge pull request #3221 from derekpierre/bye-bye-712structs
Remove `eip712_structs` dependency
2023-09-05 11:58:22 -04:00
Manuel Montenegro 2dad71e502
Merge pull request #3220 from manumonti/gitignore
Add .ruff_cache folder to .gitignore file
2023-09-04 11:41:52 +02:00
Manuel Montenegro bf9ea12a0d
Add .ruff_cache folder to .gitignore file
Ruff linter generates a cache folder when it runs pre-commit checks.
This folder is ignored since it has its own .gitignore file inside the
folder. But for homogeneity purposes this should be added to .gitignore
file.

Also, adding to general .gitignore file makes that this folder is going
to have a different treatment by IDEs.
2023-09-04 11:40:49 +02:00
derekpierre d43507d2cd Add dev newsfragment for #3221. 2023-09-01 16:14:27 -04:00
derekpierre d530733e60 Restore skipped condition tests. 2023-09-01 15:40:44 -04:00
derekpierre 7b15f9cd41 Remove the use of eip712_structs for processing eip712 message - use eth_account.message.encode_structured_data instead.
This removes reliance on eip712_structs and therefore pysha3.
2023-09-01 13:33:26 -04:00
LunarBytes d9bfd1e86a
Merge pull request #3216 from nucypher/use-core-crate
Use released `nucypher-core@0.12.0` package
2023-09-01 17:40:57 +02:00
LunarBytes f220d88332
Merge pull request #3214 from manumonti/fix-get-agent
Fix Prometheus collector when using get_agent func
2023-08-29 10:18:55 +02:00
Piotr Roslaniec 53dd1ff85b add a newsfragment 2023-08-29 10:05:23 +02:00
Piotr Roslaniec 649d0991ba use released nucypher-core@0.12.0 package 2023-08-29 10:05:23 +02:00
Manuel Montenegro beb8f59723
Add newsfragment for PR #3214 2023-08-29 08:30:51 +02:00
Manuel Montenegro 07793bf9f4
Fix Prometheus collector when using get_agent func
PR #3199 added provider_uri as argument to ContractAgency.get_agent()
function. This fixed an error, but the name of the argument was not the
correct.

This commit fixes the bug caused by the use of an incorrect argument
name.
2023-08-29 08:30:50 +02:00
LunarBytes cfe9ebe301
Merge pull request #3215 from manumonti/fix-ruffus-linter
Fix ruffus (I001) linting rule
2023-08-28 20:07:01 +02:00
Manuel Montenegro c13e5758cb
Fix ruffus (I001) linting rule
Actors.py file doesn't meet I001 rule:

Ruff (I001) nucypher/blockchain/eth/actors.py:1:1: I001 Import block
is un-sorted or un-formatted

This results in Github CI check failures.
2023-08-28 16:25:08 +02:00
LunarBytes cecdee5fde
Merge pull request #3210 from KPrasch/multichain
Multichain Compound Condition Example (Lynx)
2023-08-28 11:24:08 +02:00
Kieran Prasch 758b85bc85 newsfragment for PR #3210 2023-08-28 10:52:41 +02:00
LunarBytes b616bc780c
Merge pull request #3209 from KPrasch/bugfixes
Assorted Bugfixes (migrations, multichain, condition schema)
2023-08-28 10:51:08 +02:00
Kieran Prasch eceaad9e7d newsfragment for PR #3209 2023-08-28 10:50:31 +02:00
LunarBytes 8ae3452434
Merge pull request #3194 from derekpierre/acp
AccessControlPolicy (ACP) and ThresholdMessageKit
2023-08-27 10:22:34 +02:00
derekpierre a9cce0b8ae Add newsfragment for #3194. 2023-08-27 03:19:28 +02:00
derekpierre 03ca66b561 Utilize efficiency improvements to ThresholdMessageKit that ensures that Ciphertext is not needlessly copied between python layer and Rust later.
Allow ciphertext header to be directly obtained without needing to first get the Ciphertext.
Move decryption of ferveo encrypted data into a method on ThresholdMessageKit so that the Ciphertext data can be used directly in Rust layer, and not pulled into python to then pass
it back into the Rust layer for decryption.
2023-08-27 03:19:28 +02:00
derekpierre 62b4ed7940 Use encrypt_for_dkg function from `nucypher-core` so that AuthenticatedData is returned as part of encryption. 2023-08-27 03:19:28 +02:00
derekpierre 8021d365a3 Move allow logic authorization check before evalulation of conditions.
Add TODO for actually calling contract to determine allow logic authorization.
2023-08-27 03:19:28 +02:00
derekpierre 6dfb7e3201 Use latest AuthenticatedData/AccessControlPolicy updated types for encryption.
Finally remove python core shim.
2023-08-27 03:19:28 +02:00
derekpierre 131c04200f Use ciphertext header for authorization. 2023-08-27 03:19:28 +02:00
derekpierre 30cb008618 Update dev version of `nucypher-core` to use. 2023-08-27 03:19:28 +02:00
derekpierre a75c5da251 Incorporate latest changes from ferveo and nucypher-core that exposes key encapsulation so that only encrypted symmetric key and associated data (CiphertextHeader) are included in ThresholdDecryptionRequest. 2023-08-27 03:19:28 +02:00
derekpierre 68e9e3d195 Fix alignment to make linter happy. 2023-08-27 03:19:28 +02:00
derekpierre ce3d399483 Remove fake python core shim, and use actual nucypher_core objects now that they are available via associated nucypher-core PR. 2023-08-27 03:19:28 +02:00
derekpierre ed4a8fbd79 Not the cleanest but mimic ciphertext header / payload from conversations in ferveo#155. 2023-08-27 03:19:28 +02:00
derekpierre 12f4f43b5d Fix serialization of updated FerveoVariant - workaround since I'm dealing in Python space and not `nucypher-core`. 2023-08-27 03:19:28 +02:00
derekpierre fc9edd9ed4 Move KEM/DEM logic to ThresholdMessageKit, and add ACP.aad() function - the AAD can be controlled by versioning but the TMK dictates the AAD and so must be linked somehow with the ACP.aad() function. For now this is done via a compatibility check function. 2023-08-27 03:19:28 +02:00
derekpierre 51e78a14cf Use fernet symmetric encryption as a stop gap measure until ferveo provides kem/dem functionality. 2023-08-27 03:19:28 +02:00
derekpierre 04a0c0239a Fix test affected by member variable naming change to ThresholdMessageKit. 2023-08-27 03:19:28 +02:00
derekpierre 8c959e0c2b Pretend that we receive a kem_ciphertext and dem_ciphertext from ferveo - fake it for now by using the same ciphertext for both. ThresholdMessageKit includes both ciphertexts, but the ThresholdDecryptionRequest only requires the kem_ciphertext. 2023-08-27 03:19:28 +02:00
derekpierre d55a95644f Use ciphertext hash as the digest value when determining whether the encrypted data was produced by an authorized party. 2023-08-27 03:19:28 +02:00
derekpierre 6bb6d0cc56 Fix chaotic characters to work with latest ThresholdDecryptionRequest modifications. 2023-08-27 03:19:28 +02:00
derekpierre 98cbe16be3 Add the ability for Ursula to use the ACP, obtained from the modified ThresholdDecryptionRequest, to check whether the data is encrypted by an authorized party.
Stub method added to CoordinatorAgent for now.
2023-08-27 03:19:16 +02:00
derekpierre f93f1b1019 Rename DkgMessageKit to ThresholdMessageKit. 2023-08-27 03:18:08 +02:00
derekpierre a84680e6ca Update threshold_decrypt to take a DkgMessageKit instead of ciphertext and conditions. 2023-08-27 03:18:08 +02:00
derekpierre 2043b69a21 Remove redundant test. 2023-08-27 03:18:08 +02:00