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

Internal Audit #1

Open
wants to merge 197 commits into
base: empty
Choose a base branch
from
Open

Internal Audit #1

wants to merge 197 commits into from

Conversation

dillu24
Copy link
Collaborator

@dillu24 dillu24 commented Feb 15, 2023

This PR is meant to be a place where we can leave comments and suggestions

jacquesvcritien and others added 30 commits November 17, 2022 23:38
- price push retries
- state initialisation
- round details queries
- different job type requests
- handling of prices/results from cl node
- added docs
Copy link
Collaborator Author

@dillu24 dillu24 left a comment

Choose a reason for hiding this comment

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

Final review.

@@ -89,8 +91,8 @@ Smart Contract - https://github.com/Agoric/agoric-sdk/tree/8720d22ddf25a005aee25

The middleware is needed to:
1. Create CL jobs. CL jobs are created every minute. A cron job is not used in order to be able to pass in particular inputs to the job run so that the progress of the request can be stored and monitored.
2. Get results back from the CL node.
3. Query smart contract for new rounds.
2. Get price responses back from the CL node after Job requests are made from the middleware.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Suggested change
2. Get price responses back from the CL node after Job requests are made from the middleware.
2. Get price responses back from the CL node after job requests are made from the middleware.

What it does:
- Checks whether the following criteria is satisfied:
- SEND_CHECK_INTERVAL seconds passed from the last price push update to ensure that multiple price updates are not pushed simultaneously
- If it is a new round and we the oracle has not started the current on-chain round or if it is not a new round but the oracle has not submitted to the current round on-chain
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Suggested change
- If it is a new round and we the oracle has not started the current on-chain round or if it is not a new round but the oracle has not submitted to the current round on-chain
- If it is a new round and the oracle has not started the current on-chain round, or if it is not a new round but the oracle has not submitted to the current round on-chain

<div id='postadapter'></div>

a. <u>/adapter</u>: This is the endpoint which is used to accept job results from CL job requests. This endpoint does the following:
- Read the result, request ID, request Type and job name from the received body
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Suggested change
- Read the result, request ID, request Type and job name from the received body
- Read the result, request ID, request type and job name from the received body

| SUBMIT_RETRIES | The number of retries to try when submitting a price<br>on-chain and it fails | 3 |
| BLOCK_INTERVAL | The block time of the chain in seconds. This is used<br>to query the price and round at every interval. | 6 |
| SEND_CHECK_INTERVAL | The interval in seconds which is waited between each send. | 45 |
| AGORIC_RPC | The Agoric's node RPC endpoint | http://0.0.0.0:26657 |
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Suggested change
| AGORIC_RPC | The Agoric's node RPC endpoint | http://0.0.0.0:26657 |
| AGORIC_RPC | The Agoric node's RPC endpoint | http://0.0.0.0:26657 |

migrations/001_create_table.sql Show resolved Hide resolved
src/oracle/bridge.js Outdated Show resolved Hide resolved
src/oracle/controller.js Outdated Show resolved Hide resolved
src/oracle/monitor.js Outdated Show resolved Hide resolved
src/oracle/monitor.js Outdated Show resolved Hide resolved
src/oracle/monitor.js Outdated Show resolved Hide resolved
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