Legacy Chain Check #2308
Labels
A-rust
Area: Updates to Rust code
C-enhancement
Category: This is an improvement
NU-5
Network Upgrade: NU5 specific tasks
Milestone
Solution
Check Finalized Transaction network_upgrade field
V5 transactions have a
network_upgrade
field. If Zebra has followed a legacy chain, thenetwork_upgrade
field will be different to the calculatednetwork_upgrade
for that height.In
StateService::new
, immediately after the new state is created:new_service.any_ancestor_blocks(new_service.best_tip().1)
best_tip()
isNone
, skip the legacy chain checkNU5
activation height, or there is no NU5 activation height, returnOk(())
Block.check_transaction_network_upgrade
(Move the Transaction network upgrade check to zebra-chain #2343) returns an error, return an errornetwork_upgrade
, andBlock.check_transaction_network_upgrade
returns success, returnOk(())
Panic and Log User Action
If the finalized tip doesn't pass validation:
Testing
Unit Tests
Test that the legacy chain function works:
If the block height is less than the
NU5
activation height, or there is no NU5 activation height, returnOk(())
zebra/zebra-chain/src/transaction/tests/vectors.rs
Lines 235 to 242 in 2291abc
If you've checked 100 blocks, return an error:
If
Block.check_transaction_network_upgrade
returns an error, return that error:network_upgrade
fields, use the transaction version override from Add property test strategies for V5 transactions #2347If there is at least one transaction with a
network_upgrade
, andBlock.check_transaction_network_upgrade
returns success, returnOk(())
network_upgrade
fields, use the transaction version override and valid network upgrade overrides from Add property test strategies for V5 transactions #2347Success Cached State Test
Check that the legacy chain check passes in the existing cached state tests:
This is part of a split of #1820
The text was updated successfully, but these errors were encountered: