Skip to content

Commit 7b1e42e

Browse files
authored
feat: rebase 1.5.x to 1.6.x (#1916)
1 parent 1a22353 commit 7b1e42e

File tree

5 files changed

+88
-6
lines changed

5 files changed

+88
-6
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
* [#1898](https://github.com/crypto-org-chain/cronos/pull/1898) Chore: cleanup release by reverting #1892, #1893 and #1850.
1212
* [#1901](https://github.com/crypto-org-chain/cronos/pull/1901) Feat: add mempool.feebump and disable-tx-replacement flags.
13+
* [#1911](https://github.com/crypto-org-chain/cronos/pull/1911) Fix: bug on multiple tx replacements
1314

1415

1516
*Oct 30, 2025*

go.mod

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,11 +280,12 @@ require (
280280
sigs.k8s.io/yaml v1.6.0 // indirect
281281
)
282282

283-
// release/v0.50.x
284283
replace (
284+
// release/v0.50.x
285285
cosmossdk.io/store => github.com/crypto-org-chain/cosmos-sdk/store v0.0.0-20241217090828-cfbca9fe8254
286286
cosmossdk.io/x/tx => github.com/crypto-org-chain/cosmos-sdk/x/tx v0.0.0-20241217090828-cfbca9fe8254
287-
github.com/cosmos/cosmos-sdk => github.com/crypto-org-chain/cosmos-sdk v0.50.6-0.20250424063720-28ea58ae20d8
287+
// release/v0.50-cronosv1.5.x
288+
github.com/cosmos/cosmos-sdk => github.com/crypto-org-chain/cosmos-sdk v0.50.6-0.20251114132341-ca3cb50f8d06
288289
)
289290

290291
replace (

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -906,8 +906,8 @@ github.com/crypto-org-chain/btree v0.0.0-20240406140148-2687063b042c h1:MOgfS4+F
906906
github.com/crypto-org-chain/btree v0.0.0-20240406140148-2687063b042c/go.mod h1:twD9XRA5jj9VUQGELzDO4HPQTNJsoWWfYEL+EUQ2cKY=
907907
github.com/crypto-org-chain/cometbft v0.0.0-20251014161156-b0e778b18408 h1:7dfWkDRYCsguKrpd0t14nrZ3Xf/9aVHiQrWx5o0DCdo=
908908
github.com/crypto-org-chain/cometbft v0.0.0-20251014161156-b0e778b18408/go.mod h1:khbgmtxbgwJfMqDmnGY4rl2sQpTdzpPb1f9nqnfpy1o=
909-
github.com/crypto-org-chain/cosmos-sdk v0.50.6-0.20250424063720-28ea58ae20d8 h1:Sif0pGNc4C384OLucyQ7P/+KjYiJ6uDn8Cf8wR7MI+c=
910-
github.com/crypto-org-chain/cosmos-sdk v0.50.6-0.20250424063720-28ea58ae20d8/go.mod h1:JwwsMeZldLN20b72mmbWPY0EV9rs+v/12hRu1JFttvY=
909+
github.com/crypto-org-chain/cosmos-sdk v0.50.6-0.20251114132341-ca3cb50f8d06 h1:CCdSKOQnMUGKq77C+LZH1klNi7McshyNKtZWYxF6kGY=
910+
github.com/crypto-org-chain/cosmos-sdk v0.50.6-0.20251114132341-ca3cb50f8d06/go.mod h1:JwwsMeZldLN20b72mmbWPY0EV9rs+v/12hRu1JFttvY=
911911
github.com/crypto-org-chain/cosmos-sdk/store v0.0.0-20241217090828-cfbca9fe8254 h1:NEgy0r3otU/O+0OAjMdEhbn4VotQlg+98hHbD7M23wU=
912912
github.com/crypto-org-chain/cosmos-sdk/store v0.0.0-20241217090828-cfbca9fe8254/go.mod h1:8DwVTz83/2PSI366FERGbWSH7hL6sB7HbYp8bqksNwM=
913913
github.com/crypto-org-chain/cosmos-sdk/x/tx v0.0.0-20241217090828-cfbca9fe8254 h1:JzLOFRiKsDtLJt5h0M0jkEIPDKvFFyja7VEp7gG6O9U=

gomod2nix.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,8 @@ schema = 3
216216
version = "v1.0.0-beta.5"
217217
hash = "sha256-Fy/PbsOsd6iq0Njy3DVWK6HqWsogI+MkE8QslHGWyVg="
218218
[mod."github.com/cosmos/cosmos-sdk"]
219-
version = "v0.50.6-0.20250424063720-28ea58ae20d8"
220-
hash = "sha256-UCynFh2IangiNqQsgux4dKCk8wuF1vgoINQGA8N59QY="
219+
version = "v0.50.6-0.20251114132341-ca3cb50f8d06"
220+
hash = "sha256-hc5YBZlIL6EQHrXA2IaII10BHYAMpwAG0OEaH7oAzbI="
221221
replaced = "github.com/crypto-org-chain/cosmos-sdk"
222222
[mod."github.com/cosmos/go-bip39"]
223223
version = "v1.0.0"

integration_tests/test_mempool.py

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,3 +226,83 @@ def test_tx_replacement(cronos_mempool):
226226
},
227227
)
228228
assert "has already been mined" in str(exc)
229+
230+
231+
@pytest.mark.flaky(max_runs=3)
232+
def test_multiple_tx_replacement(cronos_mempool):
233+
w3 = cronos_mempool.w3
234+
cli = cronos_mempool.cosmos_cli()
235+
base_fee = w3.eth.get_block("latest")["baseFeePerGas"]
236+
priority_fee = w3.eth.max_priority_fee
237+
user1_nonce = get_account_nonce(w3, key=KEYS["validator"])
238+
user2_nonce = get_account_nonce(w3, key=KEYS["validator2"])
239+
user3_nonce = get_account_nonce(w3, key=KEYS["validator3"])
240+
initial_balance = w3.eth.get_balance(ADDRS["community"])
241+
242+
tx1 = {
243+
"to": ADDRS["community"],
244+
"value": 1,
245+
"maxFeePerGas": base_fee + priority_fee,
246+
"maxPriorityFeePerGas": priority_fee,
247+
"nonce": user1_nonce,
248+
"from": ADDRS["validator"],
249+
}
250+
tx1_signed = sign_transaction(w3, tx1, key=KEYS["validator"])
251+
tx1_replaced = {
252+
"to": ADDRS["community"],
253+
"value": 2,
254+
"maxFeePerGas": int((base_fee + priority_fee) * 1.15),
255+
"maxPriorityFeePerGas": int(priority_fee * 1.15),
256+
"nonce": user1_nonce,
257+
"from": ADDRS["validator"],
258+
}
259+
tx1_replaced_signed = sign_transaction(w3, tx1_replaced, key=KEYS["validator"])
260+
tx1_replaced_again = {
261+
"to": ADDRS["community"],
262+
"value": 3,
263+
"maxFeePerGas": int((base_fee + priority_fee) * 2),
264+
"maxPriorityFeePerGas": int(priority_fee * 2),
265+
"nonce": user1_nonce,
266+
"from": ADDRS["validator"],
267+
}
268+
tx1_replaced_again_signed = sign_transaction(
269+
w3, tx1_replaced_again, key=KEYS["validator"]
270+
)
271+
272+
tx2 = {
273+
"to": ADDRS["community"],
274+
"value": 10,
275+
"maxFeePerGas": base_fee + priority_fee,
276+
"maxPriorityFeePerGas": priority_fee,
277+
"nonce": user2_nonce,
278+
"from": ADDRS["validator2"],
279+
}
280+
tx2_signed = sign_transaction(w3, tx2, key=KEYS["validator2"])
281+
tx2_replaced = {
282+
"to": ADDRS["community"],
283+
"value": 11,
284+
"maxFeePerGas": int((base_fee + priority_fee) * 2),
285+
"maxPriorityFeePerGas": int(priority_fee * 2),
286+
"nonce": user2_nonce,
287+
"from": ADDRS["validator2"],
288+
}
289+
tx2_replaced_signed = sign_transaction(w3, tx2_replaced, key=KEYS["validator2"])
290+
291+
tx3 = {
292+
"to": ADDRS["community"],
293+
"value": 20,
294+
"maxFeePerGas": base_fee + priority_fee,
295+
"maxPriorityFeePerGas": priority_fee,
296+
"nonce": user3_nonce,
297+
"from": ADDRS["validator3"],
298+
}
299+
tx3_signed = sign_transaction(w3, tx3, key=KEYS["validator3"])
300+
301+
w3.eth.send_raw_transaction(tx1_signed.raw_transaction)
302+
w3.eth.send_raw_transaction(tx1_replaced_signed.raw_transaction)
303+
w3.eth.send_raw_transaction(tx1_replaced_again_signed.raw_transaction)
304+
w3.eth.send_raw_transaction(tx2_signed.raw_transaction)
305+
w3.eth.send_raw_transaction(tx2_replaced_signed.raw_transaction)
306+
w3.eth.send_raw_transaction(tx3_signed.raw_transaction)
307+
wait_for_new_blocks(cli, 1)
308+
assert w3.eth.get_balance(ADDRS["community"]) == initial_balance + 34

0 commit comments

Comments
 (0)