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

✨ Data Proxy Registry #316

Closed
Thomasvdam opened this issue Aug 12, 2024 · 0 comments · Fixed by #339
Closed

✨ Data Proxy Registry #316

Thomasvdam opened this issue Aug 12, 2024 · 0 comments · Fixed by #339
Assignees
Labels
type: feature ✨ New feature or request

Comments

@Thomasvdam
Copy link
Member

Thomasvdam commented Aug 12, 2024

✨ Feature

Motivation

The data proxy registry module will serve as a repository for public keys and the fee of the associated data proxies.

After executing a proxy_http_fetch method an overlay node will query the data proxy registry with the public key it received from the upstream data proxy node. It can use the params to determine the amount of gas that was consumed by the proxy_http_fetch call.

Warning

We will want to implement a delay to fee updates to prevent attacks and give consumers a chance to respond to fee changes.

Implementation

The store for this module would have the following key-value scheme:

[map]  public_key -> data_provider_params
# Delayed update queue
[set]  height/timestamp | public_key
[item] module_params

Where data_provider_params are the settings to be used for that provider:

  • Payout address: a seda address that receives the rewards for providing data-proxy services.
  • Fee in aseda: the cost of the data-proxy service. This can be converted to gas using the gas price of a data request.
  • Upcoming fee: a data-proxy operator can schedule a fee change to give consumers the opportunity to edit their data requests. Null when no fee change is scheduled. Otherwise a struct that includes the new fee and the height at which it comes into effect.

module_params should at least include:

  • Fee update delay: a positive integer that specifies how many blocks need to pass before a fee change comes into effect.

There should be 2 transaction endpoints. One for registering a key with params, and another to edit the params for an existing public key.

$ sedad tx dataproxy register <pubkey> <params> --from <address>
# Updates the payout address right away. If a new fee is specified it will be scheduled according to the delay in the module params, unless a manual delay is specified (which should be higher than the minimum).
$ sedad tx dataproxy edit <pubkey> <params> --from <address> [--delay int64]

Scheduling a fee update while there is already a pending fee update overwrites the old one with the new update and calculates a new effective height based on the delay.
This should also remove the old entry from the queue.

There should be a query endpoint to retrieve the params for a particular public key.

$ sedad query dataproxy proxy-params <pubkey>
@Thomasvdam Thomasvdam added the type: feature ✨ New feature or request label Aug 12, 2024
@Thomasvdam Thomasvdam self-assigned this Aug 14, 2024
Thomasvdam added a commit that referenced this issue Aug 15, 2024
Thomasvdam added a commit that referenced this issue Aug 15, 2024
Thomasvdam added a commit that referenced this issue Aug 15, 2024
Thomasvdam added a commit that referenced this issue Aug 16, 2024
Thomasvdam added a commit that referenced this issue Aug 16, 2024
Also introduces an admin address to make updates to the proxy config
easier for operators. An alternative would be to use a sequence number,
but that makes the whole managamenet process more cumbersome for the
operator.

Part-of: #316
Thomasvdam added a commit that referenced this issue Aug 16, 2024
Thomasvdam added a commit that referenced this issue Aug 17, 2024
Thomasvdam added a commit that referenced this issue Aug 17, 2024
Also introduces an admin address to make updates to the proxy config
easier for operators. An alternative would be to use a sequence number,
but that makes the whole managamenet process more cumbersome for the
operator.

Part-of: #316
Thomasvdam added a commit that referenced this issue Aug 17, 2024
Thomasvdam added a commit that referenced this issue Aug 17, 2024
Thomasvdam added a commit that referenced this issue Aug 17, 2024
Also conform to new import formatting rules.

Part-of: #316
Thomasvdam added a commit that referenced this issue Aug 17, 2024
Thomasvdam added a commit that referenced this issue Aug 17, 2024
Thomasvdam added a commit that referenced this issue Aug 17, 2024
Thomasvdam added a commit that referenced this issue Aug 17, 2024
Thomasvdam added a commit that referenced this issue Aug 17, 2024
Also move the helpers to common_test.go

Part-of: #316
Thomasvdam added a commit that referenced this issue Aug 17, 2024
Thomasvdam added a commit that referenced this issue Aug 17, 2024
Thomasvdam added a commit that referenced this issue Aug 17, 2024
Thomasvdam added a commit that referenced this issue Aug 19, 2024
Thomasvdam added a commit that referenced this issue Aug 21, 2024
Thomasvdam added a commit that referenced this issue Aug 22, 2024
Thomasvdam added a commit that referenced this issue Aug 22, 2024
Thomasvdam added a commit that referenced this issue Aug 22, 2024
Also introduces an admin address to make updates to the proxy config
easier for operators. An alternative would be to use a sequence number,
but that makes the whole managamenet process more cumbersome for the
operator.

Part-of: #316
Thomasvdam added a commit that referenced this issue Aug 22, 2024
Thomasvdam added a commit that referenced this issue Aug 22, 2024
Also conform to new import formatting rules.

Part-of: #316
Thomasvdam added a commit that referenced this issue Aug 22, 2024
Thomasvdam added a commit that referenced this issue Aug 22, 2024
Thomasvdam added a commit that referenced this issue Aug 22, 2024
Thomasvdam added a commit that referenced this issue Aug 22, 2024
Also move the helpers to common_test.go

Part-of: #316
Thomasvdam added a commit that referenced this issue Aug 22, 2024
Thomasvdam added a commit that referenced this issue Aug 22, 2024
Thomasvdam added a commit that referenced this issue Aug 22, 2024
Thomasvdam added a commit that referenced this issue Aug 22, 2024
Thomasvdam added a commit that referenced this issue Aug 22, 2024
Thomasvdam added a commit that referenced this issue Aug 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature ✨ New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant