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

db: decouple db module #1885

Merged
merged 5 commits into from
Mar 7, 2024
Merged

db: decouple db module #1885

merged 5 commits into from
Mar 7, 2024

Conversation

battlmonstr
Copy link
Contributor

  • move access_layer Account test
  • refactor EthStatusDataProvider, move it to sentry
  • add silkworm_db library target
  • cleanup silkworm_rpcdaemon cmake script, it doesn't depends on silkworm_node now 🎉
  • cleanup some cmds to not depend on silkworm_node

Copy link
Member

@JacekGlen JacekGlen left a comment

Choose a reason for hiding this comment

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

Great change!
I've got some minor comments, but you can ignore if you think they are not important

silkworm_db
PUBLIC ${LIBS_PUBLIC}
PRIVATE ${LIBS_PRIVATE}
EXCLUDE_REGEX "db/etl"
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
EXCLUDE_REGEX "db/etl"
EXCLUDE_REGEX "etl"

not sure about it, can you double check?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

EXCLUDE_REGEX is a temporary hack to exclude sub-libraries. The plan is to detect them automatically and exclude their subfolders from the sources list. It's on my TODO list ✍️

if (head_total_difficulty) {
head_info.total_difficulty = head_total_difficulty.value();
} else {
log::Warning("db::HeadInfo") << "total difficulty of canonical hash at height " << std::to_string(head_height) << " not found in db";
Copy link
Member

Choose a reason for hiding this comment

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

We should log the warning only in cases when total difficulty is required

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree. This function should probably be refactored to not log, but return optional values in these fields. Then we can check them and log on the call site.

@battlmonstr battlmonstr merged commit 34cd5ce into master Mar 7, 2024
4 checks passed
@battlmonstr battlmonstr deleted the pr/db_decoup branch March 7, 2024 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants