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

RCP-240313B: Move script and type libraries outside of schema, interfaces and operations #4

Open
dr-orlovsky opened this issue Mar 13, 2024 · 0 comments
Assignees
Labels
C-stdlib Proposes changes to standard library S-implemented
Milestone

Comments

@dr-orlovsky
Copy link
Member

layers: consensus, standard library
consensus: unaffected

With RGB v0.10 schema, interfaces and implementations include explicit source code of script (AluVM) and type (Strict Types) libraries. With v0.11, assignments in genesis, state transitions and extensions are also allowed to provide script spending conditions, and all operations will be able to come with their own script and type libraries.

This will result in the replication of the same type libraries over and over again, bloating sizes of consignments and stashes. Even with v0.10, a typical contract replicates the same type library twice (schema and interface), leading to ~30% increase in the size of the contract consignment for any asset.

Since on the consensus level schemata, interfaces and operations since v0.11 commit to the id of the script and type library - and not the library source code, I propose to move the source code into a dedicated segment in the consignment (or interface/schema containers), and let RGB data reference them only by their ids. This will prevent library replication and reduce the size of the consignments and other containers.

@dr-orlovsky dr-orlovsky changed the title RCP-240313B: Move script and type libraries outside of schema, interfaces etc into consignments RCP-240313B: Move script and type libraries outside of schema, interfaces and operations Mar 13, 2024
@dr-orlovsky dr-orlovsky added the C-stdlib Proposes changes to standard library label Mar 13, 2024
@dr-orlovsky dr-orlovsky moved this to Backlog in RGB release v0.11 Mar 13, 2024
@dr-orlovsky dr-orlovsky added this to the v0.11 milestone Mar 13, 2024
@dr-orlovsky dr-orlovsky self-assigned this Apr 9, 2024
@dr-orlovsky dr-orlovsky moved this from Backlog to Done in RGB release v0.11 Apr 18, 2024
@dr-orlovsky dr-orlovsky added S-accepted Accepted proposals for the implementation S-implemented and removed S-accepted Accepted proposals for the implementation labels Oct 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-stdlib Proposes changes to standard library S-implemented
Projects
Status: Done
Development

No branches or pull requests

1 participant