-
Notifications
You must be signed in to change notification settings - Fork 241
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Problem: rpc fails when basefee overflow int64
- add integration test to reproduce
- Loading branch information
Showing
3 changed files
with
57 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
local config = import 'default.jsonnet'; | ||
|
||
config { | ||
'cronos_777-1'+: { | ||
genesis+: { | ||
app_state+: { | ||
feemarket+: { | ||
params+: { | ||
base_fee_change_denominator: '3', | ||
elasticity_multiplier: '4', | ||
// 100 cro | ||
base_fee: '100000000000000000000', | ||
// 1 cro | ||
min_gas_price: '1000000000000000000', | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
} |
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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
from pathlib import Path | ||
|
||
import pytest | ||
|
||
from .utils import ADDRS, KEYS, send_transaction, setup_custom_cronos, w3_wait_for_block | ||
|
||
|
||
@pytest.fixture(scope="module") | ||
def cronos(tmp_path_factory): | ||
path = tmp_path_factory.mktemp("cronos-mempool") | ||
yield from setup_custom_cronos( | ||
path, 26300, Path(__file__).parent / "configs/big_basefee.jsonnet" | ||
) | ||
|
||
|
||
def test_basefee_overflow(cronos): | ||
""" | ||
test if any json-rpc breaks when base fee overflows int64 | ||
""" | ||
w3 = cronos.w3 | ||
w3_wait_for_block(w3, 1) | ||
print(w3.eth.gas_price) | ||
tx = { | ||
"from": ADDRS["validator"], | ||
"to": ADDRS["community"], | ||
"value": 1, | ||
"gasPrice": w3.eth.gas_price, | ||
} | ||
tx["gas"] = w3.eth.estimate_gas(tx) | ||
receipt = send_transaction( | ||
w3, | ||
tx, | ||
KEYS["community"], | ||
) | ||
assert receipt.status == 1 | ||
print("receipt", receipt) |