I hereby claim:
- I am s1na on github.
- I am s1na (https://keybase.io/s1na) on keybase.
- I have a public key ASBQQGpV7qMKDBDidSZPffR8nybNpISmrpKBtgad0ismhwo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
// Code generated via abigen V2 - DO NOT EDIT. | |
// This file is a generated binding and any manual changes will be lost. | |
package db | |
import ( | |
"errors" | |
"math/big" | |
"github.com/ethereum/go-ethereum/accounts/abi" |
const { request, gql } = require('graphql-request') | |
const ethers = require('ethers') | |
const assert = require('assert') | |
const { writeFile } = require('fs/promises') | |
const endpoint = 'http://localhost:8545/graphql' | |
async function main() { | |
const count = parseInt(process.argv[2]) | |
// Latest & pending are not supported |
const { request } = require('graphql-request') | |
const endpoint = 'http://localhost:8545/graphql' | |
// Taken with modifications from: | |
// https://github.com/graphql/graphql-js/blob/bba149cbdd122dc7278693c91e4aa90703ca7894/src/utilities/getIntrospectionQuery.ts#L66 | |
// Notable changes: | |
// - Deleted directives | |
// - Excluded deprecated fields and args | |
// - Excluded subscription type (none exists in the spec) |
OpName | Address | |
---|---|---|
BLOCKHASH | 0xd1ceeeeee83f8bcf3bedad437202b6154e9f5405 | |
DIFFICULTY | 0xa9d4be962d5e2b2331125d423fad76b1021d301f | |
DIFFICULTY | 0x9380a66619b5f6ca17629054bfceda879db4268c | |
BLOCKHASH | 0x0ba45a8b5d5575935b8158a88c631e9f9c95a2e5 | |
BLOCKHASH | 0xb77feddb7e627a78140a2a32cac65a49ed1dba8e | |
BLOCKHASH | 0x5650ca3f0289c762f83dde1894faa9b6d0d89798 | |
BLOCKHASH | 0x742fcf5ba052d9912499acf208d5410ae31d49ac | |
BLOCKHASH | 0xb6ed7644c69416d67b522e20bc294a9a9b405b31 | |
DIFFICULTY | 0x00000000000017c75025d397b91d284bbe8fc7f2 |
import * as assert from 'assert' | |
import BN = require('bn.js') | |
import { keccak256 } from 'ethereumjs-util' | |
import { encode, decode } from 'rlp' | |
import { verifyMultiproof, decodeInstructions } from './multiproof' | |
interface TestSuite { | |
preStateRoot: Buffer | |
blockData: Buffer | |
} |
In the context of stateless execution, a node does not need to store the full state of the blockchain and expects each transaction to come with all the necessary parts of the state and proofs for the validity of those parts.
The responsibility of attaching the proofs falls on the transaction sender or a third party who's storing the necessary parts of the trie. If a transaction doesn't make it immediately into the next block, the blockchain advances forward, modifying the state (and the state root). This causes all the proofs that were generated against a previous state root to become stale.
This script simulates the following scenario:
const assert = require('assert') | |
const { promisify } = require('util') | |
const BN = require('bn.js') | |
const Trie = require('merkle-patricia-tree') | |
const Account = require('ethereumjs-account').default | |
const StateManager = require('ethereumjs-vm/dist/state/stateManager').default | |
const PStateManager = require('ethereumjs-vm/dist/state/promisified').default | |
const { keccak256, ecsign, stripZeros } = require('ethereumjs-util') | |
const { encode } = require('rlp') |
[package] | |
name = "zkmul" | |
version = "0.0.0" | |
license = "Apache-2.0" | |
repository = "https://github.com/ewasm/scout" | |
description = "zero knowledge multiplication" | |
publish = false | |
edition = "2018" | |
[lib] |
A simple scout script which simply increments the last byte of the pre state root, and saves that as post state root.
Install assemblyscript:
npm i -D AssemblyScript/assemblyscript