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-240326A: Multiple metadata fields in contract operations #5

Open
dr-orlovsky opened this issue Mar 27, 2024 · 0 comments
Open

RCP-240326A: Multiple metadata fields in contract operations #5

dr-orlovsky opened this issue Mar 27, 2024 · 0 comments
Assignees
Labels
C-pushback Consensus-breaking change
Milestone

Comments

@dr-orlovsky
Copy link
Member

layers: consensus, standard library
consensus: pushback

Metadata are the way operation is provided with accessory data which are not kept as a part of the queryable contract state (do not blow it up), but are used in validation. A typical example is some witness (there is another operation-specific witness, and unlike it the metadata must be of the same type for all operations of certain class in the contract).

Right now, each operation has a single metadata, which has a form of serialized strict value. The operation schema commits to the data type. The idea was that if an operation needs complex metadata, it just constructs a corresponding data type, and there is no need in multiple metadata fields.

However, with interface inheritance the situation becomes more complex: each interface may require its own form of metadata, and if two or more interfaces in inheritance hierarchy needs their metadata, this interfaces can't be composed. This is a signification restriction, which can be removed by converting metadata field into a list which may contain maximum 255 values (since we have restriction on the number of composed interfaces, which can't exceed 255).

@dr-orlovsky dr-orlovsky added the C-pushback Consensus-breaking change label Mar 27, 2024
@dr-orlovsky dr-orlovsky added this to the v0.11 milestone Mar 27, 2024
@dr-orlovsky dr-orlovsky changed the title RCP-20240326A: Multiple metadata fields in contract operations RCP-240326A: Multiple metadata fields in contract operations Mar 27, 2024
@dr-orlovsky dr-orlovsky self-assigned this Apr 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-pushback Consensus-breaking change
Projects
Status: Done
Development

No branches or pull requests

1 participant