diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 5c089c4b..696d6690 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -46,7 +46,7 @@ jobs: ################################ - name: Lint Code Base # uses: github/super-linter@v3.10.0 - uses: docker://github/super-linter:v3.10.0 + uses: docker://github/super-linter:v3.10.1 env: VALIDATE_ALL_CODEBASE: true DEFAULT_BRANCH: master diff --git a/src/consensus/constants.py b/src/consensus/constants.py index 3cc8f450..80cb21ab 100644 --- a/src/consensus/constants.py +++ b/src/consensus/constants.py @@ -91,7 +91,7 @@ testnet_kwargs = { "PROPAGATION_DELAY_THRESHOLD": 1500, # Hardcoded genesis block, generated using tests/block_tools.py # Replace this any time the constants change. - "GENESIS_BLOCK": b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x81\x8f\x0c\xec\x97\x85V`C\xfc\xe4\xf9A\xb6\xa1\xa8-@\x82`\r[v\x8f,\x86\xf1X\xc2?\xf6q\xf8\xfb\x8e\rnZ\xbaw\x11CN\xb1\xa9\xf9\xbb0\x93\x10\x8fc\xc3f&\x9b\x07>H\xf1\xa5\x841\xc8\xd9\xcaO\xd4\xb8\x93\x11\xa3\xd9\xfa\xb2U\x10\xcd\xec\x92*AA\xd9\xfd7\xcc\xf7]\xaf\x91V\xe3\x10\x1aa\x17\x00\x00\x00\xb8`\xbfL[I\x16\xd5\x01>\tw>S\xf0#8\xed\xc6\x88\xc5#=i2\x0c\x8d\xbe\x85\xeb\x8f\xee\x1b\x06a\x99\x1c\xba\xfa\xcba\xe6\x04Q\xf4\xc7\xe92RrU l\x01\xee 7)\xff\xa5\xa68\xb5\x10\xbbrQb\xb0\x01\'K\xf1\x07).Z.\')\xee`b\xab\x01\xa9\x82S\x91\x16\x9c\x96\x95\xaf\xe5\xe5\xca\xb7@\x03\xf4$\x87\xe6N\xd3\xfb\xd39Y4D\x91\xed\x14\xda4\xa8\xbfO@\xb4\xd3\x8d\xa9\x9f\xc5\xd4\xf1`o\x9bg\x81\x12\xb0i\xdfJ\xeb*\xd2*`\x95\xf0\xd0j\xa4\x8e\xa6\xcf\xaaHn\xd9\xfe_\xc9\xd9\x85\x8a\xa5\xe8\x1c\x9dk\xc5\xf0\xda\xfe\xd7R\xb5\xbe\x1e\xe0qw\x7f}x\xa7\xa6[\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00P\xa2\xa9\x00cN 4\xf5\xb9]\xefu\t\x1a\x92\x85\xd0,\x8e\xca5\xff7N\xb3N-\x94-\xb4\xa3q[\xfd\xf0\x0b4\x8a/&#v\x19Y\\\xf8\x83o\x1b\x1b\x85\xe18\xbd\xce\xd5\x98\x11r\xaa\xd8\x1d8\xbe[/\x8b\xbb\xa4\xf0\x86\x10\x93\x9b\x05\xd1\x1c$\xfc\xae\xbbI\xa8\x835Qj\xba\x87E\xf8a5t\x81i\xa6Lm\x82\xc5#C!\\f\xc5\x18\x80\x97y\xd5P\xe42\xa0\x15\x8b 6\x19l\x00\x18\xb9-\x85\x15\x9c\xed\xe4\xf2\x83j\x8d^\xca&/\xf6X@P\x8eC,\xaea\x85\x0c\xa66\x16,F\xf8\x07V\xf8\x83\xd3\x18\xd2R\xdf\xf8:\x8f\n\x85\xa6\'\xb5\x8bt%\xf5\xbaz\x03\x01\x1a\xa5\xd6m\x10\xcb\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00_Y\xda\xc6Z\xb0?\x8fN^\x06\\w#Y\xc3n\xb4\x083\x1d\x01\xb4\xd8Y\xbb\xcf\xa9\xd8\t\x8a8N\xe5a\xa2\x0e\x0cM\xe8Kj\xfb99\xd4\x02\xca\xa2\x14\n\xf4\xafB%\xbf\xf8;\x83\xd7\xee&RS\x8e\x0b\xab\xfc\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00P\xa2\xa9\x8c-\x02\x9a\xb0\x08s^m1Z\xf5\x0f\xa7\x1d\x87`|\x92\xeb\x07\xb9\xaa\x90\xc1\xefz\xa2\x10\xf4\xf2\x8d\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00z\x91k\xdcP\xd3\xd03{\t\x98f\x8aOC\x96p3\x94g\xd7\xe9\x03\x9b\x86P\xba{\x1dO\xc1\xa0\x00\x00\x01\xd1\xa9J \x00z\x91k\xdcP\xd3\xd03{\t\x98f\x8aOC\x96p3\x94g\xd7\xe9\x03\x9b\x86P\xba{\x1dO\xc1\xa0\x00\x00\x00\x00\xa8\x81\xb2#\xdf\'\xe1\x14\x94p\xa6\xd2\xa4\xe6\x0c\xf7\xd3\x0b9\xdf3C\xf8\'\x98\xeb\xaf\xe8\xeef\xe5\xa8w\xd2\x94h?\x00\xe1\xb0\xd6\xee\x9a\xcb\xbeNM\x80\x17\xca(?o\xf5J\xa8\x9c\xf1\xb7\xd2\x87/\x9f\xb6\x18\xee\xf2\xf6\xcb*\xbc\xb7D\xb7\xf8\xaf\x9b\x99\xe1Z\xb0\x05\xbe\xdf\x85\x10\x0eS\x98\xd1\x14\x1b\xcf\xfe\xa5\xe0\x00\x00\x00\x00\x00\x00\x00\x00\xa1\x999\xae\xe9\xf1n\xc1\xc1\xc6q<\xe97%_\x1e\x1b\xd0>\xcd\xa8\x94\xd8;\xe4\x9f\xa7\xb1V\xa5Q\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x92.\xa5X;>\x8d\x90!Op[q\x90g\xdc,\xee\x1b!\xb7hI\x06q\xf9mq3\xd7,\xb6\x1f,qf\xa3\xdf \x8ac\xbf\x91p\xb1\xd6\xe0\x87\x0cJ\xa0\xb22z?X\x90\x0e\xa9\x85@\x0b\x90\t\x84\xd1e\xd9f\xb9U\x11\xfa+\xa2\xc8+\xa3\x0e\xdf\xcc\x04\x94\xdaC\x1c\xea\xf6\xd5\x18n\x00\x15\xa5S\x11\x00\x00\x00\x00\x04\x01A\xbap', # noqa: E501 + "GENESIS_BLOCK": b"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x81\x8f\x0c\xec\x97\x85V`C\xfc\xe4\xf9A\xb6\xa1\xa8-@\x82`\r[v\x8f,\x86\xf1X\xc2?\xf6q\xf8\xfb\x8e\rnZ\xbaw\x11CN\xb1\xa9\xf9\xbb0\x93\x10\x8fc\xc3f&\x9b\x07>H\xf1\xa5\x841\xc8\xd9\xcaO\xd4\xb8\x93\x11\xa3\xd9\xfa\xb2U\x10\xcd\xec\x92*AA\xd9\xfd7\xcc\xf7]\xaf\x91V\xe3\x10\x1aa\x17\x00\x00\x00\xb8`\xbfL[I\x16\xd5\x01>\tw>S\xf0#8\xed\xc6\x88\xc5#=i2\x0c\x8d\xbe\x85\xeb\x8f\xee\x1b\x06a\x99\x1c\xba\xfa\xcba\xe6\x04Q\xf4\xc7\xe92RrU l\x01\xee 7)\xff\xa5\xa68\xb5\x10\xbbrQb\xb0\x01'K\xf1\x07).Z.')\xee`b\xab\x01\xa9\x82S\x91\x16\x9c\x96\x95\xaf\xe5\xe5\xca\xb7@\x03\xf4$\x87\xe6N\xd3\xfb\xd39Y4D\x91\xed\x14\xda4\xa8\xbfO@\xb4\xd3\x8d\xa9\x9f\xc5\xd4\xf1`o\x9bg\x81\x12\xb0i\xdfJ\xeb*\xd2*`\x95\xf0\xd0j\xa4\x8e\xa6\xcf\xaaHn\xd9\xfe_\xc9\xd9\x85\x8a\xa5\xe8\x1c\x9dk\xc5\xf0\xda\xfe\xd7R\xb5\xbe\x1e\xe0qw\x7f}x\xa7\xa6[\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00P\xa2\xa9\x00cN 4\xf5\xb9]\xefu\t\x1a\x92\x85\xd0,\x8e\xca5\xff7N\xb3N-\x94-\xb4\xa3q[\xfd\xf0\x0b4\x8a/&#v\x19Y\\\xf8\x83o\x1b\x1b\x85\xe18\xbd\xce\xd5\x98\x11r\xaa\xd8\x1d8\xbe[/\x8b\xbb\xa4\xf0\x86\x10\x93\x9b\x05\xd1\x1c$\xfc\xae\xbbI\xa8\x835Qj\xba\x87E\xf8a5t\x81i\xa6Lm\x82\xc5#C!\\f\xc5\x18\x80\x97y\xd5P\xe42\xa0\x15\x8b 6\x19l\x00\x18\xb9-\x85\x15\x9c\xed\xe4\xf2\x83j\x8d^\xca&/\xf6X@P\x8eC,\xaea\x85\x0c\xa66\x16,F\xf8\x07V\xf8\x83\xd3\x18\xd2R\xdf\xf8:\x8f\n\x85\xa6'\xb5\x8bt%\xf5\xbaz\x03\x01\x1a\xa5\xd6m\x10\xcb\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00_Y\xda\xc6Z\xb0?\x8fN^\x06\\w#Y\xc3n\xb4\x083\x1d\x01\xb4\xd8Y\xbb\xcf\xa9\xd8\t\x8a8N\xe5a\xa2\x0e\x0cM\xe8Kj\xfb99\xd4\x02\xca\xa2\x14\n\xf4\xafB%\xbf\xf8;\x83\xd7\xee&RS\x8e\x0b\xab\xfc\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00P\xa2\xa9\x8c-\x02\x9a\xb0\x08s^m1Z\xf5\x0f\xa7\x1d\x87`|\x92\xeb\x07\xb9\xaa\x90\xc1\xefz\xa2\x10\xf4\xf2\x8d\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00z\x91k\xdcP\xd3\xd03{\t\x98f\x8aOC\x96p3\x94g\xd7\xe9\x03\x9b\x86P\xba{\x1dO\xc1\xa0\x00\x00\x01\xd1\xa9J \x00z\x91k\xdcP\xd3\xd03{\t\x98f\x8aOC\x96p3\x94g\xd7\xe9\x03\x9b\x86P\xba{\x1dO\xc1\xa0\x00\x00\x00\x00\xa8\x81\xb2#\xdf'\xe1\x14\x94p\xa6\xd2\xa4\xe6\x0c\xf7\xd3\x0b9\xdf3C\xf8'\x98\xeb\xaf\xe8\xeef\xe5\xa8w\xd2\x94h?\x00\xe1\xb0\xd6\xee\x9a\xcb\xbeNM\x80\x17\xca(?o\xf5J\xa8\x9c\xf1\xb7\xd2\x87/\x9f\xb6\x18\xee\xf2\xf6\xcb*\xbc\xb7D\xb7\xf8\xaf\x9b\x99\xe1Z\xb0\x05\xbe\xdf\x85\x10\x0eS\x98\xd1\x14\x1b\xcf\xfe\xa5\xe0\x00\x00\x00\x00\x00\x00\x00\x00\xa1\x999\xae\xe9\xf1n\xc1\xc1\xc6q<\xe97%_\x1e\x1b\xd0>\xcd\xa8\x94\xd8;\xe4\x9f\xa7\xb1V\xa5Q\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x92.\xa5X;>\x8d\x90!Op[q\x90g\xdc,\xee\x1b!\xb7hI\x06q\xf9mq3\xd7,\xb6\x1f,qf\xa3\xdf \x8ac\xbf\x91p\xb1\xd6\xe0\x87\x0cJ\xa0\xb22z?X\x90\x0e\xa9\x85@\x0b\x90\t\x84\xd1e\xd9f\xb9U\x11\xfa+\xa2\xc8+\xa3\x0e\xdf\xcc\x04\x94\xdaC\x1c\xea\xf6\xd5\x18n\x00\x15\xa5S\x11\x00\x00\x00\x00\x04\x01A\xbap", # noqa: E501 # Target tx count per sec "TX_PER_SEC": 20, # Size of mempool = 10x the size of block diff --git a/src/full_node/full_node.py b/src/full_node/full_node.py index 74216b12..a1193f28 100644 --- a/src/full_node/full_node.py +++ b/src/full_node/full_node.py @@ -1770,9 +1770,7 @@ class FullNode: return conns = self.global_connections for peer in request.peer_list: - conns.peers.add( - PeerInfo(peer.host, peer.port) - ) + conns.peers.add(PeerInfo(peer.host, peer.port)) # Pseudo-message to close the connection yield OutboundMessage(NodeType.INTRODUCER, Message("", None), Delivery.CLOSE) @@ -1789,9 +1787,7 @@ class FullNode: asyncio.create_task(self.server.start_client(target, self._on_connect)) @api_request - async def respond_peers_full_node( - self, request: full_node_protocol.RespondPeers - ): + async def respond_peers_full_node(self, request: full_node_protocol.RespondPeers): pass @api_request diff --git a/src/server/connection.py b/src/server/connection.py index 3ae962b5..2d4a6d16 100644 --- a/src/server/connection.py +++ b/src/server/connection.py @@ -215,9 +215,7 @@ class Peers: self, max_peers: int = 0, randomize: bool = False, recent_threshold=9999999 ) -> List[TimestampedPeerInfo]: target_peers = [ - TimestampedPeerInfo( - peer.host, uint16(peer.port), uint64(0) - ) + TimestampedPeerInfo(peer.host, uint16(peer.port), uint64(0)) for peer in self._peers if time.time() - self.time_added[peer.get_hash()] < recent_threshold ] diff --git a/src/wallet/cc_wallet/cc_wallet.py b/src/wallet/cc_wallet/cc_wallet.py index 77a2461c..3cfe9a26 100644 --- a/src/wallet/cc_wallet/cc_wallet.py +++ b/src/wallet/cc_wallet/cc_wallet.py @@ -37,7 +37,8 @@ from src.wallet.cc_wallet.cc_utils import ( from src.wallet.puzzles.genesis_by_coin_id_with_0 import ( create_genesis_or_zero_coin_checker, lineage_proof_for_genesis, - genesis_coin_id_for_genesis_coin_checker) + genesis_coin_id_for_genesis_coin_checker, +) from dataclasses import replace diff --git a/src/wallet/puzzles/test_cc.py b/src/wallet/puzzles/test_cc.py index 8d46dbf1..1f725d8f 100644 --- a/src/wallet/puzzles/test_cc.py +++ b/src/wallet/puzzles/test_cc.py @@ -54,7 +54,11 @@ def int_as_bytes32(v: int) -> bytes32: return v.to_bytes(32, byteorder="big") -def generate_farmed_coin(block_index: int, puzzle_hash: bytes32, amount: int,) -> Coin: +def generate_farmed_coin( + block_index: int, + puzzle_hash: bytes32, + amount: int, +) -> Coin: """ Generate a (fake) coin which can be used as a starting point for a chain of coin tests. @@ -162,7 +166,10 @@ def test_spend_through_n(mod_code, coin_checker_for_farmed_coin, n): inner_puzzle_solution = Program.to(output_conditions) spend_bundle = spend_bundle_for_spendable_ccs( - mod_code, genesis_coin_checker, spendable_cc_list, [inner_puzzle_solution], + mod_code, + genesis_coin_checker, + spendable_cc_list, + [inner_puzzle_solution], ) debug_spend_bundle(spend_bundle) @@ -187,7 +194,10 @@ def test_spend_through_n(mod_code, coin_checker_for_farmed_coin, n): ] spend_bundle = spend_bundle_for_spendable_ccs( - mod_code, genesis_coin_checker, spendable_cc_list, inner_solutions, + mod_code, + genesis_coin_checker, + spendable_cc_list, + inner_solutions, ) debug_spend_bundle(spend_bundle) diff --git a/src/wallet/trade_manager.py b/src/wallet/trade_manager.py index b76e4a2b..1a4a319b 100644 --- a/src/wallet/trade_manager.py +++ b/src/wallet/trade_manager.py @@ -16,7 +16,9 @@ from src.util.hash import std_hash from src.util.ints import uint32, uint64 from src.wallet.cc_wallet import cc_utils from src.wallet.cc_wallet.cc_wallet import CCWallet -from src.wallet.puzzles.genesis_by_coin_id_with_0 import genesis_coin_id_for_genesis_coin_checker +from src.wallet.puzzles.genesis_by_coin_id_with_0 import ( + genesis_coin_id_for_genesis_coin_checker, +) from src.wallet.trade_record import TradeRecord from src.wallet.trading.trade_status import TradeStatus from src.wallet.trading.trade_store import TradeStore diff --git a/src/wallet/wallet_node.py b/src/wallet/wallet_node.py index ac3b259e..841e9088 100644 --- a/src/wallet/wallet_node.py +++ b/src/wallet/wallet_node.py @@ -18,9 +18,7 @@ from src.util.merkle_set import ( confirm_not_included_already_hashed, MerkleSet, ) -from src.protocols import ( - introducer_protocol, wallet_protocol, full_node_protocol -) +from src.protocols import introducer_protocol, wallet_protocol, full_node_protocol from src.consensus.constants import ConsensusConstants from src.server.connection import PeerConnections from src.server.server import ChiaServer @@ -341,9 +339,7 @@ class WalletNode: return conns = self.global_connections for peer in request.peer_list: - conns.peers.add( - PeerInfo(peer.host, uint16(peer.port)) - ) + conns.peers.add(PeerInfo(peer.host, uint16(peer.port))) # Pseudo-message to close the connection yield OutboundMessage(NodeType.INTRODUCER, Message("", None), Delivery.CLOSE) @@ -364,9 +360,7 @@ class WalletNode: await asyncio.gather(*tasks) @api_request - async def respond_peers_full_node( - self, request: full_node_protocol.RespondPeers - ): + async def respond_peers_full_node(self, request: full_node_protocol.RespondPeers): pass async def _sync(self):