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

Refactor loading fee asset rates from JSON #12

Closed
fare opened this issue Apr 13, 2024 · 0 comments
Closed

Refactor loading fee asset rates from JSON #12

fare opened this issue Apr 13, 2024 · 0 comments
Assignees

Comments

@fare
Copy link

fare commented Apr 13, 2024

As a followup to #10 we should refactor the set fee asset rates code paths so that

  1. The loading from file and loading from RPC share the same underlying function.
  2. That function validates the entire data structure before it is used to atomically modify the global exchangeRateMap, so that the variable is not left in unusable state if something goes wrong.
  3. Maybe for persistence, in the RPC variant, after the data is validated and before or after the global variable is updated, save the json to a temporary file, fdatasync, then atomically replace the startup file.
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

No branches or pull requests

2 participants