-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cli updates to release #432
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wait for this to merge #423
We also need to update the private-docs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can bring #423 it's squash merged
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK a743f65
* feat(strata-cli)!: add hash version and optional password * feat(strata-cli): warn user about password strength
… refresh -> recover, config file + more (#382) * feat: manual signet fee rates + full scan command * fix: use `u64` for feerates + rename refresh to recover * fix: disable faucet L2 functionality * feat: add network + bridge pubkey settings & use config file from env var * chore: remove all strata logic from faucet * feat: add config command to show config file path * fix: featuregate strata faucet code * chore: rename `l2_http_endpoint` to `strata_endpoint` * fix: patch featuregated to use `strata_endpoint` * fix: remove password requirement from reset cmd * chore: update bridge pubkey * fix: drain command * fix: "bridge-in" and "bridge-out" to "deposit" and "withdraw" * chore: update withdraw cmd * chore: updating comments.+ logs * chore: comments * chore: update bridge strata address * chore: hide endpoints * fix: printing config file location with no config * fix: various fixes, recovery descriptor autocleanup * fix: remove `seed_encryption_key` caching for `Password` * feat: zeroize password * chore: derive `Eq` as well as `PartialEq` on `NetworkType` Co-authored-by: Jose Storopoli <jose@storopoli.io> * fix(cli): feerate logic revamp * chore(cli): fix clippy --------- Co-authored-by: Jose Storopoli <jose@storopoli.io>
…423) * feat: bitcoind wallet syncing * feat: feerate + broadcast via `SyncBackend` * feat:(cli) `SignetBackend` * feat:(cli) `spawn_bitcoin_core` wrapper * feat:(cli) trait based `SignetBackend` * refactor:(cli) update `SignetBackend` to not use `&mut Wallet` * doc: fix doclink --------- Co-authored-by: Jose Storopoli <jose@storopoli.io>
a743f65
to
5b5b49b
Compare
* ci: update to bitcoin 28.0 * fix(btcio): non-breaking changes in GetBlockChainInfo Shouldn't be a breaking change for us, since we are not using any of the changed stuff. See: https://github.com/bitcoin/bitcoin/blob/master/doc/release-notes/release-notes-28.0.md#updated-rpcs
It does not make sense to have this dep since we're already half-baking our own custom types on top of it and using only a tiny minority of the types as being the ones provided by bitcoind_json_rpc_types.
Done in #437 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Panics should only be used when they'd be triggered as of an actual bug in our code, an assumption being violated. Not something that can be caused by some normal user error. See ticket.
l1w.sync(&esplora).await.unwrap(); | ||
let mut l1w = | ||
SignetWallet::new(&seed, settings.network, settings.signet_backend.clone()).unwrap(); | ||
l1w.sync().await.unwrap(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix this .unwrap()
.
let l2w = StrataWallet::new(&seed, &settings.strata_endpoint).unwrap(); | ||
let _ = term.write_line("Getting balance..."); | ||
let balance = l2w.get_balance(l2w.default_signer_address()).await.unwrap(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix these .unwrap()
s.
let requested_strata_address = | ||
strata_address.map(|a| StrataAddress::from_str(&a).expect("bad strata address")); | ||
let mut l1w = | ||
SignetWallet::new(&seed, settings.network, settings.signet_backend.clone()).unwrap(); | ||
let l2w = StrataWallet::new(&seed, &settings.strata_endpoint).unwrap(); | ||
|
||
l1w.sync(&esplora).await.unwrap(); | ||
l1w.sync().await.unwrap(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix these unwrap
s/expect
s.
.expect("valid descriptor"); | ||
|
||
let mut temp_wallet = Wallet::create_single(desc.clone()) | ||
.network(NETWORK) | ||
.network(settings.network) | ||
.create_wallet_no_persist() | ||
.expect("valid wallet"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably should fix these expect
s.
.signet_backend | ||
.broadcast_tx(&tx) | ||
.await | ||
.expect("successful broadcast"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix this expect
.
|
||
handle | ||
.await | ||
.expect("thread to be fine") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix this expect
.
|
||
handle | ||
.await | ||
.expect("thread to be fine") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix this expect
.
WalletUpdate::SpkSync(update) => { | ||
wallet.apply_update(update).expect("update to connect") | ||
} | ||
WalletUpdate::SpkScan(update) => { | ||
wallet.apply_update(update).expect("update to connect") | ||
} | ||
WalletUpdate::NewBlock(ev) => { | ||
let height = ev.block_height(); | ||
let connected_to = ev.connected_to(); | ||
wallet | ||
.apply_block_connected_to(&ev.block, height, connected_to) | ||
.expect("block to be added") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix these expect
s.
#[derive(Debug)] | ||
pub struct InvalidFee; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should split error types out into their own module, ideally.
/// Wrapper around the built-in rusqlite db that allows | ||
/// [`PersistedWallet`](crate::signet::PersistedWallet) to be shared across multiple threads by | ||
/// lazily initializing per core connections to the sqlite db and keeping them in local thread | ||
/// storage instead of sharing the connection across cores. | ||
/// | ||
/// WARNING: [`set_data_dir`] **MUST** be called and set before using [`Persister`]. | ||
#[derive(Debug)] | ||
pub struct Persister; | ||
|
||
static DATA_DIR: OnceLock<PathBuf> = OnceLock::new(); | ||
|
||
/// Sets the data directory static for the thread local DB. | ||
/// | ||
/// Must be called before accessing [`Persister`]. | ||
/// | ||
/// Can only be set once - will return whether value was set. | ||
pub fn set_data_dir(data_dir: PathBuf) -> bool { | ||
DATA_DIR.set(data_dir).is_ok() | ||
} | ||
|
||
thread_local! { | ||
static DB: Rc<RefCell<Connection>> = RefCell::new(Connection::open(SignetWallet::db_path("default", DATA_DIR.get().expect("data dir to be set"))).unwrap()).into(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This data should be passed around as struct fields along with the data associated with it, not in globals/tls.
Description
Cherrypick cli related changes from main to release
Type of Change
Checklist
Related Issues