forked from cerc-io/laconicd-deprecated
Merge branch 'develop' into jack/contrib
This commit is contained in:
commit
757da2eff3
11
.github/PULL_REQUEST_TEMPLATE.md
vendored
Normal file
11
.github/PULL_REQUEST_TEMPLATE.md
vendored
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<!-- < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < ☺
|
||||||
|
v ✰ Thanks for creating a PR! ✰
|
||||||
|
v Before smashing the submit button please review the checkboxes.
|
||||||
|
v If a checkbox is n/a - please still include it but + a little note why
|
||||||
|
☺ > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -->
|
||||||
|
|
||||||
|
* [ ] Updated all relevant documentation in docs
|
||||||
|
* [ ] Updated all code comments where relevant
|
||||||
|
* [ ] Wrote tests
|
||||||
|
* [ ] Squashed all commits, uses message "Merge pull request #XYZ: [title]" ([coding standards](https://github.com/tendermint/coding/blob/master/README.md#merging-a-pr))
|
||||||
|
* [ ] Added appropriate labels to PR (ex. wip, ready-for-review, docs)
|
26
Gopkg.lock
generated
26
Gopkg.lock
generated
@ -11,23 +11,22 @@
|
|||||||
branch = "master"
|
branch = "master"
|
||||||
name = "github.com/btcsuite/btcd"
|
name = "github.com/btcsuite/btcd"
|
||||||
packages = ["btcec"]
|
packages = ["btcec"]
|
||||||
revision = "86fed781132ac890ee03e906e4ecd5d6fa180c64"
|
revision = "fdfc19097e7ac6b57035062056f5b7b4638b8898"
|
||||||
|
|
||||||
[[projects]]
|
[[projects]]
|
||||||
branch = "master"
|
branch = "master"
|
||||||
name = "github.com/btcsuite/btcutil"
|
name = "github.com/btcsuite/btcutil"
|
||||||
packages = ["bech32"]
|
packages = ["bech32"]
|
||||||
revision = "d4cc87b860166d00d6b5b9e0d3b3d71d6088d4d4"
|
revision = "ab6388e0c60ae4834a1f57511e20c17b5f78be4b"
|
||||||
|
|
||||||
[[projects]]
|
[[projects]]
|
||||||
branch = "develop"
|
|
||||||
name = "github.com/cosmos/cosmos-sdk"
|
name = "github.com/cosmos/cosmos-sdk"
|
||||||
packages = [
|
packages = [
|
||||||
"store",
|
"store",
|
||||||
"types",
|
"types",
|
||||||
"wire"
|
"wire"
|
||||||
]
|
]
|
||||||
revision = "08625633c62555cbd4ddc61238d35da520d942cb"
|
revision = "0d6f99d6d514916974a7cc1a7e4577c650e987e1"
|
||||||
|
|
||||||
[[projects]]
|
[[projects]]
|
||||||
name = "github.com/davecgh/go-spew"
|
name = "github.com/davecgh/go-spew"
|
||||||
@ -73,8 +72,8 @@
|
|||||||
"rpc",
|
"rpc",
|
||||||
"trie"
|
"trie"
|
||||||
]
|
]
|
||||||
revision = "dea1ce052a10cd7d401a5c04f83f371a06fe293c"
|
revision = "37685930d953bcbe023f9bc65b135a8d8b8f1488"
|
||||||
version = "v1.8.11"
|
version = "v1.8.12"
|
||||||
|
|
||||||
[[projects]]
|
[[projects]]
|
||||||
name = "github.com/go-kit/kit"
|
name = "github.com/go-kit/kit"
|
||||||
@ -179,7 +178,7 @@
|
|||||||
"leveldb/table",
|
"leveldb/table",
|
||||||
"leveldb/util"
|
"leveldb/util"
|
||||||
]
|
]
|
||||||
revision = "0d5a0ceb10cf9ab89fdd744cc8c50a83134f6697"
|
revision = "c4c61651e9e37fa117f53c5a906d3b63090d8445"
|
||||||
|
|
||||||
[[projects]]
|
[[projects]]
|
||||||
branch = "master"
|
branch = "master"
|
||||||
@ -221,15 +220,6 @@
|
|||||||
revision = "5923b6288fe8ce9581936ee97c2bf9cf9c02c2f4"
|
revision = "5923b6288fe8ce9581936ee97c2bf9cf9c02c2f4"
|
||||||
version = "v0.22.0-rc2"
|
version = "v0.22.0-rc2"
|
||||||
|
|
||||||
[[projects]]
|
|
||||||
name = "github.com/tendermint/tmlibs"
|
|
||||||
packages = [
|
|
||||||
"common",
|
|
||||||
"db",
|
|
||||||
"log"
|
|
||||||
]
|
|
||||||
revision = "692f1d86a6e2c0efa698fd1e4541b68c74ffaf38"
|
|
||||||
|
|
||||||
[[projects]]
|
[[projects]]
|
||||||
branch = "master"
|
branch = "master"
|
||||||
name = "golang.org/x/crypto"
|
name = "golang.org/x/crypto"
|
||||||
@ -257,7 +247,7 @@
|
|||||||
"trace",
|
"trace",
|
||||||
"websocket"
|
"websocket"
|
||||||
]
|
]
|
||||||
revision = "ed29d75add3d7c4bf7ca65aac0c6df3d1420216f"
|
revision = "c21de06aaf072cea07f3a65d6970e5c7d8b6cd6d"
|
||||||
|
|
||||||
[[projects]]
|
[[projects]]
|
||||||
name = "golang.org/x/text"
|
name = "golang.org/x/text"
|
||||||
@ -336,6 +326,6 @@
|
|||||||
[solve-meta]
|
[solve-meta]
|
||||||
analyzer-name = "dep"
|
analyzer-name = "dep"
|
||||||
analyzer-version = 1
|
analyzer-version = 1
|
||||||
inputs-digest = "58fcc52223aba442a24118b546ef53abff5352bbdf306e652dee3106822bba50"
|
inputs-digest = "6bd7ad37cf8a53408eeb32265fbc699bf2cc4e7a15b0b98182bcebb5c887cea1"
|
||||||
solver-name = "gps-cdcl"
|
solver-name = "gps-cdcl"
|
||||||
solver-version = 1
|
solver-version = 1
|
||||||
|
@ -1,15 +1,15 @@
|
|||||||
[[constraint]]
|
[[constraint]]
|
||||||
name = "github.com/cosmos/cosmos-sdk"
|
name = "github.com/cosmos/cosmos-sdk"
|
||||||
# TODO: Replace with a stable tagged version
|
# TODO: Replace with a stable tagged version (issue: #3)
|
||||||
branch = "develop"
|
revision = "0d6f99d6d514916974a7cc1a7e4577c650e987e1"
|
||||||
|
|
||||||
[[override]]
|
[[override]]
|
||||||
name = "google.golang.org/genproto"
|
name = "google.golang.org/genproto"
|
||||||
revision = "7fd901a49ba6a7f87732eb344f6e3c5b19d1b200"
|
revision = "7fd901a49ba6a7f87732eb344f6e3c5b19d1b200"
|
||||||
|
|
||||||
[[constraint]]
|
[[constraint]]
|
||||||
version = "=0.22.0-rc2"
|
|
||||||
name = "github.com/tendermint/tendermint"
|
name = "github.com/tendermint/tendermint"
|
||||||
|
version = "=0.22.0-rc2"
|
||||||
|
|
||||||
[prune]
|
[prune]
|
||||||
go-tests = true
|
go-tests = true
|
||||||
|
41
main.go
41
main.go
@ -7,10 +7,15 @@ package main
|
|||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
"flag"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"os"
|
"os"
|
||||||
|
"runtime/pprof"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"github.com/cosmos/ethermint/core"
|
||||||
|
"github.com/cosmos/ethermint/state"
|
||||||
ethcommon "github.com/ethereum/go-ethereum/common"
|
ethcommon "github.com/ethereum/go-ethereum/common"
|
||||||
ethmisc "github.com/ethereum/go-ethereum/consensus/misc"
|
ethmisc "github.com/ethereum/go-ethereum/consensus/misc"
|
||||||
ethcore "github.com/ethereum/go-ethereum/core"
|
ethcore "github.com/ethereum/go-ethereum/core"
|
||||||
@ -19,11 +24,12 @@ import (
|
|||||||
ethvm "github.com/ethereum/go-ethereum/core/vm"
|
ethvm "github.com/ethereum/go-ethereum/core/vm"
|
||||||
ethparams "github.com/ethereum/go-ethereum/params"
|
ethparams "github.com/ethereum/go-ethereum/params"
|
||||||
ethrlp "github.com/ethereum/go-ethereum/rlp"
|
ethrlp "github.com/ethereum/go-ethereum/rlp"
|
||||||
"github.com/ledgerwatch/ethermint/core"
|
|
||||||
"github.com/ledgerwatch/ethermint/state"
|
|
||||||
dbm "github.com/tendermint/tendermint/libs/db"
|
dbm "github.com/tendermint/tendermint/libs/db"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var cpuprofile = flag.String("cpuprofile", "", "write cpu profile `file`")
|
||||||
|
var blockchain = flag.String("blockchain", "blockchain", "file containing blocks to load")
|
||||||
|
|
||||||
var (
|
var (
|
||||||
// TODO: Document...
|
// TODO: Document...
|
||||||
miner501 = ethcommon.HexToAddress("0x35e8e5dC5FBd97c5b421A80B596C030a2Be2A04D")
|
miner501 = ethcommon.HexToAddress("0x35e8e5dC5FBd97c5b421A80B596C030a2Be2A04D")
|
||||||
@ -32,8 +38,22 @@ var (
|
|||||||
|
|
||||||
// TODO: Document...
|
// TODO: Document...
|
||||||
func main() {
|
func main() {
|
||||||
stateDB := dbm.NewDB("state", dbm.MemDBBackend, "")
|
flag.Parse()
|
||||||
codeDB := dbm.NewDB("code", dbm.MemDBBackend, "")
|
if *cpuprofile != "" {
|
||||||
|
f, err := os.Create(*cpuprofile)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Printf("could not create CPU profile: %v\n", err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if err := pprof.StartCPUProfile(f); err != nil {
|
||||||
|
fmt.Printf("could not start CPU profile: %v\n", err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
defer pprof.StopCPUProfile()
|
||||||
|
}
|
||||||
|
|
||||||
|
stateDB := dbm.NewDB("state", dbm.LevelDBBackend, "")
|
||||||
|
codeDB := dbm.NewDB("code", dbm.LevelDBBackend, "")
|
||||||
|
|
||||||
ethermintDB, err := state.NewDatabase(stateDB, codeDB)
|
ethermintDB, err := state.NewDatabase(stateDB, codeDB)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -76,7 +96,7 @@ func main() {
|
|||||||
// command.
|
// command.
|
||||||
//
|
//
|
||||||
// TODO: Allow this to be configurable
|
// TODO: Allow this to be configurable
|
||||||
input, err := os.Open("blockchain")
|
input, err := os.Open(*blockchain)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
@ -101,6 +121,7 @@ func main() {
|
|||||||
vmConfig := ethvm.Config{}
|
vmConfig := ethvm.Config{}
|
||||||
|
|
||||||
n := 0
|
n := 0
|
||||||
|
startTime := time.Now()
|
||||||
for {
|
for {
|
||||||
if err = stream.Decode(&block); err == io.EOF {
|
if err = stream.Decode(&block); err == io.EOF {
|
||||||
err = nil
|
err = nil
|
||||||
@ -195,12 +216,12 @@ func main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
n++
|
n++
|
||||||
if (n%100) == 0 {
|
if (n % 10000) == 0 {
|
||||||
fmt.Printf("processed %d blocks\n", n)
|
fmt.Printf("processed %d blocks, time so far: %v\n", n, time.Since(startTime))
|
||||||
}
|
|
||||||
if n >= 1000 {
|
|
||||||
break
|
|
||||||
}
|
}
|
||||||
|
//if n >= 20000 {
|
||||||
|
// break
|
||||||
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt.Printf("processed %d blocks\n", n)
|
fmt.Printf("processed %d blocks\n", n)
|
||||||
|
@ -3,10 +3,10 @@ package state
|
|||||||
import (
|
import (
|
||||||
"github.com/cosmos/cosmos-sdk/store"
|
"github.com/cosmos/cosmos-sdk/store"
|
||||||
"github.com/cosmos/cosmos-sdk/types"
|
"github.com/cosmos/cosmos-sdk/types"
|
||||||
|
"github.com/cosmos/ethermint/core"
|
||||||
ethcommon "github.com/ethereum/go-ethereum/common"
|
ethcommon "github.com/ethereum/go-ethereum/common"
|
||||||
ethstate "github.com/ethereum/go-ethereum/core/state"
|
ethstate "github.com/ethereum/go-ethereum/core/state"
|
||||||
ethtrie "github.com/ethereum/go-ethereum/trie"
|
ethtrie "github.com/ethereum/go-ethereum/trie"
|
||||||
"github.com/ledgerwatch/ethermint/core"
|
|
||||||
dbm "github.com/tendermint/tendermint/libs/db"
|
dbm "github.com/tendermint/tendermint/libs/db"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user