Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
e4d2c9d
Corrected typos (#1114)
shystrui1199 Feb 11, 2025
6c9f4e4
Create fip-removeBatchBalancer.md
irenegia Feb 4, 2025
641547f
Update README.md
irenegia Feb 5, 2025
fce5f54
Update fip-removeBatchBalancer.md
irenegia Feb 5, 2025
d63a76d
Update fip-removeBatchBalancer.md
irenegia Feb 5, 2025
56ea277
Update fip-removeBatchBalancer.md
irenegia Feb 5, 2025
34c18d2
Create FIPxxxxAppendix.md
irenegia Feb 5, 2025
f166d58
Update fip-removeBatchBalancer.md
irenegia Feb 5, 2025
f99884a
Initial draft of specification and implementation details
rvagg Feb 6, 2025
d3ed0e6
Add migration details and termination memoisation/reconciliation details
rvagg Feb 7, 2025
0ac06a4
Add section detailing CS changes needed to fix Calibnet
rvagg Feb 7, 2025
554a545
Further implementation notes and added test cases
rvagg Feb 7, 2025
10b004a
Update fip-removeBatchBalancer.md
irenegia Feb 10, 2025
dcd447f
Apply suggestions from code review
irenegia Feb 11, 2025
e97fb3e
Apply suggestions from code review
momack2 Feb 11, 2025
4207517
Update fip-removeBatchBalancer.md
irenegia Feb 12, 2025
f981bce
Rename to 0100
rvagg Feb 13, 2025
c7b279b
Update implementation details
rvagg Feb 13, 2025
5ab26b6
Remove power actor changes, clean-up and clarify details
rvagg Feb 13, 2025
8aeb077
fix grammar nit
momack2 Feb 13, 2025
63efc69
Update fip-0100.md
irenegia Feb 13, 2025
0129d11
Update fip-0100.md
irenegia Feb 13, 2025
2002388
Update and rename FIPxxxxAppendix.md to FIP0100Appendix.md
irenegia Feb 13, 2025
d116111
Update and rename FIP0100Appendix.md to fip0100Appendix.md
irenegia Feb 13, 2025
f5e8e9a
Update fip-0100.md
irenegia Feb 13, 2025
c800f2e
Update fip-0100.md
irenegia Feb 13, 2025
190e379
Update FIPS/fip-0100.md
momack2 Feb 13, 2025
ea103d8
Update fip0100Appendix.md
irenegia Feb 13, 2025
40e4450
Move FIP-0100 to Last Call (#1123)
momack2 Feb 14, 2025
9f2c911
Add quality phase timeout multiplier for improved proposal propagation
masih Feb 17, 2025
5361386
FIP: proposal to remove ProveCommitAggregate
rvagg Feb 5, 2025
fd6bd31
Update FIP-0097 with implementation details and security considerations
snissn Feb 7, 2025
178521a
Remove website build infrastructure
rvagg Feb 14, 2025
0e4bdfc
Add side-channel EC chain propagation to FIP-0086 (#1126)
masih Feb 20, 2025
703b100
Fix YAML error
rvagg Feb 13, 2025
6217fce
Update FIP0098 & FIP0100 Last Call Status
luckyparadise Feb 24, 2025
32191fb
FRC-0099: Delegation of Authority for F3 Parameter Setting (#1112)
BigLep Feb 26, 2025
481cf56
FIP 0100 clarifications during last call
BigLep Feb 14, 2025
4ce5747
More detailed implementation notes, account for QAP multiplier
rvagg Feb 21, 2025
a191898
Update the dailyFee formula and fee description
irenegia Feb 21, 2025
3f62dc6
Improve and make implementation details more correct
rvagg Feb 24, 2025
6125e02
Address review items
rvagg Feb 24, 2025
0b946ee
Increase accuracy of byte power multiplier by 1dp to 2.1537e-25
rvagg Feb 26, 2025
48a44eb
Opt for rounded-down multiplier, 2.1536e-25
rvagg Feb 26, 2025
d39ffff
Update fip-0100.md
irenegia Feb 26, 2025
3793db5
Update fip0100Appendix.md
irenegia Feb 26, 2025
6b98e3d
Update fip-0100.md
irenegia Feb 26, 2025
ce7900b
Integrate suggestions from feedback
rvagg Feb 27, 2025
249b681
Add graph resources locally
rvagg Feb 27, 2025
377d7c0
Further QAP clarification
rvagg Feb 27, 2025
586eea4
Add images from appendix locally
rvagg Feb 27, 2025
2a0dad5
cs-based-fee-evolution graph edited
irenegia Feb 27, 2025
b921b3e
Delete resources/fip-0100/cs-based-fee-evolution.jpg
irenegia Feb 27, 2025
012108d
Delete resources/fip-0100/cs-based-fee-evolution_expanded.jpg
irenegia Feb 27, 2025
404294d
Delete resources/fip-0100/br-based-fee-evolution.jpg
irenegia Feb 27, 2025
017848a
appendix graphs updated
irenegia Feb 27, 2025
e7ff4cf
Update fip0100Appendix.md
irenegia Feb 27, 2025
65636a9
Graphs caption and explanation edited
irenegia Feb 27, 2025
283ddbb
Update fip0100Appendix.md
irenegia Feb 27, 2025
e0e0a30
Pull fee multipler graph locally
rvagg Feb 27, 2025
d0d6d32
Add VestingFunds optimization details
rvagg Feb 25, 2025
d0d6e19
Add size stats in justification for changing VestingFunds
rvagg Feb 27, 2025
de3c8e2
FIP-0100: Improve Summary & Abstract for clarity
rvagg Feb 28, 2025
6d2605e
initial drafts of FIP for bls precompiles
snissn Mar 13, 2025
2948924
fip draft update
snissn Mar 14, 2025
148bf29
Update fip-draft.md
snissn Mar 19, 2025
c95ab05
use functions and remove efficient
snissn Mar 20, 2025
a92cc67
Update fip-draft.md
snissn Apr 4, 2025
1c95c6e
Update fip-draft.md
snissn Apr 4, 2025
7f5718c
Update fip-draft.md
snissn Apr 4, 2025
09b18dc
Update fip-draft.md
snissn Apr 4, 2025
aaa9761
Update fip-draft.md
aaravm Apr 4, 2025
1052566
Update fip-draft.md
snissn Apr 4, 2025
204cb36
Update fip-draft.md
snissn Apr 4, 2025
5977cf8
Update fip-draft.md
snissn Apr 4, 2025
37da35d
Update fip-draft.md
snissn Apr 4, 2025
3fd9b74
Update fip-draft.md
snissn Apr 11, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
.DS_Store
dist/
node_modules
_site
vendor/
fission.yaml
.sass-cache
__pycache__
.venv
6 changes: 0 additions & 6 deletions 404.html

This file was deleted.

93 changes: 90 additions & 3 deletions FIPS/fip-0086.md
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,18 @@ type PowerTableEntry struct {
Power BigInt
Key BLSPublicKey
}

// PartialGossiPBFTMessage represents a GossiPBFT message with a zeroed out vote
// value, and a precomputed MerkelizeValue of the original vote value.
//
// This key allows verification of the GossiPBFTMessage signature without needing
// the specific chain tipsets represented by its Vote.Value.
type PartialGossiPBFTMessage struct {
*GossiPBFTMessage

// VoteValueKey is the precomputed MerkelizeValue of the GossiPBFTMessage Payload.Value.
VoteValueKey []byte
}
```

Values for phase numbers are:
Expand Down Expand Up @@ -418,7 +430,7 @@ GossiPBFT(instance, inputChain, baseChain, committee) → decision, certificate:
// Committee is implicitly used to calculate quora.

01: round ← 0
02: proposal ← inputChain // CHain that the participant locally believes should be decided.
02: proposal ← inputChain // Chain that the participant locally believes should be decided.
03: timeout ← 2*Δ
04: timeout_rebroadcast ← timeout + 1 // Any value larger than timeout, at implementation discretion.
05: value ← proposal // Used to communicate the voted value to others (proposal or 丄)
Expand All @@ -430,10 +442,13 @@ GossiPBFT(instance, inputChain, baseChain, committee) → decision, certificate:
10: while (phase != DECIDE) {
// QUALTIY
11: if (round = 0)
12: BEBroadcast <QUALITY, value>; trigger (timeout)
// The timeout for QUALITY may set to be longer than the other phases using a
// multiplier. This is to increase the chances of collecting a strong quorum
// of QUALITY messages and reduce potential hindrance on successive phases.
12: BEBroadcast <QUALITY, value>; trigger (timeout * quality_timeout_multiplier)
13: phase ← QUALITY
14: collect a clean set M of valid QUALITY messages from this instance
until HasStrongQuorum(proposal, M) OR timeout expires
until HasStrongQuorum(proposal, M) OR timeout * quality_timeout_multiplier expires
15: C ← C ∪ {prefix : IsPrefix(prefix,proposal) and HasStrongQuorum(prefix,M)}
16: proposal ← longest prefix ∈ C // At least baseChain, or something longer
17: value ← proposal
Expand Down Expand Up @@ -687,6 +702,7 @@ The synchronization of participants within an instance is achieved with a timeou

As an optimization, participants may finish a phase once its execution is determined by the received messages, without waiting for the timeout. For example, if a participant receives QUALITY messages from all participants, it can proceed to the next phase without waiting for the timeout. More generally, if the remaining valid messages to be received cannot change the execution of the phase, regardless of the values contained in the messages, then a participant may continue to the next phase.

In the `QUALITY` phase, a $\Delta$ multiplier is applied to facilitate better propagation of proposals from all honest participants at the start of a GPBFT instance. This adjustment is because inadequate or delayed proposal propagation during this phase can significantly increase the likelihood of requiring additional rounds, thereby raising the chances of defaulting to the base decision. This issue is exacerbated in large networks with intermittent connectivity or message delivery throttling, leading to longer finalization times, which are undesirable.

### Synchronization of Participants across Instances

Expand Down Expand Up @@ -803,6 +819,77 @@ A smart contract will never accept a finality certificate earlier than those it

Only one such smart contract is needed on a single blockchain execution environment, which can provide the resulting final tipset information to others.

### Side-channel EC Chain Propagation
In GPBFT protocol, each message contains at least one payload, with each payload holding a value that represents the EC chain being decided. This value makes up a large portion of the total message size with a high rate of duplicities throughout a typical instance progression. To significantly reduce the size of GPBFT messages and the bandwidth required for their propagation, a side channel is introduced to separately propagate a mapping between a chain's `MerkelizeValue` and the actual Value itself. Instead of directly propagating full GPBFT messages, a partial GPBFT message is propagated. This partial message includes all components except the EC chain value being decided, along with the `MerkelizeValue` corresponding to that chain.

This approach reduces the size of GPBFT messages and allows for deduplication in EC chain value propagation. The use of `MerkelizeValue` ensures that the signature of partial messages remains verifiable without needing the actual chain being decided. Most validation processes can still be performed, except for checking the base tipset relative to the head of the previously finalized chain.

Implementers need to buffer partial messages with unknown `MerkelizeValue` as well as discovered `MerkelizeValue`s with their unseen corresponding partial messages. Security recommendations include adjusting the priority of buffered data based on the progress of GPBFT to ensure timely processing and validation with a bound buffer size. This adjustment helps maintain the integrity and efficiency of the protocol while managing the propagation of EC chain values effectively.

#### Partial Message Signature Verification

The partial message signature verification process is the same as `GossiPBFT` message verification, except that the `MerkelizeValue` is used in place of computing it from the actual chain.

#### Chain Exchange Protocol

The chain exchange protocol facilitates the dissemination of EC chain values that are being decided among the participants.
The chain exchange message format is as follows:

```go
type ChainExchangeMessage struct {
Instance uint64 // ID of the GPBFT instance.
Chain []ECTipset // The vote value being decided.
Timestamp int64 // The timestamp at which the message was created.
}
```

The instance ID identifies the GPBFT instance to which the chain value belongs. The chain value represents the EC chain being decided in that instance. The timestamp ensures message freshness and must be within `MaxTimestampAge` to be valid.

The timestamp is adjusted to the current time, rounded down to the nearest multiple of the chain exchange `RebroadcastInterval`. This adjustment helps minimize the number of messages propagated across the network.

The chain exchange protocol should ensure that the chain being decided is propagated to all participants within the $\Delta$-synchrony bound. Delays in propagation can lead to decisions defaulting to the base chain, but will not disrupt GPBFT progress since the base chain is known to all participants.

Within each GPBFT instance, a chain broadcast is triggered by:
1. **Phase Transition**: Immediately triggers a broadcast.
2. **Periodic Rebroadcast**: Occurs every `RebroadcastInterval`.

The broadcasted chain is selected based on:
* The triggering event.
* Previous chain broadcasts in the instance.

This ensures the most informative chain is shared. Participants can infer all intermediate `MerkelizeValue`s from longer chains, making shorter chains redundant if they are prefixes of longer ones.

Chain selection procedure is as follows:
* If no prior broadcast exists, use the chain from the triggering event.
* Otherwise, switch to the new chain only if it is not a prefix of the last broadcast chain.

This logic results in the QUALITY phase proposal being broadcast until the participant is swayed.

#### Partial Message Validation

The validation of `PartialGossiPBFTMessage`s is the same as non-partial messages except for the following:
* An empty `MerkelizeValue` indicates a zero-valued chain, i.e., bottom.
* The `MerkelizeValue` is used in place of the actual chain value for signature verification.
* The `MerkelizeValue` is used in place of the actual chain value for justification phase validation relative to Vote.
* The `MerkelizeValue` is used in place of the actual chain value for justification signature verification.

The above substitutions make it possible to partially validate the messages prior to buffering. To complete the validation upon discovering the chain that corresponds to a `MerkelizeValue`, the participant must:
* Check that the EC Chain itself is structurally valid, e.g. order of tipset epochs, etc.
* Check that the EC Chain indeed corresponds to the `MerkelizeValue` in the partial message.
* Check that the base tipset of the EC Chain being decided is the head of the previously finalized chain.

Once the validation is complete, the message is passed to GPBFT.

#### Buffering Recommendations

Participants must buffer partial messages until the corresponding `MerkelizeValue` is identified. To prevent unbounded growth, the buffer should be bounded and prioritize messages based on GPBFT progress to ensure timely processing and validation.

Buffering recommendations include:
* Resolve partial messages with known `MerkelizeValue`s first.
* Prioritize discovering `MerkelizeValue`s for pending partial messages.
* Limit the number of concurrent instances buffered, considering GPBFT progress and committee lookback.
* Implement a timeout mechanism to discard unresolved buffered partial messages after a certain period.

### Merkle Tree Format

This protocol uses merkle trees as vector commitments to commit to both (a) the tipsets in an instance and (b) the values committed to in each tipset. It uses a single, balanced binary merkle tree format in both cases, where:
Expand Down
115 changes: 87 additions & 28 deletions FIPS/fip-0097.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,26 +27,67 @@ While the FEVM implementation utilizes permanent storage for practical reasons,
### Opcode Descriptions

#### `TLOAD`
- **Opcode Hex:** `0x5C`
- **Stack Input:**
- `key`: Location of the transient storage value to load
- **Stack Output:**
- `value`: Stored value or zero if no value exists
- **Description:** Retrieves the value associated with `key` in the transient storage for the current transaction.
- **Opcode Hex:** `0x5C`
- **Stack Input:**
- `key`: Location of the transient storage value to load
- **Stack Output:**
- `value`: Stored value or zero if no value exists
- **Description:**
- Retrieves the value associated with `key` in transient storage.
- If the transaction has ended, transient storage is cleared, and `TLOAD` returns zero.

#### `TSTORE`
- **Opcode Hex:** `0x5D`
- **Stack Input:**
- `key`: Location to store the value
- `value`: Value to store
- **Output:** None
- **Description:** Stores `value` at the specified `key` in the transient storage for the current transaction.
- **Opcode Hex:** `0x5D`
- **Stack Input:**
- `key`: Location to store the value
- `value`: Value to store
- **Output:** None
- **Description:**
- Stores `value` at the specified `key` in transient storage.
- Data is cleared at the end of the transaction.


### Lifecycle Management
Transient storage is valid only within the context of a single transaction. A lifecycle mechanism tracks transaction metadata (`origin` and `nonce`) to enforce lifecycle validation.
Transient storage is valid only within a single transaction. The system enforces this behavior by:

- **Tracking `origin` and `nonce`**: Each transient storage slot is associated with the transaction’s origin actor and nonce.
- **Resetting Storage on New Transactions**: If a new transaction begins, previous transient storage data is discarded.
- **Allowing Reentrancy**: If a contract calls itself within a transaction, it retains access to the same transient storage.

At the implementation level, transient storage is managed via `StateKamt<U256, U256>`, ensuring transaction-scoped isolation.

### Implementation Details
The FEVM implements transient storage using a lifecycle validation mechanism to ensure data remains accessible only during the originating transaction. This validation enforces the same behavior as Ethereum’s transient storage. Internally, transient storage relies on permanent storage to manage lifecycle data and state while ensuring functional adherence to Ethereum’s behavior.
The FEVM implements transient storage (`TLOAD` and `TSTORE`) using an internal lifecycle validation mechanism. This ensures that transient storage remains scoped to the transaction and is automatically cleared once execution ends.

##### Data Structures
The implementation introduces the following Rust data structures:

- **`TransientData`**: Stores the transient storage state for a contract within a transaction.
- **`TransientDataLifespan`**: Tracks the lifespan of transient storage using the `origin` actor ID and `nonce` of the transaction.

```rust
pub struct TransientData {
pub transient_data_state: Cid, // CID of the transient storage map
pub transient_data_lifespan: TransientDataLifespan, // Lifecycle validation
}

pub struct TransientDataLifespan {
pub origin: ActorID, // Origin actor ID
pub nonce: u64, // Unique transaction identifier
}
```

##### Storage and Lifecycle Enforcement
The FEVM utilizes **persistent storage** to back transient data but enforces strict lifecycle rules to ensure it behaves like Ethereum's transient storage. The system:

1. **Checks Transaction Context**:
- Before every `TLOAD` or `TSTORE` operation, the contract verifies the transaction’s `origin` and `nonce` to ensure validity.

2. **Clears Storage at Transaction End**:
- If a new transaction begins, the system resets the `TransientData` state, ensuring no data persists across transactions.

3. **Handles Reentrant Calls**:
- If a contract invokes itself within the same transaction, transient storage remains available.

---

Expand All @@ -63,25 +104,43 @@ At the time of writing, support for `TLOAD` and `TSTORE` in current versions of

## Test Cases

### Essential Tests
1. **Basic Functionality:**
- Verify `TLOAD` retrieves the correct value.
- Verify `TSTORE` writes data to the transient storage correctly.
- Verify `TLOAD` from an unitialized location returns the zero value.
##### **1. Basic Functionality**
- Verify `TLOAD` retrieves the correct value.
- Verify `TSTORE` writes data to transient storage.
- Verify `TLOAD` from an uninitialized location returns zero.

##### **2. Lifecycle Validation**
- Verify transient storage is **cleared** at the end of a transaction.
- Verify **reentrant calls** access the same transient storage space.
- Verify **nested contract calls** have independent transient storage.

##### **3. Cross-Contract Isolation**
- Deploy two contracts, `A` and `B`.
- Have contract `A` write to transient storage.
- Have contract `B` attempt to access `A`'s transient storage.
- Verify that `B` cannot read `A`'s transient storage.

##### **4. Handling Reverted Transactions**
- Store a value in transient storage.
- Revert the transaction before it completes.
- Verify that no transient storage data persists.

2. **Lifecycle Validation:**
- Verify that transient storage is automatically cleared and becomes inaccessible after the transaction ends.
- Verify that transient storage is properly cleared at the end of each transaction and any out-of-lifecycle data does not interfere with subsequent transaction operations.
- Verify that nested contracts have independent transient storage spaces can read and write independently.
- Verify that memory remains accessible and stable after contract reentry.

---

## Security Considerations
Transient storage introduces minimal additional risk compared to existing state storage. Lifecycle validation ensures storage is inaccessible outside the originating transaction. Security measures include:
- Preventing out-of-bounds memory access.
- Ensuring transient storage clears properly after a transaction ends.
- Ensuring nested contracts do not have access to each other's memory spaces.
Transient storage introduces security considerations, primarily around ensuring that data does not persist beyond the transaction. To mitigate risks:

1. **Automatic Clearing at Transaction End**
- Transient storage is reset when a new transaction starts.
- Even if the contract does not explicitly clear storage, the FEVM enforces reset.

2. **Preventing Cross-Contract Leakage**
- Contracts cannot access transient storage from other contracts.
- Each contract’s transient storage is isolated by its execution context.

3. **Reentrancy Safety**
- Contracts can safely store temporary data within a transaction.

---

Expand Down
4 changes: 2 additions & 2 deletions FIPS/fip-0098.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
fip: "0098"
title: Simplify termination fee calculation to a fixed percentage of initial pledge
author: @Schwartz10, @anorth, @jimpick
author: Jonathan Schwartz (@Schwartz10), Alex North (@anorth), Jim Pick (@jimpick)
discussions-to: https://github.com/filecoin-project/FIPs/discussions/1036
status: Last Call
status: Accepted
type: Technical
category: Core
created: 2024-09-26
Expand Down
Loading