-
Notifications
You must be signed in to change notification settings - Fork 11.3k
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
Support immutable objects #140
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
Addressed the comments with the following changes:
Also some notes on formally supporting Move events. It seems really difficult to do given what we have right now.
where |
For user-defined events, I think we must define This is unfortunate, but since transfers are the only "system" event type, I think having a separate native function for it is ok. |
* Add simple grpc server to primary & add test to hit embedded grpc server in primary * Checkpointing gRPC Server + get_collections endpoint * Switch from build.rs to bootstrap method * Completed get_collections endpoint * Cleanup for review * small typo * fix license headers * update generated narwhal.rs * Refactoring/Changes based on review comments * Only spawn grpc server if external consensus is used & fix broken tests * fix benchmark_client: missed field name update * Add port picker for benchmarking and address other review comments * Fix small typo * rename proto bytes fields with more descriptive names
* Add simple grpc server to primary & add test to hit embedded grpc server in primary * Checkpointing gRPC Server + get_collections endpoint * Switch from build.rs to bootstrap method * Completed get_collections endpoint * Cleanup for review * small typo * fix license headers * update generated narwhal.rs * Refactoring/Changes based on review comments * Only spawn grpc server if external consensus is used & fix broken tests * fix benchmark_client: missed field name update * Add port picker for benchmarking and address other review comments * Fix small typo * rename proto bytes fields with more descriptive names
This PR introduces immutable objects for #96.
It does so by:
read_only
field is added to Object. Module objects will set it to true. Move objects will set it to false by default, but can be set to true throughto_immutable()
.to_immutable()
andtransfer_and_to_immutable()
. Note that we cannot name itfeeze()
as it is restricted keyword in Move. Sinceto_immutable()
consumes the entire object, we need to provide a way for developers to set a newly created object to immutable too. To do so, we must providetransfer_and_to_immutable()
so that the object is set to immutable and transfer to someone at the same time.to_immutable()
has the recipient field as empty, whiletransfer_and_to_immutable()
has the valid recipient field.seq_num
field in the event.seq_num
.