Skip to content

Commit

Permalink
Merge pull request #220 from eosnetworkfoundation/elmato/block-extra-…
Browse files Browse the repository at this point in the history
…data

[1.0] Use updated silkworm with the new block-extra-data storage
  • Loading branch information
elmato authored May 24, 2024
2 parents 9c890f6 + 4020a49 commit bef8d8d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
9 changes: 6 additions & 3 deletions src/block_conversion_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,10 @@ class block_conversion_plugin_impl : std::enable_shared_from_this<block_conversi
new_block.header.parent_hash = last_evm_block.header.hash();
new_block.header.transactions_root = silkworm::kEmptyRoot;
// Note: can be null
new_block.consensus_parameter_index = last_evm_block.consensus_parameter_index;
auto cpi = last_evm_block.get_consensus_parameter_index();
if(cpi.has_value()) {
new_block.set_consensus_parameter_index(cpi);
}
return new_block;
}

Expand Down Expand Up @@ -293,9 +296,9 @@ class block_conversion_plugin_impl : std::enable_shared_from_this<block_conversi
.gas_sset = std::visit([](auto&& arg) -> auto& { return arg.gas_parameter.gas_sset; }, new_config),
}
};
curr.consensus_parameter_index = consensus_param.hash();
curr.set_consensus_parameter_index(consensus_param.hash());

silkworm::db::update_consensus_parameters(appbase::app().get_plugin<blockchain_plugin>().get_tx(), *curr.consensus_parameter_index, consensus_param);
silkworm::db::update_consensus_parameters(appbase::app().get_plugin<blockchain_plugin>().get_tx(), *curr.get_consensus_parameter_index(), consensus_param);
}

for_each_action(*new_block, [this, &curr, &block_version](const auto& act){
Expand Down
2 changes: 1 addition & 1 deletion tests/nodeos_eos_evm_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@
cmd="set account permission eosio.evm active --add-code -p eosio.evm@active"
prodNode.processCleosCmd(cmd, cmd, silentErrors=True, returnType=ReturnType.raw)

trans = prodNode.pushMessage(evmAcc.name, "init", '{"chainid":15555, "fee_params": {"gas_price": "150000000000", "miner_cut": 10000, "ingress_bridge_fee": null}}', '-p eosio.evm')
trans = prodNode.pushMessage(evmAcc.name, "init", '{"chainid":15555, "fee_params": {"gas_price": "150000000000", "miner_cut": 10000, "ingress_bridge_fee": "0.0001 EOS"}}', '-p eosio.evm')

prodNode.waitForTransBlockIfNeeded(trans[1], True)

Expand Down

0 comments on commit bef8d8d

Please sign in to comment.