Skip to content

Instantly share code, notes, and snippets.

Compaction Alternative Strategy

Compaction works transactionally with the following algorithm:

  • We prepare a transaction, whereby all i/o referenced objects through the API are tracked.
  • We walk the chain and mark reachable objects, keeping 4 finalities of state roots and messages and all headers all the way to genesis.
  • Once the chain walk is complete, we write these objects to a new block store. (depending on performance this step may be better done while walking the chain in the previous step)
  • The new block store that was just created and freshly loaded with the hot items is promoted atomically to the hot store.
  • Now there are basically two cold stores that this algorithm has created which can be handled by any of the following:
  • The old cold store is deleted

Ipc Actors

The IPC actors are implemented using the Diamond pattern. The Diamond pattern is defined by EIP 2535 and the reference implementation of the Diamond library that IPC imports is here. The mechanics of the diamond pattern that is used by IPC is such that for each actor there is a diamond with storage, constructor params, constructor, and a list of facet addresses and function signatures. Facets contain functions that can be called as part of the diamond.

Table of Contents

Current Status for Diamond Upgrades:

  • Command Execution: We use make upgrade-gw-diamond and make upgrade-sr-diamond to check and potentially update each facet of the respective diamonds. In detail it uses the library addresses from the json file in order to determine and compare the deployed bytecode from the contracts in the local folder with what is currently deployed on the chain. The code also has to do a request and compare of all of the functions that are deployed with all of the local functions and execute "add" "update" or "delete" diamondCut calls. This process involves comparing the local JSON config's contract addresses and deployed bytecode against the chain's current state, also cross-verifying the functions.
  • Limitation: The current script doesn't evaluate the deployed bytecode of libraries used by the facets, which is an area we need to improve.

Proposed Next Steps:

  1. Explicit Upgrades:
  • Implement a hardhat script using upgradeFacetOnChain to manually upgra
$ docker container logs fe998fa9c1f0
2024-02-06T22:45:58.029486223Z INFO fendermint::cmd: reading configuration path="/fendermint/config"
2024-02-06T22:45:58.0299569Z INFO fendermint::cmd::run: Connecting to Tendermint at http://validator-1-cometbft:26657/
2024-02-06T22:45:58.030077812Z INFO fendermint::cmd::run: validator key address: t410fwiikaeeavgnvp6z44gu4akg6iwvfnbpi4grj4ji detected
2024-02-06T22:45:58.030442659Z INFO fendermint::cmd::run: opening database path="/data/validator-1/fendermint/data/rocksdb"
2024-02-06T22:45:58.278804109Z INFO libp2p_swarm: local_peer_id=16Uiu2HAmPVA1vATwppSGbvHBX9m4pPV494ndaAxDBC4kg2NvHb64
2024-02-06T22:45:58.279081203Z INFO fendermint::cmd::run: starting the parent finality vote gossip loop...
2024-02-06T22:45:58.279101038Z INFO fendermint::cmd::run: subscribing to gossip...
2024-02-06T22:45:58.279107867Z INFO fendermint::cmd::run: starting the IPLD Resolver Service...
2024-02-06T22:45:58.279323093Z INFO fendermint::cmd::run: starting the IPLD Resolver...
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
abstract contract Initializable {
uint8 private _initialized;
bool private _initializing;
const httpsurl = "https://wallaby.node.glif.io/rpc/v0"
const ethers = require("ethers");
const httpsProvider = new ethers.providers.JsonRpcProvider(httpsurl);
(async () => {
const provider = new ethers.providers.JsonRpcProvider("https://wallaby.node.glif.io/rpc/v0")
const wallet = new ethers.Wallet("PUTPRIVATEKEYHERE");
const address = wallet.address;
let feeData = await httpsProvider.getFeeData();
package main
import (
"bytes"
"encoding/gob"
"encoding/json"
"fmt"
"github.com/application-research/estuary/pinner"
"github.com/libp2p/go-libp2p-core/peer"
package main
import (
"github.com/application-research/estuary/pinner/types"
"github.com/libp2p/go-libp2p-core/peer"
"bytes"
"encoding/gob"
"fmt"
"github.com/ipfs/go-cid"
package main
import (
"github.com/google/uuid"
"github.com/libp2p/go-libp2p-core/peer"
"fmt"
ma "github.com/multiformats/go-multiaddr"
"bytes"
panic: interface conversion: interface is nil, not encoding.BinaryUnmarshaler [recovered]
panic: interface conversion: interface is nil, not encoding.BinaryUnmarshaler
goroutine 1 [running]:
encoding/gob.catchError(0xc000252070)
/usr/local/go/src/encoding/gob/error.go:38 +0x6d
panic({0x1275860, 0xc00007b9b0})
/usr/local/go/src/runtime/panic.go:838 +0x207
encoding/gob.(*Decoder).decodeGobDecoder(0x40?, 0xc00002bbc0, 0xc00006a9a0, {0x1291580?, 0xc000013f10?, 0xc00020b718?})
/usr/local/go/src/encoding/gob/decode.go:736 +0x196