Repository navigation
Explicitly fail build when we cannot decode persisted AddressPool. - #1238
randomlogin wants to merge 1 commit into
Conversation
|
I've assigned @tnull as a reviewer! |
Camillarhi
left a comment
There was a problem hiding this comment.
Thanks for this. I left a few comments
Nit: the commit message says "losing handed addresses", but the addresses lost are pooled ones that were never handed out. Something like "skipping pooled derivation indices" would be more accurate. Also a double space in "decode persisted".
| /// | ||
| /// Fails if the record exists but cannot be decoded: an established wallet would otherwise | ||
| /// start with an empty pool and reveal fresh indices past the old pooled ones, leaving them | ||
| /// revealed but never handed out, which widens the gap a restore from seed must scan across. |
There was a problem hiding this comment.
This now contradicts the doc on AddressPoolRecord, which still describes the record as "advisory and reconstructible". Could we update that doc too?
|
|
||
| #[tokio::test] | ||
| async fn loading_survives_an_undecodable_pool_record() { | ||
| async fn loading_fails_on_an_undecodable_pool_record() { |
There was a problem hiding this comment.
#1212 asks for a test of both a corrupt record and a deleted record against a wallet that already has persisted reveals. This covers the corrupt case. Could we add one for the deleted case too, asserting the current NotFound behaviour?
Previously we continued the build after failing to decode the persisted `AddressPool`, which skipped the pooled derivation indices: they stayed revealed but were never handed out. Now we explicitly fail the build in that case. A missing record still starts a fresh pool, as for wallets that predate the pool.
ea4b91e to
0f9a345
Compare
|
Amended the commit. |
Fixes #1212.
As with other storage readings, we fail the build if we cannot read it (despite the fact that failing to read
AddressPoolis less severe than other failed readings).NotFoundstays a fresh pool: every node upgrading from v0.7.x has no record yet, and revealing fresh indices is correct for them.