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

Add homestead and constantinople flags #9

Merged
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
2 changes: 1 addition & 1 deletion client/ethclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ func (c *client) EstimateGas(ctx context.Context, msg ethereum.CallMsg) (*big.In
if err != nil {
return nil, err
}
return gas, nil
return new(big.Int).SetUint64(gas), nil
}

// SendRawTransaction injects a signed transaction into the pending pool for execution.
Expand Down
6 changes: 3 additions & 3 deletions cmd/istanbul/setup/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
"strings"

"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/p2p/discover"
"github.com/ethereum/go-ethereum/p2p/discv5"
istcommon "github.com/jpmorganchase/istanbul-tools/common"
"github.com/jpmorganchase/istanbul-tools/docker/compose"
"github.com/jpmorganchase/istanbul-tools/genesis"
Expand Down Expand Up @@ -79,8 +79,8 @@ func gen(ctx *cli.Context) error {
v := &validatorInfo{
Address: addrs[i],
Nodekey: nodekeys[i],
NodeInfo: discover.NewNode(
discover.PubkeyID(&keys[i].PublicKey),
NodeInfo: discv5.NewNode(
discv5.PubkeyID(&keys[i].PublicKey),
net.ParseIP("0.0.0.0"),
0,
uint16(30303)).String(),
Expand Down
2 changes: 1 addition & 1 deletion common/transactions.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ var (
)

func SendEther(client client.Client, from *ecdsa.PrivateKey, to common.Address, amount *big.Int, nonce uint64) error {
tx := types.NewTransaction(nonce, to, amount, big.NewInt(DefaultGasLimit), big.NewInt(0).SetInt64(DefaultGasPrice), []byte{})
tx := types.NewTransaction(nonce, to, amount, uint64(DefaultGasLimit), big.NewInt(0).SetInt64(DefaultGasPrice), []byte{})
signedTx, err := types.SignTx(tx, types.HomesteadSigner{}, from)
if err != nil {
log.Error("Failed to sign transaction", "tx", tx, "err", err)
Expand Down
6 changes: 3 additions & 3 deletions common/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (
"github.com/ethereum/go-ethereum/accounts"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/p2p/discover"
"github.com/ethereum/go-ethereum/p2p/discv5"
uuid "github.com/satori/go.uuid"
)

Expand Down Expand Up @@ -129,8 +129,8 @@ func GenerateStaticNodesAt(dir string, nodekeys []string, ipAddrs []string) (fil
log.Error("Failed to create key from hex", "hex", nodekey, "err", err)
return ""
}
node := discover.NewNode(
discover.PubkeyID(&key.PublicKey),
node := discv5.NewNode(
discv5.PubkeyID(&key.PublicKey),
net.ParseIP(ipAddrs[i]),
0,
uint16(30303))
Expand Down
14 changes: 9 additions & 5 deletions genesis/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,19 @@ func New(options ...Option) *core.Genesis {
Difficulty: big.NewInt(InitDifficulty),
Alloc: make(core.GenesisAlloc),
Config: &params.ChainConfig{
ChainId: big.NewInt(10),
ByzantiumBlock: big.NewInt(1),
EIP150Block: big.NewInt(1),
EIP155Block: big.NewInt(1),
EIP158Block: big.NewInt(1),
ChainID: big.NewInt(10),
HomesteadBlock: big.NewInt(0),
ByzantiumBlock: big.NewInt(0),
ConstantinopleBlock: big.NewInt(0),
EIP150Block: big.NewInt(0),
EIP155Block: big.NewInt(0),
EIP158Block: big.NewInt(0),
TransactionSizeLimit: 64,
Istanbul: &params.IstanbulConfig{
ProposerPolicy: uint64(istanbul.DefaultConfig.ProposerPolicy),
Epoch: istanbul.DefaultConfig.Epoch,
},
IsQuorum: true,
},
Mixhash: types.IstanbulDigest,
}
Expand Down
3 changes: 2 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/jpmorganchase/istanbul-tools

replace github.com/ethereum/go-ethereum => github.com/jpmorganchase/quorum v2.1.1+incompatible
replace github.com/ethereum/go-ethereum => github.com/jpmorganchase/quorum v2.2.4+incompatible

replace github.com/Sirupsen/logrus => github.com/sirupsen/logrus v1.1.1

Expand All @@ -13,6 +13,7 @@ require (
github.com/aristanetworks/goarista v0.0.0-20181130030053-f7cbe917ef62 // indirect
github.com/btcsuite/btcd v0.0.0-20181130015935-7d2daa5bfef2 // indirect
github.com/cespare/cp v1.1.1 // indirect
github.com/deckarep/golang-set v1.7.1 // indirect
github.com/docker/distribution v0.0.0-20181129231500-d9e12182359e // indirect
github.com/docker/docker v0.0.0-20170504205632-89658bed64c2
github.com/docker/go-connections v0.4.0
Expand Down
7 changes: 7 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46f
github.com/cespare/cp v1.1.1/go.mod h1:SOGHArjBr4JWaSDEVpWpo/hNg6RoKrls6Oh40hiwW+s=
github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/deckarep/golang-set v1.7.1 h1:SCQV0S6gTtp6itiFrTqI+pfmJ4LN85S1YzhDf9rTHJQ=
github.com/deckarep/golang-set v1.7.1/go.mod h1:93vsz/8Wt4joVM7c2AVqh+YRMiUSc14yDtF28KmMOgQ=
github.com/docker/distribution v0.0.0-20181129231500-d9e12182359e/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
github.com/docker/docker v0.0.0-20170504205632-89658bed64c2/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec=
Expand Down Expand Up @@ -59,6 +61,10 @@ github.com/jackpal/go-nat-pmp v0.0.0-20181021192511-d89d09f6f332/go.mod h1:QPH04
github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
github.com/jpmorganchase/quorum v2.1.1+incompatible h1:epTAQm3YLLh17pF/VlMI/JWDugegUG6ZMq2onz+Cork=
github.com/jpmorganchase/quorum v2.1.1+incompatible/go.mod h1:DR/b2dsUf3s/e+ucBn6RhC9w+ouhJQp8qwZehgULebY=
github.com/jpmorganchase/quorum v2.2.3+incompatible h1:ORAD4djgouZMpRNRUOUIQqkkiRo5pPL5uyJ557t7Mm4=
github.com/jpmorganchase/quorum v2.2.3+incompatible/go.mod h1:DR/b2dsUf3s/e+ucBn6RhC9w+ouhJQp8qwZehgULebY=
github.com/jpmorganchase/quorum v2.2.4+incompatible h1:b++tFU1KfHsa3Wplb5F2Xiq13ajSN+iO60eHyDmQMkU=
github.com/jpmorganchase/quorum v2.2.4+incompatible/go.mod h1:DR/b2dsUf3s/e+ucBn6RhC9w+ouhJQp8qwZehgULebY=
github.com/jrick/logrotate v1.0.0/go.mod h1:LNinyqDIJnpAur+b8yyulnQw/wDuN1+BYKlTRt3OuAQ=
github.com/juju/ratelimit v0.0.0-20170523012141-5b9ff8664717/go.mod h1:qapgC/Gy+xNh9UxzV13HGGl/6UXNN+ct+vwSgWNm/qk=
github.com/karalabe/hid v0.0.0-20181128192157-d815e0c1a2e2/go.mod h1:YvbcH+3Wo6XPs9nkgTY3u19KXLauXW+J5nB7hEHuX0A=
Expand Down Expand Up @@ -122,6 +128,7 @@ golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJ
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180926160741-c2ed4eda69e7/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20181023152157-44b849a8bc13 h1:ICvJQ9FL9kAAfwGwpoAmcE1O51M0zE++iVRxQ3xyiGE=
golang.org/x/sys v0.0.0-20181023152157-44b849a8bc13/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
Expand Down