Skip to content

Immutable treasure maps#2773

Merged
KPrasch merged 8 commits intonucypher:mainfrom
fjarri:tmaps
Aug 19, 2021
Merged

Immutable treasure maps#2773
KPrasch merged 8 commits intonucypher:mainfrom
fjarri:tmaps

Conversation

@fjarri
Copy link
Contributor

@fjarri fjarri commented Aug 13, 2021

Based on top of #2745

Type of PR:

  • Feature
  • Other

Required reviews:

  • 3

What this does:

Note: versioning was temporarily removed, since the blockchain signature processing does not fit the "get_splitter()" approach; to be fixed in #2767.

Why it's needed:

  • needed for retrieval support in Porter

For reviewers:

  • Any other name for EncryptedTreasureMap? PublishedTreasureMap?
  • What's the format for blockchain signature in the federated case? Possible variants:
    • Optional: b'\x00' if no blockchain signature, b'\x01' + signature otherwise (current version)
    • Placeholder: b'\x00' * 65 if no blockchain signature
  • What's with the comment about Better Arrangement ID. #180 at Policy.hrac attribute? It seems out of place.

fjarri added a commit to fjarri/nucypher that referenced this pull request Aug 13, 2021
@fjarri fjarri changed the title Immutable treasure maps [WIP] Immutable treasure maps Aug 13, 2021
@fjarri fjarri force-pushed the tmaps branch 4 times, most recently from 3c3e30e to 7d0a358 Compare August 15, 2021 00:51
fjarri added a commit to fjarri/nucypher that referenced this pull request Aug 15, 2021
@fjarri fjarri force-pushed the tmaps branch 2 times, most recently from c8ca534 to b38cc33 Compare August 15, 2021 18:40
@fjarri fjarri requested review from KPrasch and derekpierre August 15, 2021 18:40
@fjarri fjarri force-pushed the tmaps branch 6 times, most recently from b033886 to 6589d01 Compare August 15, 2021 19:29
@fjarri fjarri changed the title [WIP] Immutable treasure maps Immutable treasure maps Aug 15, 2021
Copy link
Member

@derekpierre derekpierre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haven't looked through the whole PR just yet but one thought comes to mind.

hrac feels like an internal type of representation (within nucypher code) i.e. we derive an hrac and use it for identification purposes. Exposing it as an "hrac" for example in REST requests seems overly complex to me for exposure to users. We could still refer to it as an "id" externally (i.e. policy.id and treasuremap.id), but internally (within nucypher code) we know it is an hrac.

wdyt?

@@ -56,23 +39,7 @@ def _deserialize(self, value, attr, data, **kwargs):
raise InvalidInputData(f"Could not parse {self.name}: {e}")

def _validate(self, value):
Copy link
Member

@derekpierre derekpierre Aug 16, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would just move this code into _deserialize()so that deserialization returns an EncryptedTreasureMap object - see code change in #2768 - https://github.com/nucypher/nucypher/pull/2768/files#diff-54f7a125485aa11f633996b09e5f6b0468b8b91cd06a04cb097a808b70e14c1eR63

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is hrac exposed publicly that gives you concern?

fjarri added a commit to fjarri/nucypher that referenced this pull request Aug 17, 2021
@KPrasch KPrasch requested a review from vepkenez August 17, 2021 19:27
fjarri added a commit to fjarri/nucypher that referenced this pull request Aug 17, 2021
@derekpierre
Copy link
Member

@fjarri , @KPrasch any thoughts here - #2773 (review)

@derekpierre
Copy link
Member

derekpierre commented Aug 18, 2021

Where is hrac exposed publicly that gives you concern?

@KPrasch I haven't looked through the entire PR yet - but of particular concern was the Porter REST API using 'hrac' as a REST parameter - https://github.com/fjarri/nucypher/blob/tmaps/tests/integration/porter/control/test_porter_web_control_federated.py#L106 (schema: https://github.com/fjarri/nucypher/blob/tmaps/nucypher/utilities/porter/control/interfaces.py#L71)

@fjarri
Copy link
Contributor Author

fjarri commented Aug 18, 2021

@derekpierre , regarding ID/HRAC: my position is that it would be better to have the same name throughout the code. I don't feel particularly strongly whether it's ID or HRAC in the end; HRAC is a little easier to look up in the code.

The endpoint you cited is probably going away anyway - @KPrasch is thinking about getting rid of storing the treasure map on Ursula side. In this case, we won't even need to send the HRAC to Ursula.

@fjarri
Copy link
Contributor Author

fjarri commented Aug 18, 2021

Regarding the schema changes - would it be better handled in #2768?

fjarri added a commit to fjarri/nucypher that referenced this pull request Aug 18, 2021
@derekpierre
Copy link
Member

derekpierre commented Aug 19, 2021

Regarding the schema changes - would it be better handled in #2768?

Sure. I guess that would save me from an even more rough rebase 😅

@derekpierre
Copy link
Member

@derekpierre , regarding ID/HRAC: my position is that it would be better to have the same name throughout the code. I don't feel particularly strongly whether it's ID or HRAC in the end; HRAC is a little easier to look up in the code.

The endpoint you cited is probably going away anyway - @KPrasch is thinking about getting rid of storing the treasure map on Ursula side. In this case, we won't even need to send the HRAC to Ursula.

@fjarri fair enough.

Updated PR looks good - do we need a newsfragment for this PR? Currently, it is empty.

@fjarri
Copy link
Contributor Author

fjarri commented Aug 19, 2021

CI fails:

fjarri added a commit to fjarri/nucypher that referenced this pull request Aug 19, 2021
Copy link
Member

@derekpierre derekpierre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎸

@KPrasch KPrasch merged commit 5be6a96 into nucypher:main Aug 19, 2021
@fjarri fjarri deleted the tmaps branch August 19, 2021 21:48
This was referenced Aug 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants