From f3f89a1f66ce9e4ea606173101f1946849b32d88 Mon Sep 17 00:00:00 2001 From: Todd Fleming Date: Wed, 19 Jan 2022 11:17:56 -0500 Subject: [PATCH] ship support for wasm_config --- libraries/state_history/abi.cpp | 19 +++++++++++++++++- .../eosio/state_history/serialization.hpp | 20 ++++++++++++++++++- 2 files changed, 37 insertions(+), 2 deletions(-) diff --git a/libraries/state_history/abi.cpp b/libraries/state_history/abi.cpp index ae8ad2e6c1..d778d0c7fc 100644 --- a/libraries/state_history/abi.cpp +++ b/libraries/state_history/abi.cpp @@ -389,6 +389,21 @@ extern const char* const state_history_plugin_abi = R"({ { "type": "uint32", "name": "max_action_return_value_size" } ] }, + { + "name": "wasm_config_v0", "fields": [ + { "type": "uint32", "name": "max_mutable_global_bytes" }, + { "type": "uint32", "name": "max_table_elements" }, + { "type": "uint32", "name": "max_section_elements" }, + { "type": "uint32", "name": "max_linear_memory_init" }, + { "type": "uint32", "name": "max_func_local_bytes" }, + { "type": "uint32", "name": "max_nested_structures" }, + { "type": "uint32", "name": "max_symbol_bytes" }, + { "type": "uint32", "name": "max_module_bytes" }, + { "type": "uint32", "name": "max_code_bytes" }, + { "type": "uint32", "name": "max_pages" }, + { "type": "uint32", "name": "max_call_depth" } + ] + }, { "name": "global_property_v0", "fields": [ { "type": "uint32?", "name": "proposed_schedule_block_num" }, @@ -401,7 +416,8 @@ extern const char* const state_history_plugin_abi = R"({ { "type": "uint32?", "name": "proposed_schedule_block_num" }, { "type": "producer_authority_schedule", "name": "proposed_schedule" }, { "type": "chain_config", "name": "configuration" }, - { "type": "checksum256", "name": "chain_id" } + { "type": "checksum256", "name": "chain_id" }, + { "type": "wasm_config$", "name": "wasm_configuration" } ] }, { @@ -557,6 +573,7 @@ extern const char* const state_history_plugin_abi = R"({ { "name": "contract_index_double", "types": ["contract_index_double_v0"] }, { "name": "contract_index_long_double", "types": ["contract_index_long_double_v0"] }, { "name": "chain_config", "types": ["chain_config_v0", "chain_config_v1"] }, + { "name": "wasm_config", "types": ["wasm_config_v0"] }, { "name": "global_property", "types": ["global_property_v0", "global_property_v1"] }, { "name": "generated_transaction", "types": ["generated_transaction_v0"] }, { "name": "activated_protocol_feature", "types": ["activated_protocol_feature_v0"] }, diff --git a/libraries/state_history/include/eosio/state_history/serialization.hpp b/libraries/state_history/include/eosio/state_history/serialization.hpp index 2c5ca89df4..2026b3a490 100644 --- a/libraries/state_history/include/eosio/state_history/serialization.hpp +++ b/libraries/state_history/include/eosio/state_history/serialization.hpp @@ -313,6 +313,23 @@ datastream& operator<<(datastream& ds, const history_serial_wrapper +datastream& operator<<(datastream& ds, const history_serial_wrapper& obj) { + fc::raw::pack(ds, fc::unsigned_int(0)); + fc::raw::pack(ds, as_type(obj.obj.max_mutable_global_bytes)); + fc::raw::pack(ds, as_type(obj.obj.max_table_elements)); + fc::raw::pack(ds, as_type(obj.obj.max_section_elements)); + fc::raw::pack(ds, as_type(obj.obj.max_linear_memory_init)); + fc::raw::pack(ds, as_type(obj.obj.max_func_local_bytes)); + fc::raw::pack(ds, as_type(obj.obj.max_nested_structures)); + fc::raw::pack(ds, as_type(obj.obj.max_symbol_bytes)); + fc::raw::pack(ds, as_type(obj.obj.max_module_bytes)); + fc::raw::pack(ds, as_type(obj.obj.max_code_bytes)); + fc::raw::pack(ds, as_type(obj.obj.max_pages)); + fc::raw::pack(ds, as_type(obj.obj.max_call_depth)); + return ds; +} + template datastream& operator<<(datastream& ds, const history_serial_wrapper& obj) { @@ -322,7 +339,8 @@ datastream& operator<<(datastream& obj.db, as_type(obj.obj.proposed_schedule))); fc::raw::pack(ds, make_history_serial_wrapper(obj.db, as_type(obj.obj.configuration))); fc::raw::pack(ds, as_type(obj.obj.chain_id)); - + fc::raw::pack(ds, + make_history_serial_wrapper(obj.db, as_type(obj.obj.wasm_configuration))); return ds; }