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

Nodes should initialize their own information in the contract state #389

Open
Tracked by #326
itegulov opened this issue Nov 28, 2023 · 2 comments
Open
Tracked by #326
Assignees
Labels
Emerging Tech Emerging Tech flying formation at Pagoda Near BOS NEAR BOS team at Pagoda

Comments

@itegulov
Copy link
Contributor

Description

Right now the contract state has to be initialized with the full vector of information (participant id, url, account id etc), but ideally everything except for account id should be fillied in by the node itself to give more flexibility on deployment.

@itegulov itegulov added Near BOS NEAR BOS team at Pagoda Emerging Tech Emerging Tech flying formation at Pagoda labels Nov 28, 2023
@ppca ppca moved this from Backlog to In Progress in Emerging Technologies Dec 1, 2023
@ppca ppca self-assigned this Dec 1, 2023
@ppca
Copy link
Contributor

ppca commented Dec 2, 2023

@itegulov
Copy link
Contributor Author

itegulov commented Dec 2, 2023

So that method is only called once by the entity that deploys the smart contract. That entity does not necessarily know all nodes information (their URL, id etc). With the exception of account ID which is the essential part of being able to authorize nodes' calls to the smart contract.

Instead of accepting participants: BTreeMap<AccountId, ParticipantInfo> this method should just accept Vec<AccountId> which "pre-initializes" the contract (you can create a new state struct if that helps). Then each of the nodes in that list would be allowed to call some new method init_participant(info: ParticipantInfo) that fills information for the specific node that makes the call (authorized through signer_id). Once we have all the information we can consider the state to be initialized.

Feel free to stray away from the above of course if that would make more sense. I am just sharing my high-level vision not what absolutely needs to be done.

@volovyks volovyks moved this from In Progress to Selected in Emerging Technologies Jan 23, 2024
@volovyks volovyks moved this from Selected to Backlog in Emerging Technologies Jan 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Emerging Tech Emerging Tech flying formation at Pagoda Near BOS NEAR BOS team at Pagoda
Projects
Status: Backlog
Development

No branches or pull requests

2 participants