Skip to content

blockfrost: use cost_models_raw in getProtocolParameters#285

Open
sorki wants to merge 1 commit into
spacebudz:mainfrom
sorki:srk/blockfrostRawCostModels
Open

blockfrost: use cost_models_raw in getProtocolParameters#285
sorki wants to merge 1 commit into
spacebudz:mainfrom
sorki:srk/blockfrostRawCostModels

Conversation

@sorki

@sorki sorki commented Apr 28, 2026

Copy link
Copy Markdown

original cost_models have their names included in keys

  "cost_models": {
    "PlutusV1": {
      "addInteger-cpu-arguments-intercept": 197209,
      "addInteger-cpu-arguments-slope": 0
    },
    "PlutusV2": {
      "addInteger-cpu-arguments-intercept": 197209,
      "addInteger-cpu-arguments-slope": 0
    }
  },

vs cost_models_raw have only a list of values

  "cost_models_raw": {
    "PlutusV1": [
      197209,
      0
    ],
    "PlutusV2": [
      197209,
      0
    ]
  },

Removed code block transforms former format into latter, since names are not needed to construct a cost model for Plutus CEK machine.

This means less (temporary) breakage on hard forks till Blockfrost updates cost models parameter names as just happened on preview network.

Related to blockfrost/blockfrost-backend-ryo#325

original `cost_models` have their names included in keys

```json
  "cost_models": {
    "PlutusV1": {
      "addInteger-cpu-arguments-intercept": 197209,
      "addInteger-cpu-arguments-slope": 0
    },
    "PlutusV2": {
      "addInteger-cpu-arguments-intercept": 197209,
      "addInteger-cpu-arguments-slope": 0
    }
  },
```

vs `cost_models_raw` have only a list of values

```json
  "cost_models_raw": {
    "PlutusV1": [
      197209,
      0
    ],
    "PlutusV2": [
      197209,
      0
    ]
  },
```

Removed code block transforms former format into latter, since
names are not needed to construct a cost model for Plutus CEK machine.

This means less (temporary) breakage on hard forks till Blockfrost
updates cost models parameter names as just happened on preview network.

Related to blockfrost/blockfrost-backend-ryo#325
@ross-spencer

Copy link
Copy Markdown

Does anyone know if this is the only fix required to update Lucid for the new hard forks?

@sorki

sorki commented Jun 22, 2026

Copy link
Copy Markdown
Author

The fix is not required, it is already fixed on Blockfrost side. It's nice to have for future compatibility as the old format is now depraced.

Anyway you are probably better off migrating to lucid-evolution since this repository doesn't seem to be maintained anymore.

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