Commit Graph

3887 Commits

Author SHA1 Message Date
zero
7edb0cd217 apply DEP 0003: Token Mint Authorization 2024-02-01 17:38:32 +01:00
draoi
ccc6b25754 inbound_session: implement PingSelfProcess
Move the process that pings ourselves and creates a last_seen field
for each of our external addresses into a custom child process of
InboundSession, and remove from ProtocolSeed and ProtocolAddr.
2024-02-01 13:43:30 +01:00
draoi
79512e6dce chore: fix debugs and cleanup 2024-02-01 13:43:30 +01:00
skoupidi
2805f1435c validator: fixed minor encoding/decoding bugs 2024-02-01 14:04:36 +02:00
skoupidi
3e15d146a3 validator/consensus: cleaned up slots logic 2024-02-01 13:31:29 +02:00
skoupidi
4c45c8d592 validator: cleaned up verification and validations methods and merged the two files 2024-01-31 20:21:08 +02:00
skoupidi
ccc3a8e3a7 blockchain/header: derive block version using sdk block_version fn 2024-01-31 19:14:55 +02:00
skoupidi
3355575721 runtime: replaced timekeeper with verifying block height directly 2024-01-31 14:22:51 +02:00
skoupidi
2f5de8e999 runtime: removed slot related fns and added gas cost to util fns 2024-01-31 14:12:29 +02:00
skoupidi
e53ea14531 contract/money/tests/integration: fixed failing test due to erroneous block height 2024-01-30 21:35:30 +02:00
skoupidi
f64c4e5750 contract/*: renamed all slot references to block height 2024-01-30 21:27:46 +02:00
skoupidi
07b47fd521 contract/money/pow_reward: simplyfied call to use last block information directly from database overlay 2024-01-30 20:59:23 +02:00
skoupidi
6b74cebdd0 drk: moved contracts sql stuff from their client to drk directly
Also prefixed table name with their corresponding contract idfff
2024-01-30 15:34:12 +02:00
zero
42a6b92ec6 drk: move coin_blind to the correct position 2024-01-30 13:11:13 +01:00
zero
85cbf1f152 drk: update for changes to serial renamed to coin_blind 2024-01-30 12:22:07 +01:00
zero
0738b42b1c money: change the coin_attribute serial to coin_blind. We no longer use the serial, and its sole purpose is to blind the coin. Also move it to the end, consistent with all bullas and commits used in darkfi core. 2024-01-30 12:12:56 +01:00
skoupidi
16103b84a7 Night of the living dead 2024-01-29 21:41:01 +02:00
draoi
195dfb6935 chore: cargo fmt 2024-01-29 15:31:37 +01:00
draoi
e9e3bd41ca Revert "channel: safely shutdown the channel when an error is triggered"
This reverts commit 8a01a59b063b3d0dca1eae3963a83dcb52427487.

This commit was wrong because the channel gets shutdown after the receive loop returns Error::ChannelStopped in handle_stop()
2024-01-29 15:31:37 +01:00
draoi
ccf660b924 chore: fix comments and cleanup 2024-01-29 15:31:37 +01:00
draoi
2563c3995c acceptor: upgrade "reached incoming connection limit" to a warning 2024-01-29 15:31:37 +01:00
draoi
ae154de787 chore: fix typo 2024-01-29 15:31:37 +01:00
draoi
e631e8ce68 doc: minor tweak to channel.rs doc 2024-01-29 15:31:37 +01:00
draoi
a21def4f53 refinery: fix redundant channel.stop() call 2024-01-29 15:31:37 +01:00
draoi
589a847205 settings: change inbound_connections default to 10
Setting this to 0 disables inbound sessions by default, even if we have
configured a inbound address.

If we have a inbound address configured, it should be assumed we want to accept inbound sessions.
2024-01-29 15:31:37 +01:00
draoi
7959d9741c channel: safely shutdown the channel when an error is triggered 2024-01-29 15:31:37 +01:00
draoi
78964589ca inbound_session: activate subscriber before accepting inbound connections
InboundSession::start() must happen in this order:

* create the Acceptor
* activate acceptor subscriber
* finally we are ready to start accepting inbound connections.

Previously the flow was like this:

* create the acceptor
* starting accepting inbound connections
* activate the subscriber

This means that inbound connections would potentially be dropped in between
creating the acceptor and activating the subscriber. This is only
obvious in low latency conditions, like refinery::ping_node().
2024-01-29 15:31:37 +01:00
zero
43621729fe spec: money xfer params 2024-01-29 11:11:37 +01:00
draoi
deb784d68d channel: use convenience function 2024-01-27 17:46:48 +01:00
draoi
5aa187913f refinery: bugfix
start the channel BEFORE calling .await on the handshake task. otherwise
the channel does not exist yet and the handshake will timeout.
2024-01-27 14:05:43 +01:00
draoi
cbfef54aab chore: remove artifact from protocol_version 2024-01-27 14:05:03 +01:00
draoi
cecf284cef net: create system::run_until_completion() to ensure ping_node() does not create zombie process
This commit refactors the ping_node method to use a system function
called run_until_completion(), which ensures a task will safely complete even
if it's parent task has been cancelled.

This happens in ping_node() in the case the handshake is ongoing but the
p2p network has been destroyed.

We also introduce a timeout for ping_node() to prevent
perform_handshake_protocols from running forever and blocking
channel.stop() from being safely invoked.
2024-01-26 11:10:44 +01:00
draoi
715f6c7a86 channel: fix incorrect API usage 2024-01-26 11:10:44 +01:00
draoi
d60bb8bf33 manual_session: bugfix
Push the tasks onto the vector of stoppable tasks before starting them
to avoid a possible race condition.
2024-01-26 11:10:44 +01:00
skoupidi
9d9dd1590c net/hosts/store: chore clippy 2024-01-25 20:29:59 +02:00
draoi
a42fd04bee store: update test to use new flattened fetch_address logic 2024-01-25 18:30:00 +01:00
skoupidi
c3f84d3abb src/wallet: yeet 2024-01-25 19:06:37 +02:00
skoupidi
c04667a845 net/session/outbound_session::fetch_address(): simplyfied returns 2024-01-25 14:51:13 +02:00
draoi
3447394eda net: make fetch address logic less nested + fix bug
Previously when we called whitelist_fetch_[...](), it would call
greylist_fetch_[...]() inside that method if insufficient whitelist
entries were found.

This was confusing and non-intuitive.

This commit removes this nesting. Now we call
whitelist_fetch_[...] followed by greylist_fetch_[...] in ProtocolAddr
and OutboundSession explicitly.

This commit also fixes a bug in the refinery.
2024-01-25 13:30:24 +01:00
aggstam
6e7dc81704 chore: clippy 2024-01-24 17:57:46 +02:00
parazyd
b498847676 contract/money: Add missing error to the error enum 2024-01-24 16:26:14 +01:00
parazyd
228aea9926 contract/fee: Enforce that fee_paid > 0 2024-01-24 13:11:56 +01:00
lunar-mining
354ef3270e store: reverse the order of hostlists
entries with the most recently seen timestamps should be at the top of
the list.
2024-01-24 12:47:36 +01:00
lunar-mining
949f9f0f6f net: remove advertise bool from settings
instead use the presence of an external addresses to decide whether or
not our address should be broadcasted.
2024-01-24 11:20:15 +01:00
lunar-mining
831d17cd48 chore: more informational debug statement 2024-01-24 11:08:54 +01:00
lunar-mining
b1511b991a chore: correct debug statements and code comments 2024-01-24 10:18:28 +01:00
lunar-mining
fe95e34db5 chore: remove artifact from debug statement 2024-01-24 10:11:52 +01:00
lunar-mining
7f3d43f538 protocol_address/seed: don't return if ping_node is false
this would mean that if the first external addr in our list is invalid
it will exit the function. instead, continue to check each addr, and if
they are all invalid just broadcast an empty vector inside the AddrsMessage.
2024-01-24 09:56:03 +01:00
lunar-mining
453a712b9e refinery: only refine nodes that match our transports
this commit means each node's whitelist will only consist of nodes that match their own transports.
2024-01-24 08:00:41 +01:00
parazyd
badd907efc hosts: Wrap module rustdoc 2024-01-23 18:01:04 +01:00