Skip to content

Instantly share code, notes, and snippets.

View p-offtermatt's full-sized avatar
🧁

Philip Offtermatt p-offtermatt

🧁
View GitHub Profile
@p-offtermatt
p-offtermatt / determiniser.sh
Created April 3, 2024 06:58
Useful files for working with Quint MBT traces
#!/bin/bash
# Replace 'your_command_here' with your actual command, ensuring it's properly quoted if it contains spaces or special characters
COMMAND='go test -v'
EXPECTED_OUT="Running traces from the traces folder done"
# Loop 1000 times
for i in {1..100}
@p-offtermatt
p-offtermatt / local-testnet.sh
Last active March 25, 2024 09:51
Local testnet for partial set security
#!/bin/bash
set -eux
# User balance of stake tokens
USER_COINS="100000000000stake"
# Amount of stake tokens staked
STAKE="100000000stake"
# Node IP address
NODE_IP="0.0.0.0"
@p-offtermatt
p-offtermatt / genesis.json
Created March 18, 2024 08:50
Files for the local partial set security testnet
{
"genesis_time": "2024-03-18T08:39:55.3864Z",
"chain_id": "provider",
"initial_height": "1",
"consensus_params": {
"block": {
"max_bytes": "22020096",
"max_gas": "-1"
},
"evidence": {
@p-offtermatt
p-offtermatt / find_violation.sh
Created March 1, 2024 11:09
Quint: Identifying a violation from an `all` invariant
#!/bin/bash
### This script exists to find out which of the invariants from an "all"
### invariant like all{AInv, BInv, CInv} is violated.
### To use: paste the command you ran Quint with into the command variable
### Then, run find_violation.sh 'seed', where 'seed' is the seed provided by Quint for the violation.
# Check if a seed is provided
if [ $# -eq 0 ]; then
echo "Usage: $0 <seed>"
@p-offtermatt
p-offtermatt / trace.itf
Created January 16, 2024 16:50
Quint trace for type system weirdness
This file has been truncated, but you can view the full file.
{"stage":"running","warnings":[],"modules":[{"id":4618,"name":"Time","declarations":[{"id":4595,"kind":"typedef","name":"Time","type":{"id":4594,"kind":"int"}},{"id":4597,"kind":"def","name":"Second","qualifier":"pureval","expr":{"id":4596,"kind":"int","value":1}},{"id":4601,"kind":"def","name":"Minute","qualifier":"pureval","expr":{"id":4600,"kind":"app","opcode":"imul","args":[{"id":4598,"kind":"int","value":60},{"id":4599,"kind":"name","name":"Second"}]}},{"id":4605,"kind":"def","name":"Hour","qualifier":"pureval","expr":{"id":4604,"kind":"app","opcode":"imul","args":[{"id":4602,"kind":"int","value":60},{"id":4603,"kind":"name","name":"Minute"}]}},{"id":4609,"kind":"def","name":"Day","qualifier":"pureval","expr":{"id":4608,"kind":"app","opcode":"imul","args":[{"id":4606,"kind":"int","value":24},{"id":4607,"kind":"name","name":"Hour"}]}},{"id":4613,"kind":"def","name":"Week","qualifier":"pureval","expr":{"id":4612,"kind":"app","opcode":"imul","args":[{"id":4610,"kind":"int","value":7},{"id":4611,"kind":"nam
@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
@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 / 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 / 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 / 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