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

Slim account #1

Closed
wants to merge 28 commits into from
Closed

Slim account #1

wants to merge 28 commits into from

Conversation

quocle108
Copy link

@quocle108 quocle108 commented Jan 19, 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 OWNER 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 are a couple of unresolved issues:

  • Snapshot Issue: There's a failure in the <buffered_snapshot_suite> unit-test.
  • State History Issue: When creating an account, the permissions returned do not match the expected permissions in state history unit-test.

Copy link

@wanderingbort wanderingbort left a comment

Choose a reason for hiding this comment

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

I believe you need to make changes here:

if( update.permission == config::active_name )
EOS_ASSERT(update.parent == config::owner_name, action_validate_exception, "Cannot change active authority's parent from owner", ("update.parent", update.parent) );
if (update.permission == config::owner_name)
EOS_ASSERT(update.parent.empty(), action_validate_exception, "Cannot change owner authority's parent");
else
EOS_ASSERT(!update.parent.empty(), action_validate_exception, "Only owner permission can have empty parent" );

otherwise you will be unable to change a slim accounts active key after account creation.

@quocle108
Copy link
Author

replaced by #2

@quocle108 quocle108 closed this Mar 20, 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 this pull request may close these issues.

2 participants