Skip to content

Instantly share code, notes, and snippets.

vmx / replica-encode.go
Created December 7, 2023 14:08
Filecoin replica encoding in Go
View replica-encode.go
package main
import (
vmx /
Created September 20, 2023 13:57
Running lotus-bench for 2KiB sector
# `OUT_DIR` determines where to put the files generated by this script.
# The default directory is `/tmp/lotusbenchdata`
mkdir -p "${OUT_DIR}"
# Create unsealed sector file
./lotus-bench simple addpiece --sector-size 2K /dev/zero "${OUT_DIR}/unsealed"
# Run PreCommit1
vmx /
Created April 3, 2023 12:47
Filecoin replica encoding in Go
vmx /
Last active January 20, 2023 15:47
Filecoin PreCommit1 phase labelling

This is the pseudocode on how the labelling in PC1 works. It's for the 32GiB sector size production parameters.


  • node: A "node" refers to a 256-bit (32 bytes) value of the padded input data. A 32 GiB sector as 1m nodes.
  • label: A "label" refers to a 256-bit (32 bytes) value of one of the layers. It's the result of hashing the node index, layer index, replica ID and multiple labels together.


  • parent_file: That's a pre-generated file (it's fixed and the same for everyone) that contains a list of random 32-bit integers that are used as offsets to read from a file.
  • padded_data: A 32GiB file that has the padding already applied. "Padding" in this case means that each 0th and 1st bit is zero. It could be validated as:
vmx /
Created January 18, 2023 11:01
IPLD Shallow dive 2023-01-18
title tags description slideOptions
IPLD Shallow Dive
IPLD, Launchpad
Launchpad V8 presentaiton 2023-01-18
width theme
vmx /
Created October 12, 2022 10:15
Takes a file and indents at `(` and `[`.
# SPDX-License-Identifier: MIT
# Takes a file and indents at `(` and `[`.
import sys
def main(argv=None):
if argv is None:
argv = sys.argv
vmx / Cargo.toml
Created September 30, 2022 16:26
Multiexp Halo2/sppark comparison
View Cargo.toml
name = "halo2_sppark_msm"
version = "0.1.0"
edition = "2021"
halo2_proofs = "0.2.0"
pasta-msm = "0.1.3"
vmx /
Last active May 23, 2022 09:34
OSGeo wiki LDAP migration debgging
  1. I'm opening a new Firefox window
  2. I'm going to
  3. I click on Log in on top right corner, which gets me to
  4. It redirects to
  5. (BTW: It's 2022-05-23 9:54 CEST)
  6. I enter:
    • Username: Vmische
    • Password: :)
    • Keep me logged in: No
  7. I press "Log in" which gets me to
vmx /
Created January 21, 2022 15:55
Make GDB skip Rust's standard library files
# This script defines a command called `skiprustc` which skips all Rust
# standard library source files when debugging. Just drop this file into your
# `~/.gdbinit.d` directory.
# In order to enable it automatically whenever you debug Rust, you can add
# this hook to your `.gdbinit`:
# define hookpost-run
# skiprustc
# end
vmx /
Created January 12, 2022 22:56
Trying to serialize a CID as enum
use std::fmt;
use serde::{de, ser, Deserialize, Serialize};
pub const ENUM_NAME: &str = "enumname";
pub const ENUM_VARIANT_NAME: &str = "enumvariantname";
//#[derive(Debug, PartialEq, Deserialize, Serialize)]
#[derive(Debug, PartialEq)]
pub struct Cid(String);