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

Upstream merge up to 1.9.16 #1536

Merged
merged 132 commits into from
Jun 2, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
132 commits
Select commit Hold shift + click to select a range
8523ad4
core: filter out txs with invalid signatures as soon as possible
duanhao0814 Jun 3, 2020
da06519
params: begin v1.9.16 release cycle
fjl Jun 8, 2020
45b7535
cmd/ethkey: support --passwordfile in generate command (#21183)
libby Jun 8, 2020
39abd92
ethstats: use timer instead of time.sleep (#20924)
ucwong Jun 8, 2020
cf66745
core/vm: use uint256 in EVM implementation (#20787)
chfast Jun 8, 2020
80e887d
core/state: avoid escape analysis fault when accessing cached state
karalabe Jun 8, 2020
a0797e3
Merge pull request #21192 from karalabe/fix-escape-analysis
karalabe Jun 8, 2020
d5c267f
accounts/keystore: fix typo in error message (#21200)
p4u Jun 9, 2020
89043cb
accounts/abi: make GetType public again (#21157)
natsukagami Jun 9, 2020
e9ba536
eth/downloader: fix spuriously failing tests (#21149)
holiman Jun 9, 2020
4a19c0e
core, eth, internal: include read storage entries in structlog output…
rjl493456442 Jun 10, 2020
e30c0af
build, internal/ethapi, crypto/bls12381: fix typos (#21210)
howjmay Jun 10, 2020
c85fdb7
go.mod: update uint256 to 1.1.0 (#21206)
holiman Jun 11, 2020
9371b2f
internal/web3ext: add missing params to debug.accountRange (#21208)
hackmod Jun 11, 2020
a981b60
eth/downloader: don't use defer for unlock before return (#21227)
six-days Jun 15, 2020
eb9d7d1
Merge pull request #21170 from duanhao0814/fix-dup-ecrecover
karalabe Jun 16, 2020
bcf19bc
core/rawdb: swap tailId and itemOffset for deleted items in freezer (…
zhangsoledad Jun 17, 2020
56a319b
cmd, eth, internal, les: add txfee cap (#21212)
rjl493456442 Jun 17, 2020
e029cc6
go.mod: update snappy dependency (#21237)
ucwong Jun 18, 2020
5435e0d
whisper : use timer.Ticker instead of sleep (#21240)
ucwong Jun 18, 2020
3ebfeb0
core/rawdb: fix high memory usage in freezer (#21243)
AusIV Jun 19, 2020
9a188c9
common/fdlimit: build on DragonflyBSD (#21241)
gballet Jun 19, 2020
dce533c
whisper: fix time.sleep by time.ticker in whisper_test (#21251)
ucwong Jun 23, 2020
42ccb2f
p2p: measure packet throughput too, not just bandwidth
karalabe Jun 24, 2020
c42d139
Merge pull request #21256 from karalabe/p2p-packet-metrics
karalabe Jun 24, 2020
da180ba
cmd/devp2p: add commands for node key management (#21202)
fjl Jun 24, 2020
23f1a0b
crypto/secp256k1: enable 128-bit int code and endomorphism optimizati…
fjl Jun 24, 2020
93142e5
eth: don't block if transaction broadcast loop fails (#21255)
rjl493456442 Jun 24, 2020
b482423
trie: reduce allocs in insertPreimage (#21261)
MariusVanDerWijden Jun 24, 2020
0c82928
core/vm: fix incorrect computation of BLS discount (#21253)
MariusVanDerWijden Jun 24, 2020
413358a
cmd/geth: make import cmd exit with 1 if import errors occurred (#21244)
meowsbits Jun 24, 2020
02cea23
eth: returned revert reason in traceTx (#21195)
MariusVanDerWijden Jun 26, 2020
c13df14
utils: fix ineffectual miner config flags (#21271)
meowsbits Jun 30, 2020
dd91c7c
cmd: abstract `getPassPhrase` functions into one (#21219)
binacs Jun 30, 2020
e376d2f
cmd/evm: add state transition tool for testing (#20958)
holiman Jun 30, 2020
ddeea1e
core: types: less allocations when hashing and tx handling (#21265)
MariusVanDerWijden Jun 30, 2020
b86b1e6
go.mod: bump gopsutil version (#21275)
gballet Jun 30, 2020
1e635bd
go.mod: updated crypto deps causing build failure (#21276)
renaynay Jun 30, 2020
d671dbd
eth/downloader: fixes data race between synchronize and other methods…
MariusVanDerWijden Jun 30, 2020
ec51cbb
cmd/geth: LES priority client test (#20719)
adamschmideg Jul 1, 2020
8dfd66f
rlp: avoid list header allocation in encoder (#21274)
MariusVanDerWijden Jul 1, 2020
af5c97a
core, txpool: less allocations when handling transactions (#21232)
MariusVanDerWijden Jul 1, 2020
12867d1
rpc, internal/ethapi: default rpc gascap at 25M + better error messag…
holiman Jul 1, 2020
7451fc6
internal/ethapi: default gas to maxgascap, not max int64 (#21284)
holiman Jul 2, 2020
04c4e50
ethapi: don't crash when keystore-specific methods are called but ext…
holiman Jul 2, 2020
07a95ce
les/checkpointoracle: don't lookup checkpoint more than once per minu…
holiman Jul 2, 2020
61270e5
eth/gasprice: lighter gas price oracle for light client (#20409)
rjl493456442 Jul 3, 2020
490b380
cmd/geth: allow configuring metrics HTTP server on separate endpoint …
meowsbits Jul 3, 2020
fa01117
build/ci: handle split up listing (#21293)
holiman Jul 4, 2020
6315b6f
rlp: reduce allocations for big.Int and byte array encoding (#21291)
fjl Jul 6, 2020
6d8e51a
cmd, node: dump empty value config (#21296)
rjl493456442 Jul 6, 2020
e5871b9
cmd/clef: Update README with external v6.0.0 & internal v7.0.1 APIs (…
chris-j-h Jul 7, 2020
6a48ae3
cmd/devp2p: add discv4 test suite (#21163)
adamschmideg Jul 7, 2020
c16967c
cmd/clef: Fix broken link in README and other minor fixes (#21303)
chris-j-h Jul 7, 2020
5b1cfde
eth: increase timeout in TestBroadcastBlock (#21299)
holiman Jul 8, 2020
7a556ab
go.mod: upgrade to github.com/golang/snappy with arm64 asm (#21304)
ucwong Jul 8, 2020
967d8de
eth/downloader: fix peer idleness tracking when restarting state sync…
holiman Jul 8, 2020
bcb3087
Revert "core, txpool: less allocations when handling transactions (#2…
fjl Jul 9, 2020
6ccce09
common/math: use math/bits intrinsics for Safe* (#21316)
fjl Jul 9, 2020
beabf95
cmd/geth, cmd/puppeth: replace deprecated rpc and ws flags in tests a…
renaynay Jul 9, 2020
feb40e3
accounts/external: remove dependency on internal/ethapi (#21319)
rjl493456442 Jul 10, 2020
ea3b00a
params: go-ethereum v1.9.16 stable
fjl Jul 10, 2020
5d4d4e6
Merge commit '8523ad4' into hbandura/merge-upstream-1.9.16
hbandura Apr 22, 2021
dc7a211
Merge commit 'da06519' into hbandura/merge-upstream-1.9.16
hbandura Apr 22, 2021
f0bf283
Merge commit '45b7535' into hbandura/merge-upstream-1.9.16
hbandura Apr 22, 2021
95d6aa4
Merge commit '39abd92' into hbandura/merge-upstream-1.9.16
hbandura Apr 28, 2021
115b6ed
Merge commit 'cf66745' into hbandura/merge-upstream-1.9.16
hbandura Apr 29, 2021
000c437
Merge commit '80e887d' into hbandura/merge-upstream-1.9.16
hbandura Apr 29, 2021
fc89fa8
Merge commit 'a0797e3' into hbandura/merge-upstream-1.9.16
hbandura Apr 29, 2021
ec185e1
Merge commit 'd5c267f' into hbandura/merge-upstream-1.9.16
hbandura Apr 29, 2021
1c2dd15
Merge commit '89043cb' into hbandura/merge-upstream-1.9.16
hbandura Apr 29, 2021
65d52ae
Remove lint warning
hbandura Apr 29, 2021
8c15109
Merge commit 'e9ba536' into hbandura/merge-upstream-1.9.16
hbandura Apr 29, 2021
db3be27
Merge commit '4a19c0e' into hbandura/merge-upstream-1.9.16
hbandura Apr 29, 2021
b8c37ca
Merge commit 'e30c0af' into hbandura/merge-upstream-1.9.16
hbandura Apr 29, 2021
f1b572d
Merge commit 'c85fdb7' into hbandura/merge-upstream-1.9.16
hbandura Apr 29, 2021
f1959a7
Merge commit '9371b2f' into hbandura/merge-upstream-1.9.16
hbandura Apr 29, 2021
962203f
Merge commit 'a981b60' into hbandura/merge-upstream-1.9.16
hbandura Apr 29, 2021
d4094cf
Merge commit 'eb9d7d1' into hbandura/merge-upstream-1.9.16
hbandura Apr 29, 2021
96fbcfa
Merge commit 'bcf19bc' into hbandura/merge-upstream-1.9.16
hbandura Apr 29, 2021
e8cbf75
Merge commit '56a319b' into hbandura/merge-upstream-1.9.16
hbandura Apr 29, 2021
8644d58
Fix error message
hbandura Apr 29, 2021
815a5c9
Merge commit '5435e0d' into hbandura/merge-upstream-1.9.16
hbandura Apr 29, 2021
6eaa509
Merge commit '3ebfeb0' into hbandura/merge-upstream-1.9.16
hbandura Apr 29, 2021
23dec81
Merge commit '9a188c9' into hbandura/merge-upstream-1.9.16
hbandura Apr 29, 2021
8b1cf76
Merge commit 'dce533c' into hbandura/merge-upstream-1.9.16
hbandura Apr 29, 2021
a8f2242
Merge commit '42ccb2f' into hbandura/merge-upstream-1.9.16
hbandura Apr 29, 2021
76d8879
Merge commit 'c42d139' into hbandura/merge-upstream-1.9.16
hbandura Apr 29, 2021
2ccdcca
Merge commit 'da180ba' into hbandura/merge-upstream-1.9.16
hbandura Apr 29, 2021
97a8556
Merge commit '23f1a0b' into hbandura/merge-upstream-1.9.16
hbandura Apr 29, 2021
69bf97c
Merge commit '93142e5' into hbandura/merge-upstream-1.9.16
hbandura Apr 29, 2021
bcad49c
Merge commit 'b482423' into hbandura/merge-upstream-1.9.16
hbandura Apr 29, 2021
11da563
Merge commit '0c82928' into hbandura/merge-upstream-1.9.16
hbandura Apr 29, 2021
ea3049f
Merge commit '413358a' into hbandura/merge-upstream-1.9.16
hbandura Apr 29, 2021
859bc7f
Merge commit '02cea23' into hbandura/merge-upstream-1.9.16
hbandura Apr 29, 2021
c14224e
Merge commit 'c13df14' into hbandura/merge-upstream-1.9.16
hbandura Apr 29, 2021
95097a1
Merge commit 'dd91c7c' into hbandura/merge-upstream-1.9.16
hbandura Apr 30, 2021
fa637ff
Merge commit 'e376d2f' into hbandura/merge-upstream-1.9.16
hbandura Apr 30, 2021
f431aea
Merge commit 'ddeea1e' into hbandura/merge-upstream-1.9.16
hbandura May 5, 2021
7aa5a35
Merge commit 'b86b1e6' into hbandura/merge-upstream-1.9.16
hbandura May 5, 2021
b03b296
Merge commit '1e635bd' into hbandura/merge-upstream-1.9.16
hbandura May 5, 2021
4d97d6f
Merge commit 'd671dbd' into hbandura/merge-upstream-1.9.16
hbandura May 5, 2021
4073a78
Merge commit 'ec51cbb' into hbandura/merge-upstream-1.9.16
hbandura May 5, 2021
da3a1de
Merge commit '8dfd66f' into hbandura/merge-upstream-1.9.16
hbandura May 5, 2021
b38dafb
Skip priority client test
hbandura May 5, 2021
f7bd67f
Merge commit 'af5c97a' into hbandura/merge-upstream-1.9.16
hbandura May 5, 2021
6f4b23f
Merge commit '12867d1' into hbandura/merge-upstream-1.9.16
hbandura May 6, 2021
84fe03b
Merge commit '7451fc6' into hbandura/merge-upstream-1.9.16
hbandura May 6, 2021
249e44e
Merge commit '04c4e50' into hbandura/merge-upstream-1.9.16
hbandura May 6, 2021
5c07222
Merge commit '07a95ce' into hbandura/merge-upstream-1.9.16
hbandura May 6, 2021
230119d
Merge commit '61270e5' into hbandura/merge-upstream-1.9.16
hbandura May 6, 2021
7af4144
Merge commit '490b380' into hbandura/merge-upstream-1.9.16
hbandura May 6, 2021
2aff45f
Merge commit 'fa01117' into hbandura/merge-upstream-1.9.16
hbandura May 6, 2021
6f94816
Merge commit '6315b6f' into hbandura/merge-upstream-1.9.16
hbandura May 6, 2021
7f44edf
Merge commit '6d8e51a' into hbandura/merge-upstream-1.9.16
hbandura May 6, 2021
631a661
Merge commit 'e5871b9' into hbandura/merge-upstream-1.9.16
hbandura May 6, 2021
07ab6c9
Merge commit '6a48ae3' into hbandura/merge-upstream-1.9.16
hbandura May 6, 2021
3ecb198
Merge commit 'c16967c' into hbandura/merge-upstream-1.9.16
hbandura May 6, 2021
e47a24f
Merge commit '5b1cfde' into hbandura/merge-upstream-1.9.16
hbandura May 6, 2021
30fc32b
Merge commit '7a556ab' into hbandura/merge-upstream-1.9.16
hbandura May 6, 2021
b45edd4
Merge commit '967d8de' into hbandura/merge-upstream-1.9.16
hbandura May 6, 2021
d70a7f0
Merge commit 'bcb3087' into hbandura/merge-upstream-1.9.16
hbandura May 6, 2021
a9a09a2
Merge commit '6ccce09' into hbandura/merge-upstream-1.9.16
hbandura May 6, 2021
1f93923
Merge commit 'beabf95' into hbandura/merge-upstream-1.9.16
hbandura May 6, 2021
b3481b4
Merge commit 'feb40e3' into hbandura/merge-upstream-1.9.16
hbandura May 6, 2021
7694d1e
Merge commit 'ea3b00a' into hbandura/merge-upstream-1.9.16
hbandura May 6, 2021
40ddf14
Add currency comparison when using RPCTxFeeCap in internal/ethapi/api.go
hbandura May 7, 2021
8e59652
Fix flag doc
hbandura May 7, 2021
72a85b7
Change RPCTxFeeCap to celo instead of wei
hbandura May 7, 2021
c0d414b
Merge remote-tracking branch 'origin/master' into hbandura/merge-upst…
hbandura May 10, 2021
79ab857
Fix les priority client test
hbandura Jun 1, 2021
494ffce
Merge remote-tracking branch 'origin/master' into hbandura/merge-upst…
hbandura Jun 1, 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
25 changes: 18 additions & 7 deletions core/rawdb/freezer_table.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,8 @@ func (t *freezerTable) repair() error {
t.index.ReadAt(buffer, 0)
firstIndex.unmarshalBinary(buffer)

t.tailId = firstIndex.offset
t.itemOffset = firstIndex.filenum
t.tailId = firstIndex.filenum
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😬

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

funny one

t.itemOffset = firstIndex.offset

t.index.ReadAt(buffer, offsetsSize-indexEntrySize)
lastIndex.unmarshalBinary(buffer)
Expand Down Expand Up @@ -519,16 +519,27 @@ func (t *freezerTable) Append(item uint64, blob []byte) error {
// getBounds returns the indexes for the item
// returns start, end, filenumber and error
func (t *freezerTable) getBounds(item uint64) (uint32, uint32, uint32, error) {
var startIdx, endIdx indexEntry
buffer := make([]byte, indexEntrySize)
if _, err := t.index.ReadAt(buffer, int64(item*indexEntrySize)); err != nil {
return 0, 0, 0, err
}
startIdx.unmarshalBinary(buffer)
var startIdx, endIdx indexEntry
// Read second index
if _, err := t.index.ReadAt(buffer, int64((item+1)*indexEntrySize)); err != nil {
return 0, 0, 0, err
}
endIdx.unmarshalBinary(buffer)
// Read first index (unless it's the very first item)
if item != 0 {
if _, err := t.index.ReadAt(buffer, int64(item*indexEntrySize)); err != nil {
return 0, 0, 0, err
}
startIdx.unmarshalBinary(buffer)
} else {
// Special case if we're reading the first item in the freezer. We assume that
// the first item always start from zero(regarding the deletion, we
// only support deletion by files, so that the assumption is held).
// This means we can use the first item metadata to carry information about
// the 'global' offset, for the deletion-case
return 0, endIdx.offset, endIdx.filenum, nil
}
if startIdx.filenum != endIdx.filenum {
// If a piece of data 'crosses' a data-file,
// it's actually in one piece on the second data-file.
Expand Down
46 changes: 37 additions & 9 deletions core/rawdb/freezer_table_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -564,8 +564,8 @@ func TestOffset(t *testing.T) {
tailId := uint32(2) // First file is 2
itemOffset := uint32(4) // We have removed four items
zeroIndex := indexEntry{
offset: tailId,
filenum: itemOffset,
filenum: tailId,
offset: itemOffset,
}
buf := zeroIndex.marshallBinary()
// Overwrite index zero
Expand All @@ -579,39 +579,67 @@ func TestOffset(t *testing.T) {

}
// Now open again
{
checkPresent := func(numDeleted uint64) {
f, err := newCustomTable(os.TempDir(), fname, rm, wm, sg, 40, true)
if err != nil {
t.Fatal(err)
}
f.printIndex()
// It should allow writing item 6
f.Append(6, getChunk(20, 0x99))
f.Append(numDeleted+2, getChunk(20, 0x99))

// It should be fine to fetch 4,5,6
if got, err := f.Retrieve(4); err != nil {
if got, err := f.Retrieve(numDeleted); err != nil {
t.Fatal(err)
} else if exp := getChunk(20, 0xbb); !bytes.Equal(got, exp) {
t.Fatalf("expected %x got %x", exp, got)
}
if got, err := f.Retrieve(5); err != nil {
if got, err := f.Retrieve(numDeleted + 1); err != nil {
t.Fatal(err)
} else if exp := getChunk(20, 0xaa); !bytes.Equal(got, exp) {
t.Fatalf("expected %x got %x", exp, got)
}
if got, err := f.Retrieve(6); err != nil {
if got, err := f.Retrieve(numDeleted + 2); err != nil {
t.Fatal(err)
} else if exp := getChunk(20, 0x99); !bytes.Equal(got, exp) {
t.Fatalf("expected %x got %x", exp, got)
}

// It should error at 0, 1,2,3
for i := 0; i < 4; i++ {
if _, err := f.Retrieve(uint64(i)); err == nil {
for i := numDeleted - 1; i > numDeleted-10; i-- {
if _, err := f.Retrieve(i); err == nil {
t.Fatal("expected err")
}
}
}
checkPresent(4)
// Now, let's pretend we have deleted 1M items
{
// Read the index file
p := filepath.Join(os.TempDir(), fmt.Sprintf("%v.ridx", fname))
indexFile, err := os.OpenFile(p, os.O_RDWR, 0644)
if err != nil {
t.Fatal(err)
}
indexBuf := make([]byte, 3*indexEntrySize)
indexFile.Read(indexBuf)

// Update the index file, so that we store
// [ file = 2, offset = 1M ] at index zero

tailId := uint32(2) // First file is 2
itemOffset := uint32(1000000) // We have removed 1M items
zeroIndex := indexEntry{
offset: itemOffset,
filenum: tailId,
}
buf := zeroIndex.marshallBinary()
// Overwrite index zero
copy(indexBuf, buf)
indexFile.WriteAt(indexBuf, 0)
indexFile.Close()
}
checkPresent(1000000)
}

// TODO (?)
Expand Down