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

BLOCKCHAIN-463 - Judiciary Phase 1 #388

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

kacperzuk-neti
Copy link
Collaborator

@kacperzuk-neti kacperzuk-neti commented Jun 20, 2024

Process from merging to forcing move of some staked llm on real chain:

  1. Release new runtime version, upgrade the chain
  2. Deploy the contract with the initial set of judges
  3. sudo call llm.setCourts, providing address of the contract as a court
  4. First judge calls propose with Proposal::LLMForceTranfer {...} on the contract
  5. Remaining judges (as many as required by the configured threshold) call approve
  6. Proposal will execute automatically when threshold is reached.

@kacperzuk-neti kacperzuk-neti self-assigned this Jun 20, 2024
@kacperzuk-neti kacperzuk-neti force-pushed the BLOCKCHAIN-463/judiciary-phase-1 branch 3 times, most recently from 8a0d625 to 8dd2b2b Compare June 20, 2024 20:36
},
};
let transfer_to = match to {
LLMAccount::Liquid(account) => account,
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This means that Courts are able to instantly unlock staked LLM. Is that OK or do we want only staked -> staked moves?

@kacperzuk-neti kacperzuk-neti force-pushed the BLOCKCHAIN-463/judiciary-phase-1 branch 5 times, most recently from ef6c3d9 to d05db42 Compare June 21, 2024 15:39
#[derive(Default)]
pub struct LiberlandExtension;

impl LiberlandExtension {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Turns out we could do phase 1 with no chain extension using call_runtime. However:

  1. I found this after this chain extension was written 🤷
  2. it can only dispatch calls, not read any data. And we will need to read data in the future (asset balances, llm politipool). So enough for phase 1, but not for later.

@kacperzuk-neti kacperzuk-neti force-pushed the BLOCKCHAIN-463/judiciary-phase-1 branch from 7234ccc to c8068f7 Compare June 25, 2024 13:10
@kacperzuk-neti kacperzuk-neti marked this pull request as ready for review June 25, 2024 13:43
@kacperzuk-neti kacperzuk-neti mentioned this pull request Jun 26, 2024
@kacperzuk-neti kacperzuk-neti force-pushed the BLOCKCHAIN-463/judiciary-phase-1 branch from c8068f7 to 7e7c27c Compare July 1, 2024 14:09
#[cfg_attr(feature = "std", derive(ink::storage::traits::StorageLayout))]
pub enum Proposal {
LLMForceTransfer(LLMForceTransferArguments),
SetGovernance { threshold: u32, judges: Vec<AccountId> },
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

There's no such thing as sudo/root for contracts. So instead, adding/removing judges can be made by current judges, just like any other proposal.

If that's not OK and we want sudo, we can add a contract owner, set it to some address with no private key then use sudo.sudoAs to trigger it. Let me know what you prefer and I'll adjust if needed.

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 this pull request may close these issues.

None yet

1 participant