-
Notifications
You must be signed in to change notification settings - Fork 43
Conversation
ec46ca5
to
d0b084d
Compare
core/consensus/src/adapter.rs
Outdated
.call::<ConsensusRpcRequest, ConsensusRpcResponse>( | ||
ctx, | ||
end, | ||
ConsensusRpcRequest::PullEpochs(msg), |
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.
Why not use protobuf
? There is no requirement for serialization consistency in a network.
&self, | ||
ctx: Context, | ||
hashes: Vec<Hash>, | ||
end: &str, |
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.
end
?
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.
This is request by RPC.
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.
Actually, it's "endpoint".
core/consensus/src/consensus.rs
Outdated
} | ||
|
||
// Lock the consensus engine, block commit process. | ||
self.engine.lock.lock().await; |
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.
This is a problem if you have multiple threads competing for locks at the same time.
First, these threads will get the lock-in turn, and then they will all execute the synchronization process once, although possibly repeatedly.
// 2. Save the signed transactions. | ||
// 3. Save the latest proof. | ||
// 4. Save the new epoch. | ||
let exec_resp = self |
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.
- save receipt
1f33a6a
to
f93a04b
Compare
where | ||
EF: ExecutorFactory<DB>, | ||
G: Gossip + Sync + Send, | ||
R: Rpc + Sync + Send, |
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.
Combine G
and R
, since network handle implement both traits.
&self, | ||
ctx: Context, | ||
hashes: Vec<Hash>, | ||
end: &str, |
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.
Actually, it's "endpoint".
core/consensus/src/consensus.rs
Outdated
.engine | ||
.get_epoch_by_id(ctx.clone(), current_epoch_id) | ||
.await?; | ||
let mut current_hash = Hash::digest(current_epoch.encode().await?); |
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.
No rlp ?
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.
Use protobuf temporarily.
c712463
to
57cf806
Compare
8cb7e5a
to
3bae434
Compare
* feat: develop merkle root * refactor arguments * remove useless code dev synchronization dev synchronization dev network handler refactor update current status cargo fmt refactor mempool test add iql fix synchronous bug cargo update dev synchronization tmp update cache status fix(mempool): Resize the queue to ensure correct switching. (#18) * fix(mempool): Resize the queue to ensure correct switching. * resize map. * resize map. cargo fmt add log cargo fmt feat: synchronization cargo clippy fix: save proof and locks fix sync cargo clippy fix a bug cargo fmt tmp config fix tmp commit fix mempool
3bae434
to
bbf41f8
Compare
devtools/chain/config-bootstrap.toml
Outdated
@@ -0,0 +1,42 @@ | |||
# chain id |
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.
remove
devtools/chain/config-node-1.toml
Outdated
@@ -0,0 +1,53 @@ | |||
# chain id |
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.
remove
devtools/chain/config-node-2.toml
Outdated
@@ -0,0 +1,53 @@ | |||
# chain id |
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.
remove
devtools/chain/config-node-3.toml
Outdated
@@ -0,0 +1,53 @@ | |||
# chain id |
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.
remove
Co-Authored-By: Jiayu Ye <[email protected]>
Resolve conflict @KaoImin |
* add adapter, crypto, env, utils * add env, utils * refactor test and bench * add test_mempool_package test_mempool_flush * adjust code style * add ophelia * fix ophelia unstable feature * combine all test files into only one file * add some new tests and refer ophelia to common-crypto * add test_sync_propose_txs
* feat: develop merkle root (nervosnetwork#17) * feat: develop merkle root * refactor arguments * remove useless code dev synchronization dev synchronization dev network handler refactor update current status cargo fmt refactor mempool test add iql fix synchronous bug cargo update dev synchronization tmp update cache status fix(mempool): Resize the queue to ensure correct switching. (nervosnetwork#18) * fix(mempool): Resize the queue to ensure correct switching. * resize map. * resize map. cargo fmt add log cargo fmt feat: synchronization cargo clippy fix: save proof and locks fix sync cargo clippy fix a bug cargo fmt tmp config fix tmp commit fix mempool * fix synchronization * fix CI * remove debug config files * Update core/consensus/Cargo.toml Co-Authored-By: Jiayu Ye <[email protected]> * update Cargo lock * fix cargo toml
What type of PR is this?
feature
What this PR does / why we need it:
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer: