correct subset check + block verification optimization

This commit is contained in:
AF 2022-07-25 17:09:46 +03:00
parent 30284c8f72
commit 96f200bbd0
3 changed files with 3 additions and 15 deletions

2
faq.md
View File

@ -1,6 +1,6 @@
### Why is `Coroutine[Any, Any, T]` used instead of `Awaitable[T]`?
* Typing issues (PyCharm)
* Explicit expression of whether some sort of action is performed or not (tasks vs futures vs coros)
* Explicit expression of whether some sort of action is performed or not (futures vs coros)
### Why is `subset-verify-optimized` branch closed?
* Performance gain at large set sizes are 0% or less.

View File

@ -123,6 +123,7 @@ class SubCheck(
if case.tree == self.split.tree:
return SubTree()
else:
assert case.split.key == self.key
return Found()
async def on_left(self, case: PBS) -> CheckResult:

View File

@ -150,20 +150,7 @@ class FlowBlockIndexedVerification(
return True
async def _verify_previous(self, previous: HashPoint[FBL], block: FBL) -> bool:
async def verify_previous_contained() -> bool:
assert_true(await self.index.contains(previous))
return True
async def verify_previous_block() -> bool:
assert_true(await self._verify_previous_block(await previous.resolve(), block))
return True
assert_trues(
await gather(
verify_previous_block(),
verify_previous_contained(),
)
)
assert_true(await self._verify_previous_block(await previous.resolve(), block))
return True
async def _verify(self, block: FBL) -> bool: