Skip to content

Instantly share code, notes, and snippets.

View gumb0's full-sized avatar
🥑

Andrei Maiboroda gumb0

🥑
View GitHub Profile
@gumb0
gumb0 / fizzy_metering.cpp
Last active October 23, 2020 14:36
Injecting metering in Fizzy's parser
// ControlFrame new members:
struct ControlFrame
{
// ...
int gas;
size_t metering_immediate_offset;
};
void insert_metering_statement()
{
{
"context": {
"date": "2020-07-10 15:14:47",
"host_name": "andrei-laptop",
"executable": "fizzy/build/bin/fizzy-bench",
"num_cpus": 8,
"mhz_per_cpu": 4900,
"cpu_scaling_enabled": false,
"caches": [
{
struct InstructionType
{
std::initializer_list<ValType> inputs;
std::initializer_list<ValType> outputs;
};
constexpr InstructionType instruction_type_table[256] = {
// Polymorphic instructions.
/* drop = 0x1a */ {},
Running tests from ../../wasm-spec/test/core/json/address/address.json
Line 3: module Instantiating address.0.wasm PASSED
Line 104: assert_return PASSED
Line 105: assert_return PASSED
Line 106: assert_return PASSED
Line 107: assert_return PASSED
Line 108: assert_return PASSED
Line 110: assert_return PASSED
Line 111: assert_return PASSED
Line 112: assert_return PASSED
{"source_filename": "names.wast",
"commands": [
{"type": "module", "line": 4, "filename": "names.0.wasm"},
{"type": "assert_return", "line": 8, "action": {"type": "invoke", "field": "foo", "args": []}, "expected": [{"type": "i32", "value": "0"}]},
{"type": "module", "line": 12, "filename": "names.1.wasm"},
{"type": "assert_return", "line": 16, "action": {"type": "invoke", "field": "foo", "args": []}, "expected": [{"type": "i32", "value": "1"}]},
{"type": "module", "line": 19, "filename": "names.2.wasm"},
{"type": "assert_return", "line": 615, "action": {"type": "invoke", "field": "", "args": []}, "expected": [{"type": "i32", "value": "0"}]},
{"type": "assert_return", "line": 616, "action": {"type": "invoke", "field": "0", "args": []}, "expected": [{"type": "i32", "value": "1"}]},
{"type": "assert_return", "line": 617, "action": {"type": "invoke", "field": "-0", "args": []}, "expected": [{"type": "i32", "value": "2"}]},
{"source_filename": "i32.wast",
"commands": [
{"type": "module", "line": 3, "filename": "i32.0.wasm"},
{"type": "assert_return", "line": 35, "action": {"type": "invoke", "field": "add", "args": [{"type": "i32", "value": "1"}, {"type": "i32", "value": "1"}]}, "expected": [{"type": "i32", "value": "2"}]},
{"type": "assert_return", "line": 36, "action": {"type": "invoke", "field": "add", "args": [{"type": "i32", "value": "1"}, {"type": "i32", "value": "0"}]}, "expected": [{"type": "i32", "value": "1"}]},
{"type": "assert_return", "line": 37, "action": {"type": "invoke", "field": "add", "args": [{"type": "i32", "value": "4294967295"}, {"type": "i32", "value": "4294967295"}]}, "expected": [{"type": "i32", "value": "4294967294"}]},
{"type": "assert_return", "line": 38, "action": {"type": "invoke", "field": "add", "args": [{"type": "i32", "value": "4294967295"}, {"type": "i32", "value": "1"}]}, "expected": [{"type": "i32", "value": "0"}]},
{"type": "assert_return", "line": 39, "action": {"type": "i
TRACE 11-12 11:16:13 aleth rpc {"jsonrpc":"2.0","method":"test_setChainParams","params":[{
"params" : {
"homesteadForkBlock" : "0x00",
"EIP150ForkBlock" : "0x00",
"EIP158ForkBlock" : "0x00",
"byzantiumForkBlock" : "0x00",
"constantinopleForkBlock" : "0x00",
"constantinopleFixForkBlock" : "0x00",
"istanbulForkBlock" : "0x00"
},
{
"params" : {
"homesteadForkBlock" : "0x00",
"EIP150ForkBlock" : "0x00",
"EIP158ForkBlock" : "0x00",
"byzantiumForkBlock" : "0x00",
"constantinopleForkBlock" : "0x00",
"constantinopleFixForkBlock" : "0x00",
"istanbulForkBlock" : "0x00"
},
{
"sealEngine": "Ethash",
"params": {
"accountStartNonce": "0x00",
"maximumExtraDataSize": "0x20",
"homesteadForkBlock": "0x2710",
"daoHardforkBlock": "0x00",
"EIP150ForkBlock": "0x3a98",
"EIP158ForkBlock": "0x59d8",
"byzantiumForkBlock": "0x7530",
{
"sealEngine": "Ethash",
"params": {
"accountStartNonce": "0x00",
"maximumExtraDataSize": "0x20",
"homesteadForkBlock": "0x01",
"daoHardforkBlock": "0x00",
"EIP150ForkBlock": "0x02",
"EIP158ForkBlock": "0x03",
"byzantiumForkBlock": "0x04",