Skip to content

Commit 675d3a1

Browse files
authored
Merge branch 'main' into import_check_time_locks
2 parents 7843a70 + 9242a5c commit 675d3a1

36 files changed

+692
-509
lines changed

.github/dependabot.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ updates:
88
schedule:
99
interval: "weekly"
1010
day: "tuesday"
11+
cooldown:
12+
default-days: 7
1113
open-pull-requests-limit: 10
1214
rebase-strategy: auto
1315
labels:
@@ -25,6 +27,8 @@ updates:
2527
schedule:
2628
interval: "weekly"
2729
day: "tuesday"
30+
cooldown:
31+
default-days: 7
2832
open-pull-requests-limit: 30
2933
rebase-strategy: auto
3034
labels:
@@ -38,6 +42,8 @@ updates:
3842
schedule:
3943
interval: "weekly"
4044
day: "tuesday"
45+
cooldown:
46+
default-days: 7
4147
open-pull-requests-limit: 10
4248
rebase-strategy: auto
4349
labels:
@@ -51,6 +57,8 @@ updates:
5157
schedule:
5258
interval: "weekly"
5359
day: "tuesday"
60+
cooldown:
61+
default-days: 7
5462
open-pull-requests-limit: 10
5563
rebase-strategy: auto
5664
labels:
@@ -64,6 +72,8 @@ updates:
6472
schedule:
6573
interval: "weekly"
6674
day: "tuesday"
75+
cooldown:
76+
default-days: 7
6777
open-pull-requests-limit: 10
6878
rebase-strategy: auto
6979
labels:
@@ -76,5 +86,7 @@ updates:
7686
schedule:
7787
interval: "weekly"
7888
day: "tuesday"
89+
cooldown:
90+
default-days: 7
7991
open-pull-requests-limit: 10
8092
rebase-strategy: auto

.github/workflows/check-commit-signing.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222

2323
steps:
2424
- name: Checkout Code
25-
uses: actions/checkout@v5
25+
uses: actions/checkout@v6
2626
with:
2727
fetch-depth: 0
2828

.github/workflows/dependency-review.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
runs-on: ubuntu-latest
1818
steps:
1919
- name: "Checkout Repository"
20-
uses: actions/checkout@v5
20+
uses: actions/checkout@v6
2121

2222
- name: "Dependency Review"
2323
uses: actions/dependency-review-action@v4

chia/_tests/cmds/wallet/test_wallet.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
from chia.wallet.wallet_coin_store import GetCoinRecords
4343
from chia.wallet.wallet_request_types import (
4444
BalanceResponse,
45+
CancelOffer,
4546
CancelOfferResponse,
4647
CATAssetIDToName,
4748
CATAssetIDToNameResponse,
@@ -1180,14 +1181,14 @@ async def get_offer(self, request: GetOffer) -> GetOfferResponse:
11801181

11811182
async def cancel_offer(
11821183
self,
1183-
trade_id: bytes32,
1184+
request: CancelOffer,
11841185
tx_config: TXConfig,
1185-
fee: uint64 = uint64(0),
1186-
secure: bool = True,
1187-
push: bool = True,
1186+
extra_conditions: tuple[Condition, ...] = tuple(),
11881187
timelock_info: ConditionValidTimes = ConditionValidTimes(),
11891188
) -> CancelOfferResponse:
1190-
self.add_to_log("cancel_offer", (trade_id, tx_config, fee, secure, push, timelock_info))
1189+
self.add_to_log(
1190+
"cancel_offer", (request.trade_id, tx_config, request.fee, request.secure, request.push, timelock_info)
1191+
)
11911192
return CancelOfferResponse([STD_UTX], [STD_TX])
11921193

11931194
inst_rpc_client = CancelOfferRpcClient()

chia/_tests/core/custom_types/test_proof_of_space.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ def b32(key: str) -> bytes32:
128128
),
129129
ProofOfSpaceCase(
130130
id="Not passing the plot filter v2",
131-
pos_challenge=b32("5706ae15c4a437399f464c64ef4f33c362d860ccd2945b76b3ebdb0505783817"),
131+
pos_challenge=b32("4cfaacbd2782db64d07cf490ca938534adb07dfbd2f92b0e479e2e5b196178db"),
132132
plot_size=PlotParam.make_v2(32),
133133
pool_contract_puzzle_hash=bytes32(b"1" * 32),
134134
plot_public_key=g1(
@@ -180,7 +180,7 @@ def test_verify_and_get_quality_string(caplog: pytest.LogCaptureFixture, case: P
180180
ProofOfSpaceCase(
181181
id="not passing the plot filter v2",
182182
plot_size=PlotParam.make_v2(2),
183-
pos_challenge=b32("fb1d676f0e3ce173f4e6cfb06d7059886cbc3b91cf65be0af0fc2fbe569c6597"),
183+
pos_challenge=b32("aefba5c94bc9bbfe2c538b7faaaf03384ac5a6170e40b024657df6b0a27c34a7"),
184184
plot_public_key=g1(
185185
"afa3aaf09c03885154be49216ee7fb2e4581b9c4a4d7e9cc402e27280bf0cfdbdf1b9ba674e301fd1d1450234b3b1868"
186186
),
@@ -291,10 +291,10 @@ def test_calculate_prefix_bits_v1(height: uint32, expected: int) -> None:
291291
argvalues=[
292292
(0, 5),
293293
(0xFFFFFFFA, 5),
294-
(0xFFFFFFFB, 6),
295-
(0xFFFFFFFC, 7),
296-
(0xFFFFFFFD, 8),
297-
(0xFFFFFFFF, 8),
294+
(0xFFFFFFFB, 4),
295+
(0xFFFFFFFC, 3),
296+
(0xFFFFFFFD, 2),
297+
(0xFFFFFFFF, 2),
298298
],
299299
)
300300
def test_calculate_prefix_bits_v2(height: uint32, expected: int) -> None:

chia/_tests/core/data_layer/test_data_rpc.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -777,6 +777,7 @@ async def test_get_owned_stores(
777777
assert res is not None
778778
launcher_id = bytes32.from_hexstr(res["id"])
779779
expected_store_ids.append(launcher_id)
780+
await full_node_api.wait_for_wallet_synced(wallet_node)
780781

781782
await time_out_assert(4, check_mempool_spend_count, True, full_node_api, 3)
782783
await full_node_api.farm_new_transaction_block(FarmNewBlockProtocol(ph))

chia/_tests/core/full_node/test_conditions.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
from chia._tests.blockchain.blockchain_test_utils import _validate_and_add_block
1616
from chia._tests.conftest import ConsensusMode
1717
from chia._tests.core.full_node.ram_db import create_ram_blockchain
18+
from chia._tests.core.full_node.test_full_node import find_reward_coin
1819
from chia.consensus.condition_tools import agg_sig_additional_data
1920
from chia.simulator.block_tools import BlockTools
2021
from chia.simulator.keyring import TempKeyring
@@ -46,7 +47,6 @@ async def initial_blocks(bt: BlockTools, block_count: int = 4) -> list[FullBlock
4647
block_count,
4748
guarantee_transaction_block=True,
4849
farmer_reward_puzzle_hash=EASY_PUZZLE_HASH,
49-
pool_reward_puzzle_hash=EASY_PUZZLE_HASH,
5050
genesis_timestamp=uint64(10000),
5151
time_per_block=10,
5252
)
@@ -100,7 +100,7 @@ async def check_conditions(
100100
aggsig: G2Element = G2Element(),
101101
) -> tuple[list[CoinRecord], list[CoinRecord], FullBlock]:
102102
blocks = await initial_blocks(bt)
103-
coin = blocks[spend_reward_index].get_included_reward_coins()[0]
103+
coin = find_reward_coin(blocks[spend_reward_index], EASY_PUZZLE_HASH)
104104

105105
coin_spend = make_spend(coin, EASY_PUZZLE, condition_solution)
106106
spend_bundle = SpendBundle([coin_spend], aggsig)
@@ -142,9 +142,9 @@ async def test_unknown_conditions_with_cost(
142142
# once the hard fork activates, blocks no longer pay the cost of the ROM
143143
# generator (which includes hashing all puzzles).
144144
if consensus_mode >= ConsensusMode.HARD_FORK_2_0:
145-
block_base_cost = 756064
145+
block_base_cost = 756064 - 12000
146146
else:
147-
block_base_cost = 761056
147+
block_base_cost = 761056 - 12000
148148
assert new_block.transactions_info is not None
149149
assert new_block.transactions_info.cost - block_base_cost == expected_cost
150150

@@ -163,11 +163,11 @@ async def test_softfork_condition(
163163
_additions, _removals, new_block = await check_conditions(bt, conditions)
164164

165165
if consensus_mode < ConsensusMode.HARD_FORK_2_0:
166-
block_base_cost = 737056
166+
block_base_cost = 737056 - 12000
167167
else:
168168
# once the hard fork activates, blocks no longer pay the cost of the ROM
169169
# generator (which includes hashing all puzzles).
170-
block_base_cost = 732064
170+
block_base_cost = 732064 - 12000
171171

172172
# the block_base_cost includes the cost of the bytes for the condition
173173
# with 2 bytes argument. This test works as long as the conditions it's
@@ -266,7 +266,7 @@ async def test_condition(self, opcode: ConditionOpcode, value: int, expected: Er
266266
@pytest.mark.anyio
267267
async def test_invalid_my_id(self, bt: BlockTools) -> None:
268268
blocks = await initial_blocks(bt)
269-
coin = blocks[-2].get_included_reward_coins()[0]
269+
coin = find_reward_coin(blocks[-2], EASY_PUZZLE_HASH)
270270
wrong_name = bytearray(coin.name())
271271
wrong_name[-1] ^= 1
272272
conditions = Program.to(assemble(f"(({ConditionOpcode.ASSERT_MY_COIN_ID[0]} 0x{wrong_name.hex()}))"))
@@ -275,14 +275,14 @@ async def test_invalid_my_id(self, bt: BlockTools) -> None:
275275
@pytest.mark.anyio
276276
async def test_valid_my_id(self, bt: BlockTools) -> None:
277277
blocks = await initial_blocks(bt)
278-
coin = blocks[-2].get_included_reward_coins()[0]
278+
coin = find_reward_coin(blocks[-2], EASY_PUZZLE_HASH)
279279
conditions = Program.to(assemble(f"(({ConditionOpcode.ASSERT_MY_COIN_ID[0]} 0x{coin.name().hex()}))"))
280280
await check_conditions(bt, conditions)
281281

282282
@pytest.mark.anyio
283283
async def test_invalid_coin_announcement(self, bt: BlockTools) -> None:
284284
blocks = await initial_blocks(bt)
285-
coin = blocks[-2].get_included_reward_coins()[0]
285+
coin = find_reward_coin(blocks[-2], EASY_PUZZLE_HASH)
286286
announce = AssertCoinAnnouncement(asserted_id=coin.name(), asserted_msg=b"test_bad")
287287
conditions = Program.to(
288288
assemble(
@@ -295,7 +295,7 @@ async def test_invalid_coin_announcement(self, bt: BlockTools) -> None:
295295
@pytest.mark.anyio
296296
async def test_valid_coin_announcement(self, bt: BlockTools) -> None:
297297
blocks = await initial_blocks(bt)
298-
coin = blocks[-2].get_included_reward_coins()[0]
298+
coin = find_reward_coin(blocks[-2], EASY_PUZZLE_HASH)
299299
announce = AssertCoinAnnouncement(asserted_id=coin.name(), asserted_msg=b"test")
300300
conditions = Program.to(
301301
assemble(
@@ -373,7 +373,7 @@ async def test_announce_conditions_limit(
373373
"""
374374

375375
blocks = await initial_blocks(bt)
376-
coin = blocks[-2].get_included_reward_coins()[0]
376+
coin = find_reward_coin(blocks[-2], EASY_PUZZLE_HASH)
377377
coin_announcement = AssertCoinAnnouncement(asserted_id=coin.name(), asserted_msg=b"test")
378378
puzzle_announcement = AssertPuzzleAnnouncement(asserted_ph=EASY_PUZZLE_HASH, asserted_msg=b"test")
379379

@@ -403,7 +403,7 @@ async def test_announce_conditions_limit(
403403
@pytest.mark.anyio
404404
async def test_coin_messages(self, bt: BlockTools, consensus_mode: ConsensusMode) -> None:
405405
blocks = await initial_blocks(bt)
406-
coin = blocks[-2].get_included_reward_coins()[0]
406+
coin = find_reward_coin(blocks[-2], EASY_PUZZLE_HASH)
407407
conditions = Program.to(
408408
assemble(
409409
f"(({ConditionOpcode.SEND_MESSAGE[0]} 0x3f 'test' 0x{coin.name().hex()})"
@@ -415,7 +415,7 @@ async def test_coin_messages(self, bt: BlockTools, consensus_mode: ConsensusMode
415415
@pytest.mark.anyio
416416
async def test_parent_messages(self, bt: BlockTools, consensus_mode: ConsensusMode) -> None:
417417
blocks = await initial_blocks(bt)
418-
coin = blocks[-2].get_included_reward_coins()[0]
418+
coin = find_reward_coin(blocks[-2], EASY_PUZZLE_HASH)
419419
conditions = Program.to(
420420
assemble(
421421
f"(({ConditionOpcode.SEND_MESSAGE[0]} 0x24 'test' 0x{coin.parent_coin_info})"
@@ -436,7 +436,7 @@ async def test_parent_messages(self, bt: BlockTools, consensus_mode: ConsensusMo
436436
('(66 0x27 "foo" {coin}) (67 0x3f "foo" {coin})', Err.MESSAGE_NOT_SENT_OR_RECEIVED),
437437
('(66 0 "foo") (67 0 "foo")', None),
438438
('(66 0 "foobar") (67 0 "foo")', Err.MESSAGE_NOT_SENT_OR_RECEIVED),
439-
('(66 0x09 "foo" 1750000000000) (67 0x09 "foo" 1750000000000)', None),
439+
('(66 0x09 "foo" 250000000000) (67 0x09 "foo" 250000000000)', None),
440440
('(66 -1 "foo")', Err.INVALID_MESSAGE_MODE),
441441
('(67 -1 "foo")', Err.INVALID_MESSAGE_MODE),
442442
('(66 0x40 "foo")', Err.INVALID_MESSAGE_MODE),
@@ -447,7 +447,7 @@ async def test_message_conditions(
447447
self, bt: BlockTools, consensus_mode: ConsensusMode, conds: str, expected: Err | None
448448
) -> None:
449449
blocks = await initial_blocks(bt)
450-
coin = blocks[-2].get_included_reward_coins()[0]
450+
coin = find_reward_coin(blocks[-2], EASY_PUZZLE_HASH)
451451
conditions = Program.to(assemble("(" + conds.format(coin="0x" + coin.name().hex()) + ")"))
452452

453453
await check_conditions(bt, conditions, expected_err=expected)
@@ -520,7 +520,7 @@ async def test_agg_sig_illegal_suffix(
520520

521521
sk = AugSchemeMPL.key_gen(b"8" * 32)
522522
pubkey = sk.get_g1()
523-
coin = blocks[-2].get_included_reward_coins()[0]
523+
coin = find_reward_coin(blocks[-2], EASY_PUZZLE_HASH)
524524
for msg in [
525525
c.AGG_SIG_ME_ADDITIONAL_DATA,
526526
c.AGG_SIG_PARENT_ADDITIONAL_DATA,

chia/_tests/core/full_node/test_tx_processing_queue.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ async def test_local_txs(seeded_random: random.Random) -> None:
3030
transaction_queue = TransactionQueue(1000, log)
3131
# test 1 tx
3232
first_tx = get_transaction_queue_entry(None, 0)
33-
await transaction_queue.put(first_tx, None)
33+
transaction_queue.put(first_tx, None)
3434

3535
result1 = await transaction_queue.pop()
3636

@@ -40,7 +40,7 @@ async def test_local_txs(seeded_random: random.Random) -> None:
4040
num_txs = 2000
4141
list_txs = [get_transaction_queue_entry(bytes32.random(seeded_random), i) for i in range(num_txs)]
4242
for tx in list_txs:
43-
await transaction_queue.put(tx, None)
43+
transaction_queue.put(tx, None)
4444

4545
resulting_txs = []
4646
for _ in range(num_txs):
@@ -58,12 +58,12 @@ async def test_one_peer_and_await(seeded_random: random.Random) -> None:
5858

5959
list_txs = [get_transaction_queue_entry(peer_id, i) for i in range(num_txs)]
6060
for tx in list_txs:
61-
await transaction_queue.put(tx, peer_id)
61+
transaction_queue.put(tx, peer_id)
6262

6363
# test transaction priority
6464
local_txs = [get_transaction_queue_entry(None, i) for i in range(int(num_txs / 5))] # 20 txs
6565
for tx in local_txs:
66-
await transaction_queue.put(tx, None)
66+
transaction_queue.put(tx, None)
6767

6868
resulting_txs = []
6969
for _ in range(num_txs + len(local_txs)):
@@ -80,7 +80,7 @@ async def test_one_peer_and_await(seeded_random: random.Random) -> None:
8080
with pytest.raises(asyncio.InvalidStateError): # task is not done, so we expect an error when getting result
8181
task.result()
8282
# add a tx to test task completion
83-
await transaction_queue.put(get_transaction_queue_entry(None, 0), None)
83+
transaction_queue.put(get_transaction_queue_entry(None, 0), None)
8484
await asyncio.wait_for(task, 1) # we should never time out here
8585

8686

@@ -95,7 +95,7 @@ async def test_lots_of_peers(seeded_random: random.Random) -> None:
9595
# 100 txs per peer
9696
list_txs = [get_transaction_queue_entry(peer_id, i) for peer_id in peer_ids for i in range(num_txs)]
9797
for tx in list_txs:
98-
await transaction_queue.put(tx, tx.peer_id) # type: ignore[attr-defined]
98+
transaction_queue.put(tx, tx.peer_id) # type: ignore[attr-defined]
9999

100100
resulting_txs = []
101101
for _ in range(total_txs):
@@ -117,11 +117,11 @@ async def test_full_queue(seeded_random: random.Random) -> None:
117117
# 999 txs per peer then 1 to fail later
118118
list_txs = [get_transaction_queue_entry(peer_id, i) for peer_id in peer_ids for i in range(num_txs)]
119119
for tx in list_txs:
120-
await transaction_queue.put(tx, tx.peer_id) # type: ignore[attr-defined]
120+
transaction_queue.put(tx, tx.peer_id) # type: ignore[attr-defined]
121121

122122
# test failure case.
123123
with pytest.raises(TransactionQueueFull):
124-
await transaction_queue.put(get_transaction_queue_entry(peer_ids[0], 1001), peer_ids[0])
124+
transaction_queue.put(get_transaction_queue_entry(peer_ids[0], 1001), peer_ids[0])
125125

126126
resulting_txs = []
127127
for _ in range(total_txs):
@@ -142,7 +142,7 @@ async def test_queue_cleanup_and_fairness(seeded_random: random.Random) -> None:
142142

143143
list_txs = peer_tx_a + peer_tx_b + peer_tx_c
144144
for tx in list_txs:
145-
await transaction_queue.put(tx, tx.peer_id) # type: ignore[attr-defined]
145+
transaction_queue.put(tx, tx.peer_id) # type: ignore[attr-defined]
146146

147147
resulting_ids = []
148148
for _ in range(3): # we validate we get one transaction per peer

0 commit comments

Comments
 (0)