Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge standalone wallet into main #9793

Merged
merged 59 commits into from
Jan 13, 2022
Merged
Show file tree
Hide file tree
Changes from 58 commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
dd0dfac
wallet changes from pac
Yostra Dec 9, 2021
7cab7aa
cat changes
Yostra Dec 9, 2021
6531f38
pool tests
Yostra Dec 14, 2021
211dd1e
pooling tests passing
Yostra Dec 20, 2021
5fef6e3
offers
Yostra Dec 20, 2021
f066a5a
lint
Yostra Dec 20, 2021
e283e71
mempool_mode
Yostra Dec 20, 2021
f001c6d
black
Yostra Dec 20, 2021
f9dfe33
linting
Yostra Dec 20, 2021
04e5fcb
workflow files
Yostra Dec 20, 2021
722190a
flake8
Yostra Dec 20, 2021
c67ccbe
more cleanup
Yostra Dec 20, 2021
63a6f39
renamed
Yostra Dec 20, 2021
25bd129
remove obsolete test, don't cast announcement
Yostra Dec 21, 2021
4184f97
memos are not only bytes32
Yostra Dec 21, 2021
4b39222
trade renames
Yostra Dec 21, 2021
73889a8
fix rpcs, block_record
Yostra Dec 21, 2021
f937720
wallet rpc, recompile settlement clvm
Yostra Dec 21, 2021
86d9bee
key derivation
Yostra Dec 21, 2021
d5d8a87
clvm tests
Yostra Dec 21, 2021
89b1b6e
lgtm issues and wallet peers
Yostra Dec 21, 2021
51e7345
stash
Yostra Dec 23, 2021
b42c4b8
rename
Yostra Jan 3, 2022
312e6b0
mypy linting
Yostra Jan 3, 2022
5038ac4
flake8
Yostra Jan 3, 2022
5b0e41b
bad initializer
Yostra Jan 3, 2022
897e945
flaky tests
Yostra Jan 4, 2022
9d62ecc
Make CAT wallets only create on verified hints (#9651)
Quexington Jan 5, 2022
0474bcc
fix clvm tests
Yostra Jan 5, 2022
19a6283
return to log lvl warn
Yostra Jan 5, 2022
bf2688e
check puzzle unhardened
Yostra Jan 5, 2022
dc15914
public key, not bytes. api caching change
Yostra Jan 5, 2022
059b073
precommit changes
Yostra Jan 5, 2022
94f5b1a
remove unused import
Yostra Jan 5, 2022
6cc63d7
mypy ci file, tests
Yostra Jan 6, 2022
13916fd
ensure balance before creating a tx
Yostra Jan 6, 2022
078ed15
Remove CAT logic from full node test (#9741)
Quexington Jan 6, 2022
05ada47
Add confirmations and sleeps for wallet (#9742)
Quexington Jan 7, 2022
956df22
use pool executor
Yostra Jan 7, 2022
1eb16ec
rever merge mistakes/cleanup
Yostra Jan 7, 2022
4e52f1b
Fix trade test flakiness (#9751)
Quexington Jan 7, 2022
f12f070
remove precommit
Yostra Jan 7, 2022
b10a303
older version of black
Yostra Jan 7, 2022
a87acad
lint only in super linter
Yostra Jan 7, 2022
3fd09f1
Make announcements in RPC be objects instead of bytes (#9752)
Quexington Jan 7, 2022
423a4be
misc hint'ish cleanup (#9753)
altendky Jan 8, 2022
48b3026
Use main cached_bls.py
Quexington Jan 10, 2022
3cacf5a
Fix bad merge in main_pac (#9774)
Quexington Jan 11, 2022
2288bba
Remove obsolete test
Quexington Jan 11, 2022
4352d02
remove commented out
Yostra Jan 11, 2022
1ec9f7f
remove duplicate payment object
Yostra Jan 11, 2022
0ebdbbb
remove long sync
Yostra Jan 12, 2022
c169c4a
remove unused test, noise
Yostra Jan 12, 2022
9477742
memos type
Yostra Jan 12, 2022
d49edf9
bytes32
Yostra Jan 12, 2022
9e665ce
make it clear it's a single state at a time
Yostra Jan 12, 2022
1b8f180
copy over asset ids from pacr
Yostra Jan 12, 2022
aa8a900
file endl linter
Yostra Jan 12, 2022
11c94d0
Update chia/server/ws_connection.py
Yostra Jan 13, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
#
name: MacOS wallet-cc_wallet Tests
name: MacOS wallet-cat_wallet Tests

on:
push:
Expand All @@ -15,7 +15,7 @@ on:

jobs:
build:
name: MacOS wallet-cc_wallet Tests
name: MacOS wallet-cat_wallet Tests
runs-on: ${{ matrix.os }}
timeout-minutes: 30
strategy:
Expand Down Expand Up @@ -92,10 +92,10 @@ jobs:
sh install-timelord.sh
./vdf_bench square_asm 400000

- name: Test wallet-cc_wallet code with pytest
- name: Test wallet-cat_wallet code with pytest
run: |
. ./activate
./venv/bin/py.test tests/wallet/cc_wallet/test_*.py -s -v --durations 0
./venv/bin/py.test tests/wallet/cat_wallet/test_*.py -s -v --durations 0
#
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
#
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
#
name: Ubuntu wallet-cc_wallet Test
name: Ubuntu wallet-cat_wallet Test

on:
push:
Expand All @@ -15,7 +15,7 @@ on:

jobs:
build:
name: Ubuntu wallet-cc_wallet Test
name: Ubuntu wallet-cat_wallet Test
runs-on: ${{ matrix.os }}
timeout-minutes: 30
strategy:
Expand Down Expand Up @@ -97,10 +97,10 @@ jobs:
sh install-timelord.sh
./vdf_bench square_asm 400000

- name: Test wallet-cc_wallet code with pytest
- name: Test wallet-cat_wallet code with pytest
run: |
. ./activate
./venv/bin/py.test tests/wallet/cc_wallet/test_*.py -s -v --durations 0
./venv/bin/py.test tests/wallet/cat_wallet/test_*.py -s -v --durations 0


#
Expand Down
2 changes: 1 addition & 1 deletion chia/cmds/wallet_funcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ async def delete_unconfirmed_transactions(args: dict, wallet_client: WalletRpcCl


def wallet_coin_unit(typ: WalletType, address_prefix: str) -> Tuple[str, int]:
if typ == WalletType.COLOURED_COIN:
if typ == WalletType.CAT:
return "", units["colouredcoin"]
if typ in [WalletType.STANDARD_WALLET, WalletType.POOLING_WALLET, WalletType.MULTI_SIG, WalletType.RATE_LIMITED]:
return address_prefix, units["chia"]
Expand Down
14 changes: 2 additions & 12 deletions chia/consensus/blockchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -848,22 +848,12 @@ def add_block_record(self, block_record: BlockRecord):
self.__heights_in_cache[block_record.height] = set()
self.__heights_in_cache[block_record.height].add(block_record.header_hash)

# TODO: address hint error and remove ignore
# error: Argument 1 of "persist_sub_epoch_challenge_segments" is incompatible with supertype
# "BlockchainInterface"; supertype defines the argument type as "uint32" [override]
# note: This violates the Liskov substitution principle
# note: See https://mypy.readthedocs.io/en/stable/common_issues.html#incompatible-overrides
async def persist_sub_epoch_challenge_segments( # type: ignore[override]
async def persist_sub_epoch_challenge_segments(
self, ses_block_hash: bytes32, segments: List[SubEpochChallengeSegment]
):
return await self.block_store.persist_sub_epoch_challenge_segments(ses_block_hash, segments)

# TODO: address hint error and remove ignore
# error: Argument 1 of "get_sub_epoch_challenge_segments" is incompatible with supertype
# "BlockchainInterface"; supertype defines the argument type as "uint32" [override]
# note: This violates the Liskov substitution principle
# note: See https://mypy.readthedocs.io/en/stable/common_issues.html#incompatible-overrides
async def get_sub_epoch_challenge_segments( # type: ignore[override]
async def get_sub_epoch_challenge_segments(
self,
ses_block_hash: bytes32,
) -> Optional[List[SubEpochChallengeSegment]]:
Expand Down
4 changes: 2 additions & 2 deletions chia/consensus/blockchain_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,13 @@ def try_block_record(self, header_hash: bytes32) -> Optional[BlockRecord]:
return None

async def persist_sub_epoch_challenge_segments(
self, sub_epoch_summary_height: uint32, segments: List[SubEpochChallengeSegment]
self, sub_epoch_summary_height: bytes32, segments: List[SubEpochChallengeSegment]
):
pass

async def get_sub_epoch_challenge_segments(
self,
sub_epoch_summary_height: uint32,
sub_epoch_summary_hash: bytes32,
) -> Optional[List[SubEpochChallengeSegment]]:
pass

Expand Down
8 changes: 5 additions & 3 deletions chia/consensus/full_block_to_block_record.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ def block_to_block_record(
required_iters: uint64,
full_block: Optional[Union[FullBlock, HeaderBlock]],
header_block: Optional[HeaderBlock],
sub_slot_iters: Optional[uint64] = None,
) -> BlockRecord:

if full_block is None:
Expand All @@ -32,9 +33,10 @@ def block_to_block_record(
prev_b = blocks.try_block_record(block.prev_header_hash)
if block.height > 0:
assert prev_b is not None
sub_slot_iters, _ = get_next_sub_slot_iters_and_difficulty(
constants, len(block.finished_sub_slots) > 0, prev_b, blocks
)
if sub_slot_iters is None:
sub_slot_iters, _ = get_next_sub_slot_iters_and_difficulty(
constants, len(block.finished_sub_slots) > 0, prev_b, blocks
)
overflow = is_overflow_block(constants, block.reward_chain_block.signage_point_index)
deficit = calculate_deficit(
constants,
Expand Down
9 changes: 4 additions & 5 deletions chia/full_node/mempool_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,8 @@ def validate_clvm_and_signature(
return Err(result.error), b"", {}

pks: List[G1Element] = []
msgs: List[bytes32] = []
# TODO: address hint error and remove ignore
# error: Incompatible types in assignment (expression has type "List[bytes]", variable has type
# "List[bytes32]") [assignment]
pks, msgs = pkm_pairs(result.npc_list, additional_data) # type: ignore[assignment]
msgs: List[bytes] = []
pks, msgs = pkm_pairs(result.npc_list, additional_data)

# Verify aggregated signature
cache: LRUCache = LRUCache(10000)
Expand Down Expand Up @@ -249,6 +246,7 @@ async def pre_validate_spendbundle(
start_time = time.time()
if new_spend_bytes is None:
new_spend_bytes = bytes(new_spend)

err, cached_result_bytes, new_cache_entries = await asyncio.get_running_loop().run_in_executor(
self.pool,
validate_clvm_and_signature,
Expand All @@ -257,6 +255,7 @@ async def pre_validate_spendbundle(
self.constants.COST_PER_BYTE,
self.constants.AGG_SIG_ME_ADDITIONAL_DATA,
)

if err is not None:
raise ValidationError(err)
for cache_entry_key, cached_entry_value in new_cache_entries.items():
Expand Down
Loading