Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove memsize #121

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions .github/workflows/devnet-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: devnet-ci

on:
pull_request:
branches:
- devnet

jobs:
build_test:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.19

- name: Build Go-WEMIX
run: make gwemix.tar.gz
- name: Check Build
run: ls -al build/gwemix.tar.gz

lint_test:
strategy:
fail-fast: false
matrix:
version: [1.17, 1.18, 1.19]
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.version }}

- name: Check Lint
run: make lint

unit_test:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.19

- name: Check golang Test Cases
run: |
unset ANDROID_HOME
make test
2 changes: 0 additions & 2 deletions cmd/geth/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -396,8 +396,6 @@ func geth(ctx *cli.Context) error {
// it unlocks any requested accounts, and starts the RPC/IPC interfaces and the
// miner.
func startNode(ctx *cli.Context, stack *node.Node, backend ethapi.Backend, isConsole bool) {
debug.Memsize.Add("node", stack)

// Start up the node itself
utils.StartNode(ctx, stack, isConsole)

Expand Down
7 changes: 6 additions & 1 deletion core/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,10 @@ func SetupGenesisBlockWithOverride(db ethdb.Database, genesis *Genesis, override
// chain config as that would be AllProtocolChanges (applying any new fork
// on top of an existing private network genesis block). In that case, only
// apply the overrides.
if genesis == nil && !(stored == params.MainnetGenesisHash || stored == params.WemixMainnetGenesisHash) {
if genesis == nil &&
!(stored == params.MainnetGenesisHash ||
stored == params.WemixMainnetGenesisHash ||
stored == params.DevnetGenesisHash) {
newcfg = storedcfg
if overrideArrowGlacier != nil {
newcfg.ArrowGlacierBlock = overrideArrowGlacier
Expand All @@ -327,6 +330,8 @@ func SetupGenesisBlockWithOverride(db ethdb.Database, genesis *Genesis, override

func (g *Genesis) configOrDefault(ghash common.Hash) *params.ChainConfig {
switch {
case ghash == params.DevnetGenesisHash:
return params.WemixDevnetChainConfig
case ghash == params.WemixMainnetGenesisHash:
return params.WemixMainnetChainConfig
case ghash == params.WemixTestnetGenesisHash:
Expand Down
1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ require (
github.com/elastic/gosigar v0.8.1-0.20180330100440-37f05ff46ffa
github.com/fatih/color v1.7.0
github.com/fjl/gencodec v0.0.0-20220412091415-8bb9e558978c
github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5
github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff
github.com/go-stack/stack v1.8.0
github.com/golang-jwt/jwt/v4 v4.3.0
Expand Down
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,6 @@ github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys=
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
github.com/fjl/gencodec v0.0.0-20220412091415-8bb9e558978c h1:CndMRAH4JIwxbW8KYq6Q+cGWcGHz0FjGR3QqcInWcW0=
github.com/fjl/gencodec v0.0.0-20220412091415-8bb9e558978c/go.mod h1:AzA8Lj6YtixmJWL+wkKoBGsLWy9gFrAzi4g+5bCKwpY=
github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5 h1:FtmdgXiUlNeRsoNMFlKLDt+S+6hbjVMEW6RGQ7aUf7c=
github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0=
github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k=
github.com/form3tech-oss/jwt-go v3.2.3+incompatible h1:7ZaBxOI7TMoYBfyA3cQHErNNyAWIKUMIwqxEtgHOs5c=
github.com/form3tech-oss/jwt-go v3.2.3+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k=
Expand Down
4 changes: 0 additions & 4 deletions internal/debug/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,11 @@ import (
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/metrics"
"github.com/ethereum/go-ethereum/metrics/exp"
"github.com/fjl/memsize/memsizeui"
"github.com/mattn/go-colorable"
"github.com/mattn/go-isatty"
"gopkg.in/urfave/cli.v1"
)

var Memsize memsizeui.Handler

var (
verbosityFlag = cli.IntFlag{
Name: "verbosity",
Expand Down Expand Up @@ -190,7 +187,6 @@ func StartPProf(address string, withMetrics bool) {
if withMetrics {
exp.Exp(metrics.DefaultRegistry)
}
http.Handle("/memsize/", http.StripPrefix("/memsize", &Memsize))
log.Info("Starting pprof server", "addr", fmt.Sprintf("http://%s/debug/pprof", address))
go func() {
if err := http.ListenAndServe(address, nil); err != nil {
Expand Down
30 changes: 30 additions & 0 deletions params/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ var (
RinkebyGenesisHash = common.HexToHash("0x6341fd3daf94b748c72ced5a5b26028f2474f5f00d824504e4fa37a75767e177")
GoerliGenesisHash = common.HexToHash("0xbf7e331f7f7c1dd2e05159666b3bf8bc7a8a3a9eb1d518969eab529dd9b88c1a")
KilnGenesisHash = common.HexToHash("0x51c7fe41be669f69c45c33a56982cbde405313342d9e2b00d7c91a7b284dd4f8")
DevnetGenesisHash = common.HexToHash("0x45ef4029e520fff2763b31821da9bf761ca73f243bb8e912f4d3004ce3598151")
)

// TrustedCheckpoints associates each known checkpoint with the genesis hash of
Expand Down Expand Up @@ -201,6 +202,35 @@ var (
},
}

WemixDevnetChainConfig = &ChainConfig{
ChainID: big.NewInt(1113),
HomesteadBlock: big.NewInt(0),
DAOForkBlock: big.NewInt(0),
DAOForkSupport: true,
EIP150Block: big.NewInt(0),
EIP155Block: big.NewInt(0),
EIP158Block: big.NewInt(0),
ByzantiumBlock: big.NewInt(0),
ConstantinopleBlock: big.NewInt(0),
PetersburgBlock: big.NewInt(0),
IstanbulBlock: big.NewInt(0),
MuirGlacierBlock: big.NewInt(0),
BerlinBlock: big.NewInt(0),
LondonBlock: big.NewInt(0),
PangyoBlock: big.NewInt(0),
ApplepieBlock: big.NewInt(0),
BriocheBlock: big.NewInt(607_147), // target date: 2024-05-29 16:00:00 (GMT+09)
Ethash: new(EthashConfig),
Brioche: &BriocheConfig{
BlockReward: big.NewInt(1e18),
FirstHalvingBlock: big.NewInt(607_147),
HalvingPeriod: big.NewInt(63_115_200),
FinishRewardBlock: big.NewInt(2_412_358_747), // target date: 2100-11-01 11:00:00 (GMT+09)
HalvingTimes: 16,
HalvingRate: 50,
},
}

// SepoliaChainConfig contains the chain parameters to run a node on the Sepolia test network.
SepoliaChainConfig = &ChainConfig{
ChainID: big.NewInt(11155111),
Expand Down
Loading