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

Ledger API #2660

Merged
merged 68 commits into from
Feb 6, 2024
Merged

Ledger API #2660

merged 68 commits into from
Feb 6, 2024

Conversation

sergeuz
Copy link
Member

@sergeuz sergeuz commented Jun 8, 2023

Do not merge, superseded by #2715.

This is the first part of the Ledger functionality covering its storage logic and system/application APIs. Below are some links to simplify navigation in the new code:

Ledger

Auxillary classes

Outstanding issues

  • The Ledger is disabled on Tracker as we currently don't have enough flash space available on that platform. I still had to disable system error messages (HAL_PLATFORM_ERROR_MESSAGES) on Tracker, which freed about 2K of flash space, to accommodate for other changes in this PR.
  • The rmrf() function added in this PR sometimes fails in load tests. The issue only affects the ledger_purge* functions and may be specific to LittleFS.

Testing

This PR adds some basic unit tests for the auxillary classes but the unit tests for the Ledger itself will be added in another PR with the synchronization logic. For now, the wiring/ledger test can be used to validate the basic logic of the Ledger.

References

  • sc-118798

@sergeuz sergeuz marked this pull request as draft June 8, 2023 11:15
@sergeuz sergeuz force-pushed the feature/ledger branch 6 times, most recently from a6722ab to 712b0e0 Compare June 14, 2023 18:54
@sergeuz sergeuz force-pushed the feature/ledger branch 3 times, most recently from c5b99ab to 9f396c3 Compare June 22, 2023 15:31
@sergeuz sergeuz force-pushed the feature/ledger branch 5 times, most recently from 88cdcef to b9e5bb1 Compare June 27, 2023 15:51
@eberseth
Copy link
Contributor

Could you please add doxygen comments in the new wiring headers? The comments are automatically parsed by Workbench (VS Code) and appear as tips when implementing those classes/APIs in user apps.

@sergeuz sergeuz force-pushed the feature/ledger branch 5 times, most recently from 2246615 to 6009686 Compare July 5, 2023 09:12
@sergeuz sergeuz force-pushed the feature/ledger branch 2 times, most recently from fece42c to fc48ccf Compare July 7, 2023 16:58
@sergeuz sergeuz marked this pull request as ready for review July 10, 2023 15:16
Copy link
Member

@monkbroc monkbroc left a comment

Choose a reason for hiding this comment

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

Very nice work! I'm approving this PR so it is ready to merge when it's time.


spark::JSONWriter& spark::JSONWriter::value(unsigned long long val) {
writeSeparator();
printf("%llu", val);
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think that our libc support this format type, %llu

#ifndef Wiring_Ledger
#define Wiring_Ledger 0
#endif

Copy link
Contributor

Choose a reason for hiding this comment

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

Please add Variant and Map defines here as well in case we want to reuse them for external libraries.

#define Wiring_Variant 1
#define Wiring_Map 1

@sergeuz sergeuz marked this pull request as draft December 11, 2023 13:19
@sergeuz sergeuz mentioned this pull request Dec 11, 2023
@sergeuz sergeuz merged commit 12ec94a into develop Feb 6, 2024
@sergeuz sergeuz deleted the feature/ledger branch February 6, 2024 17: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.

3 participants