Skip to content

Commit 3407244

Browse files
achamayouCopilot
andauthored
Start node readonly ledger dir hygiene check (#7475)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 977bf24 commit 3407244

3 files changed

Lines changed: 24 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
66
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
77

8+
## [7.0.0-dev6]
9+
10+
[7.0.0-dev6]: https://github.com/microsoft/CCF/releases/tag/ccf-7.0.0-dev6
11+
12+
### Changed
13+
14+
- Start nodes now confirm that read-only ledger directories are empty on startup (#7355).
15+
816
## [7.0.0-dev5]
917

1018
[7.0.0-dev5]: https://github.com/microsoft/CCF/releases/tag/ccf-7.0.0-dev5

python/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "ccf"
7-
version = "7.0.0-dev5"
7+
version = "7.0.0-dev6"
88
authors = [
99
{ name="CCF Team", email="CCF-Sec@microsoft.com" },
1010
]

src/host/run.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -822,6 +822,21 @@ namespace ccf
822822
return static_cast<int>(CLI::ExitCodes::ValidationError);
823823
}
824824

825+
for (const auto& readonly_ledger_directory :
826+
config.ledger.read_only_directories)
827+
{
828+
if (
829+
files::exists(readonly_ledger_directory) &&
830+
!fs::is_empty(readonly_ledger_directory))
831+
{
832+
LOG_FATAL_FMT(
833+
"On start, read-only ledger directories should not exist or be "
834+
"empty ({})",
835+
readonly_ledger_directory);
836+
return static_cast<int>(CLI::ExitCodes::ValidationError);
837+
}
838+
}
839+
825840
populate_config_for_start(config, startup_config);
826841
}
827842
else if (config.command.type == StartType::Join)

0 commit comments

Comments
 (0)