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

Feat/get opn migration #31

Merged
merged 27 commits into from
Jul 29, 2024
Merged

Feat/get opn migration #31

merged 27 commits into from
Jul 29, 2024

Conversation

Khrafts
Copy link
Collaborator

@Khrafts Khrafts commented Jun 17, 2024

This pull request includes several updates, with the primary focus on migrating from GET to OPN. Historically, we reinterpreted all instances of GET as OPN using a 1:1000 conversion rate, accompanied by an adjustment of fuel prices.

Key changes include:

  1. GET to OPN Migration: We transitioned from GET to OPN, applying a 1:1000 conversion rate between GET and OPN. Fuel prices have been readjusted accordingly to reflect this change.

  2. Soft Deprecation of the Price Variable: The price variable on integrator entities has been soft-deprecated. Contracts now emit fuel usage in USD, aligning with our shift from an average fuel price model on top-ups to a FIFO fuel model.

  3. Accurate Tracking of Fuel Usage: All events for version 2.2 (the latest iteration of fuel economics) now accurately track fuel usage in USD.

  4. Average Fuel Usage Calculation for v2.1 Events: We externally calculated the average fuel used by integrators between v2.1 and v2.2 and used this data for calculations on v2.1 events. Events prior to v2.1 continue to use the average integrator prices for USD calculations.

jackturnbull and others added 21 commits March 18, 2024 14:44
Fuel is now spent directly on mint rather than at check-in or
invalidation post Economics 2.1 migration so this means that
currenReservedFuel will always be 0 post-migration.

This fix sets this to zero after the migration takes place and ensures
that it is not counted upwards from version 2.1 onwards.
Previous version would double count events as we use the same event
factory address so we need to keep the EventImplementation singular (or
place an endBlock at the top of each EventImplementation V2 mapping).
These combines the two to toggle behaviour depending on the upgrade
block.
The migration of GET to OPN is on a 1:1000 ratio. We chose to historically
represent all fuel as OPN therefore multiplying all GET readings by 1e3.
We refer to the dark days as the timeline between v2.1 and v2.2
of the contracts. Due to the change in our fuel pricing model -
from an average pricing to a FIFO pricing - we had difficulty
accurately tracking the fuel used in USD for a sale/resale.
Previously, this was easily calculated by the average integrator
price and the fuel tokens. This was no longer possible after v2.1.

We have provided a fix by externally tracking the fuel prices of an
integrator during the dark days and use that for fuel deductions.
A more permanent solution was introduced in the v2.2 contracts
which is to include the fuel used in USD on sale/resale events.
- Merged the abis for the v2.2 and v2 events
- Fixed wrong tracking fuel balances for IntegratorDay entity
- Update startblock for v2.2 on development
@Khrafts Khrafts merged commit fa9902e into master Jul 29, 2024
1 check passed
@Khrafts Khrafts deleted the feat/get-opn-migration branch July 29, 2024 12:46
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.

2 participants