Skip to content

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

@dr-orlovsky

Description

@dr-orlovsky
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).

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions