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

Proposal: programs' frame_system::AccountInfo permanent existence #3924

Closed
13 tasks
breathx opened this issue Apr 26, 2024 · 1 comment · Fixed by #3961
Closed
13 tasks

Proposal: programs' frame_system::AccountInfo permanent existence #3924

breathx opened this issue Apr 26, 2024 · 1 comment · Fixed by #3961
Assignees
Labels
C2-refactoring Refactoring proposal

Comments

@breathx
Copy link
Member

breathx commented Apr 26, 2024

Motivation of the PR is to increase transparency of the system and isolate user-space from executable environment's restrictions, with upcoming security improvement and bug-safe space within the substrate code.

Invariant: Each program should have ED locked on its account when active.

Implementation details (TODO):

  • Implement charging from balance within pallet_gear::upload_program and pallet_gear::create_program extrinsics
    • 2 tests
  • Implement charging from program balance on backend level in case of calling gr_create_program and further charging in JournalNote::StoreNewPrograms processing (track the case when code not exist, so refund should be performed)
    • 2 tests
  • In case of calling gr_exit this funds should be unlocked and transferred to inheritor
    • 1 test
  • Remove value limits (check_value) for sendings in all send-extrinsics and all backend send-syscalls
    • 2 tests: extrinsics/syscalls (for syscalls could be implemented in core-processor/ext units)
  • Replace all transfers in system to Existence::AllowDeath version
  • Implement migrations that transfer ED from treasury for each existing program
    • try-runtime tests that after migrations all program that are in "Active" status has ED locked.
  • Fix existing tests

  • Consider (maybe only open an issue or resolving in another PR) to lock the balance for builtin actors and "pallet_gear_staking_rewards" and "pallet_gear_bank"
@breathx
Copy link
Member Author

breathx commented Apr 26, 2024

If possible, in PR that resolves this, split each solved TODO into separate commit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C2-refactoring Refactoring proposal
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants