Conversation
77e2d88 to
8ea292f
Compare
src/wallet/params.rs
Outdated
| /// Set the [`Wallet`]'s birthday, as a [`BlockId`]. | ||
| /// | ||
| /// The birthday can be used to limit how far back a chain oracle is queried, | ||
| /// saving up time and data bandwidth in full-scans. | ||
| pub fn birthday(mut self, birthday: BlockId) -> Self { | ||
| self.birthday = Some(birthday); | ||
| self | ||
| } | ||
|
|
There was a problem hiding this comment.
I wonder if this should be public. It gives the user the freedom to set whatever value he wants, even if they're incorrect. @ValuedMammal or @evanlinjin can you shed some light on what would happen if I create a CheckPoint with a height+hash pair that doesn't exist on the chain, and then synched from genesis?
There was a problem hiding this comment.
Good question and probably requires testing before going ahead with this feature. The hope is that the bad block will be "reorged out" of the wallet, but that'll depend on which block IDs the chain source decides to return.
There was a problem hiding this comment.
I think the best approach would be to not allow manually setting the birthday, and instead rely on the result of a full-scan to define it.
|
I was more in favor of the approach in #348 which provided an option on |
Indeed, this would be a better flow, but may conflict with a possibly inexistent |
Some thoughts:
The only fear is if the chain source has never even seen the no-longer-existing-block - in which case, the chain source starts syncing from genesis (as that would be the closest checkpoint that connects). So if the user creates a wallet just before a reorg, that would be non-ideal. My suggestion:
Then we provide docs as how to convey the wallet's birthday to the chain source using the checkpoint tip. |
c45fd79 to
3189d91
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #368 +/- ##
==========================================
- Coverage 86.99% 86.98% -0.02%
==========================================
Files 25 25
Lines 8860 8973 +113
==========================================
+ Hits 7708 7805 +97
- Misses 1152 1168 +16
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
3189d91 to
41e5b65
Compare
Closes #110.
TBD