Repository navigation
Conversation
When the stored masterchain block is already at or past the liteserver's last block (liteservers lag behind each other), the proof contains no forward link, so client.last_key_block stayed None and the next proof failed with AttributeError on None (yungwine#33). Use the trusted key block chosen by sync.
…onsensus) Mainnet masterchain proofs now carry liteServer.signatureSet.simplex. Pass the whole set to pytoniq_core's check_block_signature_set, which builds the signed message for either kind; with an older pytoniq-core the previous catchain-only check is used.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #33 and makes
trust_level=0work on current mainnet together with the pytoniq-core change linked below.sync()leftlast_key_blockunset (#33). When the stored masterchain block is already at or past the liteserver's last block (liteservers lag behind each other), the proof has no forward link, soclient.last_key_blockstayedNoneand the next proof failed withAttributeErroronNone.sync()now sets it to the trusted key block it chose. Test:tests/test_sync.py(offline; fails onmaster, passes here).Simplex consensus signatures. Masterchain proofs now carry
liteServer.signatureSet.simplex;raw_get_mc_block_proofpasses the whole set to pytoniq-core's newcheck_block_signature_set, which builds the right signed message. With an older pytoniq-core it falls back to the previous catchain-only check, so this change is safe on its own.Live: with both changes,
LiteClient.from_mainnet_config(trust_level=0)connected on mainnet three times in a row, the second and third from the stored blocks.tests/test_sync.pyandtests/test_wallet.pypass offline;flake8(CI selection) clean.Requires (for Simplex): yungwine/pytoniq-core#35