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

Draft: Slim accounts #2328

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

quocle108
Copy link

@quocle108 quocle108 commented Mar 21, 2024

Change Description

This MR introduces a significant optimization in RAM usage by implementing a new account structure. The changes are designed to enhance efficiency and reduce the memory. The key modifications include:

  • Restructure account_object and account_metadata_object. The account_object is now universal for all account types, while the account_metadata_object is specifically applied for smart contract accounts
  • Merge Object: resource_limits_object and resource_usage_object into resource_object, permission_object and permission_usage_object into permission_object
  • Introduction of Slim Accounts:: To further economize RAM usage, the concept of 'Slim accounts' is introduced. These accounts are smaller, containing only the account_object, resource_object, and one ACTIVE permission. Unlike regular accounts, Slim accounts don't have the ACTIVE permission by default. A Slim account uses up to 54% less RAM than a regular account.

API Changes

  • API Changes
    New actions: eosio:: newslimacc

Documentation Additions

  • Documentation Additions
    Documentation can be found here

Note

There is an unresolved issues:

  • State History Issue: When creating an account, the permissions returned do not match the expected permissions in state history unit-test.

@quocle108 quocle108 changed the title Slim accounts Draft: Slim accounts Mar 22, 2024
@cc32d9
Copy link
Contributor

cc32d9 commented Jun 18, 2024

as discussed in the chat:

  1. namespace reservation must not be hardcoded. It needs a configurable way, if needed at all:
     // system account only can be created by newaccount
      EOS_ASSERT( name_str.find( "eosio." ) != 0, action_validate_exception,
                     "only newaccount action can create account with name start with 'eosio.'" );
  1. Odd placement of create_slim_account() inside libraries/chain/webassembly/privileged.cpp. It belongs where newaccount() sits.

  2. State history plugin needs to be able to read the data created by previous Leap versions.

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.

2 participants