Skip to content
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

Alphanet-v5 #85

Closed
wants to merge 46 commits into from
Closed

Alphanet-v5 #85

wants to merge 46 commits into from

Conversation

Sword-Smith
Copy link
Member

No description provided.

Update these upstreams and port all TASM contained in this repo to Triton-VM
v0.36 instruction set, and all TVM interaction to that defined in `tasm-lib`/
Triton-VM.
This handles the change from rusty-leveldb to rs-leveldb that was made
in twenty-first and also in this repository.

This is the 2nd commit in the porting to latest version of
twenty-first, triton-vm.
Clock cycle count for removal record integrity program drops 44 %,
from ~52k to ~29k.
@Sword-Smith Sword-Smith marked this pull request as draft January 10, 2024 11:42
@dan-da
Copy link
Collaborator

dan-da commented Jan 11, 2024

Seems we are duplicating some work here. I spent all day yesterday rebasing this branch to master, but I fear a lot of conflicts with this PR.

I've been maintaining and updating the branch since I started doing twenty-first storage changes, and it has a lot of changes and refactors. Quite probably the best thing is to go ahead with this PR for alphanet-v5, and then I can rebase again, deal with conflicts (perhaps just squash everything) and test properly without a looming deadline.

Speed up the check that verifies that the wallet-DB contains the
required membership proofs by fetching all monitored UTXOs in a
batch-fetch instead of accessing the DB from inside a loop.

Cf. #80.
Turn up peer tolerance to reduce chance of peers being needlessly
banned.
Messages up to 2GB are now allowed, which should correspond to 50
full blocks if each block is 20MB.

Also give peers more time to respond to a batch-block request.

Since max message size is now 2GB, we should give the peers more
time to send this huge amount of information. They now have 400
seconds, which is still high, at 5MB/s.
Avoid unnecessary qualifiers as `get`.
Ensure that names of commands match with those of the endpoints. Also
match ordering. It is still such that the RPC server has endpoints that
the CLI does nto include. That's OK since some of the RPC server
endpoints are only intended for the dashboard.

Also adds a CLI endpoint for returning the node's instance-ID.

Cf. #80.
Also add instructions on how to get tab-completions for Neptune Core's CLI.
…State

As these functions only touch networking state, they belong in there.
Also move two networking-related methods from global state to networking state,
as they only refer to the networking-part of the state.

Cf. #80.
This is done because the database has produced flaky tets when many tests
open/close/create databases in parallel.
…tored_utxos_with_lock`

This should make the function run faster, but we still have dead-lock-related problems,
so we should inspect this method's call to `monitored_utxo.was_abandoned`, as there's
a lot of locking that takes place in there.
Due to performance issues related to `prune_abandoned_monitored_utxos`, we
want as little work done inside its busy-loop as possible. So the function
gets a header as input instead of having to read it from archival state
itself.
MUTXOs that are already marked as abandoned should not be re-checked
in the MUTXO-pruning/abandoned-marker method.
Not relevant anymore after the upgrade to twenty-first 0.36.
Avoid accessing the database from inside a for-loop; fetch all monitored
UTXOs from database, then loop over them.
The function to read balance only needs the digest of the tip, not the
entire tip block.
nolga is short for Neptune 0xfoi lattice generation address.
There's still room for improvement here, but this removes *most* of the
MUTXO fetching from inside loops.
Sword-Smith and others added 15 commits January 11, 2024 12:14
Now also prints the block height at which the MUTXO was confirmed such
that the user can see when they can prune stale UTXOs from their wallet.
The default is to allow pruning after 200 blocks.
 - make rustup non-interactive
 - rename heading to "installing"
 - indicate where root is necessary
put sudo in front
put sudo in front
wait a few minutes, more than 2
Specifically:
 - Map `WalletSecret` to and from `Vec<String>` which is 18 BIP-39
   seed phrase words. Test conversion.
 - Zeroize `WalletSecret` on Drop.
 - Migrate `gen_wallet` to `neptune-cli generate-wallet`.
 - Add `neptune-cli import-seed-phrase` and
   `neptune-cli export-seed-phrase`.
 - Harmonize methods of creating new `WalletSecret` with random seed;
   now use `new_random()`.
 - Field `secret_seed` now has type `SecretKeyMaterial` which is a
   wrapper around `XFieldElement`.
 - Rename `create_wallet_seed_file` to `save_to_disk`.
Co-authored-by: Thorkil Værge <thor@neptune.cash>
Co-authored-by: Thorkil Værge <thor@neptune.cash>
Co-authored-by: Thorkil Værge <thor@neptune.cash>
Previously the server would crash if the user requested to send a larger
amount than their balance allowed. Now it logs an error and returns
`None`.

Also: Add two RPC server tests, and fix a bug in the global state
generation used for unit tests.
This should lead to a 3x+ speedup in initial syncing, as most time is
simply spent between these requests.
Alphanet-v5

- Updated upstream triton-vm to 0.36, which has new instruction set
- Updated upstream twenty-first to 0.36 which has a new storage schema using
  rs-leveldb instead of rusty-leveldb. This uses the C++ implementation
  of leveldb instead of the ported Rust one. The C++ implementation is thread
  safe and the Rust version is not.
  See: Neptune-Crypto/twenty-first@cf0a204
  for more information about the new database.
- Default to mine throttling to prevent unintentional difficulty spikes:
  246b813
- Update tarpc dependency
- Add more log output to startup process to show why startup is slow
- Fix slow wallet-related methods by batch fetching/storing entries in
  database.
- Presumably fix deadlock issue by batch fetching/setting entries in DB.
- Add support for tokio-console: f1c75fe
- Add Linux script to restart alphanet blockchain data
- Add support for seed phrases (BIP-39): c241ff9
- Speedup initial block syncing by reducing sync interval from 10s to 3s.

Anyone running the integration tests should run `make reset` before running them
again, as the old database data is invalid for this version.

Since this changes programs, this version is a hardfork and not backwards-
compatible with any previous version of neptune-core.
aszepieniec and others added 3 commits January 11, 2024 12:36
This closes #87.

Co-authored-by: Thorkil Værge <thor@neptune.cash>
Co-authored-by: Thorkil Værge <thor@neptune.cash>
@Sword-Smith
Copy link
Member Author

Merged through CLI

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants