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

prepare for release v1.1.14 #1090

Merged
merged 34 commits into from
Sep 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
3d5896a
go.mod : upnp 1.0.3 stable version (#24573)
ucwong Mar 29, 2022
3b4c683
eth/tracers/logger: use omitempty to reduce log bloat (#24547)
holiman Mar 29, 2022
c54fd7f
eth: change snapshot extension registration failure to warning instea…
nicjansma Mar 30, 2022
211ab45
eth/fetcher: if peers never respond, drop them
karalabe Apr 6, 2022
f310921
core/state/snapshot: remove noop map item assignment
karalabe Apr 7, 2022
a41619f
les: fix panic in ultralight client sync (#24641)
rjl493456442 Apr 8, 2022
f37f2a9
core/types: make "miner" optional in Header JSON (#24666)
fjl Apr 11, 2022
a723243
core: fix benchmark panic (#24657)
rjl493456442 Apr 12, 2022
3081421
trie: remove unused makeHashNode (#24702)
darioush Apr 20, 2022
3766168
eth/tracers/logger: remove unnecessary comparisons in accessList.equa…
Apr 21, 2022
30c695c
cmd/evm: ensure input length is even (#24721)
jwasinger Apr 25, 2022
6aae1bc
mobile: fix receipt encoding to json (#24701)
enginegl Apr 25, 2022
ae31b5f
p2p: fix type of DiscSubprotocolError (#24747)
henopied Apr 25, 2022
34420d0
core/types: fix unhandled errors in TestTransactionCoding (#24692)
tia-99 Apr 27, 2022
a181eee
ethclient/gethclient: return storage proofs in GetProof (#24697)
trianglesphere Apr 27, 2022
f67e303
eth/filters: remove unused struct fields (#24782)
hero5512 Apr 29, 2022
58f1e8b
docker: speed up docker image build (#24796)
eval-exec May 3, 2022
cea8319
cmd/utils: double limit on free-disk monitor (#24781)
holiman May 3, 2022
bd22292
build: fix formatted logs (#24807)
freaker2k7 May 3, 2022
0981812
eth/filters: remove explicit continue label in filterLogs (#24795)
eval-exec May 5, 2022
f781ea8
p2p/simulations: escape mockerType value from request (#24822)
ImanSharaf May 5, 2022
8d19185
eth/fetcher: avoid hang in tests (partial fix for #23331) (#23351)
holiman May 6, 2022
5a06ca3
abi: fix checks when all fields are indexed (#24792)
rachel-bousfield May 6, 2022
e8b9338
core/state/snapshot: fix race condition (#24685)
MariusVanDerWijden May 6, 2022
5d980a0
internal: drop TestSignCliqueBlock (#24837)
s1na May 10, 2022
4feeaf3
core/vm: update benchmark to use Errorf instead of Sprintf (#24845)
aaronbuchwald May 10, 2022
461835a
core/vm: clean up some dead functions (#24851)
s7v7nislands May 11, 2022
ef24fa3
graphql: fix long literal passed in a variable (#24864)
s1na May 12, 2022
57da9c0
core/asm: use strings.Builder and fix godoc issues (#24861)
s7v7nislands May 16, 2022
4fb1e9d
all: use strings.EqualFold for string comparison (#24890)
estensen May 17, 2022
b051dc6
core: fix the order of address in queue (#24907)
zhaochonghe May 19, 2022
3c7bccb
core: fix potential goroutine leak (#1079)
qinglin89 Sep 19, 2022
8375939
overwrite HTTPHost in config.toml via cli (#999)
yutianwu Sep 21, 2022
781e567
release: update version and changelogs
unclezoro Sep 21, 2022
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
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Changelog

## v1.1.14
IMPROVEMENT
* [\#1057](https://github.com/bnb-chain/bsc/pull/1057) ci: allow merge pull request
* [\#1063](https://github.com/bnb-chain/bsc/pull/1063) ci: fix the pattern of commit lint

BUGFIX
* [\#1062](https://github.com/bnb-chain/bsc/pull/1062) test: fix TestOfflineBlockPrune failed randomly
* [\#1076](https://github.com/bnb-chain/bsc/pull/1076) bug: pick some patches from go-ethereum on v1.10.18
* [\#1079](https://github.com/bnb-chain/bsc/pull/1079) core: fix potential goroutine leak

## v1.1.13

FEATURE
Expand Down
4 changes: 4 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ ARG BUILDNUM=""
FROM golang:1.17-alpine as builder

RUN apk add --no-cache make gcc musl-dev linux-headers git bash
# Get dependencies - will also be cached if we won't change go.mod/go.sum
COPY go.mod /go-ethereum/
COPY go.sum /go-ethereum/
RUN cd /go-ethereum && go mod download

ADD . /go-ethereum
RUN cd /go-ethereum && go run build/ci.go install ./cmd/geth
Expand Down
4 changes: 4 additions & 0 deletions Dockerfile.alltools
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ ARG BUILDNUM=""
FROM golang:1.17-alpine as builder

RUN apk add --no-cache gcc musl-dev linux-headers git
# Get dependencies - will also be cached if we won't change go.mod/go.sum
COPY go.mod /go-ethereum/
COPY go.sum /go-ethereum/
RUN cd /go-ethereum && go mod download

ADD . /go-ethereum
RUN cd /go-ethereum && go run build/ci.go install
Expand Down
8 changes: 4 additions & 4 deletions accounts/abi/argument.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func (arguments Arguments) isTuple() bool {
// Unpack performs the operation hexdata -> Go format.
func (arguments Arguments) Unpack(data []byte) ([]interface{}, error) {
if len(data) == 0 {
if len(arguments) != 0 {
if len(arguments.NonIndexed()) != 0 {
return nil, fmt.Errorf("abi: attempting to unmarshall an empty string while arguments are expected")
}
return make([]interface{}, 0), nil
Expand All @@ -93,7 +93,7 @@ func (arguments Arguments) UnpackIntoMap(v map[string]interface{}, data []byte)
return fmt.Errorf("abi: cannot unpack into a nil map")
}
if len(data) == 0 {
if len(arguments) != 0 {
if len(arguments.NonIndexed()) != 0 {
return fmt.Errorf("abi: attempting to unmarshall an empty string while arguments are expected")
}
return nil // Nothing to unmarshal, return
Expand All @@ -115,8 +115,8 @@ func (arguments Arguments) Copy(v interface{}, values []interface{}) error {
return fmt.Errorf("abi: Unpack(non-pointer %T)", v)
}
if len(values) == 0 {
if len(arguments) != 0 {
return fmt.Errorf("abi: attempting to copy no values while %d arguments are expected", len(arguments))
if len(arguments.NonIndexed()) != 0 {
return fmt.Errorf("abi: attempting to copy no values while arguments are expected")
}
return nil // Nothing to copy, return
}
Expand Down
17 changes: 17 additions & 0 deletions accounts/abi/unpack_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,23 @@ var unpackTests = []unpackTest{
IntOne *big.Int
}{big.NewInt(1)},
},
{
def: `[{"type":"bool"}]`,
enc: "",
want: false,
err: "abi: attempting to unmarshall an empty string while arguments are expected",
},
{
def: `[{"type":"bytes32","indexed":true},{"type":"uint256","indexed":false}]`,
enc: "",
want: false,
err: "abi: attempting to unmarshall an empty string while arguments are expected",
},
{
def: `[{"type":"bool","indexed":true},{"type":"uint64","indexed":true}]`,
enc: "",
want: false,
},
}

// TestLocalUnpackTests runs test specially designed only for unpacking.
Expand Down
4 changes: 2 additions & 2 deletions build/ci.go
Original file line number Diff line number Diff line change
Expand Up @@ -961,10 +961,10 @@ func doWindowsInstaller(cmdline []string) {
build.Render("build/nsis.pathupdate.nsh", filepath.Join(*workdir, "PathUpdate.nsh"), 0644, nil)
build.Render("build/nsis.envvarupdate.nsh", filepath.Join(*workdir, "EnvVarUpdate.nsh"), 0644, nil)
if err := cp.CopyFile(filepath.Join(*workdir, "SimpleFC.dll"), "build/nsis.simplefc.dll"); err != nil {
log.Fatal("Failed to copy SimpleFC.dll: %v", err)
log.Fatalf("Failed to copy SimpleFC.dll: %v", err)
}
if err := cp.CopyFile(filepath.Join(*workdir, "COPYING"), "COPYING"); err != nil {
log.Fatal("Failed to copy copyright note: %v", err)
log.Fatalf("Failed to copy copyright note: %v", err)
}
// Build the installer. This assumes that all the needed files have been previously
// built (don't mix building and packaging to keep cross compilation complexity to a
Expand Down
7 changes: 6 additions & 1 deletion cmd/evm/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,12 @@ func runCmd(ctx *cli.Context) error {
} else {
hexInput = []byte(ctx.GlobalString(InputFlag.Name))
}
input := common.FromHex(string(bytes.TrimSpace(hexInput)))
hexInput = bytes.TrimSpace(hexInput)
if len(hexInput)%2 != 0 {
fmt.Println("input length must be even")
os.Exit(1)
}
input := common.FromHex(string(hexInput))

var execFunc func() ([]byte, uint64, error)
if ctx.GlobalBool(CreateFlag.Name) {
Expand Down
3 changes: 2 additions & 1 deletion cmd/geth/consolecmd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ func runMinimalGeth(t *testing.T, args ...string) *testgeth {
// --networkid=1337 to avoid cache bump
// --syncmode=full to avoid allocating fast sync bloom
allArgs := []string{"--ropsten", "--networkid", "1337", "--syncmode=full", "--port", "0",
"--nat", "none", "--nodiscover", "--maxpeers", "0", "--cache", "64"}
"--nat", "none", "--nodiscover", "--maxpeers", "0", "--cache", "64",
"--datadir.minfreedisk", "0"}
return runGeth(t, append(allArgs, args...)...)
}

Expand Down
6 changes: 3 additions & 3 deletions cmd/utils/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,11 @@ func StartNode(ctx *cli.Context, stack *node.Node, isConsole bool) {
signal.Notify(sigc, syscall.SIGINT, syscall.SIGTERM)
defer signal.Stop(sigc)

minFreeDiskSpace := ethconfig.Defaults.TrieDirtyCache
minFreeDiskSpace := 2 * ethconfig.Defaults.TrieDirtyCache // Default 2 * 256Mb
if ctx.GlobalIsSet(MinFreeDiskSpaceFlag.Name) {
minFreeDiskSpace = ctx.GlobalInt(MinFreeDiskSpaceFlag.Name)
} else if ctx.GlobalIsSet(CacheFlag.Name) || ctx.GlobalIsSet(CacheGCFlag.Name) {
minFreeDiskSpace = ctx.GlobalInt(CacheFlag.Name) * ctx.GlobalInt(CacheGCFlag.Name) / 100
minFreeDiskSpace = 2 * ctx.GlobalInt(CacheFlag.Name) * ctx.GlobalInt(CacheGCFlag.Name) / 100
}
if minFreeDiskSpace > 0 {
go monitorFreeDiskSpace(sigc, stack.InstanceDir(), uint64(minFreeDiskSpace)*1024*1024)
Expand Down Expand Up @@ -131,7 +131,7 @@ func monitorFreeDiskSpace(sigc chan os.Signal, path string, freeDiskSpaceCritica
} else if freeSpace < 2*freeDiskSpaceCritical {
log.Warn("Disk space is running low. Geth will shutdown if disk space runs below critical level.", "available", common.StorageSize(freeSpace), "critical_level", common.StorageSize(freeDiskSpaceCritical))
}
time.Sleep(60 * time.Second)
time.Sleep(30 * time.Second)
}
}

Expand Down
6 changes: 4 additions & 2 deletions cmd/utils/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -1050,8 +1050,10 @@ func SplitAndTrim(input string) (ret []string) {
// setHTTP creates the HTTP RPC listener interface string from the set
// command line flags, returning empty if the HTTP endpoint is disabled.
func setHTTP(ctx *cli.Context, cfg *node.Config) {
if ctx.GlobalBool(HTTPEnabledFlag.Name) && cfg.HTTPHost == "" {
cfg.HTTPHost = "127.0.0.1"
if ctx.GlobalBool(HTTPEnabledFlag.Name) {
if cfg.HTTPHost == "" {
cfg.HTTPHost = "127.0.0.1"
}
if ctx.GlobalIsSet(HTTPListenAddrFlag.Name) {
cfg.HTTPHost = ctx.GlobalString(HTTPListenAddrFlag.Name)
}
Expand Down
2 changes: 1 addition & 1 deletion console/prompt/prompter.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ func (p *terminalPrompter) PromptPassword(prompt string) (passwd string, err err
// choice to be made, returning that choice.
func (p *terminalPrompter) PromptConfirm(prompt string) (bool, error) {
input, err := p.Prompt(prompt + " [y/n] ")
if len(input) > 0 && strings.ToUpper(input[:1]) == "Y" {
if len(input) > 0 && strings.EqualFold(input[:1], "y") {
return true, nil
}
return false, err
Expand Down
18 changes: 9 additions & 9 deletions core/asm/asm.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.

// Provides support for dealing with EVM assembly instructions (e.g., disassembling them).
// Package asm provides support for dealing with EVM assembly instructions (e.g., disassembling them).
package asm

import (
Expand All @@ -34,14 +34,14 @@ type instructionIterator struct {
started bool
}

// Create a new instruction iterator.
// NewInstructionIterator create a new instruction iterator.
func NewInstructionIterator(code []byte) *instructionIterator {
it := new(instructionIterator)
it.code = code
return it
}

// Returns true if there is a next instruction and moves on.
// Next returns true if there is a next instruction and moves on.
func (it *instructionIterator) Next() bool {
if it.error != nil || uint64(len(it.code)) <= it.pc {
// We previously reached an error or the end.
Expand Down Expand Up @@ -79,27 +79,27 @@ func (it *instructionIterator) Next() bool {
return true
}

// Returns any error that may have been encountered.
// Error returns any error that may have been encountered.
func (it *instructionIterator) Error() error {
return it.error
}

// Returns the PC of the current instruction.
// PC returns the PC of the current instruction.
func (it *instructionIterator) PC() uint64 {
return it.pc
}

// Returns the opcode of the current instruction.
// Op returns the opcode of the current instruction.
func (it *instructionIterator) Op() vm.OpCode {
return it.op
}

// Returns the argument of the current instruction.
// Arg returns the argument of the current instruction.
func (it *instructionIterator) Arg() []byte {
return it.arg
}

// Pretty-print all disassembled EVM instructions to stdout.
// PrintDisassembled pretty-print all disassembled EVM instructions to stdout.
func PrintDisassembled(code string) error {
script, err := hex.DecodeString(code)
if err != nil {
Expand All @@ -117,7 +117,7 @@ func PrintDisassembled(code string) error {
return it.Error()
}

// Return all disassembled EVM instructions in human-readable format.
// Disassemble returns all disassembled EVM instructions in human-readable format.
func Disassemble(script []byte) ([]string, error) {
instrs := make([]string, 0)

Expand Down
14 changes: 7 additions & 7 deletions core/asm/compiler.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ type Compiler struct {
debug bool
}

// newCompiler returns a new allocated compiler.
// NewCompiler returns a new allocated compiler.
func NewCompiler(debug bool) *Compiler {
return &Compiler{
labels: make(map[string]int),
Expand Down Expand Up @@ -105,16 +105,16 @@ func (c *Compiler) Compile() (string, []error) {
}

// turn the binary to hex
var bin string
var bin strings.Builder
for _, v := range c.binary {
switch v := v.(type) {
case vm.OpCode:
bin += fmt.Sprintf("%x", []byte{byte(v)})
bin.WriteString(fmt.Sprintf("%x", []byte{byte(v)}))
case []byte:
bin += fmt.Sprintf("%x", v)
bin.WriteString(fmt.Sprintf("%x", v))
}
}
return bin, errors
return bin.String(), errors
}

// next returns the next token and increments the
Expand Down Expand Up @@ -243,12 +243,12 @@ func (c *Compiler) pushBin(v interface{}) {
// isPush returns whether the string op is either any of
// push(N).
func isPush(op string) bool {
return strings.ToUpper(op) == "PUSH"
return strings.EqualFold(op, "PUSH")
}

// isJump returns whether the string op is jump(i)
func isJump(op string) bool {
return strings.ToUpper(op) == "JUMPI" || strings.ToUpper(op) == "JUMP"
return strings.EqualFold(op, "JUMPI") || strings.EqualFold(op, "JUMP")
}

// toBinary converts text to a vm.OpCode
Expand Down
2 changes: 1 addition & 1 deletion core/asm/lexer.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ type lexer struct {
debug bool // flag for triggering debug output
}

// lex lexes the program by name with the given source. It returns a
// Lex lexes the program by name with the given source. It returns a
// channel on which the tokens are delivered.
func Lex(source []byte, debug bool) <-chan token {
ch := make(chan token)
Expand Down
2 changes: 1 addition & 1 deletion core/bench_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ func genTxRing(naccounts int) func(int, *BlockGen) {

// genUncles generates blocks with two uncle headers.
func genUncles(i int, gen *BlockGen) {
if i >= 6 {
if i >= 7 {
b2 := gen.PrevBlock(i - 6).Header()
b2.Extra = []byte("foo")
gen.AddUncle(b2)
Expand Down
4 changes: 3 additions & 1 deletion core/state/snapshot/difflayer.go
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,9 @@ func (dl *diffLayer) CorrectAccounts(accounts map[common.Hash][]byte) {

// Parent returns the subsequent layer of a diff layer.
func (dl *diffLayer) Parent() snapshot {
dl.lock.RLock()
defer dl.lock.RUnlock()

return dl.parent
}

Expand Down Expand Up @@ -527,7 +530,6 @@ func (dl *diffLayer) flatten() snapshot {
for storageHash, data := range storage {
comboData[storageHash] = data
}
parent.storageData[accountHash] = comboData
}
// Return the combo parent
return &diffLayer{
Expand Down
6 changes: 5 additions & 1 deletion core/state_prefetcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,11 @@ func (p *statePrefetcher) Prefetch(block *types.Block, statedb *state.StateDB, c

// it should be in a separate goroutine, to avoid blocking the critical path.
for i := 0; i < len(transactions); i++ {
txChan <- i
select {
case txChan <- i:
case <-interruptCh:
return
}
}
}

Expand Down
Loading