Skip to content

Instantly share code, notes, and snippets.

View p-offtermatt's full-sized avatar
🧁

Philip Offtermatt p-offtermatt

🧁
View GitHub Profile
------------------------------ MODULE bcastFolklore_bmc ------------------------------
(* An encoding of a parameterized model of the reliable broadcast by message diffusion [1]
with crashed failures in TLA+. This broadcast algorithm is described in Fig. 4 of [1].
[1] Chandra, Tushar Deepak, and Sam Toueg. "Unreliable failure detectors for reliable
distributed systems." Journal of the ACM (JACM) 43.2 (1996): 225-267.
A short description of the parameterized model is described in:
---------------------------- MODULE counterexample ----------------------------
EXTENDS ManyBoxes
(* Constant initialization state *)
(* ConstInit == TRUE *)
ConstInit == TRUE
(* Initial state *)
(* State0 ==
@p-offtermatt
p-offtermatt / erc20.py
Last active May 30, 2022 16:06
erc20.py
import random
from recordclass import recordclass
ADDRESSES = list(range(5))
MAX_PENDING = 5
Transfer = recordclass("Transfer", ["sender", "dst", "value"])
TransferFrom = recordclass("TransferFrom", ["sender", "src", "dst", "value"])
@p-offtermatt
p-offtermatt / local-testnet-debug.sh
Last active June 13, 2023 07:12
local-testnet.sh
#!/bin/bash
set -eux
# User balance of stake tokens
USER_COINS="100000000000stake"
# Amount of stake tokens staked
STAKE="100000000stake"
# Node IP address
NODE_IP="127.0.0.1"
--> Running linter
golangci-lint run ./... --config .golangci.yml
cmd/interchain-security-pd/main.go:6:2: import 'github.com/cosmos/cosmos-sdk/server' is not allowed from list 'Main' (depguard)
"github.com/cosmos/cosmos-sdk/server"
^
cmd/interchain-security-pd/main.go:7:2: import 'github.com/cosmos/cosmos-sdk/server/cmd' is not allowed from list 'Main' (depguard)
svrcmd "github.com/cosmos/cosmos-sdk/server/cmd"
^
cmd/interchain-security-pd/main.go:8:2: import 'github.com/cosmos/interchain-security/v2/app/provider' is not allowed from list 'Main' (depguard)
app "github.com/cosmos/interchain-security/v2/app/provider"
@p-offtermatt
p-offtermatt / broken.qnt
Last active August 4, 2023 13:18
Quint ?Bug? in parsing
// -*- mode: Bluespec; -*-
module common {
type Validator = str
type Chain = str
pure val Provider = "provider"
pure val Consumer = "consumer"
type Timestamp = int
@p-offtermatt
p-offtermatt / 1.log
Created August 15, 2023 15:53
CometMock test failures
// see the pr here: https://github.com/cosmos/interchain-security/actions/runs/5867349452/job/15907879477?pr=1204
2023-08-15T12:58:55.5576794Z Requested labels: ubuntu-latest
2023-08-15T12:58:55.5577068Z Job defined at: cosmos/interchain-security/.github/workflows/automated-tests.yml@refs/pull/1204/merge
2023-08-15T12:58:55.5577184Z Waiting for a runner to pick up this job...
2023-08-15T12:58:57.3597118Z Job is waiting for a hosted runner to come online.
2023-08-15T12:58:59.8955329Z Job is about to start running on the hosted runner: GitHub Actions 9 (hosted)
2023-08-15T12:59:02.3579049Z Current runner version: '2.307.1'
2023-08-15T12:59:02.3605168Z ##[group]Operating System
2023-08-15T12:59:02.3605696Z Ubuntu
@p-offtermatt
p-offtermatt / README.md
Created August 16, 2023 16:32
Manual test for penumbra and CometMock

Install penumbra and CometMock. Make sure cometmock is compiled from branch v0.34.x. My penumbra version is from branch 2771-cometmock-smoketest.

Run cometmock-test.sh This will print out two commands, one for penumbra and one for CometMock. Just copy-paste the commands and run them (in separate terminals). Run pd first, give it a second until it's started, then run the one for CometMock.

They look like this for me: cargo run --quiet --release --bin pd -- start --home /Users/offtermatt/.penumbra/testnet_data/node0/pd for pd

@p-offtermatt
p-offtermatt / vote-extensions-1.sh
Last active October 10, 2023 06:53
Local Testnet with standard CometBFT
#!/bin/bash
set -eux
BINARY_NAME=$1
# User balance of stake tokens
USER_COINS="100000000000stake"
# Amount of stake tokens staked
STAKE="100000000stake"
# Node IP address
@p-offtermatt
p-offtermatt / gas.json
Created December 7, 2023 08:59
Utility script to verify that --gas=auto is nondeterministic
#!/bin/bash
# Run the first command
output=$(interchain-security-pd tx staking delegate cosmosvaloper19pe9pg5dv9k5fzgzmsrgnw9rl9asf7ddtrgtng 500stake --from validatoralice --chain-id provi --home provi/validatoralice --node tcp://7.7.7.4:26658 --keyring-backend test --gas=auto --gas-adjustment=1 --output json -y)
# Extract the txhash from the output
txhash=$(echo "$output" | jq -r '.txhash')
sleep 1