| Age | Commit message (Collapse) | Author |
|
After converting to SQLite the wizard said "restart to apply" but offered
no way to do it, so a user could close the dialog and keep mining on the
old Berkeley DB wallet without realizing the switch had not taken effect --
and coins mined in the meantime land only in wallet.dat, not the SQLite
wallet they think they are now on.
The post-conversion screen now offers "Restart Now", which relaunches
Bitflash with the same command line and datadir (a short delay lets this
instance release the network port and block-index files first) and asks
this one to exit, so mining resumes on the SQLite wallet. "Later" keeps
the old behaviour. A dimmed line warns that mining before the restart
still credits the old wallet.
wallet.dat is still never touched. The conversion action itself is
unchanged (wallet-convert self-test still green); this is GUI wiring only.
|
|
first-run conversion wizard' (#62) from wallet-sqlite-default into main
|
|
A first-run dialog for an existing wallet.dat with no backend choice yet:
"Convert to SQLite" exports the wallet and records the sqlite marker so
the next start opens it; "Keep Berkeley DB" records that choice so the
offer does not return; "Decide later" leaves no marker and asks again.
wallet.dat is never touched, and the change takes effect on restart --
matching the restart-to-apply model.
The conversion itself is DoConvertWalletToSQLite(), a headless-testable
function the button calls: it reuses the export path (extracted as
ExportActiveWalletToSQLite, shared with -walletsqliteexport, which keeps
its own specific messages), refuses if already on SQLite or if a
wallet.sqlite exists, and writes the marker only after a verified export.
New wallet-convert self-test proves the action end to end: build a
Berkeley DB wallet, convert, and confirm wallet.sqlite + the marker are
written, wallet.dat is left untouched, a second convert refuses, and a
flagless restart opens the converted SQLite wallet with its phrase intact.
All wallet suites pass. The modal itself is thin UI over this tested
action.
|
|
A fresh install with no wallet.dat now starts on the SQLite backend and
creates wallet.sqlite, instead of a Berkeley DB wallet.dat. The choice is
recorded in a plain-text <datadir>/wallet-backend marker so it survives a
restart without a command-line flag.
Backend resolution when no -walletbackend is given: an existing
wallet.sqlite (or a "sqlite" marker) stays on SQLite; an existing
wallet.dat stays on Berkeley DB -- nothing is converted behind the user;
a fresh datadir starts on SQLite. An explicit -walletbackend=bdb or a
"bdb" marker forces Berkeley DB and overrides the default.
Adds CreateNewSQLiteWallet() (WalletSQLiteRuntimeOpen gains fMustExist so
the create path can make a new file) which mints the first default key
straight into the SQLite store via the same FinishLoadedWallet() call the
Berkeley DB create path uses, then cleans up on failure. Marker read/write
helpers are plain text, hand-editable.
New wallet-backend-default self-test proves the resolution in child
processes (fresh->SQLite+marker, existing wallet.dat->BDB, "bdb"
marker->BDB, explicit flag->wallet.dat). The three wallet.dat-specific
suites now ask for -walletbackend=bdb explicitly, since a flagless fresh
datadir is SQLite now. All wallet suites pass.
|
|
atomicity, one-shot commands)' (#61) from wallet-sqlite-encrypt into main
|
|
-walletstorageaudit, -walletstoragecheck and -backupwallet all read
wallet.dat regardless of the selected backend. Under -walletbackend=sqlite
that is wrong, and for backup it is dangerous: it silently backs up the
stale plaintext wallet.dat instead of the live wallet.sqlite.
- ScanWalletRecords() routes to the active SQLite store instead of a
Berkeley DB cursor (it returned an error under the runtime before). This
is the single choke point audit and check scan through.
- WalletSQLiteRuntimeOpenReadOnly() opens wallet.sqlite for scanning
without loading or validating records, so the pre-load diagnostics can
inspect a wallet the loader would refuse. main_gui opens it for
audit/check when the SQLite backend is selected (and rejects an unknown
backend value there too).
- BackupWallet() copies wallet.sqlite (checkpoint, then the temp/old/rename
dance; a checkpointed SQLite file is self-contained, no lsn_reset).
wallet-sqlite-encrypt self-test proves routing on a datadir where the
SQLite wallet is encrypted and wallet.dat beside it is still plaintext:
audit with the flag reports the encrypted seed, without it reports the
plaintext one; the SQLite backup carries no plaintext key and loadchecks
as a standalone wallet.
|
|
The SQLite runtime wrote each record as its own autocommit, so a group
that must land together -- hdmaster and hdchaincode, the two halves of an
HD seed -- could be left half-written by a failure or crash between them,
the incomplete-seed state -walletstoragecheck exists to catch. Berkeley DB
was no worse (it is not transactional here either) but no better.
Add WalletSQLiteRuntimeBeginTxn/CommitTxn/RollbackTxn -- no-ops that
succeed when the SQLite backend is not active, so Berkeley DB keeps its
existing per-write behaviour -- and wrap WriteHDMaster in them so the seed
lands all-or-nothing under SQLite. The one BDB-atomic wallet rewrite, the
encrypt path, is already matched by its own transaction in the SQLite
encrypt branch; every other wallet multi-write is ordering-based on both
backends by design.
wallet-sqlite self-test now proves the bracket: a rolled-back runtime
write leaves no record, a committed one persists, and WriteHDMaster lands
both halves of the seed.
|
|
EncryptWallet() had only a Berkeley DB path: it rebuilt a wallet.dat temp
file and swapped it in. Under -walletbackend=sqlite that was wrong -- it
would leave the live wallet.sqlite unencrypted and write a divergent
wallet.dat instead. Add a SQLite persistence branch that rebuilds a fresh
wallet.sqlite in one transaction (public records copied from the live
store, encrypted key material serialized byte-for-byte the way the BDB
path writes it), checkpoints it, and swaps it in with a .before-encrypt
backup, mirroring the BDB rename dance. A fresh file rather than an
in-place rewrite keeps the change atomic and leaves no plaintext key in a
freed page.
CmdEncryptWallet skips PurgeDbEnvironmentLogs under SQLite (no Berkeley DB
environment behind the wallet) and reports the backend it used.
New wallet-sqlite-encrypt self-test drives the real command path in child
processes: export a wallet to SQLite, encrypt it through
-walletbackend=sqlite, and prove it comes out encrypted, unlockable with
the right passphrase, refusing the wrong one, with its recovery phrase
intact and the original wallet.dat left untouched.
|
|
net-per-ip-connlimit into main
|
|
from wallet-sqlite-activate into main
|
|
Review follow-up. A managed-Tor node receives every inbound onion peer
over its local hidden-service listener, so they all accept as 127.0.0.1.
Capping loopback would cap onion peers as one group and refuse the 33rd
legitimate onion peer -- the wrong limit for a network moving toward
onion-only. Exempt loopback (127.0.0.0/8): the global MAX_CONNECTIONS
still bounds the total, and the direct-IP flood this defends against
never arrives over loopback.
Bench: a 40-connection flood from 127.0.0.1 is now held in full (no
per-IP refusal), while a flood from the machine's LAN address still caps
at exactly 32.
|
|
Review follow-up on the SQLite activation. Two guards, both fail-closed;
neither is a correctness fix -- FinishLoadedWallet already refuses a
missing default key -- but they make the refusal say what happened:
- an empty or non-wallet wallet.sqlite is refused with "no default key
record; it may be empty or not a wallet export", instead of the generic
"no usable default public key" that reads as corruption;
- a misspelled -walletbackend value (e.g. sqlit) is refused instead of
silently falling through to Berkeley DB; -walletbackend=bdb is accepted
as the explicit default.
|
|
A single IP could hold every inbound slot up to MAX_CONNECTIONS -- which
is what a connection-exhaustion flood did to the rendezvous relays, one
address parking hundreds of sockets and starving real peers. Add
MAX_CONNECTIONS_PER_IP (32): the accept path counts existing connections
from the same address and refuses a new one past the cap. The relays'
firewall connlimit does the same a layer lower; this makes every build
carry the defense, including future poll()-based relays with no FD ceiling.
|
|
Adds -walletbackend=sqlite: an opt-in flag that runs the node on
<datadir>/wallet.sqlite instead of wallet.dat. It requires an export to
exist first (no silent migration) and prints a step-by-step guide when
one does not; wallet.dat is never opened or touched, so a plain restart
goes back to Berkeley DB.
- LoadWalletFromSQLiteRuntime opens the export read-write, keeps the
handle open as the active backend, loads records into memory through
the same visitor/reconcile/finish path as the read-only staging load,
and never fabricates a default key.
- Shutdown checkpoints and closes the SQLite backend; a kill before that
loses nothing because WAL + synchronous=FULL already made every
committed write durable.
- Self-test proves runtime writes persist across a close and reopen.
BDB stays the default: nothing activates the SQLite runtime unless the
flag is given. One-shot audit/recovery commands still use Berkeley DB.
|
|
from wallet-sqlite-runtime-write into main
|
|
|
|
wallet-sqlite-typed-load-proof into main
|
|
|
|
wallet-storage-backend-stage into main
|
|
|
|
wallet-sqlite-runtime into main
|
|
|
|
from wallet-sqlite-loadcheck into main
|
|
|
|
wallet-sqlite-cleanup-failures into main
|
|
|
|
from wallet-sqlite-restore into main
|
|
|
|
wallet-sqlite-verify into main
|
|
|
|
wallet-sqlite-scan into main
|
|
|
|
wallet-sqlite-migration into main
|
|
|
|
wallet-sqlite-skeleton into main
|
|
|
|
(#46) from db-recreate-env-after-shutdown into main
|
|
|
|
from tests-guard-wallet-mutation-hook into main
|
|
|
|
tests-wallet-storage-sanity-negative into main
|
|
|
|
wallet-backup-tempfile-install into main
|
|
|
|
records' (#42) from wallet-rewrite-public-record-test into main
|
|
|
|
from wallet-rewrite-record-boundary into main
|
|
|
|
wallet-store-read-abstraction into main
|
|
|
|
(#39) from wallet-storage-sanity-checks into main
|
|
wallet-storage-audit-bdb into main
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
direct onion peers, onion-only mode)
|
|
auto-managed-tor into main
|
|
tor-diagnostics into main
|
|
|
|
|
|
|
|
managed-tor-two-node-smoke into main
|
|
|
|
from windows-managed-tor-package into main
|
|
|
|
|
|
from embedded-tor-manager into main
|
|
|
|
|
|
|
|
|
|
onion-direct-peers into main
|
|
|
|
(#30) from site-docs-polish-v1218 into main
|
|
restore-collapse-hdnext into main
|
|
|
|
|
|
app icon)
|
|
BITFLASH_NODE_BUILD)
|
|
poll-socket-handler into main
|
|
# Conflicts:
# src/makefile.mingw
|
|
tor-mode into main
|
|
socks5-proxy into main
|
|
tool-fixtures into main
|
|
|
|
|
|
tooling-hardening into main
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|