Skip to content

Commit

Permalink
fix etc && geth v1.8.17
Browse files Browse the repository at this point in the history
  • Loading branch information
kimmyeonghun committed Oct 11, 2018
1 parent 234ef59 commit 5929619
Show file tree
Hide file tree
Showing 11 changed files with 55 additions and 41 deletions.
12 changes: 6 additions & 6 deletions accounts/abi/bind/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,12 @@ import (
"math/big"
"strings"
ethereum "github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum/accounts/abi"
"github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/event"
ethereum "github.com/ethersocial/go-esn"
"github.com/ethersocial/go-esn/accounts/abi"
"github.com/ethersocial/go-esn/accounts/abi/bind"
"github.com/ethersocial/go-esn/common"
"github.com/ethersocial/go-esn/core/types"
"github.com/ethersocial/go-esn/event"
)
// Reference imports to suppress errors if they are not otherwise used.
Expand Down
2 changes: 1 addition & 1 deletion core/vm/analysis_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package vm
import (
"testing"

"github.com/ethereum/go-ethereum/crypto"
"github.com/ethersocial/go-esn/crypto"
)

func TestJumpDestAnalysis(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion p2p/enode/node_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func TestPythonInterop(t *testing.T) {
wantID = HexID("a448f24c6d18e575453db13171562b71999873db5b286df957af199ec94617f7")
wantSeq = uint64(1)
wantIP = enr.IP{127, 0, 0, 1}
wantUDP = enr.UDP(30303)
wantUDP = enr.UDP(50505)
)
if n.Seq() != wantSeq {
t.Errorf("wrong seq: got %d, want %d", n.Seq(), wantSeq)
Expand Down
8 changes: 4 additions & 4 deletions p2p/enode/nodedb_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,17 +215,17 @@ var nodeDBSeedQueryNodes = []struct {
node: NewV4(
hexPubkey("c013a50b4d1ebce5c377d8af8cb7114fd933ffc9627f96ad56d90fef5b7253ec736fd07ef9a81dc2955a997e54b7bf50afd0aa9f110595e2bec5bb7ce1657004"),
net.IP{127, 0, 0, 3},
30303,
30303,
50505,
50505,
),
pong: time.Now().Add(-2 * time.Second),
},
{
node: NewV4(
hexPubkey("f141087e3e08af1aeec261ff75f48b5b1637f594ea9ad670e50051646b0416daa3b134c28788cbe98af26992a47652889cd8577ccc108ac02c6a664db2dc1283"),
net.IP{127, 0, 0, 3},
30303,
30303,
50505,
50505,
),
pong: time.Now().Add(-2 * time.Second),
},
Expand Down
19 changes: 13 additions & 6 deletions params/bootnodes.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ package params
// the main Ethereum network.
var MainnetBootnodes = []string{
// Ethereum Foundation Go Bootnodes
"enode://6dcb79d9a9f978521a7edf53a50484f0595e14aa08575f0e71099a009ce2dbf40ef9b2dada99e3c78782f1300c1f6726c3d5acefa02730e1c8fe3c1a5301d8d8@52.231.75.3:50501", // asia-01
"enode://6dcb79d9a9f978521a7edf53a50484f0595e14aa08575f0e71099a009ce2dbf40ef9b2dada99e3c78782f1300c1f6726c3d5acefa02730e1c8fe3c1a5301d8d8@52.231.75.3:50501", // Asia-01
"enode://e1d30788711266f699bf95f0392120ec620086d4eeabfd7e92e65a996ecd116cb9331ee3623aab88f498fb28bc302ac827cd3dc71f2db3c134e726eb23944af6@23.100.101.195:50501", // Asia-02
"enode://f2c298eee215cefa930b5280e665a38b2706be3120c302b9fcb48dc7d3ceba3a3e7bac354dccbbcbc3bfd177882b0d5498f36833dfcd5674225adb19dd04ec3a@52.231.74.146:50505", // KR1
"enode://7769cf0bdb7edd8dd95e590b46f950b9bd9625d681ec6123b31d3be58f1f1e0531d9811ccd9c1ad5d52a73999c6da2131943ca02666e238b1f265a1cc64dcae7@52.231.35.75:50505", // KR2
"enode://52e5e84d44bbda7e24a92826e60dfeb20a5d840c3c0be646b21940d7648f49a91bff2b7c47d37894b962eb183d8c7f71f693efb8534ee170ccd902addd487970@52.226.16.248:50505", // us-east
Expand All @@ -32,19 +33,25 @@ var MainnetBootnodes = []string{
// TestnetBootnodes are the enode URLs of the P2P bootstrap nodes running on the
// Ropsten test network.
var TestnetBootnodes = []string{
"enode://eece4a79e9dfa3e61209b006d97334f9310178de8efd0832f76372ab98abcc7d28ec050a1b43f03c3c5837fb4eb29e32f549f9afca38f10014d62f93de35ca45@52.170.148.239:50505", // US-TX
"enode://eece4a79e9dfa3e61209b006d97334f9310178de8efd0832f76372ab98abcc7d28ec050a1b43f03c3c5837fb4eb29e32f549f9afca38f10014d62f93de35ca45@52.170.148.239:50505", // US-Azure geth
//"enode://865a63255b3bb68023b6bffd5095118fcc13e79dcf014fe4e47e065c350c7cc72af2e53eff895f11ba1bbb6a2b33271c1116ee870f266618eadfc2e78aa7349c@52.176.100.77:30303", // US-Azure parity
//"enode://6332792c4a00e3e4ee0926ed89e0d27ef985424d97b6a45bf0f23e51f0dcb5e66b875777506458aea7af6f9e4ffb69f43f3778ee73c81ed9d34c51c4b16b0b0f@52.232.243.152:30303", // Parity
//"enode://94c15d1b9e2fe7ce56e458b9a3b672ef11894ddedd0c6f247e0f1d3487f52b66208fb4aeb8179fce6e3a749ea93ed147c37976d67af557508d199d9594c35f09@192.81.208.223:30303", // @gpip
}

// RinkebyBootnodes are the enode URLs of the P2P bootstrap nodes running on the
// Rinkeby test network.
var RinkebyBootnodes = []string{
"enode://f2c298eee215cefa930b5280e665a38b2706be3120c302b9fcb48dc7d3ceba3a3e7bac354dccbbcbc3bfd177882b0d5498f36833dfcd5674225adb19dd04ec3a@1.1.1.1:50505", // IE
//"enode://a24ac7c5484ef4ed0c5eb2d36620ba4e4aa13b8c84684e1b4aab0cebea2ae45cb4d375b77eab56516d34bfbd3c1a833fc51296ff084b770b94fb9028c4d25ccf@52.169.42.101:30303", // IE
//"enode://343149e4feefa15d882d9fe4ac7d88f885bd05ebb735e547f12e12080a9fa07c8014ca6fd7f373123488102fe5e34111f8509cf0b7de3f5b44339c9f25e87cb8@52.3.158.184:30303", // INFURA
//"enode://b6b28890b006743680c52e64e0d16db57f28124885595fa03a562be1d2bf0f3a1da297d56b13da25fb992888fd556d4c1a27b1f39d531bde7de1921c90061cc6@159.89.28.211:30303", // AKASHA
}

// DiscoveryV5Bootnodes are the enode URLs of the P2P bootstrap nodes for the
// experimental RLPx v5 topic-discovery network.
var DiscoveryV5Bootnodes = []string{
"enode://f2c298eee215cefa930b5280e665a38b2706be3120c302b9fcb48dc7d3ceba3a3e7bac354dccbbcbc3bfd177882b0d5498f36833dfcd5674225adb19dd04ec3a@1.1.1.1:50507",
"enode://7769cf0bdb7edd8dd95e590b46f950b9bd9625d681ec6123b31d3be58f1f1e0531d9811ccd9c1ad5d52a73999c6da2131943ca02666e238b1f265a1cc64dcae7@1.1.1.1:50508",
"enode://07c7baac71f398dce3fae3d75632eabf5c31b2d02fc37e2b1dd5f8ed5049ea74a7e91b311a60e72f77e0bba1943ef7ce14595ad6edde688d14223e7c9d82ee91@1.1.1.1:50509",
//"enode://06051a5573c81934c9554ef2898eb13b33a34b94cf36b202b69fde139ca17a85051979867720d4bdae4323d4943ddf9aeeb6643633aa656e0be843659795007a@35.177.226.168:30303",
//"enode://0cc5f5ffb5d9098c8b8c62325f3797f56509bff942704687b6530992ac706e2cb946b90a34f1f19548cd3c7baccbcaea354531e5983c7d1bc0dee16ce4b6440b@40.118.3.223:30304",
//"enode://1c7a64d76c0334b0418c004af2f67c50e36a3be60b5e4790bdac0439d21603469a85fad36f2473c9a80eb043ae60936df905fa28f1ff614c3e5dc34f15dcd2dc@40.118.3.223:30306",
//"enode://85c85d7143ae8bb96924f2b54f1b3e70d8c4d367af305325d30a61385a432f247d2c75c45c6b4a60335060d072d7f5b35dd1d4c45f76941f62a4f83b6e75daaf@40.118.3.223:30307",
}
2 changes: 1 addition & 1 deletion params/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
const (
VersionMajor = 0 // Major version component of the current release
VersionMinor = 3 // Minor version component of the current release
VersionPatch = 6 // Patch version component of the current release
VersionPatch = 7 // Patch version component of the current release
VersionMeta = "stable" // Version metadata to append to the version string
)

Expand Down
1 change: 0 additions & 1 deletion swarm/network/simulations/discovery/jsonsnapshot.txt

This file was deleted.

2 changes: 1 addition & 1 deletion swarm/network/stream/common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ func newStreamerTester(t *testing.T, registryOptions *RegistryOptions) (*p2ptest

delivery := NewDelivery(to, netStore)
netStore.NewNetFetcherFunc = network.NewFetcherFactory(delivery.RequestFromPeers, true).New
streamer := NewRegistry(addr.ID(), delivery, netStore, state.NewInmemoryStore(), nil)
streamer := NewRegistry(addr.ID(), delivery, netStore, state.NewInmemoryStore(), registryOptions)
teardown := func() {
streamer.Close()
removeDataDir()
Expand Down
14 changes: 10 additions & 4 deletions swarm/network/stream/messages.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (
bv "github.com/ethersocial/go-esn/swarm/network/bitvector"
"github.com/ethersocial/go-esn/swarm/spancontext"
"github.com/ethersocial/go-esn/swarm/storage"
opentracing "github.com/opentracing/opentracing-go"
"github.com/opentracing/opentracing-go"
)

var syncBatchTimeout = 30 * time.Second
Expand Down Expand Up @@ -197,18 +197,24 @@ func (p *Peer) handleOfferedHashesMsg(ctx context.Context, req *OfferedHashesMsg
if err != nil {
return err
}

hashes := req.Hashes
want, err := bv.New(len(hashes) / HashSize)
lenHashes := len(hashes)
if lenHashes%HashSize != 0 {
return fmt.Errorf("error invalid hashes length (len: %v)", lenHashes)
}

want, err := bv.New(lenHashes / HashSize)
if err != nil {
return fmt.Errorf("error initiaising bitvector of length %v: %v", len(hashes)/HashSize, err)
return fmt.Errorf("error initiaising bitvector of length %v: %v", lenHashes/HashSize, err)
}

ctr := 0
errC := make(chan error)
ctx, cancel := context.WithTimeout(ctx, syncBatchTimeout)

ctx = context.WithValue(ctx, "source", p.ID().String())
for i := 0; i < len(hashes); i += HashSize {
for i := 0; i < lenHashes; i += HashSize {
hash := hashes[i : i+HashSize]

if wait := c.NeedData(ctx, hash); wait != nil {
Expand Down
32 changes: 17 additions & 15 deletions swarm/network/stream/streamer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package stream
import (
"bytes"
"context"
"errors"
"strconv"
"testing"
"time"
Expand Down Expand Up @@ -56,11 +57,12 @@ func TestStreamerRequestSubscription(t *testing.T) {
}

var (
hash0 = sha3.Sum256([]byte{0})
hash1 = sha3.Sum256([]byte{1})
hash2 = sha3.Sum256([]byte{2})
hashesTmp = append(hash0[:], hash1[:]...)
hashes = append(hashesTmp, hash2[:]...)
hash0 = sha3.Sum256([]byte{0})
hash1 = sha3.Sum256([]byte{1})
hash2 = sha3.Sum256([]byte{2})
hashesTmp = append(hash0[:], hash1[:]...)
hashes = append(hashesTmp, hash2[:]...)
corruptHashes = append(hashes[:40])
)

type testClient struct {
Expand Down Expand Up @@ -461,7 +463,7 @@ func TestStreamerUpstreamSubscribeLiveAndHistory(t *testing.T) {
}

func TestStreamerDownstreamCorruptHashesMsgExchange(t *testing.T) {
tester, streamer, _, teardown, err := newStreamerTester(t)
tester, streamer, _, teardown, err := newStreamerTester(t, nil)
defer teardown()
if err != nil {
t.Fatal(err)
Expand Down Expand Up @@ -770,7 +772,7 @@ func TestMaxPeerServersWithUnsubscribe(t *testing.T) {
return newTestServer(t), nil
})

peerID := tester.IDs[0]
node := tester.Nodes[0]

for i := 0; i < maxPeerServers+10; i++ {
stream := NewStream("foo", strconv.Itoa(i), true)
Expand All @@ -784,7 +786,7 @@ func TestMaxPeerServersWithUnsubscribe(t *testing.T) {
Stream: stream,
Priority: Top,
},
Peer: peerID,
Peer: node.ID(),
},
},
Expects: []p2ptest.Expect{
Expand All @@ -799,7 +801,7 @@ func TestMaxPeerServersWithUnsubscribe(t *testing.T) {
From: 1,
To: 1,
},
Peer: peerID,
Peer: node.ID(),
},
},
})
Expand All @@ -816,7 +818,7 @@ func TestMaxPeerServersWithUnsubscribe(t *testing.T) {
Msg: &UnsubscribeMsg{
Stream: stream,
},
Peer: peerID,
Peer: node.ID(),
},
},
})
Expand Down Expand Up @@ -844,7 +846,7 @@ func TestMaxPeerServersWithoutUnsubscribe(t *testing.T) {
return newTestServer(t), nil
})

peerID := tester.IDs[0]
node := tester.Nodes[0]

for i := 0; i < maxPeerServers+10; i++ {
stream := NewStream("foo", strconv.Itoa(i), true)
Expand All @@ -859,7 +861,7 @@ func TestMaxPeerServersWithoutUnsubscribe(t *testing.T) {
Stream: stream,
Priority: Top,
},
Peer: peerID,
Peer: node.ID(),
},
},
Expects: []p2ptest.Expect{
Expand All @@ -868,7 +870,7 @@ func TestMaxPeerServersWithoutUnsubscribe(t *testing.T) {
Msg: &SubscribeErrorMsg{
Error: ErrMaxPeerServers.Error(),
},
Peer: peerID,
Peer: node.ID(),
},
},
})
Expand All @@ -888,7 +890,7 @@ func TestMaxPeerServersWithoutUnsubscribe(t *testing.T) {
Stream: stream,
Priority: Top,
},
Peer: peerID,
Peer: node.ID(),
},
},
Expects: []p2ptest.Expect{
Expand All @@ -903,7 +905,7 @@ func TestMaxPeerServersWithoutUnsubscribe(t *testing.T) {
From: 1,
To: 1,
},
Peer: peerID,
Peer: node.ID(),
},
},
})
Expand Down
2 changes: 1 addition & 1 deletion swarm/version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
const (
VersionMajor = 0 // Major version component of the current release
VersionMinor = 3 // Minor version component of the current release
VersionPatch = 4 // Patch version component of the current release
VersionPatch = 5 // Patch version component of the current release
VersionMeta = "stable" // Version metadata to append to the version string
)

Expand Down

0 comments on commit 5929619

Please sign in to comment.