-
Notifications
You must be signed in to change notification settings - Fork 1
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
Extended price messages #10
Conversation
I thought I left a comment about testing somewhere but can't find it. At the risk of repeating myself: I vaguely recall you mentioned you are all about testing, so where are all the tests 😄 ? This is getting to a point where a bunch of testing seems healthy to me. Especially considering the fact we want this to be highly reliable. What is your thinking regarding testing? |
You are absolutely right, I should have done more testing. I didn't add unittests for components that are only placeholders / mocks and I suggest adding tests there when we replace those with the actual components. ( |
10ba1aa
to
f4dd9ce
Compare
Extends the message format that will be sent to the server by the following fields:
interval_inclusion_messages
: A list of signed message indicating all prices that are within a given intervalvalue_message
: A single message containing the "exact" price valuevalidator_public_key
: For signature validation on the serverThe
value_message
and each element ininterval_inclusion_messages
is signed individually and includes the slot_number to avoid "replay attacks".The values to which to attest in
interval_inclusion_messages
include all values within a relative range of +/-INTERVAL_SIZE_BASIS_POINTS
and a precision ofINTERVAL_STEP_DECIMALS
.So for
current_price = 1800, INTERVAL_SIZE_BASIS_POINTS=100 (0.1%), INTERVAL_STEP_DECIMALS=2 (precision of 1 usd-cent)
it would be ca.1800 * 0.001 * 100 * 2 = 720
entries.For the rust type definitions see here
Additional changes:
JsonFileMessageBroadcaster
to write the messages to individual Json files intest_files
for better inspection.closes #3