Skip to content

docs(specs): Customizability#903

Merged
raulk merged 2 commits intomainfrom
customazability
Jun 10, 2024
Merged

docs(specs): Customizability#903
raulk merged 2 commits intomainfrom
customazability

Conversation

@fridrik01
Copy link
Copy Markdown
Contributor

Added documentation for IPC Customazbility

@fridrik01 fridrik01 requested a review from a team May 8, 2024 16:05
@fridrik01 fridrik01 marked this pull request as ready for review May 8, 2024 16:38
@maciejwitowski maciejwitowski changed the title Add IPC spec - Customizability Spec: Customizability May 9, 2024

Your actor has now been deployed and we should be able to send it messages!

# Genesis Parameters
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Should this maybe be a separate spec doc?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yeah, definitely belongs in a separate doc.

- `timestamp` is the number of seconds since UNIX epoch
- `network_version` is used by the FVM to select gas pricing policy
- `base_fee` is measured in *atto* and represents the base price for gas
- `power_scale` is the number of decimals to take into account from the FIL token collateral balance when converting it into voting power expressed as `u64`, which is what CometBFT expects. For example if the scale is 0 then every 1 FIL gives 1 voting power, if it’s 3 then every 0.001 FIL does, and if it’s -1 then every 10 FIL. The power is rounded upwards, so that we don’t end up with 0 power, which would be rejected by CometBFT; for example if the scale is 1, then both 1.1 FIL and 1.9 FIL give 2 power.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

maybe mention that it only works for the Collateral (ie PoS) mode?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

So... as we've noted recently, this applies in Federated mode too.


# Gas policy

The gas price in the FVM is by default [determined](https://github.com/filecoin-project/ref-fvm/blob/c39d880d086aa2e771c7190163436e02715d80f3/fvm/src/machine/mod.rs#L156) by the network version when the `NetworkConfig` is created, but could further be customised by assigning to the `price_list` field. Should Fendermint have to do that, it would be in the [constructor](https://github.com/consensus-shipyard/ipc/blob/7af25c4c860f5ab828e8177927a0f8b6b7a7cc74/fendermint/vm/interpreter/src/fvm/state/exec.rs#L132) of the `FvmExecState`.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

assigning to the price_list field

price_list is hypothetical here or where does it come from?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The FVM will return a price_list for the specified Filecoin network version, but the user can customize it before creating an FVM Machine.

Copy link
Copy Markdown
Contributor

@raulk raulk left a comment

Choose a reason for hiding this comment

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

The first half is duplicative with the relevant section in the developer docs, and isn't really a specification. Will merge for now and clean up the redundancy once we also merge #1014.

@raulk raulk changed the title Spec: Customizability docs(specs): Customizability Jun 10, 2024
@raulk raulk merged commit 96e741b into main Jun 10, 2024
@raulk raulk deleted the customazability branch June 10, 2024 11:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

No open projects
Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants