correct subset check + block verification optimization
This commit is contained in:
parent
30284c8f72
commit
96f200bbd0
2
faq.md
2
faq.md
@ -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.
|
||||
|
@ -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:
|
||||
|
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user