-
Notifications
You must be signed in to change notification settings - Fork 0
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
Worker #100
Merged
Merged
Worker #100
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This will be important as Nock gets scry, as it will need to know where to read from, and the meta table will have fields that talk about which tables scry ought to read from magically
This reflects the general idea that this represnets environmental information, with jettedness being a apart of this
eff87de
to
48ebfda
Compare
ac9d5d5
to
386fbef
Compare
This serves as the basis for what a real order would expect the format to be. Making this an explicit type makes it easy to refactor the intenral representation without having to go and change every instance of it
960e1b8
to
6ea05c4
Compare
We remove all known warnings, this makes it nice as `mix test` and other commands will not spit any wanrings anymore
This ensures that the db is initialized before we run any tests. This matters in a lot of topics that require the DB to be online
This module consists of two parts: 1. An ordering map which tells of the latest order in the qualification map 2. A qualification map which maps from a qualified key to the stored value Further we provide types for everything so the code can be somewhat grocked by looking at the types
We test: 1. reads 2. blocking_reads 3. puts 4. blocking_reads with data not in yet
The intended strategy is to hold a current order and cache of ids to orders, to better get timestamps of the keyspace This is highly inefficient but is the best we can do without partitioning the key_space explicitly somehow
As we can see by running: mix test --cover we end up testing most of the module, with just a few basic calls, the ordering system is quite simple, and one can just take a number to figure out where they are next in line Percentage | Module -----------|-------------------------- 60.00% | Anoma.Node.Storage 92.86% | Anoma.Node.Storage.Communicator 96.43% | Anoma.Node.Storage.Ordering
With this, we have a very slow way of effectively slowly snapshotting the database. Very slow, someone should do a better method than what I'm doing here
Currently this caller blocking APΙ only has - `caller_blocking_read_id/2` - `caller_blocking_read_id/3` However these are the key functions needed to implementing scry like behavior
This makes sure that the logic for reading at an ID is fairly stable and works as intended
Scry gets a snapshot from storage and from there indexs into the proper keys
This helps when other files need to use these definitions
I implement the increment function and test out that scrying indeed works
This worker just waits to write to the database, blocking on both reading and writing
We do this by acting as the mempool by hand and telling it what order to execute the workers in
6ea05c4
to
8de0c7e
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
A simple worker node and corresponding tests