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

ci: build dockers test #1020

Merged
merged 18 commits into from May 9, 2024
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
104 changes: 52 additions & 52 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Cargo.toml
@@ -1,6 +1,6 @@
# NOTE: When editing this version, also edit the versions in template_built_in/templates/account and account_nft
[workspace.package]
version = "0.5.1"
version = "0.5.2"
edition = "2021"
authors = ["The Tari Development Community"]
repository = "https://github.com/tari-project/tari-dan"
Expand Down
6 changes: 3 additions & 3 deletions applications/tari_generate/src/main.rs
Expand Up @@ -88,7 +88,7 @@ struct ScaffoldArgs {
#[clap(long, short = 'c', alias = "config")]
pub generator_config_file: Option<PathBuf>,
#[clap(long, short = 'a')]
address: String,
template_address: String,
#[clap(long, short = 'j')]
dan_testing_jrpc_url: String,
}
Expand Down Expand Up @@ -284,7 +284,7 @@ async fn scaffold(args: ScaffoldArgs) -> anyhow::Result<()> {
output_path: "output/".into(),
liquid: Some(generators::LiquidGeneratorOpts {
skip_format: false,
variables: vec![("template_address".to_string(), Value::String(args.address.clone()))]
variables: vec![("template_address".to_string(), Value::String(args.template_address.clone()))]
.into_iter()
.collect(),
}),
Expand All @@ -307,7 +307,7 @@ async fn scaffold(args: ScaffoldArgs) -> anyhow::Result<()> {
let request = json!({
"jsonrpc" : "2.0",
"method": "get_template",
"params": [hex::decode(args.address)?],
"params": [hex::decode(args.template_address)?],
"id": 1
});
let response = reqwest::Client::new()
Expand Down
8 changes: 6 additions & 2 deletions applications/tari_indexer/log4rs_sample.yml
Expand Up @@ -106,12 +106,16 @@ loggers:
- stdout
additive: false

tari::dan::networking:
level: debug
appenders:
- network
additive: true

tari::dan:
level: info
appenders:
- dan_layer
- stdout
additive: false

tari::indexer:
level: info
Expand Down
9 changes: 5 additions & 4 deletions dan_layer/consensus/src/hotstuff/on_receive_local_proposal.rs
Expand Up @@ -151,7 +151,7 @@ impl<TConsensusSpec: ConsensusSpec> OnReceiveLocalProposalHandler<TConsensusSpec
}

let Some((valid_block, tree_diff)) =
self.validate_block(tx, block, &local_committee, &local_committee_shard)?
self.validate_block_header(tx, block, &local_committee, &local_committee_shard)?
else {
return Ok(None);
};
Expand Down Expand Up @@ -191,7 +191,7 @@ impl<TConsensusSpec: ConsensusSpec> OnReceiveLocalProposalHandler<TConsensusSpec
Ok(high_qc)
}

fn validate_block(
fn validate_block_header(
&self,
tx: &mut <TConsensusSpec::StateStore as StateStore>::WriteTransaction<'_>,
block: Block,
Expand Down Expand Up @@ -424,6 +424,8 @@ impl<TConsensusSpec: ConsensusSpec> OnReceiveLocalProposalHandler<TConsensusSpec
)?;

let justify_block_height = justify_block.height();
// if the block parent is not the justify parent, then we have experienced a leader failure
// and should make dummy blocks to fill in the gaps.
if justify_block.id() != candidate_block.parent() {
let mut dummy_blocks =
Vec::with_capacity((candidate_block.height().as_u64() - justify_block_height.as_u64() - 1) as usize);
Expand All @@ -432,8 +434,7 @@ impl<TConsensusSpec: ConsensusSpec> OnReceiveLocalProposalHandler<TConsensusSpec
let base_layer_block_hash = *justify_block.base_layer_block_hash();
dummy_blocks.push(justify_block);
let mut last_dummy_block = dummy_blocks.last().unwrap();
// if the block parent is not the justify parent, then we have experienced a leader failure
// and should make dummy blocks to fill in the gaps.

while last_dummy_block.id() != candidate_block.parent() {
if last_dummy_block.height() > candidate_block.height() {
warn!(target: LOG_TARGET, "🔥 Bad proposal, dummy block height {} is greater than new height {}", last_dummy_block, candidate_block);
Expand Down
Expand Up @@ -102,7 +102,7 @@ impl<TAddr: NodeAddressable + DerivableFromPublicKey + 'static>

#[allow(clippy::too_many_lines)]
async fn handle_request(&mut self, req: EpochManagerRequest<TAddr>) {
info!(target: LOG_TARGET, "Received request: {:?}", req);
debug!(target: LOG_TARGET, "Received request: {:?}", req);
match req {
EpochManagerRequest::CurrentEpoch { reply } => handle(reply, Ok(self.inner.current_epoch())),
EpochManagerRequest::CurrentBlockInfo { reply } => handle(reply, Ok(self.inner.current_block_info())),
Expand Down
1 change: 1 addition & 0 deletions docker_rig/tari-dan.Dockerfile
Expand Up @@ -43,6 +43,7 @@ RUN apt-get update && apt-get install -y \
libsqlite3-0 \
openssl \
cmake \
protobuf-compiler \
nodejs

# https://gcc.gnu.org/onlinedocs/gcc/x86-Options.html
Expand Down
3 changes: 2 additions & 1 deletion networking/core/src/worker.rs
Expand Up @@ -520,6 +520,7 @@ where
relay_peer_id, renewal, limit
);
},

RelayClient(event) => {
info!(target: LOG_TARGET, "🌎️ RelayClient event: {:?}", event);
},
Expand Down Expand Up @@ -921,7 +922,7 @@ where
let _ignore = reply.send(Ok(NegotiatedSubstream::new(peer_id, protocol, stream)));
},
InboundSubstreamOpen { notification } => {
info!(target: LOG_TARGET, "📥 Inbound substream open: protocol={}", notification.protocol);
debug!(target: LOG_TARGET, "📥 Inbound substream open: protocol={}", notification.protocol);
self.substream_notifiers.notify(notification);
},
InboundFailure {
Expand Down
6 changes: 3 additions & 3 deletions networking/rpc_framework/src/server/mod.rs
Expand Up @@ -368,7 +368,7 @@ where
}

fn on_session_complete(&mut self, node_id: &PeerId) {
info!(target: LOG_TARGET, "Session complete for {}", node_id);
debug!(target: LOG_TARGET, "Session complete for {}", node_id);
if let Some(v) = self.sessions.get_mut(node_id) {
*v -= 1;
if *v == 0 {
Expand Down Expand Up @@ -416,7 +416,7 @@ where

match self.new_session_for(peer_id) {
Ok(num_sessions) => {
info!(
debug!(
target: LOG_TARGET,
"NEW SESSION for {} ({} active) ", peer_id, num_sessions
);
Expand Down Expand Up @@ -446,7 +446,7 @@ where
#[cfg(feature = "metrics")]
num_sessions.inc();
service.start().await;
info!(target: LOG_TARGET, "END OF SESSION for {} ", peer_id,);
debug!(target: LOG_TARGET, "END OF SESSION for {} ", peer_id,);
#[cfg(feature = "metrics")]
num_sessions.dec();

Expand Down