I'd like to thank @ribasushi for helping figuring all this out.
git clone https://github.com/filecoin-project/lotus
cd lotus
I'd like to thank @ribasushi for helping figuring all this out.
git clone https://github.com/filecoin-project/lotus
cd lotus
#!/usr/bin/env python3 | |
# SPDX-License-Identifier: MIT | |
# Override every 32 byte with a zero. The input file is modified! | |
# | |
# Start e.g. with a file with random bytes: | |
# | |
# dd if=/dev/urandom of=/tmp/random.dat count=1 bs=1MiB | |
# |
package main | |
import ( | |
"fmt" | |
"io/ioutil" | |
"log" | |
"os" | |
"github.com/consensys/gnark-crypto/ecc/bls12-381/fr" | |
) |
#!/bin/sh | |
# `OUT_DIR` determines where to put the files generated by this script. | |
# The default directory is `/tmp/lotusbenchdata` | |
${OUT_DIR:=/tmp/lotusbenchdata} | |
mkdir -p "${OUT_DIR}" | |
# Create unsealed sector file | |
./lotus-bench simple addpiece --sector-size 2K /dev/zero "${OUT_DIR}/unsealed" | |
# Run PreCommit1 |
The encoding of a unsealed data into the replica data with a sector key is simple field additions. The Rust source is at https://github.com/filecoin-project/rust-fil-proofs/blob/fcb22da26b2ac6ea6acafd1da41cc4f098ae332b/storage-proofs-porep/src/encode.rs.
The following is a translation into a Python-like pseudo code, where I add the Go functions to call as comments.
def encode(key_bytes, value_bytes):
'''`key_bytes` and `value_bytes` are each 32 bytes long.
This is the pseudocode on how the labelling in PC1 works. It's for the 32GiB sector size production parameters.
Glossary:
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.Inputs:
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:title | tags | description | slideOptions | ||||
---|---|---|---|---|---|---|---|
IPLD Shallow Dive |
IPLD, Launchpad |
Launchpad V8 presentaiton 2023-01-18 |
|
# SPDX-License-Identifier: MIT | |
# | |
# Takes a file and indents at `(` and `[`. | |
import sys | |
def main(argv=None): | |
if argv is None: | |
argv = sys.argv |
[package] | |
name = "halo2_sppark_msm" | |
version = "0.1.0" | |
edition = "2021" | |
[dependencies] | |
halo2_proofs = "0.2.0" | |
pasta-msm = "0.1.3" |
Log in
on top right corner, which gets me to https://staging.wiki.osgeo.org/w/index.php?title=Special:UserLogin&returnto=Main+Page