-
Notifications
You must be signed in to change notification settings - Fork 219
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
Scaffold initial directory structure #2
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.
Looks good, though I don't see the infrastructure folder mentioned in the readme?
@philipr-za thanks for the catch. git doesn't allow empty folders, so I've added Cargo scaffolding to the |
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.
Just some suggestions, otherwise I'm happy
[workspace] | ||
|
||
members = [ | ||
"base_layer/blockchain", |
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.
For some reason, most chains I've seen call this folder chain
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.
Personally, I prefer the more explicit blockchain
, but not married to it
|
||
members = [ | ||
"base_layer/blockchain", | ||
"base_layer/core", |
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.
I would have put all the base_layer
folders in the root, and just had the digital_assets_layer
as digital_assets
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.
I've been back and forth on this myself, but ultimately came to the conclusion that the base and DA layers are siblings and should sit at the same level.
There is scope for a "common" crate that holds stuff that everyone will use, like error handling, logging, etc.
members = [ | ||
"base_layer/blockchain", | ||
"base_layer/core", | ||
"base_layer/mempool", |
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.
Time will tell whether we need a mempool
folder. I would think that most of this will be in chain
or core
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.
Sure.
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.
It looks good. Where will the unit and functional tests fit in?
Just follow Rust conventions, Unit tests are in the source code; functional tests will be in a |
It is a great start. Something I immediately observed to be missing, the consensus algorithms/schemes/protocols. Where would they live? In |
Possibly |
Yeah, it's just a start; and we can refactor obviously; but this type of thing tends to be sticky so worth having the convo about it |
Add configurable timeouts for base node service requests and fetch block requests
…ate#2_COPY feat: dark mode update #2
Description --- Removed blocking call from mempool retrieve template request. Motivation and Context --- See #6219 How Has This Been Tested? --- System-level testing with a big mempool With a fairly large mempool going 30 blocks deep, these are the results, nice and fast responses from the mempool: ```rust 2024-03-19 11:58:23.819942200 [c::mp::mempool] DEBUG Retrieved 4 highest priority transaction(s) from the mempool in 116µs ms 2024-03-19 11:58:43.196219300 [c::mp::mempool] DEBUG Retrieved 4 highest priority transaction(s) from the mempool in 342ms ms 2024-03-19 12:00:25.633493600 [c::mp::mempool] DEBUG Retrieved 4 highest priority transaction(s) from the mempool in 155µs ms 2024-03-19 12:00:41.847437000 [c::mp::mempool] DEBUG Retrieved 4 highest priority transaction(s) from the mempool in 39ms ms 2024-03-19 12:04:41.302614400 [c::mp::mempool] DEBUG Retrieved 4 highest priority transaction(s) from the mempool in 172ms ms 2024-03-19 12:04:57.957985300 [c::mp::mempool] DEBUG Retrieved 4 highest priority transaction(s) from the mempool in 168µs ms 2024-03-19 12:05:49.060040100 [c::mp::mempool] DEBUG Retrieved 4 highest priority transaction(s) from the mempool in 114µs ms 2024-03-19 12:05:58.040083300 [c::mp::mempool] DEBUG Retrieved 4 highest priority transaction(s) from the mempool in 198µs ms 2024-03-19 12:08:47.903942500 [c::mp::mempool] DEBUG Retrieved 4 highest priority transaction(s) from the mempool in 169µs ms ``` The mempool stats for the period: ```rust 11:58 v1.0.0-pre.11a esmeralda State: Listening Tip: 2427 (Tue, 19 Mar 2024 09:58:14 +0000) Mempool: 80tx (2281440g, +/- 18blks) Connections: 12|10 Banned: 0 Messages (last 60s): 64 Rpc: 55/10000 RandomX: #2 with flags FLAG_HARD_AES | FLAG_JIT | FLAG_ARGON2_SSSE3 | FLAG_ARGON2_AVX2 | FLAG_ARGON2 11:59 v1.0.0-pre.11a esmeralda State: Listening Tip: 2427 (Tue, 19 Mar 2024 09:58:14 +0000) Mempool: 83tx (2366994g, +/- 19blks) Connections: 12|10 Banned: 0 Messages (last 60s): 68 Rpc: 57/10000 12:00 v1.0.0-pre.11a esmeralda State: Listening Tip: 2427 (Tue, 19 Mar 2024 09:58:14 +0000) Mempool: 91tx (2595138g, +/- 21blks) Connections: 13|10 Banned: 0 Messages (last 60s): 56 Rpc: 55/10000 12:01 v1.0.0-pre.11a esmeralda State: Listening Tip: 2429 (Tue, 19 Mar 2024 10:00:27 +0000) Mempool: 90tx (2566620g, +/- 21blks) Connections: 12|10 Banned: 0 Messages (last 60s): 63 Rpc: 56/10000 12:02 v1.0.0-pre.11a esmeralda State: Listening Tip: 2429 (Tue, 19 Mar 2024 10:00:27 +0000) Mempool: 97tx (2766246g, +/- 22blks) Connections: 11|10 Banned: 0 Messages (last 60s): 45 Rpc: 55/10000 12:03 v1.0.0-pre.11a esmeralda State: Listening Tip: 2429 (Tue, 19 Mar 2024 10:00:27 +0000) Mempool: 104tx (2965872g, +/- 24blks) Connections: 12|10 Banned: 0 Messages (last 60s): 50 Rpc: 55/10000 12:04 v1.0.0-pre.11a esmeralda State: Listening Tip: 2429 (Tue, 19 Mar 2024 10:00:27 +0000) Mempool: 114tx (3251052g, +/- 26blks) Connections: 13|10 Banned: 0 Messages (last 60s): 55 Rpc: 55/10000 12:05 v1.0.0-pre.11a esmeralda State: Listening Tip: 2431 (Tue, 19 Mar 2024 10:04:41 +0000) Mempool: 117tx (3336606g, +/- 27blks) Connections: 13|10 Banned: 0 Messages (last 60s): 68 Rpc: 90/10000 12:06 v1.0.0-pre.11a esmeralda State: Listening Tip: 2433 (Tue, 19 Mar 2024 10:05:49 +0000) Mempool: 118tx (3365124g, +/- 27blks) Connections: 12|10 Banned: 0 Messages (last 60s): 67 Rpc: 91/10000 12:07 v1.0.0-pre.11a esmeralda State: Listening Tip: 2433 (Tue, 19 Mar 2024 10:05:49 +0000) Mempool: 128tx (3650304g, +/- 29blks) Connections: 10|10 Banned: 0 Messages (last 60s): 40 Rpc: 90/10000 12:08 v1.0.0-pre.11a esmeralda State: Listening Tip: 2433 (Tue, 19 Mar 2024 10:05:49 +0000) Mempool: 134tx (3821412g, +/- 30blks) Connections: 12|10 Banned: 0 Messages (last 60s): 45 Rpc: 90/10000 ``` What process can a PR reviewer use to test or verify this change? --- Review code changes <!-- Checklist --> <!-- 1. Is the title of your PR in the form that would make nice release notes? The title, excluding the conventional commit tag, will be included exactly as is in the CHANGELOG, so please think about it carefully. --> Breaking Changes --- - [x] None - [ ] Requires data directory on base node to be deleted - [ ] Requires hard fork - [ ] Other - Please specify <!-- Does this include a breaking change? If so, include this line as a footer --> <!-- BREAKING CHANGE: Description what the user should do, e.g. delete a database, resync the chain -->
From the README:
The code follows a domain-driven design layout, with top-level folders falling into infrastructure, domain, or application layers.
The
infrastructure
folder contains code that is not Tari-specific. It holds the following crates:comms
: The networking and messaging subsystemcrypto
: All cryptographic services, including a Curve25519 implementationstorage
: Data persistence services, including LMDBThe
base_layer
is a domain-level folder and contains:core
: common classes and traits, such asTransaction
s andBlock
sblockchain
: The Tari consensus codemempool
: The unconfirmed transaction pool implementationmining
: The merge-mining modulesp2p
: The block and transaction propagation moduleapi
: interfaces for clients and wallets to interact with the base layer componentsThe
digital_assets_layer
is a domain-level folder contains code related to the management of native Tari digital assets. Substructure TBD.It's envisaged that at least the following
applications
are built on top of the domain layer libraries:tari_miner
)tari_pool_miner
)cli_wallet
)tari_basenode
)