Skip to content

Commit 6dcc8cf

Browse files
authored
catchup: into long_lived/datalayer_merkle_blob from main @ a803d18 (#19658)
Source hash: a803d18 Remaining commits: 0
2 parents 5d3fd3f + 10d9576 commit 6dcc8cf

File tree

171 files changed

+962
-736
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

171 files changed

+962
-736
lines changed

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ to configure how the tests are run. For example, for more logging: change the lo
5757
```bash
5858
sh install.sh -d
5959
. ./activate
60-
ruff format && ruff check --fix && mypy
61-
pytest tests -v --durations 0
60+
ruff format && ruff check --fix && mypy .
61+
pytest . -v --durations 0
6262
```
6363

6464
The [Mypy library](https://mypy.readthedocs.io/en/stable/) is very useful for ensuring objects are of the correct type, so try to always add the type of the return value, and the type of local variables.

chia-blockchain-gui

Submodule chia-blockchain-gui updated 127 files

chia/_tests/blockchain/test_blockchain.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,13 @@
4545
from chia.consensus.coinbase import create_farmer_coin
4646
from chia.consensus.find_fork_point import lookup_fork_chain
4747
from chia.consensus.full_block_to_block_record import block_to_block_record
48+
from chia.consensus.generator_tools import get_block_header
4849
from chia.consensus.get_block_generator import get_block_generator
4950
from chia.consensus.multiprocess_validation import PreValidationResult, pre_validate_block
5051
from chia.consensus.pot_iterations import is_overflow_block
5152
from chia.simulator.block_tools import BlockTools, create_block_tools_async
5253
from chia.simulator.keyring import TempKeyring
54+
from chia.simulator.vdf_prover import get_vdf_info_and_proof
5355
from chia.simulator.wallet_tools import WalletTool
5456
from chia.types.blockchain_format.classgroup import ClassgroupElement
5557
from chia.types.blockchain_format.coin import Coin
@@ -60,11 +62,9 @@
6062
from chia.types.generator_types import BlockGenerator
6163
from chia.types.validation_state import ValidationState
6264
from chia.util.errors import Err
63-
from chia.util.generator_tools import get_block_header
6465
from chia.util.hash import std_hash
6566
from chia.util.keychain import Keychain
6667
from chia.util.recursive_replace import recursive_replace
67-
from chia.util.vdf_prover import get_vdf_info_and_proof
6868
from chia.wallet.puzzles.p2_delegated_puzzle_or_hidden_puzzle import (
6969
DEFAULT_HIDDEN_PUZZLE_HASH,
7070
calculate_synthetic_secret_key,
@@ -1156,7 +1156,7 @@ async def test_bad_pos(self, empty_blockchain: Blockchain, bt: BlockTools) -> No
11561156
)
11571157
await _validate_and_add_block(empty_blockchain, block_bad, expected_error=Err.INVALID_POSPACE)
11581158

1159-
block_bad = recursive_replace(blocks[-1], "reward_chain_block.proof_of_space.size", 62)
1159+
block_bad = recursive_replace(blocks[-1], "reward_chain_block.proof_of_space.version_and_size", 62)
11601160
await _validate_and_add_block(empty_blockchain, block_bad, expected_error=Err.INVALID_POSPACE)
11611161

11621162
block_bad = recursive_replace(
@@ -1167,14 +1167,14 @@ async def test_bad_pos(self, empty_blockchain: Blockchain, bt: BlockTools) -> No
11671167
await _validate_and_add_block(empty_blockchain, block_bad, expected_error=Err.INVALID_POSPACE)
11681168
block_bad = recursive_replace(
11691169
blocks[-1],
1170-
"reward_chain_block.proof_of_space.size",
1170+
"reward_chain_block.proof_of_space.version_and_size",
11711171
32,
11721172
)
11731173
await _validate_and_add_block(empty_blockchain, block_bad, expected_error=Err.INVALID_POSPACE)
11741174
block_bad = recursive_replace(
11751175
blocks[-1],
11761176
"reward_chain_block.proof_of_space.proof",
1177-
bytes([1] * int(blocks[-1].reward_chain_block.proof_of_space.size * 64 / 8)),
1177+
bytes([1] * int((blocks[-1].reward_chain_block.proof_of_space.version_and_size & 0x7F) * 64 / 8)),
11781178
)
11791179
await _validate_and_add_block(empty_blockchain, block_bad, expected_error=Err.INVALID_POSPACE)
11801180

chia/_tests/clvm/test_message_conditions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,13 +129,13 @@ def test_message_error_conditions() -> None:
129129
mode_integer=uint8(0b111),
130130
).necessary_args
131131

132-
with pytest.raises(ValueError, match="Must specify either mode_integer or both sender and reciever"):
132+
with pytest.raises(ValueError, match="Must specify either mode_integer or both sender and receiver"):
133133
SendMessage(
134134
msg=b"foo",
135135
sender=MessageParticipant(coin_id_committed=test_coin.name()),
136136
)
137137

138-
with pytest.raises(ValueError, match="Must specify either mode_integer or both sender and reciever"):
138+
with pytest.raises(ValueError, match="Must specify either mode_integer or both sender and receiver"):
139139
SendMessage(
140140
msg=b"foo",
141141
receiver=MessageParticipant(coin_id_committed=test_coin.name()),

chia/_tests/cmds/wallet/test_wallet.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
get_bytes32,
2626
)
2727
from chia.cmds.cmds_util import TransactionBundle
28+
from chia.protocols.outbound_message import NodeType
2829
from chia.rpc.wallet_request_types import (
2930
CancelOfferResponse,
3031
CATSpendResponse,
@@ -33,7 +34,6 @@
3334
SendTransactionResponse,
3435
TakeOfferResponse,
3536
)
36-
from chia.server.outbound_message import NodeType
3737
from chia.types.blockchain_format.program import Program
3838
from chia.types.signing_mode import SigningMode
3939
from chia.util.bech32m import encode_puzzle_hash

chia/_tests/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1257,7 +1257,7 @@ async def farmer_harvester_2_simulators_zero_bits_plot_filter(
12571257
]
12581258
]:
12591259
zero_bit_plot_filter_consts = test_constants_modified.replace(
1260-
NUMBER_ZERO_BITS_PLOT_FILTER=uint8(0),
1260+
NUMBER_ZERO_BITS_PLOT_FILTER_V1=uint8(0),
12611261
NUM_SPS_SUB_SLOT=uint32(8),
12621262
)
12631263

chia/_tests/connection_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313

1414
from chia._tests.util.time_out_assert import time_out_assert
1515
from chia.apis import ApiProtocolRegistry
16+
from chia.protocols.outbound_message import NodeType
1617
from chia.protocols.shared_protocol import default_capabilities
17-
from chia.server.outbound_message import NodeType
1818
from chia.server.server import ChiaServer, ssl_context_for_client
1919
from chia.server.ssl_context import chia_ssl_ca_paths, private_ssl_ca_paths
2020
from chia.server.ws_connection import WSChiaConnection

chia/_tests/core/custom_types/test_proof_of_space.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ class ProofOfSpaceCase:
2727
marks: Marks = ()
2828

2929

30+
# TODO: test v2 plots
3031
@datacases(
3132
ProofOfSpaceCase(
3233
id="Neither pool public key nor pool contract puzzle hash",
@@ -108,7 +109,7 @@ def test_verify_and_get_quality_string(caplog: pytest.LogCaptureFixture, case: P
108109
pool_public_key=case.pool_public_key,
109110
pool_contract_puzzle_hash=case.pool_contract_puzzle_hash,
110111
plot_public_key=case.plot_public_key,
111-
size=case.plot_size,
112+
version_and_size=case.plot_size,
112113
proof=b"1",
113114
)
114115
quality_string = verify_and_get_quality_string(
@@ -125,7 +126,7 @@ def test_verify_and_get_quality_string(caplog: pytest.LogCaptureFixture, case: P
125126

126127

127128
class TestProofOfSpace:
128-
@pytest.mark.parametrize("prefix_bits", [DEFAULT_CONSTANTS.NUMBER_ZERO_BITS_PLOT_FILTER, 8, 7, 6, 5, 1, 0])
129+
@pytest.mark.parametrize("prefix_bits", [DEFAULT_CONSTANTS.NUMBER_ZERO_BITS_PLOT_FILTER_V1, 8, 7, 6, 5, 1, 0])
129130
def test_can_create_proof(self, prefix_bits: int, seeded_random: random.Random) -> None:
130131
"""
131132
Tests that the change of getting a correct proof is exactly 1/target_filter.

chia/_tests/core/data_layer/test_data_layer_util.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,15 @@ def create_valid_proof_of_inclusion(layer_count: int, other_hash_side: Side) ->
3737
other_hashes = [bytes32([i] * 32) for i in range(layer_count)]
3838

3939
for other_hash in other_hashes:
40-
new_layer = ProofOfInclusionLayer.from_hashes(
41-
primary_hash=existing_hash,
40+
if other_hash_side == Side.LEFT:
41+
combined_hash = internal_hash(other_hash, existing_hash)
42+
else:
43+
combined_hash = internal_hash(existing_hash, other_hash)
44+
45+
new_layer = ProofOfInclusionLayer(
4246
other_hash_side=other_hash_side,
4347
other_hash=other_hash,
48+
combined_hash=combined_hash,
4449
)
4550

4651
layers.append(new_layer)

chia/_tests/core/farmer/test_farmer_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
)
1818
from chia.farmer.farmer_api import FarmerAPI
1919
from chia.protocols import farmer_protocol
20+
from chia.protocols.outbound_message import Message, NodeType
2021
from chia.protocols.protocol_message_types import ProtocolMessageTypes
21-
from chia.server.outbound_message import Message, NodeType
2222
from chia.util.hash import std_hash
2323
from chia.util.task_referencer import create_referenced_task
2424

0 commit comments

Comments
 (0)