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

Scaffold initial directory structure #2

Merged
merged 3 commits into from
Dec 3, 2018
Merged

Scaffold initial directory structure #2

merged 3 commits into from
Dec 3, 2018

Conversation

CjS77
Copy link
Collaborator

@CjS77 CjS77 commented Nov 28, 2018

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 subsystem
  • crypto: All cryptographic services, including a Curve25519 implementation
  • storage: Data persistence services, including LMDB
    The base_layer is a domain-level folder and contains:
  • core: common classes and traits, such as Transactions and Blocks
  • blockchain: The Tari consensus code
  • mempool: The unconfirmed transaction pool implementation
  • mining: The merge-mining modules
  • p2p: The block and transaction propagation module
  • api: interfaces for clients and wallets to interact with the base layer components

The 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:

  • A standalone miner (tari_miner)
  • A pool miner (tari_pool_miner)
  • A CLI wallet for the Tari cryptocurrency (cli_wallet)
  • A full node executable (tari_basenode)

philipr-za
philipr-za previously approved these changes Dec 1, 2018
Copy link
Contributor

@philipr-za philipr-za left a 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?

@CjS77
Copy link
Collaborator Author

CjS77 commented Dec 2, 2018

@philipr-za thanks for the catch. git doesn't allow empty folders, so I've added Cargo scaffolding to the infrastructure folders and repushed

Copy link
Collaborator

@stringhandler stringhandler left a 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",
Copy link
Collaborator

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

Copy link
Collaborator Author

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",
Copy link
Collaborator

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

Copy link
Collaborator Author

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",
Copy link
Collaborator

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure.

Copy link
Contributor

@neonknight64 neonknight64 left a 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?

@CjS77
Copy link
Collaborator Author

CjS77 commented Dec 3, 2018

Just follow Rust conventions, Unit tests are in the source code; functional tests will be in a tests folder per crate etc.

@hansieodendaal
Copy link
Contributor

It is a great start. Something I immediately observed to be missing, the consensus algorithms/schemes/protocols. Where would they live? In infrastructure ? This has potential use in base layer and 2nd layer.

@CjS77
Copy link
Collaborator Author

CjS77 commented Dec 3, 2018

Possibly crypto; If it gets too cumbersome, e.g. we have a fairly involved DAG implementation, we can pull it out into it's own crate

@CjS77
Copy link
Collaborator Author

CjS77 commented Dec 3, 2018

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

@CjS77 CjS77 merged commit b9b23e9 into master Dec 3, 2018
@CjS77 CjS77 deleted the folder-structure branch December 3, 2018 18:56
sdbondi referenced this pull request in sdbondi/tari Feb 3, 2022
Add configurable timeouts for base node service requests and fetch block requests
CjS77 pushed a commit that referenced this pull request Jul 19, 2022
@CjS77 CjS77 added the P-acks_required Process - Requires more ACKs or utACKs label Dec 13, 2022
SWvheerden pushed a commit that referenced this pull request Mar 20, 2024
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 -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P-acks_required Process - Requires more ACKs or utACKs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants