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

fix(dashmate)!: drive logs configuration #1406

Merged
merged 28 commits into from
Oct 6, 2023
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
603bb41
fix(dashmate): drive logs configuration
shumkov Sep 15, 2023
f6f665f
docs: update documentation
shumkov Sep 16, 2023
db8f0b4
fix: wrong level config
shumkov Sep 16, 2023
2ed71a0
Merge branch 'v0.25-dev' into fix/dashmate/drive-log
shumkov Sep 18, 2023
2db9238
feat(drive): reopen log file on HUP signal (#1408)
lklimek Sep 18, 2023
afcb60f
fix: default config in volume
shumkov Sep 18, 2023
f40cd0f
test(drive): fix order of items in logging tests
lklimek Sep 19, 2023
bdcd1d4
style: fix clippy warningˆ
shumkov Sep 19, 2023
c7a077f
revert: config change
shumkov Sep 19, 2023
5a5d56f
revert: log destination name
shumkov Sep 19, 2023
433e5e4
refactor: list all stdout log options
shumkov Sep 19, 2023
d74ba78
Update packages/rs-drive-abci/src/logging.rs
shumkov Sep 19, 2023
661898a
Update packages/rs-drive-abci/src/logging.rs
shumkov Sep 19, 2023
3d63105
feat: add more validation for log path
shumkov Sep 19, 2023
32d804d
feat: improve validation
shumkov Sep 19, 2023
acbae42
Merge branch 'v0.25-dev' into fix/dashmate/drive-log
shumkov Sep 19, 2023
421fe43
test(drive): validate log path tests
lklimek Sep 20, 2023
c6e0c2b
test: remove unnecessary test
shumkov Sep 20, 2023
98c313e
refactor: unwrap -> expect
shumkov Sep 20, 2023
9344064
Merge branch 'v0.25-dev' into fix/dashmate/drive-log
shumkov Sep 20, 2023
c56d1ed
tests: ignore rotation test
shumkov Sep 20, 2023
03ef89f
Merge branch 'v0.25-dev' into fix/dashmate/drive-log
shumkov Sep 25, 2023
426082b
fix(drive): invalid permissions on db dir
lklimek Sep 27, 2023
5ed8fe3
Merge branch 'v0.25-dev' into fix/dashmate/drive-log
shumkov Sep 29, 2023
0492c3b
tests: use silent log level by default
shumkov Sep 29, 2023
104cc85
chore: empty commit to fix CI
shumkov Oct 1, 2023
7c1bb62
tests: build drive in dashmate tests tooˆ
shumkov Oct 2, 2023
2390144
Merge branch 'v0.25-dev' into fix/dashmate/drive-log
shumkov Oct 3, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ RUN apk add --no-cache libgcc libstdc++
ENV DB_PATH=/var/lib/dash/rs-drive-abci/db

RUN mkdir -p /var/log/dash \
/var/lib/dash/rs-drive-abci
/var/lib/dash/rs-drive-abci/db

COPY --from=build-drive-abci /artifacts/drive-abci /usr/bin/drive-abci
COPY --from=build-drive-abci /platform/packages/rs-drive-abci/.env.example /var/lib/dash/rs-drive-abci/.env
Expand Down
16 changes: 8 additions & 8 deletions packages/dashmate/configs/getConfigFileMigrationsFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,14 @@ function getConfigFileMigrationsFactory(homeDir, defaultConfigs) {
options.platform.drive.tenderdash.docker.image = base.get('platform.drive.tenderdash.docker.image');
}

if (options.platform.drive.abci.log.jsonFile.level === 'fatal') {
options.platform.drive.abci.log.jsonFile.level = 'error';
}

if (options.platform.drive.abci.log.prettyFile.level === 'fatal') {
options.platform.drive.abci.log.prettyFile.level = 'error';
}

if (options.network === NETWORK_TESTNET) {
options.platform.drive.tenderdash.genesis.chain_id = testnet.get('platform.drive.tenderdash.genesis.chain_id');
options.platform.drive.tenderdash
Expand All @@ -163,14 +171,6 @@ function getConfigFileMigrationsFactory(homeDir, defaultConfigs) {
'0.25.0-dev.30': (configFile) => {
Object.entries(configFile.configs)
.forEach(([, options]) => {
if (options.platform.drive.abci.log.jsonFile.level === 'fatal') {
options.platform.drive.abci.log.jsonFile.level = 'error';
}

if (options.platform.drive.abci.log.prettyFile.level === 'fatal') {
options.platform.drive.abci.log.prettyFile.level = 'error';
}

if (options.network === NETWORK_TESTNET) {
options.platform.drive.tenderdash.p2p.seeds = testnet.get('platform.drive.tenderdash.p2p.seeds');
}
Expand Down
1 change: 1 addition & 0 deletions packages/dashmate/test/e2e/localNetwork.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ describe('Local Network', function main() {
// Update local config template that will be used to setup nodes
const localConfig = configFile.getConfig(groupName);
localConfig.set('dashmate.helper.docker.build.enabled', true);
localConfig.set('platform.drive.abci.docker.build.enabled', true);
localConfig.set('docker.network.subnet', '172.30.0.0/24');
localConfig.set('dashmate.helper.api.port', 40000);
localConfig.set('core.p2p.port', 40001);
Expand Down
1 change: 1 addition & 0 deletions packages/dashmate/test/e2e/testnetFullnode.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ describe('Testnet Fullnode', function main() {
config = configFile.getConfig(preset);

config.set('dashmate.helper.docker.build.enabled', true);
config.set('platform.drive.abci.docker.build.enabled', true);
shumkov marked this conversation as resolved.
Show resolved Hide resolved
config.set('docker.network.subnet', '172.27.24.0/24');
config.set('dashmate.helper.api.port', 40000);
config.set('core.p2p.port', 40001);
Expand Down
1 change: 1 addition & 0 deletions packages/dashmate/test/e2e/testnetHPFullnode.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ describe('Testnet HP Fullnode', function main() {
config = configFile.getConfig(preset);

config.set('dashmate.helper.docker.build.enabled', true);
config.set('platform.drive.abci.docker.build.enabled', true);
shumkov marked this conversation as resolved.
Show resolved Hide resolved
config.set('docker.network.subnet', '172.27.24.0/24');
config.set('dashmate.helper.api.port', 40000);
config.set('core.p2p.port', 40001);
Expand Down
10 changes: 5 additions & 5 deletions packages/rs-drive-abci/src/abci/handlers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,11 +171,11 @@
if let Some(core_chain_lock_update) = core_chain_lock_update.as_ref() {
// We can't add this, as it slows down CI way too much
// todo: find a way to re-enable this without destroying CI
// tracing::info!(
// "chain lock update to height {} at block {}",
// core_chain_lock_update.core_block_height,
// request.height
// );
tracing::debug!(
"propose chain lock update to height {} at block {}",
core_chain_lock_update.core_block_height,
request.height
);
block_proposal.core_chain_locked_height = core_chain_lock_update.core_block_height;
}

Expand Down Expand Up @@ -429,7 +429,7 @@
Err(Error::from(AbciError::RequestForWrongBlockReceived(format!(
"received extend vote request for height: {} round: {}, block: {}; expected height: {} round: {}, block: {}",
height, round, hex::encode(block_hash),
block_state_info.height(), block_state_info.round(), block_state_info.block_hash().map(|block_hash| hex::encode(block_hash)).unwrap_or("None".to_string())

Check warning on line 432 in packages/rs-drive-abci/src/abci/handlers.rs

View workflow job for this annotation

GitHub Actions / clippy

redundant closure

warning: redundant closure --> packages/rs-drive-abci/src/abci/handlers.rs:432:104 | 432 | ...lock_hash().map(|block_hash| hex::encode(block_hash)).unwrap_or("None".to_string()) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `hex::encode` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure = note: `#[warn(clippy::redundant_closure)]` on by default
)))
.into())
} else {
Expand Down
3 changes: 2 additions & 1 deletion packages/rs-drive-abci/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,7 @@ mod test {
use dpp::block::epoch::Epoch;
use drive::fee_pools::epochs::epoch_key_constants;

use drive_abci::logging::LogLevelPreset;
use platform_version::version::PlatformVersion;
use rocksdb::{IteratorMode, Options};

Expand Down Expand Up @@ -438,7 +439,7 @@ mod test {

#[test]
fn test_verify_grovedb_corrupt_0th_root() {
drive_abci::logging::init_for_tests(4);
drive_abci::logging::init_for_tests(LogLevelPreset::Silent);
let tempdir = tempfile::tempdir().unwrap();
let db_path = setup_db(tempdir.path());

Expand Down
Loading