Skip to content

Commit a224d31

Browse files
authored
Merge pull request #294 from mocachain/fix/e2e-min-gas-price-post-v2
fix(e2e): pay the v2 20 gwei min_gas_price floor across cosmos + EVM upgrade txs
2 parents 2ec0f6c + 0a56b19 commit a224d31

8 files changed

Lines changed: 27 additions & 19 deletions

File tree

e2e/kind/framework/framework.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ fw_run_test() {
246246

247247
fw_tx_send() {
248248
local from="$1" to="$2" amount="$3"
249-
local fees="${4:-200000000000000amoca}"
249+
local fees="${4:-5000000000000000amoca}"
250250

251251
local out hash
252252
# Direct kubectl exec so mocad's stderr (errors) reaches our 2>&1.

e2e/kind/scripts/upgrade-chain.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ log_info " Image: ${NEW_DOCKER_IMAGE}"
3030

3131
# ── Governance mode ──────────────────────────────────────────────────────────
3232
_upgrade_governance() {
33-
local fees="200000000000000amoca"
33+
local fees="5000000000000000amoca"
3434

3535
log_info "Submitting software-upgrade proposal..."
3636

e2e/kind/tests/modules/mod_evm.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,13 +102,13 @@ evm_erc20_tx() {
102102
1)
103103
log_info " [evm] erc20 transfer 100 Alice -> Bob"
104104
cast send "$_EVM_ERC20_ADDR" "transfer(address,uint256)" "$_EVM_BOB_ADDR" "100000000000000000000" \
105-
--private-key "$_EVM_ALICE_KEY" --rpc-url "$EVM_RPC" --chain-id "$EVM_CHAIN_ID" > /dev/null 2>&1 || true
105+
--private-key "$_EVM_ALICE_KEY" --rpc-url "$EVM_RPC" --chain-id "$EVM_CHAIN_ID" --gas-price 30000000000 > /dev/null 2>&1 || true
106106
sleep 2
107107
;;
108108
2)
109109
log_info " [evm] erc20 transferFrom 50 Alice -> deployer (via Bob)"
110110
cast send "$_EVM_ERC20_ADDR" "transferFrom(address,address,uint256)" "$_EVM_ALICE_ADDR" "$val0_addr" "50000000000000000000" \
111-
--private-key "$_EVM_BOB_KEY" --rpc-url "$EVM_RPC" --chain-id "$EVM_CHAIN_ID" > /dev/null 2>&1 || true
111+
--private-key "$_EVM_BOB_KEY" --rpc-url "$EVM_RPC" --chain-id "$EVM_CHAIN_ID" --gas-price 30000000000 > /dev/null 2>&1 || true
112112
sleep 2
113113
;;
114114
3)
@@ -154,7 +154,7 @@ _evm_verify_fresh_transfer() {
154154
local recv_addr; recv_addr=$(cast wallet address "$recv_key" 2>/dev/null)
155155
cast send "$recv_addr" --value 0.1ether \
156156
--private-key "$VAL0_PRIVKEY" --rpc-url "$EVM_RPC" \
157-
--chain-id "$EVM_CHAIN_ID" > /dev/null 2>&1
157+
--chain-id "$EVM_CHAIN_ID" --gas-price 30000000000 > /dev/null 2>&1
158158
sleep 3
159159
local bal; bal=$(cast balance "$recv_addr" --rpc-url "$EVM_RPC" 2>/dev/null || echo "0")
160160
assert_eq "$bal" "100000000000000000" "Fresh EVM transfer works post-upgrade"

e2e/kind/tests/modules/mod_gov.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ _GOV_PROP_IDX=0
1111
_gov_submit_proposal() {
1212
local proposal_json="$1"
1313
local tmpfile="$2"
14-
local fees="200000000000000amoca"
14+
local fees="5000000000000000amoca"
1515

1616
# Count proposals before submission
1717
local before_count

e2e/kind/tests/test_upgrade_comprehensive.sh

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,15 @@ cosmos_tx() {
6868
--home /root/.mocad \
6969
--keyring-backend test --chain-id "${CHAIN_ID}" \
7070
--node tcp://localhost:26657 \
71-
--gas auto --gas-adjustment 1.3 --fees 2000000000000000amoca \
71+
--gas 1000000 --fees 30000000000000000amoca \
7272
--broadcast-mode sync -y --output json) || {
7373
log_error " cosmos_tx broadcast failed: $out"
7474
return 1
7575
}
76+
if [ "$(echo "$out" | jq -r '.code // 0')" != "0" ]; then
77+
log_error " cosmos_tx CheckTx rejected: $out"
78+
return 1
79+
fi
7680
hash=$(echo "$out" | jq -r '.txhash // empty' 2>/dev/null)
7781
if [ -z "$hash" ]; then
7882
log_error " cosmos_tx returned no txhash: $out"
@@ -89,11 +93,15 @@ cosmos_tx_on() {
8993
--home /root/.mocad \
9094
--keyring-backend test --chain-id "${CHAIN_ID}" \
9195
--node tcp://localhost:26657 \
92-
--gas auto --gas-adjustment 1.3 --fees 2000000000000000amoca \
96+
--gas 1000000 --fees 30000000000000000amoca \
9397
--broadcast-mode sync -y --output json) || {
9498
log_error " cosmos_tx_on broadcast failed: $out"
9599
return 1
96100
}
101+
if [ "$(echo "$out" | jq -r '.code // 0')" != "0" ]; then
102+
log_error " cosmos_tx_on CheckTx rejected: $out"
103+
return 1
104+
fi
97105
hash=$(echo "$out" | jq -r '.txhash // empty' 2>/dev/null)
98106
if [ -z "$hash" ]; then
99107
log_error " cosmos_tx_on returned no txhash: $out"
@@ -109,25 +117,25 @@ evm_transfer() {
109117
local out hash
110118
out=$(cast send "$1" --value "$2" \
111119
--private-key "$VAL0_PRIVKEY" --rpc-url "$EVM_RPC" \
112-
--chain-id "$EVM_CHAIN_ID" --json 2>&1) || {
120+
--chain-id "$EVM_CHAIN_ID" --gas-price 30000000000 --json 2>&1) || {
113121
log_error " evm_transfer broadcast failed: $out"
114122
return 1
115123
}
116124
hash=$(echo "$out" | jq -r '.transactionHash // empty' 2>/dev/null)
117125
[ -z "$hash" ] && { log_error " evm_transfer returned no hash: $out"; return 1; }
118-
fw_wait_evm_tx "$hash" 10 "$EVM_RPC"
126+
fw_wait_evm_tx "$hash" 30 "$EVM_RPC" || { log_error " evm_transfer wait timeout: $hash ($out)"; return 1; }
119127
}
120128

121129
evm_send() {
122130
local out hash
123131
out=$(cast send "$@" --private-key "$VAL0_PRIVKEY" --rpc-url "$EVM_RPC" \
124-
--chain-id "$EVM_CHAIN_ID" --json 2>&1) || {
132+
--chain-id "$EVM_CHAIN_ID" --gas-price 30000000000 --json 2>&1) || {
125133
log_error " evm_send broadcast failed: $out"
126134
return 1
127135
}
128136
hash=$(echo "$out" | jq -r '.transactionHash // empty' 2>/dev/null)
129137
[ -z "$hash" ] && { log_error " evm_send returned no hash: $out"; return 1; }
130-
fw_wait_evm_tx "$hash" 10 "$EVM_RPC"
138+
fw_wait_evm_tx "$hash" 30 "$EVM_RPC" || { log_error " evm_send wait timeout: $hash ($out)"; return 1; }
131139
}
132140

133141
evm_call() {
@@ -138,15 +146,15 @@ evm_deploy() {
138146
local bytecode="$1"
139147
local output hash
140148
output=$(cast send --private-key "$VAL0_PRIVKEY" --rpc-url "$EVM_RPC" \
141-
--chain-id "$EVM_CHAIN_ID" --json --create "$bytecode" 2>&1) || {
149+
--chain-id "$EVM_CHAIN_ID" --gas-price 30000000000 --json --create "$bytecode" 2>&1) || {
142150
log_error " evm_deploy broadcast failed: $output"
143151
return 1
144152
}
145153
hash=$(echo "$output" | jq -r '.transactionHash // empty' 2>/dev/null)
146154
[ -z "$hash" ] && { log_error " evm_deploy returned no hash: $output"; return 1; }
147-
fw_wait_evm_tx "$hash" 10 "$EVM_RPC" || return 1
148-
cast receipt "$hash" --rpc-url "$EVM_RPC" --json 2>/dev/null \
149-
| jq -r '.contractAddress // empty' 2>/dev/null
155+
fw_wait_evm_tx "$hash" 30 "$EVM_RPC" || { log_error " evm_deploy wait timeout: $hash ($output)"; return 1; }
156+
local rcpt; rcpt=$(cast receipt "$hash" --rpc-url "$EVM_RPC" --json 2>&1) || { log_error " evm_deploy receipt failed: $rcpt"; return 1; }
157+
echo "$rcpt" | jq -r '.contractAddress // empty' 2>/dev/null
150158
}
151159

152160
# Shuffle an array (Fisher-Yates). Usage: shuffle_array array_name

e2e/kind/tests/test_upgrade_governance.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ fw_init
1515

1616
OLD_VERSION="${OLD_VERSION:-v1.3.0}"
1717
UPGRADE_NAME="${UPGRADE_NAME:-v2.0.0}"
18-
FEES="200000000000000amoca"
18+
FEES="5000000000000000amoca"
1919

2020
# ── Setup: deploy old version ────────────────────────────────────────────────
2121
fw_start_chain_from_version "$OLD_VERSION"

e2e/kind/tests/test_upgrade_hardfork.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ fw_init
1212

1313
OLD_VERSION="${OLD_VERSION:-v1.3.0}"
1414
UPGRADE_NAME="${UPGRADE_NAME:-v2.0.0}"
15-
FEES="200000000000000amoca"
15+
FEES="5000000000000000amoca"
1616

1717
# ── Setup: deploy old version ────────────────────────────────────────────────
1818
fw_start_chain_from_version "$OLD_VERSION"

e2e/local/transfer_test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ echo "初始余额: ${INITIAL_BALANCE}amoca"
6666
# 执行转账
6767
echo "执行转账..."
6868
TRANSFER_AMOUNT="2000000000000000000000amoca"
69-
FEES="200000000000000amoca"
69+
FEES="5000000000000000amoca"
7070

7171
TX_RESULT=$(./build/mocad tx bank send validator0 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 "$TRANSFER_AMOUNT" \
7272
--keyring-backend test \

0 commit comments

Comments
 (0)