Skip to content

Instantly share code, notes, and snippets.

View webmaster128's full-sized avatar

Simon Warta webmaster128

View GitHub Profile
@webmaster128
webmaster128 / F64B8C6A320A9C25FD1EA60B00194817B069C9CBEF19B736117D9339F33F2E51_events.json
Last active October 19, 2022 11:07
Logs from test transaction on Juno testnet (uni-5)
[
{
"type": "coin_spent",
"attributes": [
{
"key": "c3BlbmRlcg==",
"value": "anVubzEwMHM0NXM0aDk0cWRrY2FmbW1ycWZsdGxyZ3lxd3luNmUwNWp4Mg==",
"index": true
},
{
@webmaster128
webmaster128 / config.toml
Last active February 28, 2023 09:39
Nois blocktime settings
# How long we wait for a proposal block before prevoting nil
timeout_propose = "2000ms"
# How much timeout_propose increases with each round
timeout_propose_delta = "500ms"
# How long we wait after receiving +2/3 prevotes for “anything” (ie. not a single block or nil)
timeout_prevote = "1s"
# How much the timeout_prevote increases with each round
timeout_prevote_delta = "500ms"
# How long we wait after receiving +2/3 precommits for “anything” (ie. not a single block or nil)
timeout_precommit = "1s"
[
{
"in": {
"checksum": "13a1fc994cc6d1c81b746ee0c0ff6f90043875e0bf1d9be6b7d779fc978dc2a5",
"creator": "purple1nxvenxve42424242hwamhwamenxvenxvhxf2py",
"creatorData": "9999999999aaaaaaaaaabbbbbbbbbbcccccccccc",
"salt": "61",
"msg": null
},
"intermediate": {
@webmaster128
webmaster128 / sync_juno_from_genesis.md
Last active April 22, 2022 08:25
Sync Juno from genesis (April 7th, 2022)

Run juno node from genesis

Base installation

Tested on Ubuntu 20.04 but should be very similar for all Ubuntu/Debian systems. Logged in as root because I'm feeling lucky.

# Base installation
apt update && apt upgrade -y \
  && apt install -y joe git build-essential jq screen
@webmaster128
webmaster128 / reproduce.sh
Created March 26, 2022 13:43
Juno zero address
$ npx @cosmjs/[email protected] \
--code 'import { toBech32 } from "@cosmjs/encoding"; console.log(toBech32("juno", new Uint8Array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0])))'
# juno1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq93ryqp

The gas comsumption of a comtract built to Wasm by different Rust versions for an Argon2 implementation.

The host is always the same, just Wasm is created differently.

Build command Gas used relative
cargo +1.51.0 wasm && cargo integration-test argon2 -- --nocapture 27143267400000 100.0%
cargo +1.52.1 wasm && cargo integration-test argon2 -- --nocapture 23615946150000 87.0%
cargo +1.53.0 wasm && cargo integration-test argon2 -- --nocapture 23615432700000 87.0%
cargo +1.54.0 wasm && cargo integration-test argon2 -- --nocapture 23611119600000 87.0%
@webmaster128
webmaster128 / leveldb_dump.py
Last active January 22, 2023 22:20 — forked from dexX7/leveldb_dump.py
Python LevelDB debug dumper
#!/usr/bin/env python
import argparse
import binascii
import sys
import leveldb
def b2x(b):
"""Convert bytes to a hex string"""
return binascii.hexlify(b).decode('utf8')
@webmaster128
webmaster128 / WASMVM_PATCH_ANNOUNCEMENT.md
Last active November 10, 2021 00:41
CosmWasm patch to be released on Wednesday, November 10th

A bug in wasmvm has been discovered.

Bug

This bug

  1. can potentially crash the node,
  2. can potentially cause consensus failures.

No code path is known to the author that can cause 1 or 2, but this does not guarantee such paths do not exist.

@webmaster128
webmaster128 / json-schema-ref-parser-cli.js
Created October 13, 2021 20:15
CosmWasm schema to TypeScript .d.ts
#!/usr/bin/env node
const $RefParser = require("@apidevtools/json-schema-ref-parser");
function printUsage() {
console.info("Usage: json-schema-ref-parser-cli FILE")
}
async function main(args) {
if (args.length !== 1) {
@webmaster128
webmaster128 / gist:f571b16b055487bc3e893f37208e7e81
Last active October 1, 2021 08:53 — forked from davepuchyr/genesis.json
Genesis file for iov-mainnet-2
We couldn’t find that file to show.