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

merge V0.2.12 candidate from maticnetwork:v0.2.12-candidate #7

Merged
merged 128 commits into from
Dec 9, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
128 commits
Select commit Hold shift + click to select a range
3258211
core/vm: rework jumpdest analysis benchmarks (#23499)
chfast Aug 30, 2021
f85cf72
docs: add links to more audits in SECURITY.md (#23482)
fredriksvantes Aug 31, 2021
31be5d4
core: fix typo in iterator.go (#23502)
eltociear Aug 31, 2021
d019e90
common: fixes format verb (#23495)
AlexanderYastrebov Aug 31, 2021
067084f
core: fix race conditions in txpool (#23474)
MariusVanDerWijden Aug 31, 2021
4d88974
cmd/evm: add tests for evm t8n (#23507)
holiman Sep 2, 2021
de2c44a
trie: add missing copyright header (#23530)
aaronbuchwald Sep 7, 2021
7957530
docs: add post-mortem (#23518)
holiman Sep 7, 2021
ca5bc67
internal/debug: remove deprecated flags (#23368)
n1charlie Sep 7, 2021
9a0df80
cmd/geth, cmd/utils: remove legacy rpc flags (#23358)
n1charlie Sep 7, 2021
794c613
core/rawdb: freezer batch write (#23462)
holiman Sep 7, 2021
6ef3a16
p2p/enode: use unix timestamp as base ENR sequence number (#19903)
karalabe Sep 7, 2021
51ed39c
core: make txPricedList.stales the first field for 64bit alignment (#…
fjl Sep 7, 2021
5c1fc3b
core: 64bit alignment of testBlockChain.gasLimit (#23543)
fjl Sep 7, 2021
90987db
appveyor.yml: add linux/amd64 build job (#23548)
fjl Sep 8, 2021
9e17648
les: duplicate downloader and fetcher to allow progressive refactoring
karalabe Sep 10, 2021
9ada4a2
Merge pull request #23561 from karalabe/temp-split-leseh
karalabe Sep 10, 2021
578bc81
README: add londonBlock to example genesis config (#23565)
verheesj Sep 13, 2021
babe9b9
cmd/evm: transaction validation tool (#23494)
holiman Sep 13, 2021
b8d7c66
core, rpc: disable memory output by default in traces (#23558)
MariusVanDerWijden Sep 13, 2021
84ff152
cmd/devp2p/internal/ethtest: only use eth66 if eth66 is negotiated (#…
MariusVanDerWijden Sep 15, 2021
7ada89d
eth/tracers: abort evm execution when trace is aborted (#23580)
holiman Sep 16, 2021
4013549
core,eth: call frame tracing (#23087)
s1na Sep 17, 2021
1b34283
ethclient, accounts/keystore: fix flaky tests (#23599)
holiman Sep 20, 2021
62e3b83
docs: fix spelling on 2021-08-22 postmortem (#23595)
peteyburgers Sep 20, 2021
e28f713
internal: support optional filter expression for debug.stacks (#23605)
karalabe Sep 20, 2021
9bf495b
internal/debug: make gosimple linter happy
karalabe Sep 20, 2021
86f3625
Merge pull request #23609 from karalabe/regex-fix
karalabe Sep 20, 2021
5b246af
go.mod: fix module file to prevent go from updating it during build
karalabe Sep 20, 2021
b1a5e4a
Merge pull request #23610 from karalabe/gomod-tify
karalabe Sep 20, 2021
d8211c7
console: add note about typing exit to exit (#23602)
thadguidry Sep 21, 2021
b61ef24
consensus/clique: prevent 0 len extradata from panicing (#23538)
MariusVanDerWijden Sep 21, 2021
ca9bce9
rpc: set scheme for ws and ipc conns to the server (#23615)
s1na Sep 21, 2021
57a3fab
accounts/abi: fix resolving single struct argument (#23573)
rjl493456442 Sep 22, 2021
51ececb
rpc: set pong read deadline (#23556)
jmank88 Sep 27, 2021
12674d4
cmd/puppeth: remove shh from Dockerfile (#23634)
n1charlie Sep 27, 2021
ac7baea
eth/tracers: re-write of 4byte tracer using enter/exit (#23622)
s1na Sep 27, 2021
443afc9
core/state: move state account to core/types + abstracted "write acco…
gballet Sep 28, 2021
ab2caae
eth/tracers: implement debug.intermediateRoots (#23594)
holiman Sep 28, 2021
783e97e
core/rawdb: avoid unnecessary receipt processing for log filtering (#…
s1na Sep 28, 2021
92c5d10
accounts/abi/bind: check event signature before parsing (#23230)
yihau Sep 28, 2021
3531ca2
eth/tracers: avoid unsyncronized mutations on trie database (#23632)
holiman Sep 28, 2021
a541fbe
eth/protocols/eth: simplify peer known block/txs caches (#23649)
ferranbt Sep 28, 2021
42bc194
graphql: add storage slots to access list (#23650)
holiman Sep 28, 2021
3a6fe69
eth/protocols/snap, trie: better error-handling (#23657)
holiman Sep 29, 2021
eae3b19
params: release go-ethereum v1.10.9 stable
fjl Sep 29, 2021
06082fe
params: begin v1.10.10 release cycle
fjl Sep 29, 2021
f2491c5
core: fix typo in comment (#23658)
eltociear Sep 29, 2021
07a5bc1
internal/ethapi: support retrieving header RLPs too
karalabe Oct 1, 2021
a47b8cf
Merge pull request #23670 from karalabe/get-header-rlp
karalabe Oct 1, 2021
b522f5e
eth/tracers: fix callTracer fault handling (#23667)
s1na Oct 1, 2021
5240725
internal/ethapi: make header/block rlp retrieval canonical
karalabe Oct 3, 2021
01fdca5
Merge pull request #23677 from karalabe/canon-rlp-fetcher
karalabe Oct 3, 2021
12f971f
core/state: fix typo in comment (#23665)
hsyodyssey Oct 4, 2021
5a0e1d8
eth/filters: fix TestPendingLogsSubscription (#23619)
mirokuratczyk Oct 4, 2021
0dbb3b1
eth/protocols/eth: replace array with counter in txn broadcaster (#23…
ferranbt Oct 4, 2021
307156c
eth/api: add rpc method to obtain which states are accessible (#23646)
holiman Oct 5, 2021
57ff2de
go.mod: upgrade github.com/karalable/usb (#23684)
fjl Oct 5, 2021
4e599ee
core/types: copy tx recipient address (#23376)
aaronbuchwald Oct 6, 2021
edb1937
core: improve shutdown synchronization in BlockChain (#22853)
holiman Oct 7, 2021
48496e0
internal/ethapi: use correct signer when serving old blocks (#23683)
s1na Oct 7, 2021
ec2b43c
cmd/geth: fix typo in error message (#23697)
darcys22 Oct 8, 2021
2fe0c65
build: upgrade -dlgo version to 1.17.2 (#23698)
fjl Oct 8, 2021
28d30b5
eth: close miner on exit (instead of just stopping) (#21992)
holiman Oct 8, 2021
ee120ef
miner: fix data race during shutdown (#23435)
MariusVanDerWijden Oct 8, 2021
1bea4b0
miner/stress: initialize account backends explicitly (#23699)
fjl Oct 9, 2021
a6a0609
internal/jsre: handle null and undefined to prevent crash (#23701)
aditya520 Oct 10, 2021
84bccd0
core/state: fix typos in comments (#23702)
hsyodyssey Oct 10, 2021
bcbd700
eth/gasprice: avoid modifying TestChainConfig (#23204)
aaronbuchwald Oct 10, 2021
8a430fb
cmd/puppeth: add txpool to explorer Dockerfile (#23652)
n1charlie Oct 11, 2021
64da037
cmd/evm: stricter transaction validation (#23694)
holiman Oct 11, 2021
8b6e018
build: increase C thread stack size on linux (#23676)
gballet Oct 11, 2021
53b1420
params: changed CatalystBlock to TerminalTotalDifficulty (#23700)
MariusVanDerWijden Oct 11, 2021
088bc34
les/vflux/server: fix metrics (#22946)
rjl493456442 Oct 11, 2021
cf8a6d6
core: tests for forked blocks retrievable by hash (#23695)
mirokuratczyk Oct 11, 2021
da3da7c
ci: enable race tests as cron job on travis (#23480)
MariusVanDerWijden Oct 11, 2021
6289137
consensus/clique, core: API cleanup (#23100)
holiman Oct 11, 2021
3d11a22
fixed broken web3 methods link in README.md (#23703)
z89 Oct 12, 2021
633e7ef
eth,rpc: allow for flag configured timeouts for eth_call (#23645)
noam-alchemy Oct 12, 2021
f9d683b
go.mod: upgrade goja (#23721)
fjl Oct 13, 2021
e4f570f
core/types: add MarshalBinary, UnmarshalBinary for Receipt (#22806)
i-norden Oct 13, 2021
778ff94
all: fix some go-critic linter warnings (#23709)
quasilyte Oct 13, 2021
79b727b
accounts/abi/bind: refactor transact method (#23719)
MariusVanDerWijden Oct 13, 2021
011fe3e
core: remove unused error from TxPool.Pending (#23720)
jwasinger Oct 13, 2021
08e782c
accounts/abi: add basic support for error types (#23161)
MariusVanDerWijden Oct 14, 2021
f915f68
core/state/snapshot: fix data race in layer flattening (#23628)
rjl493456442 Oct 15, 2021
bb74230
params: release go-ethereum v1.10.10 stable
fjl Oct 15, 2021
0aa8fee
Apply best practices to Dockerfile
Nov 5, 2021
1cd6c84
Vendor protobuf and go extension issue PR (#223)
rajatlko13 Nov 9, 2021
57898e4
Final touches to Dockerfiles
Nov 10, 2021
e58bdfa
Build the new CLI
Nov 10, 2021
8ce3032
Bump Go
Nov 10, 2021
ba25f84
Revert "Build the new CLI"
Nov 10, 2021
2191490
Add chain set head command (#226)
ferranbt Nov 11, 2021
5d0f0b7
Merge pull request #227 from maticnetwork/victor/pos-48-refactor-bor-…
vcastellm Nov 11, 2021
fc58176
Added Prometheus flag on bor-cli
0xsharma Nov 11, 2021
7b6bab4
Release multi-platform with goreleaser
Nov 9, 2021
f3a43f9
Added Prometheus to New CLI: fixes
0xsharma Nov 12, 2021
c23cd5e
minor Clean
0xsharma Nov 12, 2021
a5bcab1
Minor Clean-up
0xsharma Nov 12, 2021
cd6a163
minor cleanup
0xsharma Nov 12, 2021
9ab4781
Merge pull request #228 from maticnetwork/victor/pos-47-improve-bor-b…
vcastellm Nov 12, 2021
358e683
Added Prometheus Flag and Default
0xsharma Nov 12, 2021
3b264e9
Merge branch 'master' into main
0xsharma Nov 12, 2021
baed325
Merge pull request #231 from Shivam691999/main
0xsharma Nov 13, 2021
322e964
added opentelemetry config, flags, and setup (#235)
manav2401 Nov 17, 2021
78ba316
Adapt Dockerfile for development (#237)
vcastellm Nov 17, 2021
87f9b91
added service name in config and flags (#238)
manav2401 Nov 17, 2021
983e32b
merged geth v1.10.10
ssandeep Nov 22, 2021
c55094a
fix: bor receipt #1
jdkanani Nov 22, 2021
9513fbd
Write bor receipts in ancient
ferranbt Nov 22, 2021
ded22da
fix: bor receipt rlp
jdkanani Nov 22, 2021
908cbbf
fix: testcases
jdkanani Nov 22, 2021
5431702
merge conflicts
temaniarpit27 Nov 23, 2021
6f59153
Arpit/reorg fix 2 (#210)
temaniarpit27 Nov 25, 2021
fb79b8d
Merge pull request #242 from maticnetwork/geth-v1.10.10
ssandeep Nov 26, 2021
b1fb79a
Small tweeks to Dockerfiles (#247)
vcastellm Nov 30, 2021
149f47e
Fix ancient receipts
ferranbt Dec 1, 2021
d3010f4
Fix ancestor bor receipts (#249)
ferranbt Dec 1, 2021
08db8bc
bumped version to 0.2.11
ssandeep Dec 1, 2021
cf900a9
Changed syncmode from fast to full
0xsharma Dec 2, 2021
b633382
Merge pull request #250 from maticnetwork/shivam/newCLI-syncmode
0xsharma Dec 3, 2021
a7d97ce
Genesis change fix (#252)
temaniarpit27 Dec 3, 2021
e51394b
add block alloc
temaniarpit27 Dec 3, 2021
753301c
change block alloc
temaniarpit27 Dec 3, 2021
64ba7d6
remove byte array
temaniarpit27 Dec 3, 2021
488ea2b
mainnet upgrade
jdkanani Dec 4, 2021
a276c23
Merge branch 'master' of github.com:maticnetwork/bor into v0.2.12-can…
temaniarpit27 Dec 7, 2021
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
Prev Previous commit
Next Next commit
rpc: set pong read deadline (#23556)
This PR adds a 30s timeout for the remote part to answer a ping message, thus detecting (silent) disconnnects
  • Loading branch information
jmank88 authored Sep 27, 2021
commit 51ececb64e9cacaaa9b736b5bc2455225d061edb
6 changes: 6 additions & 0 deletions rpc/websocket.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ const (
wsWriteBuffer = 1024
wsPingInterval = 60 * time.Second
wsPingWriteTimeout = 5 * time.Second
wsPongTimeout = 30 * time.Second
wsMessageSizeLimit = 15 * 1024 * 1024
)

Expand Down Expand Up @@ -241,6 +242,10 @@ type websocketCodec struct {

func newWebsocketCodec(conn *websocket.Conn) ServerCodec {
conn.SetReadLimit(wsMessageSizeLimit)
conn.SetPongHandler(func(appData string) error {
conn.SetReadDeadline(time.Time{})
return nil
})
wc := &websocketCodec{
jsonCodec: NewFuncCodec(conn, conn.WriteJSON, conn.ReadJSON).(*jsonCodec),
conn: conn,
Expand Down Expand Up @@ -287,6 +292,7 @@ func (wc *websocketCodec) pingLoop() {
wc.jsonCodec.encMu.Lock()
wc.conn.SetWriteDeadline(time.Now().Add(wsPingWriteTimeout))
wc.conn.WriteMessage(websocket.PingMessage, nil)
wc.conn.SetReadDeadline(time.Now().Add(wsPongTimeout))
wc.jsonCodec.encMu.Unlock()
timer.Reset(wsPingInterval)
}
Expand Down
89 changes: 89 additions & 0 deletions rpc/websocket_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,15 @@ package rpc

import (
"context"
"io"
"net"
"net/http"
"net/http/httptest"
"net/http/httputil"
"net/url"
"reflect"
"strings"
"sync/atomic"
"testing"
"time"

Expand Down Expand Up @@ -188,6 +192,63 @@ func TestClientWebsocketLargeMessage(t *testing.T) {
}
}

func TestClientWebsocketSevered(t *testing.T) {
t.Parallel()

var (
server = wsPingTestServer(t, nil)
ctx = context.Background()
)
defer server.Shutdown(ctx)

u, err := url.Parse("http://" + server.Addr)
if err != nil {
t.Fatal(err)
}
rproxy := httputil.NewSingleHostReverseProxy(u)
var severable *severableReadWriteCloser
rproxy.ModifyResponse = func(response *http.Response) error {
severable = &severableReadWriteCloser{ReadWriteCloser: response.Body.(io.ReadWriteCloser)}
response.Body = severable
return nil
}
frontendProxy := httptest.NewServer(rproxy)
defer frontendProxy.Close()

wsURL := "ws:" + strings.TrimPrefix(frontendProxy.URL, "http:")
client, err := DialWebsocket(ctx, wsURL, "")
if err != nil {
t.Fatalf("client dial error: %v", err)
}
defer client.Close()

resultChan := make(chan int)
sub, err := client.EthSubscribe(ctx, resultChan, "foo")
if err != nil {
t.Fatalf("client subscribe error: %v", err)
}

// sever the connection
severable.Sever()

// Wait for subscription error.
timeout := time.NewTimer(3 * wsPingInterval)
defer timeout.Stop()
for {
select {
case err := <-sub.Err():
t.Log("client subscription error:", err)
return
case result := <-resultChan:
t.Error("unexpected result:", result)
return
case <-timeout.C:
t.Error("didn't get any error within the test timeout")
return
}
}
}

// wsPingTestServer runs a WebSocket server which accepts a single subscription request.
// When a value arrives on sendPing, the server sends a ping frame, waits for a matching
// pong and finally delivers a single subscription result.
Expand Down Expand Up @@ -290,3 +351,31 @@ func wsPingTestHandler(t *testing.T, conn *websocket.Conn, shutdown, sendPing <-
}
}
}

// severableReadWriteCloser wraps an io.ReadWriteCloser and provides a Sever() method to drop writes and read empty.
type severableReadWriteCloser struct {
io.ReadWriteCloser
severed int32 // atomic
}

func (s *severableReadWriteCloser) Sever() {
atomic.StoreInt32(&s.severed, 1)
}

func (s *severableReadWriteCloser) Read(p []byte) (n int, err error) {
if atomic.LoadInt32(&s.severed) > 0 {
return 0, nil
}
return s.ReadWriteCloser.Read(p)
}

func (s *severableReadWriteCloser) Write(p []byte) (n int, err error) {
if atomic.LoadInt32(&s.severed) > 0 {
return len(p), nil
}
return s.ReadWriteCloser.Write(p)
}

func (s *severableReadWriteCloser) Close() error {
return s.ReadWriteCloser.Close()
}