Skip to content
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

zome re-structure mirco-service architecture #4

Open
nphias opened this issue May 31, 2024 · 7 comments · May be fixed by #89
Open

zome re-structure mirco-service architecture #4

nphias opened this issue May 31, 2024 · 7 comments · May be fixed by #89
Assignees

Comments

@nphias
Copy link
Contributor

nphias commented May 31, 2024

currently there is only one zome for the functionality of four distinct parts which could be split into four zomes:

  • username attestaion
  • wallet attestation
  • external_id attestation
  • recipes

this would make documentation clearer

@nphias nphias self-assigned this May 31, 2024
@nphias nphias changed the title fix for docker on cpu architecture arm64 zome re-structure and docs Jun 10, 2024
@nphias nphias removed their assignment Jun 11, 2024
@nphias nphias changed the title zome re-structure and docs zome re-structure and crate docs Jun 12, 2024
@8e8b2c
Copy link
Collaborator

8e8b2c commented Jun 12, 2024

I think actually we'll need them all in one zome in order to enable validation that ties everything together. The direction I'm taking this project is one in which you can specify some verifiable aggregation of the various resources in a customisable manor. For example, I imagine might do something like this for producing verifiable winnings-coupon contexts for signing:

{
  '$args': ['recipient_evm_address'],
  match_ids: { doc: 'championships/123/match_ids_final' },
  matches: { doc_list: '$match_ids' },
  player_win_counts: { in: '$matches', jq: '# matches into player_id: win_count' },
  player_ids: { in: '$player_win_counts', jq: '# key of ^' },
  external_ids: { fetch_external_id_attestations: '$player_ids' }
  split: { in: ['$player_win_counts', '$external_ids'], jq: '# filter by external id and calc percentage' },
  caller: { get_pubkey },
  '$return': { in: ['$caller', '$split', '$recipient_evm_address'], jq: '# select percentage and arrange context array' }
}

@8e8b2c
Copy link
Collaborator

8e8b2c commented Jun 12, 2024

Rather than splitting everything into zomes, it might still be useful to split them into crates. That would allow other projects to more conveniently include functionality in a partial manor.

@nphias
Copy link
Contributor Author

nphias commented Jun 18, 2024

Rather than splitting everything into zomes, it might still be useful to split them into crates. That would allow other projects to more conveniently include functionality in a partial manor.

I would say in general zomes are at the crate level of granularity and have their own cargo file.. right now you have four independent features bundled under one zome called username_registry.. Its fine for a repo to maintain multiple zomes which can be later pulled in as independent crates to other projects.

@8e8b2c
Copy link
Collaborator

8e8b2c commented Jun 19, 2024

Its fine for a repo to maintain multiple zomes which can be later pulled in as independent crates to other projects.

Could you give me an example of how this would work? I was under the impression (perhaps mistakenly?) that when calling must_get_valid_record in an integrity zome, it is only able to retrieve data for entries defined within that zome.

Let's say I want to validate a Recipe that incorporates an ExternalIdAttestation and an OracleDocument. Can the recipe validation call must_get_valid_record to get the contents of the specified ExternalIdAttestation and OracleDocument for use in the recipe's execution?

@8e8b2c
Copy link
Collaborator

8e8b2c commented Jun 24, 2024

@nphias, see validate_create_recipe_execution in #24 for a concrete example of why I want validation across the various entry types.

@dcatki dcatki assigned nphias and 8e8b2c and unassigned nphias Jul 10, 2024
@dcatki
Copy link
Collaborator

dcatki commented Jul 10, 2024

Deprioritised

@8e8b2c
Copy link
Collaborator

8e8b2c commented Aug 19, 2024

Spike for establishing pattern to make features modular:
#98

@nphias nphias changed the title zome re-structure and crate docs zome re-structure mirco-service architecture Aug 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants