-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into arhag/common-mapping-height-timestamp
- Loading branch information
Showing
15 changed files
with
224 additions
and
147 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,47 @@ | ||
#pragma once | ||
|
||
#include <evmc/instructions.h> | ||
namespace evm_runtime { | ||
|
||
struct print_tracer : EvmTracer { | ||
|
||
void on_execution_start(evmc_revision rev, const evmc_message& msg, evmone::bytes_view code) override { | ||
const char* const* opcode_names_ = nullptr; | ||
|
||
void on_execution_start(evmc_revision rev, const evmc_message& msg, evmone::bytes_view code) noexcept override { | ||
eosio::print("TRACE: start\n"); | ||
}; | ||
if (opcode_names_ == nullptr) { | ||
opcode_names_ = evmc_get_instruction_names_table(rev); | ||
} | ||
} | ||
|
||
void on_instruction_start(uint32_t pc, const evmone::ExecutionState& state, | ||
const IntraBlockState& intra_block_state) override { | ||
eosio::print("TRACE[inst] ", uint64_t(pc), ": ", uint64_t(state.gas_left), "\n"); | ||
std::string get_opcode_name(const char* const* names, std::uint8_t opcode) { | ||
const auto name = names[opcode]; | ||
return (name != nullptr) ?name : "opcode 0x" + evmc::hex(opcode) + " not defined"; | ||
} | ||
|
||
}; | ||
void on_instruction_start(uint32_t pc, const intx::uint256* stack_top, int stack_height, | ||
const evmone::ExecutionState& state, | ||
const IntraBlockState& intra_block_state) noexcept override { | ||
const auto opcode = state.code[pc]; | ||
auto opcode_name = get_opcode_name(opcode_names_, opcode); | ||
eosio::print(opcode_name.c_str(), "\n"); | ||
} | ||
|
||
void on_execution_end(const evmc_result& result, const IntraBlockState& intra_block_state) override { | ||
void on_execution_end(const evmc_result& result, const IntraBlockState& intra_block_state) noexcept override { | ||
eosio::print("TRACE: end\n"); | ||
} | ||
|
||
}; | ||
void on_creation_completed(const evmc_result& result, const IntraBlockState& intra_block_state) noexcept override { | ||
|
||
} | ||
|
||
void on_precompiled_run(const evmc_result& result, int64_t gas, | ||
const IntraBlockState& intra_block_state) noexcept override { | ||
|
||
} | ||
|
||
void on_reward_granted(const CallResult& result, const IntraBlockState& intra_block_state) noexcept override { | ||
|
||
} | ||
|
||
}; | ||
} //namespace evm_runtime |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.