Skip to content

Commit

Permalink
Various clean ups, spelling thanks @AdamFiddler, isort (#1278)
Browse files Browse the repository at this point in the history
* Various clean ups, spelling thanks @AdamFiddler, isort

* Actually thank @AdamFiddler

* isort tests

* Update changelog, readme, spec, spelling

* Readme nit

* locales

* locales again
  • Loading branch information
hoffmang9 authored Mar 13, 2021
1 parent 7534383 commit 4697e39
Show file tree
Hide file tree
Showing 24 changed files with 49 additions and 50 deletions.
9 changes: 7 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project does not yet adhere to [Semantic Versioning](https://semver.org/spec/v2.0.0.html)
for setuptools_scm/PEP 440 reasons.

## 1.0rc7 aka Release Candidate 7 - 2020-03-12
## 1.0rc7 aka Release Candidate 7 - 2020-03-13

### Changed

Expand All @@ -16,8 +16,13 @@ for setuptools_scm/PEP 440 reasons.

### Fixed

- Setting difficulty way too low on the testnet_6 launch revealed a Timelord edge case. The full node was hardcoding the default difficulty if block height is < EPOCH_BLOCKS. However there were many overlapping blocks, so none of the blocks reached the height, and therefore the timelord infused the wrong difficulty.
- Fixed a race condition in the Timelord, where it took time to update the state, so it ignored the new_peak_timelord form the full_node, which should have reset the timelord to a good state.
- Wallet notoriously showed "not synced" when it was in sync.
- Installers were not correctly placing root TLS certificates into the bundle.
- Weight proofs had a logic typo.
- There was a typo in `chia netspace`. Thanks @altendky.
- There was a typo in `chia plots`. Thanks @adamfiddler.

## 1.0rc6 aka Release Candidate 6 - 2020-03-11

Expand Down Expand Up @@ -78,7 +83,7 @@ for setuptools_scm/PEP 440 reasons.
- The RC5 release is a new breaking change/hard fork blockchain. Plots and keys from previous chains will work fine on RC5 but balances of TXCH will not come forward.
- We now support a "green flag" chain launch process. A new version of the software will poll download.chia.net/notify/ for a signed json file that will be the genesis block of the chain for that version. This will allow unattended start at mainnet.
- Bluebox Timelords are back. These are Timelords most anyone can run. They search through the historical chain and find large proofs of times and compact them down to their smallest representation. This significantly speeds up syncing for newly started nodes. Currently this is only supported on Linux and MacOS x86_64 but we will expand that. Any desktop or server of any age will be fast enough to be a useful Bluebox Timelord.
- Thanks to @jespino there is now `chia farm show`. You can now get almost exactly the same farming information on the CLI as the GUI.
- Thanks to @jespino there is now `chia farm summary`. You can now get almost exactly the same farming information on the CLI as the GUI.
- We have added Romanian to the GUI translations. Thank you to @bicilis on [Crowdin](https://crowdin.com/project/chia-blockchain). We also added a couple of additional target languages. Klingon anyone?
- `chia wallet` now takes get_address to get a new wallet receive address from the CLI.
- `chia plots check` will list out all the failed plot filenames at the end of the report. Thanks for the PR go to @eFishCent.
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

| Current Release/main | Development Branch/dev |
| :---: | :---: |
| ![Build Ubuntu on 3.7 and 3.8](https://github.com/Chia-Network/chia-blockchain/workflows/Build%20Ubuntu%20on%20Python%203.7%20and%203.8/badge.svg) ![Build MacOS](https://github.com/Chia-Network/chia-blockchain/workflows/Build%20MacOS/badge.svg) ![Build Windows](https://github.com/Chia-Network/chia-blockchain/workflows/Build%20Windows/badge.svg) | ![Build Ubuntu on 3.7 and 3.8](https://github.com/Chia-Network/chia-blockchain/workflows/Build%20Ubuntu%20on%20Python%203.7%20and%203.8/badge.svg?branch=dev) ![Build MacOS](https://github.com/Chia-Network/chia-blockchain/workflows/Build%20MacOS/badge.svg?branch=dev) ![Build Windows](https://github.com/Chia-Network/chia-blockchain/workflows/Build%20Windows/badge.svg?branch=dev) |
| [![Ubuntu Core Tests](https://github.com/Chia-Network/chia-blockchain/actions/workflows/build-test-ubuntu-core.yml/badge.svg)](https://github.com/Chia-Network/chia-blockchain/actions/workflows/build-test-ubuntu-core.yml) [![MacOS Core Tests](https://github.com/Chia-Network/chia-blockchain/actions/workflows/build-test-macos-core.yml/badge.svg)](https://github.com/Chia-Network/chia-blockchain/actions/workflows/build-test-macos-core.yml) [![Windows Installer on Windows 10 and Python 3.7](https://github.com/Chia-Network/chia-blockchain/actions/workflows/build-windows-installer.yml/badge.svg)](https://github.com/Chia-Network/chia-blockchain/actions/workflows/build-windows-installer.yml) | [![Ubuntu Core Tests](https://github.com/Chia-Network/chia-blockchain/actions/workflows/build-test-ubuntu-core.yml/badge.svg?branch=dev)](https://github.com/Chia-Network/chia-blockchain/actions/workflows/build-test-ubuntu-core.yml) [![MacOS Core Tests](https://github.com/Chia-Network/chia-blockchain/actions/workflows/build-test-macos-core.yml/badge.svg?branch=dev)](https://github.com/Chia-Network/chia-blockchain/actions/workflows/build-test-macos-core.yml) [![Windows Installer on Windows 10 and Python 3.7](https://github.com/Chia-Network/chia-blockchain/actions/workflows/build-windows-installer.yml/badge.svg?branch=dev)](https://github.com/Chia-Network/chia-blockchain/actions/workflows/build-windows-installer.yml) |

![GitHub contributors](https://img.shields.io/github/contributors/Chia-Network/chia-blockchain?logo=GitHub)

Expand All @@ -22,9 +22,9 @@ TCP port 8444 access to your peer.
These methods tend to be router make/model specific.

Most should only install harvesters, farmers, plotter, full nodes, and wallets.
Building timelords and VDFs is for sophisticated users in most environments.
Building Timelords and VDFs is for sophisticated users in most environments.
Chia Network and additional volunteers are running sufficient Timelords
for testnet consensus.
for consensus.

## Installing
Install instructions are available in the
Expand Down
7 changes: 4 additions & 3 deletions build_scripts/daemon_windows.spec
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,18 @@ keyring_datas = copy_metadata('keyring')[0]
version_data = copy_metadata(get_distribution("chia-blockchain"))[0]

SUBCOMMANDS = [
"configure",
"farm",
"init",
"keys",
"netspace",
"plots",
"run_daemon",
"show",
"start",
"stop",
"version",
"netspace",
"run_daemon",
"wallet",
"configure",
]
block_cipher = None
subcommand_modules = [f"../src.cmds.%s" % _ for _ in SUBCOMMANDS]
Expand Down
2 changes: 1 addition & 1 deletion chia-blockchain-gui
Submodule chia-blockchain-gui updated 1 files
+2 −0 README.md
2 changes: 1 addition & 1 deletion src/cmds/plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def __init__(self):
print("If you are testing and you want to use smaller size please add the --override-k flag.")
sys.exit(1)
elif size < 25 and override_k:
print("Error: The minimun k size allowed from the cli is k=25.")
print("Error: The minimum k size allowed from the cli is k=25.")
sys.exit(1)

create_plots(Params(), ctx.obj["root_path"])
Expand Down
4 changes: 2 additions & 2 deletions src/consensus/pot_iterations.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from src.consensus.constants import ConsensusConstants
from src.consensus.pos_quality import _expected_plot_size
from src.types.blockchain_format.sized_bytes import bytes32
from src.util.hash import std_hash
from src.consensus.pos_quality import _expected_plot_size
from src.consensus.constants import ConsensusConstants
from src.util.ints import uint8, uint64, uint128


Expand Down
7 changes: 3 additions & 4 deletions src/farmer/farmer.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@

from blspy import G1Element

from src.consensus.coinbase import create_puzzlehash_for_pk
from src.util.config import load_config, save_config

import src.server.ws_connection as ws # lgtm [py/import-and-import-from]
from src.consensus.coinbase import create_puzzlehash_for_pk
from src.consensus.constants import ConsensusConstants
from src.protocols import farmer_protocol, harvester_protocol
from src.protocols.protocol_message_types import ProtocolMessageTypes
Expand All @@ -18,7 +16,8 @@
from src.types.blockchain_format.proof_of_space import ProofOfSpace
from src.types.blockchain_format.sized_bytes import bytes32
from src.util.bech32m import decode_puzzle_hash
from src.util.ints import uint64, uint32
from src.util.config import load_config, save_config
from src.util.ints import uint32, uint64
from src.util.keychain import Keychain
from src.wallet.derive_keys import master_sk_to_farmer_sk, master_sk_to_pool_sk, master_sk_to_wallet_sk

Expand Down
5 changes: 2 additions & 3 deletions src/full_node/full_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,19 @@
from src.server.outbound_message import Message, NodeType, make_msg
from src.server.server import ChiaServer
from src.types.blockchain_format.classgroup import ClassgroupElement
from src.types.end_of_slot_bundle import EndOfSubSlotBundle
from src.types.blockchain_format.pool_target import PoolTarget
from src.types.blockchain_format.sized_bytes import bytes32
from src.types.blockchain_format.sub_epoch_summary import SubEpochSummary
from src.types.blockchain_format.vdf import CompressibleVDFField, VDFInfo, VDFProof
from src.types.end_of_slot_bundle import EndOfSubSlotBundle
from src.types.full_block import FullBlock
from src.types.header_block import HeaderBlock
from src.types.mempool_inclusion_status import MempoolInclusionStatus
from src.types.spend_bundle import SpendBundle
from src.types.unfinished_block import UnfinishedBlock
from src.util.errors import ConsensusError, Err
from src.util.ints import uint8, uint32, uint64, uint128
from src.util.genesis_wait import wait_for_genesis_challenge

from src.util.ints import uint8, uint32, uint64, uint128
from src.util.path import mkdir, path_from_root


Expand Down
4 changes: 2 additions & 2 deletions src/protocols/shared_protocol.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from dataclasses import dataclass
from typing import Tuple, List

from enum import IntEnum
from typing import List, Tuple

from src.util.ints import uint8, uint16
from src.util.streamable import Streamable, streamable

Expand Down
3 changes: 1 addition & 2 deletions src/server/rate_limits.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import dataclasses
import logging
import time
from collections import Counter
from typing import Optional

from src.protocols.protocol_message_types import ProtocolMessageTypes
from collections import Counter

from src.server.outbound_message import Message

log = logging.getLogger(__name__)
Expand Down
4 changes: 1 addition & 3 deletions src/server/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from secrets import token_bytes
from typing import Any, Callable, Dict, List, Optional, Set, Tuple

from aiohttp import ClientSession, ClientTimeout, WSCloseCode, client_exceptions, web, ServerDisconnectedError
from aiohttp import ClientSession, ClientTimeout, ServerDisconnectedError, WSCloseCode, client_exceptions, web
from aiohttp.web_app import Application
from aiohttp.web_runner import TCPSite
from cryptography import x509
Expand All @@ -25,7 +25,6 @@
from src.types.peer_info import PeerInfo
from src.util.errors import Err, ProtocolError
from src.util.ints import uint16

from src.util.network import is_localhost


Expand Down Expand Up @@ -527,7 +526,6 @@ async def wrapped_coroutine():
connection.log.error(f"Exception: {e}, closing connection {connection.get_peer_info()}. {tb}")
else:
connection.log.debug(f"Exception: {e} while closing connection")
pass
# TODO: actually throw one of the errors from errors.py and pass this to close
await connection.close(self.api_exception_ban_seconds, WSCloseCode.PROTOCOL_ERROR, Err.UNKNOWN)
finally:
Expand Down
2 changes: 1 addition & 1 deletion src/server/start_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from sys import platform
from typing import Any, Callable, List, Optional, Tuple

from src.server.ssl_context import private_ssl_ca_paths, chia_ssl_ca_paths
from src.server.ssl_context import chia_ssl_ca_paths, private_ssl_ca_paths

try:
import uvloop
Expand Down
2 changes: 1 addition & 1 deletion src/server/ws_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

from src.cmds.init import chia_full_version_str
from src.protocols.protocol_message_types import ProtocolMessageTypes
from src.protocols.shared_protocol import Handshake, Capability
from src.protocols.shared_protocol import Capability, Handshake
from src.server.outbound_message import Message, NodeType, make_msg
from src.server.rate_limits import RateLimiter
from src.types.blockchain_format.sized_bytes import bytes32
Expand Down
3 changes: 1 addition & 2 deletions src/ssl/create_ssl.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import datetime
import pathlib
from pathlib import Path
from typing import Any, Tuple

Expand All @@ -19,7 +18,7 @@ def get_chia_ca_crt_key() -> Tuple[Any, Any]:


def get_mozzila_ca_crt() -> str:
mozilla_path = pathlib.Path(__file__).parent.parent.parent.absolute() / "mozilla-ca/cacert.pem"
mozilla_path = Path(__file__).parent.parent.parent.absolute() / "mozilla-ca/cacert.pem"
return str(mozilla_path)


Expand Down
2 changes: 1 addition & 1 deletion src/timelord/timelord.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@
RewardChainSubSlot,
SubSlotProofs,
)
from src.util.genesis_wait import wait_for_genesis_challenge
from src.types.blockchain_format.sub_epoch_summary import SubEpochSummary
from src.types.blockchain_format.vdf import VDFInfo, VDFProof
from src.types.end_of_slot_bundle import EndOfSubSlotBundle
from src.util.genesis_wait import wait_for_genesis_challenge
from src.util.ints import uint8, uint32, uint64

log = logging.getLogger(__name__)
Expand Down
5 changes: 3 additions & 2 deletions src/wallet/puzzles/lowlevel_generator.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
from src.wallet.chialisp import eval, sexp, args, make_if, quote, make_list, rest, cons, sha256tree
from src.types.blockchain_format.program import SerializedProgram, Program
from clvm_tools import binutils

from src.types.blockchain_format.program import Program, SerializedProgram
from src.wallet.chialisp import args, cons, eval, make_if, make_list, quote, rest, sexp, sha256tree


def get_generator():

Expand Down
2 changes: 1 addition & 1 deletion src/wallet/wallet_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
from src.types.header_block import HeaderBlock
from src.types.peer_info import PeerInfo
from src.util.byte_types import hexstr_to_bytes
from src.util.errors import ValidationError, Err
from src.util.errors import Err, ValidationError
from src.util.genesis_wait import wait_for_genesis_challenge
from src.util.ints import uint32, uint128
from src.util.keychain import Keychain
Expand Down
9 changes: 4 additions & 5 deletions tests/blockchain/test_blockchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,22 @@
from src.types.blockchain_format.classgroup import ClassgroupElement
from src.types.blockchain_format.sized_bytes import bytes32
from src.types.blockchain_format.slots import InfusedChallengeChainSubSlot
from src.types.blockchain_format.vdf import VDFInfo, VDFProof
from src.types.end_of_slot_bundle import EndOfSubSlotBundle
from src.types.full_block import FullBlock
from src.types.unfinished_block import UnfinishedBlock
from src.types.blockchain_format.vdf import VDFInfo, VDFProof
from src.util.block_tools import get_vdf_info_and_proof, BlockTools
from src.util.block_tools import BlockTools, get_vdf_info_and_proof
from src.util.errors import Err
from src.util.hash import std_hash
from src.util.ints import uint8, uint64
from src.util.recursive_replace import recursive_replace
from tests.core.fixtures import empty_blockchain, create_blockchain # noqa: F401
from tests.core.fixtures import default_1000_blocks # noqa: F401
from src.util.wallet_tools import WalletTool
from tests.core.fixtures import default_400_blocks # noqa: F401
from tests.core.fixtures import default_400_blocks # noqa: F401; noqa: F401
from tests.core.fixtures import default_1000_blocks # noqa: F401
from tests.core.fixtures import default_10000_blocks # noqa: F401
from tests.core.fixtures import default_10000_blocks_compact # noqa: F401
from tests.core.fixtures import empty_blockchain # noqa: F401
from tests.core.fixtures import create_blockchain
from tests.setup_nodes import bt, test_constants

log = logging.getLogger(__name__)
Expand Down
5 changes: 2 additions & 3 deletions tests/clvm/test_chialisp_deserialization.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
from unittest import TestCase

from src.wallet.puzzles.load_clvm import load_clvm
from src.util.byte_types import hexstr_to_bytes
from src.types.blockchain_format.program import Program

from src.util.byte_types import hexstr_to_bytes
from src.wallet.puzzles.load_clvm import load_clvm

DESERIALIZE_MOD = load_clvm("chialisp_deserialisation.clvm", package_or_requirement="src.wallet.puzzles")

Expand Down
4 changes: 2 additions & 2 deletions tests/core/daemon/test_daemon_alerts.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
from src.util.ints import uint16
from src.util.validate_alert import create_alert_file, create_not_ready_alert_file
from tests.core.full_node.test_full_sync import node_height_at_least
from tests.setup_nodes import setup_daemon, self_hostname, setup_full_system
from tests.setup_nodes import self_hostname, setup_daemon, setup_full_system
from tests.simulation.test_simulation import test_constants_modified
from tests.util.alert_server import AlertServer
from tests.time_out_assert import time_out_assert, time_out_assert_custom_interval
from tests.util.alert_server import AlertServer

no_genesis = dataclasses.replace(test_constants_modified, GENESIS_CHALLENGE=None)
b_tools = BlockTools(constants=no_genesis)
Expand Down
7 changes: 3 additions & 4 deletions tests/core/fixtures.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
import pickle
from os import path
from pathlib import Path
from typing import List

import aiosqlite
import pytest
from typing import List
from pathlib import Path

from src.consensus.constants import ConsensusConstants

from src.consensus.blockchain import Blockchain
from src.consensus.constants import ConsensusConstants
from src.full_node.block_store import BlockStore
from src.full_node.coin_store import CoinStore
from src.types.full_block import FullBlock
Expand Down
2 changes: 1 addition & 1 deletion tests/core/full_node/test_full_node_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from src.util.block_tools import get_signage_point
from src.util.hash import std_hash
from src.util.ints import uint8, uint32, uint64, uint128
from tests.core.fixtures import empty_blockchain, default_1000_blocks # noqa: F401
from tests.core.fixtures import default_1000_blocks, empty_blockchain # noqa: F401
from tests.setup_nodes import bt, test_constants

log = logging.getLogger(__name__)
Expand Down
1 change: 1 addition & 0 deletions tests/core/server/test_rate_limits.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import asyncio

import pytest

from src.protocols.protocol_message_types import ProtocolMessageTypes
Expand Down
2 changes: 1 addition & 1 deletion tests/core/test_farmer_harvester_rpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from src.util.bech32m import decode_puzzle_hash, encode_puzzle_hash
from src.util.block_tools import get_plot_dir
from src.util.hash import std_hash
from src.util.ints import uint8, uint16, uint64, uint32
from src.util.ints import uint8, uint16, uint32, uint64
from src.wallet.derive_keys import master_sk_to_wallet_sk
from tests.setup_nodes import bt, self_hostname, setup_farmer_harvester, test_constants
from tests.time_out_assert import time_out_assert
Expand Down

0 comments on commit 4697e39

Please sign in to comment.