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

Reference: Params and proto objects #15

Open
calebsheridan opened this issue Mar 26, 2020 · 0 comments
Open

Reference: Params and proto objects #15

calebsheridan opened this issue Mar 26, 2020 · 0 comments

Comments

@calebsheridan
Copy link
Member

calebsheridan commented Mar 26, 2020

Description

⚠️ This is a reference ticket that describes the schema for tracking Params. Work to build this schema should take place in other tickets:

Params are platform configurations that can be changed by spells.

Updated schema

type Param @entity {
  id: ID!
  description: String!      # Human-readable description
  currentValue: String!     # String representation of the value
  platform: Platform!       # Affected platform
  target: Target!           # Affected contract
  history: [ParamHistory]! @derivedFrom(field:"param")
  proposals: [ParamProposal]! @derivedFrom(field:"param")
}

type ParamHistory @entity {
  id: ID!
  param: Param!
  oldValue: String!
  newValue: String!
  changedInSpell: Spell! # Spell that changed the Param when it was executed
  timestamp: BigInt!     # Time of spell execution
}

type ParamProposal @entity {
  id: ID!
  param: Param!
  proposedValue: String!
  proposedInSpell: Spell!
  timestamp: BigInt!      # Time of spell creation
  eta: BigInt!            # Eta of spell
}

Current value

When a Spell is executed, the current value of the Param should be updated.

The current value of the Param will also often be set at contract execution. This must be handled manually for now, when the Params are initially created.

The old value will be placed in a proto object ParamHistory.

Proposed values

Params may have multiple proposed values from multiple spells. These are tracked and updated as a proto object ParamProposal.

The proto object only needs to be created when a new Spell is cast and does not need to be further updated.

@calebsheridan calebsheridan changed the title Human-readable params Add Params and proto objects Mar 26, 2020
@calebsheridan calebsheridan changed the title Add Params and proto objects Reference: Params and proto objects Mar 29, 2020
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

1 participant