Skip to content

Commit

Permalink
Merge pull request #2449 from Taraxa-project/remove-old-code
Browse files Browse the repository at this point in the history
Remove old code
  • Loading branch information
MatusKysel authored Apr 17, 2023
2 parents 645d7e4 + f180a71 commit b58eb48
Show file tree
Hide file tree
Showing 10 changed files with 30 additions and 204 deletions.
34 changes: 0 additions & 34 deletions CMakeModules/EthDependencies.cmake

This file was deleted.

61 changes: 0 additions & 61 deletions CMakeModules/EthExecutableHelper.cmake

This file was deleted.

82 changes: 0 additions & 82 deletions CMakeModules/EthUtils.cmake

This file was deleted.

25 changes: 25 additions & 0 deletions CMakeModules/jsonrpcstubHelper.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# custom cmake scripts
set(ETH_CMAKE_DIR ${CMAKE_CURRENT_LIST_DIR})
set(ETH_SCRIPTS_DIR ${ETH_CMAKE_DIR}/scripts)

macro(jsonrpcstub_create EXECUTABLE SPEC SERVERNAME SERVERDIR SERVERFILENAME CLIENTNAME CLIENTDIR CLIENTFILENAME)
if (ETH_JSON_RPC_STUB)
add_custom_target(${SPEC}stub)
add_custom_command(
TARGET ${SPEC}stub
POST_BUILD
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/${SPEC}"
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMAND ${CMAKE_COMMAND} -DETH_SPEC_PATH="${CMAKE_CURRENT_SOURCE_DIR}/${SPEC}" -DETH_SOURCE_DIR="${CMAKE_SOURCE_DIR}" -DETH_CMAKE_DIR="${ETH_CMAKE_DIR}"
-DETH_CLIENT_DIR="${CLIENTDIR}"
-DETH_CLIENT_NAME=${CLIENTNAME}
-DETH_CLIENT_FILENAME=${CLIENTFILENAME}
-DETH_SERVER_DIR="${SERVERDIR}"
-DETH_SERVER_NAME=${SERVERNAME}
-DETH_SERVER_FILENAME=${SERVERFILENAME}
-DETH_JSON_RPC_STUB="${ETH_JSON_RPC_STUB}"
-P "${ETH_SCRIPTS_DIR}/jsonrpcstub.cmake"
)
add_dependencies(${EXECUTABLE} ${SPEC}stub)
endif ()
endmacro()
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ class StateAPI {

void update_state_config(const Config& new_config);

Proof prove(EthBlockNumber blk_num, const root_t& state_root, const addr_t& addr,
const std::vector<h256>& keys) const;
std::optional<Account> get_account(EthBlockNumber blk_num, const addr_t& addr) const;
u256 get_account_storage(EthBlockNumber blk_num, const addr_t& addr, const u256& key) const;
bytes get_code_by_address(EthBlockNumber blk_num, const addr_t& addr) const;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,20 +92,6 @@ struct Account {
h256 const& storage_root_eth() const;
} const ZeroAccount;

struct TrieProof {
bytes value;
std::vector<bytes> nodes;

HAS_RLP_FIELDS
};

struct Proof {
TrieProof account_proof;
std::vector<TrieProof> storage_proofs;

HAS_RLP_FIELDS
};

struct StateDescriptor {
EthBlockNumber blk_num = 0;
h256 state_root;
Expand Down
7 changes: 4 additions & 3 deletions libraries/core_libs/consensus/src/final_chain/final_chain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -274,9 +274,10 @@ class FinalChainImpl final : public FinalChain {
db_->compactColumn(DB::Columns::final_chain_blk_hash_by_number);
db_->compactColumn(DB::Columns::final_chain_blk_number_by_hash);

boost::asio::post(prune_thread_, [this, last_block_to_keep, state_root_to_prune]() {
state_api_.prune(last_block_to_keep->state_root, state_root_to_prune, last_block_to_keep->number);
});
boost::asio::post(
prune_thread_,
[this, to_keep = std::move(last_block_to_keep->state_root), to_prune = std::move(state_root_to_prune),
number = last_block_to_keep->number]() { state_api_.prune(to_keep, to_prune, number); });
}
}

Expand Down
5 changes: 0 additions & 5 deletions libraries/core_libs/consensus/src/final_chain/state_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,6 @@ void StateAPI::update_state_config(const Config& new_config) {
err_h.check();
}

Proof StateAPI::prove(EthBlockNumber blk_num, const root_t& state_root, const addr_t& addr,
const std::vector<h256>& keys) const {
return c_method_args_rlp<Proof, from_rlp, taraxa_evm_state_api_prove>(this_c_, blk_num, state_root, addr, keys);
}

std::optional<Account> StateAPI::get_account(EthBlockNumber blk_num, const addr_t& addr) const {
return c_method_args_rlp<std::optional<Account>, from_rlp, taraxa_evm_state_api_get_account>(this_c_, blk_num, addr);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ RLP_FIELDS_DEFINE(LogRecord, address, topics, data)
RLP_FIELDS_DEFINE(ExecutionResult, code_retval, new_contract_addr, logs, gas_used, code_err, consensus_err)
RLP_FIELDS_DEFINE(StateTransitionResult, execution_results, state_root, total_reward)
RLP_FIELDS_DEFINE(Account, nonce, balance, storage_root_hash, code_hash, code_size)
RLP_FIELDS_DEFINE(TrieProof, value, nodes)
RLP_FIELDS_DEFINE(Proof, account_proof, storage_proofs)
RLP_FIELDS_DEFINE(StateDescriptor, blk_num, state_root)
RLP_FIELDS_DEFINE(Tracing, vmTrace, trace, stateDiff)
} // namespace taraxa::state_api
2 changes: 1 addition & 1 deletion submodules/taraxa-evm

0 comments on commit b58eb48

Please sign in to comment.