pyquarkchain
pyquarkchain copied to clipboard
ShardState.__validate_tx should not depend on shard state non-constant variable
https://github.com/QuarkChain/pyquarkchain/blob/7fb8b7cbeeb40dbef13ac29fc1c0eb40885a9ada/quarkchain/cluster/shard_state.py#L436-L448
As referenced by the above code, __validate_tx() uses root_tip to determine whether the neighbor exists or not, which is wrong for run_block() case, where the root block observed by the minor block may have much lower height than root_tip
@jyouyj can you help look into this?
If we want to dynamically add a new shard chain, I think the function __validate_tx() will depend on the height of root_tip. Besides, root_tip observed by minor block is updated timely. When will it have a much lower height than root_tip?