Skip to content

Instantly share code, notes, and snippets.

View vyzo's full-sized avatar

vyzo vyzo

  • Internet
  • Planet Earth
View GitHub Profile
@vyzo
vyzo / gas.md
Created March 8, 2023 14:12
Gas in FEVM

How Gas works in FEVM

Gas in FEVM works quite differently from the EVM. Instead of assigning a fixed gas cost in each instruction, FEVM charges FVM/FIL gas based on WASM code execution of the FEVM interpreter.

When executing a message that invokes an EVM contract, the FVM charges for the message chain inclusion (when the message originates off chain) and then invokes the actor that hosts the contract. The actor is an instance of the EVM actor, which uses the FEVM interpreter to

@vyzo
vyzo / episub-1000.txt
Created August 7, 2022 10:12
Preliminary EPISUB results with 1000 nodes
>>> Running simulations with nodes: 1000, sources: 5, messages: 60, rng-state: #(3906201752 593635287 270152346 3570226858 1968263816 2261421116)
+++ gossipsub/v1.0
=== simulation summary ===
nodes: 1000
messages: 60
sources: 5
publish: 60
deliver: 60000
!!pubsub.message: 377370
!!pubsub.connect: 20000
@vyzo
vyzo / episub-500.txt
Created August 5, 2022 04:27
Preliminary EPISUB results with 500 nodes
>>> Running simulations with nodes: 500, sources: 5, messages: 60, rng-state: #(450148173 3493484164 3958739570 345133728 1597196054 3722366174)
+++ gossipsub/v1.0
=== simulation summary ===
nodes: 500
messages: 60
sources: 5
publish: 60
deliver: 30000
!!pubsub.message: 189451
!!pubsub.connect: 10000
@vyzo
vyzo / episub-250.txt
Created August 4, 2022 09:53
Preliminary EPISUB results with 250 nodes
>>> Running simulations with nodes: 250, sources: 5, messages: 60, rng-state: #(1288990669 1488285165 2465753151 3626470647 1609608140 743526869)
+++ gossipsub/v1.0
=== simulation summary ===
nodes: 250
messages: 60
sources: 5
publish: 60
deliver: 15000
!!pubsub.message: 96320
!!pubsub.connect: 5000
@vyzo
vyzo / episub-experiments.md
Created August 2, 2022 09:15
Some Preliminary EPISUB results

Some Expirements with Episub

The gossipsub simulator now has experimental support for episub -- see also the discussion in the specs repo.

The episub extension comes with two new control messages, CHOKE and UNCHOKE. Choking a peer means instructing it to not directly forward messages, except self-published through flood publish, even though it remains in the mesh; instead the peer sends gossip. Unchoking a peer means instructing it to resume forwarding messages.

@vyzo
vyzo / txnlock.c
Created July 8, 2021 16:54
Transaction Locks that allow recursive RLocking
#include <pthread.h>
#include <sys/types.h>
u_int64_t goid(void) {
return (u_int64_t)pthread_self();
}
@vyzo
vyzo / accum.ss
Created June 5, 2020 15:03
A simple program to measure list accumulation performance
(import :std/srfi/1
:std/misc/list
:gerbil/gambit/os)
(export main)
(def (accum1 lst)
(let lp ((rest lst) (r []))
(match rest
([e . rest]
(lp rest (cons e r)))
@vyzo
vyzo / scoresim.ss
Last active May 12, 2020 12:05
A program to simulate mesh propagation and score accumulation in gossipsub
;; -*- Gerbil -*-
(import :std/sugar
:std/getopt
:std/iter
:std/srfi/1
:std/misc/pqueue
:std/misc/shuffle
:gerbil/gambit)
(export main)
@vyzo
vyzo / build-log.txt
Created April 20, 2020 20:51
dockercloud failure
Cloning into '.'...
Switched to a new branch 'make'
Pulling cache layers for index.docker.io/gerbil/scheme:latest...
Done!
KernelVersion: 4.4.0-1060-aws
Components: [{u'Version': u'18.03.1-ee-3', u'Name': u'Engine', u'Details': {u'KernelVersion': u'4.4.0-1060-aws', u'Os': u'linux', u'BuildTime': u'2018-08-30T18:42:30.000000000+00:00', u'ApiVersion': u'1.37', u'MinAPIVersion': u'1.12', u'GitCommit': u'b9a5c95', u'Arch': u'amd64', u'Experimental': u'false', u'GoVersion': u'go1.10.2'}}]
Arch: amd64
BuildTime: 2018-08-30T18:42:30.000000000+00:00
ApiVersion: 1.37
Platform: {u'Name': u''}
@vyzo
vyzo / params.md
Created March 18, 2020 14:57
Calculating Peer Score Configuration Parameters

Calculating Peer Score Configuration Parameters

Configuration Parameters and Counters

Configuration parameters for a topic:

// P1
TimeInMeshWeight  float64
TimeInMeshQuantum time.Duration
TimeInMeshCap float64