Commit Graph

3783 Commits

Author SHA1 Message Date
parazyd
d42ba0d511 contract: Move POW_REWARD constant to money contract 2024-01-18 19:30:31 +01:00
zero
ce5a92ff21 spec: add money contract with money transfer 2024-01-18 19:30:31 +01:00
zero
9fd2e2e467 make DAO nullifiers the same as money, otherwise we can't detect whether the coins we're using were already spent or not. Having access to a set non-membership merkle tree here would fix this. 2024-01-18 19:30:31 +01:00
Dastan-glitch
77fb9d4321 src/event_graph: aquire locks outside loops 2024-01-18 19:30:31 +01:00
zero
111c803085 spec: DAO::mint() and DAO::propose() 2024-01-18 19:30:31 +01:00
Dastan-glitch
2fe38d699c remove unused import 2024-01-18 19:30:31 +01:00
Dastan-glitch
2074625d1d src/event_graph: request and reply multiple events 2024-01-18 19:30:31 +01:00
aggstam
efe6f39041 darkfid2: use minerd to mine blocks, validator: cleaned up threads info as its not longer required 2024-01-18 19:30:31 +01:00
aggstam
daa625d856 validator:pow: decoulbed mine_block() from PowModule so it can be used outside of it 2024-01-18 19:30:31 +01:00
parazyd
31d0d2f617 validator: Configurable fee verification, incomplete
It's now only used in add_transactions(), but needs to be in other
places as well.
2024-01-18 19:30:31 +01:00
parazyd
2f9a9cc237 contract/money/integration: Gather block reward owncoins 2024-01-18 19:30:31 +01:00
parazyd
9c18ec3446 contract/money: Fix slot generation in integration test 2024-01-18 19:30:31 +01:00
parazyd
ecc5c6ae11 contract/money: WIP complete integration test 2024-01-18 19:30:31 +01:00
parazyd
d24248d026 contract/money: Rename "integration" test to "token_mint" 2024-01-18 19:30:31 +01:00
parazyd
7a6b0a5203 contract/money: Ignore benchmark tests when running test units 2024-01-18 19:30:31 +01:00
zero
62b9cdc04c dao model: add note about blake2 hash function usage 2024-01-18 19:30:31 +01:00
zero
870fd3e246 dao: replace use of blake3 hash with blake2b. See code comments for explanation of the rationale 2024-01-18 19:30:31 +01:00
zero
063a03e892 dao::vote(): correct mistake in nullifier 2024-01-18 19:30:31 +01:00
zero
9a2505c9e1 zk/debug: add Uint32 and MerklePath for export_witness_json() 2024-01-18 19:30:31 +01:00
parazyd
690b747b26 contract/test-harness: Set fixed-difficulty=1 mining 2024-01-18 19:30:31 +01:00
zero
901793bb79 spec2: vote nullifiers and finish dao model page 2024-01-18 19:30:31 +01:00
zero
fd177220e1 spec2: DAO model 2024-01-18 19:30:31 +01:00
aggstam
a318bb3d76 validator: check if proposal already exists when looking ofr its fork index
This also solves the bug where when appending a dublicated proposal, a new duplicate fork being created, resulting in never finalizing, as forks of same height existed
2024-01-18 19:30:31 +01:00
parazyd
b10b078147 runtime: Disable payload debug message on Deploy 2024-01-18 19:30:31 +01:00
parazyd
099e2e72ba contract: Strip built WASM binaries using wasm-strip from the wabt toolkit 2024-01-18 19:30:31 +01:00
parazyd
ed892ea991 contract/deployooor: Update API to use DarkLeaf for contract calls 2024-01-18 19:30:31 +01:00
parazyd
b0ba8b7d3d validator: Deploy the deployooor contract as a native contract 2024-01-18 19:30:31 +01:00
parazyd
80b650e4f5 contract/deployooor: Add initial integration test 2024-01-18 19:30:30 +01:00
parazyd
9d2671d9c7 validator: Move DeployParamsV1 to darkfi-sdk 2024-01-18 19:30:30 +01:00
parazyd
55f72d0956 validator: Implement contract deployment handling upon tx verification 2024-01-18 19:30:30 +01:00
parazyd
cb9f095e9d contract/deployooor: Include deployment instruction payload in params 2024-01-18 19:30:30 +01:00
parazyd
0668ac4606 contract/deployooor: Implement initial client API 2024-01-18 19:30:30 +01:00
parazyd
f2390ec288 runtime: Remove unused sanity_check() function
This is now done inside the deployooor contract.
2024-01-18 19:30:30 +01:00
parazyd
7240e6251f chore: Clippy lints 2024-01-18 19:30:30 +01:00
zero
59a819b9aa remove unmaintained ShareAddress 2024-01-18 19:30:30 +01:00
zero
d30a0f312c dao::vote(): add proposal_bulla to the nullifiers 2024-01-18 19:30:30 +01:00
parazyd
77f3c0d079 net: Port from deprecated async-rustls to futures-rustls.
This is also a protocol-breaking change. We now have a bit looser
certificate verification that does not append the base32-encoded
public key into the altName.
2024-01-18 19:30:30 +01:00
parazyd
857ebb42bf chore: Update crate dependencies 2024-01-18 19:30:30 +01:00
zero
bbddc4d0b6 spec2: sections on concepts, notation, pallas/vesta 2024-01-18 19:30:30 +01:00
zero
9ae3668779 spec2: add section on crypto schemes 2024-01-18 19:30:30 +01:00
zero
fa71b711a1 spec2: concepts page 2024-01-18 19:30:30 +01:00
zero
daeefbb7bf money: switch to new nullifier scheme N = hash(secret, coin) 2024-01-18 19:30:30 +01:00
lunar-mining
818ceaec4d store: don't remove from greylist or whitelist on anchorlist upgrade
because of the refinery running in the background, if we remove a peer
from the white or greylist on upgrade it can create an index error in
when seperate threads execute this code at the same time:

refinery:
    upgrades node to whitelist, removes from greylist

upgrade_host:
    upgrades node to anchorlist, removes from greylist

leaving a "safe" peer on the grey or whitelist is not a problem. the
only impact is that we risk selecting a peer from the whitelist that we
are already connected as an anchor, but p2p checks exist to protect
from this.

equally, if we remove from the greylist or whitelist on upgrade_host this can
happen:

upgrade_host:
    upgrades node to anchorlist, removes from greylist

protocol_addr:
    recv Addr
    do we have this node? no, add to greylist
    refinery: promotes to whitelist, etc

the above scenario makes removing the host in this case redundant.
2024-01-18 13:51:34 +01:00
lunar-mining
deb3ea5936 net: cleanup warnings + run make clippy 2024-01-18 13:17:51 +01:00
lunar-mining
fed0e582c1 net: bug fixes and cleanup
* move upgrade_host() and downgrade_host() to store.rs
* don't downgrade disconnected inbound connections
* fix logic error (missing else clause) on [hostlist]_store_or_update
* improve code comments
* make [hostlist]_remove a single-line function
2024-01-18 13:00:55 +01:00
lunar-mining
576afd574d store: create test_remove() unit test 2024-01-17 16:57:46 +01:00
lunar-mining
2674cfd32e store: do not shuffle hosts on fetch_address()
Previously we were shuffling hosts that we select to avoid trying to
connect to them in a deterministic order. However, this contradicts the
protocol of ordering hostlists by last_seen.

Instead, we should try to connect to addresses stored at the top of the
hostlists first, as they are most likely to be active.

The problem of multiple slots competing for the same peer should be
solved by the various locking checks in check_address_with_lock().
2024-01-17 15:13:54 +01:00
lunar-mining
eda5c69af4 lilith: add whitelist_refinery task
Lilith now periodically pings nodes on its whitelist, updating their
last_seen field if they are active, otherwise downgrading them to
greylist.

This is to prevent Lilith from sharing inactive peers with other hosts
when it shares its whitelist.
2024-01-17 14:27:51 +01:00
lunar-mining
3d5eabfe59 net: downgrade host if they disconnect or we can't connect to them.
This commit introduces a new Session method called downgrade_host().

It gets called on two occasions:

* if we receive a stop signal on a channel (Inbound, Outbound, Manual sessions)
* if we cannot establish a connection (Outbound and Manual session)

This commit deprecates the "rejected" vector inside Outbound session
that prevented us from instantly reconnecting to an inactive host.
2024-01-17 11:01:36 +01:00
lunar-mining
4ded978f06 chore: cargo fmt 2024-01-16 18:41:59 +01:00