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.15 #1504

Merged
merged 102 commits into from
May 10, 2021
Merged

Upstream merge up to 1.9.15 #1504

merged 102 commits into from
May 10, 2021

Conversation

hbandura
Copy link
Contributor

@hbandura hbandura commented Apr 12, 2021

First big conflict commit from upstream: b4a2681
ethereum/go-ethereum#20758
Completely rewrites the les server pool.
-- Currently accepted upstream version and DID NOT reimplement our changes on top of it: ( from #1132 )
-- -- The server pool entries RPC ( there are no more server pool entries now, moved to the node state machine)
-- -- The call to saveNodes may not be relevant now since this behaviour was moved to the NodeStateMachine
-- -- The use of clientDiscoveredNodesCounter. The counter was completely removed.

Upstream upgraded golangci-lint to 1.27 (was 1.24 upstream, 1.25 ours), but was kept at 1.25 (this should be done in a different issue, since it provokes some additional lint issues)

EIP-2315 related:
ethereum/go-ethereum#20619

Adds p2p wirev4 (we already had it)

Adds crypto/bls12381 (we already had it), but left our versions. Another commit made a change on it and since there was no conflict I left it there, needs review.

karalabe and others added 30 commits May 13, 2020 12:33
* accounts/abi: simplified reflection logic

* accounts/abi: simplified reflection logic

* accounts/abi: removed unpack

* accounts/abi: removed comments

* accounts/abi: removed uneccessary complications

* accounts/abi: minor changes in error messages

* accounts/abi: removed unnused code

* accounts/abi: fixed indexed argument unpacking

* accounts/abi: removed superfluous test cases

This commit removes two test cases. The first one is trivially invalid as we have the same
test cases as passing in packing_test.go L375. The second one passes now,
because we don't need the mapArgNamesToStructFields in unpack_atomic anymore.
Checking for purely underscored arg names generally should not be something we do
as the abi/contract is generally out of the control of the user.

* accounts/abi: removed comments, debug println

* accounts/abi: added commented out code

* accounts/abi: addressed comments

* accounts/abi: remove unnecessary dst.CanSet check

* accounts/abi: added dst.CanSet checks
* cmd/clef, signer/core: use better terminal input for passwords, make it possible to avoid boot-up warning

* all: move commonly used prompter to isolated (small) package

* cmd/clef: Add new --acceptWarn to clef README

* cmd/clef: rename flag 'acceptWarn' to 'suppress-bootwarn'

Co-authored-by: ligi <ligi@ligi.de>
* abi/bind/backends: testcase for double-lock

* accounts: add blockByNumberNoLock to avoid double-lock

* backend/simulated: use stateroot, not blockhash for retrieveing state

Co-authored-by: Martin Holst Swende <martin@swende.se>
* trie: implement range proof with non-existent edge proof

* trie: fix cornercase

* trie: consider empty range

* trie: add singleSide test

* trie: support all-elements range proof

* trie: fix typo

* trie: tiny typos and formulations

Co-authored-by: Péter Szilágyi <peterke@gmail.com>
This PR reimplements the light client server pool. It is also a first step
to move certain logic into a new lespay package. This package will contain
the implementation of the lespay token sale functions, the token buying and
selling logic and other components related to peer selection/prioritization
and service quality evaluation. Over the long term this package will be
reusable for incentivizing future protocols.

Since the LES peer logic is now based on enode.Iterator, it can now use
DNS-based fallback discovery to find servers.

This document describes the function of the new components:
https://gist.github.com/zsfelfoldi/3c7ace895234b7b345ab4f71dab102d4
* metrics/prometheus: define type once for histograms

* metrics/prometheus: test collector
…1073)

* ethstats: avoid blocking chan when received invalid stats request

* ethstats: minor code polishes

Co-authored-by: Péter Szilágyi <peterke@gmail.com>
* trie: fix for range proof

* trie: fix typo
* build: upgrade to golangci-lint v1.27.0

* build: raise lint timeout to 3 minutes
This adds a new API method on core.BlockChain to allow interrupting
running data inserts, and calls the method before shutting down the
downloader.

The BlockChain interrupt checks are now done through a method instead
of inlining the atomic load everywhere. There is no loss of efficiency from
this and it makes the interrupt protocol a lot clearer because the check is
defined next to the method that sets the flag.
Co-authored-by: linjing <linjingjing@baidu.com>
* trie: add hasRightElement indicator

* trie: ensure the range is monotonic increasing

* trie: address comment and fix lint

* trie: address comment

* trie: make linter happy

Co-authored-by: Péter Szilágyi <peterke@gmail.com>
This PR makes use of go 1.13 error handling, wrapping errors and using
errors.Is to check a wrapped root-cause. It also removes the travis
builders for go 1.11 and go 1.12.
* replace gosigar with gopsutil

* removed check for whether GOOS is openbsd

* removed accidental import of runtime

* potential fix for difference in units between gosig and gopsutil

* fixed lint error

* remove multiplication factor

* uses cpu.ClocksPerSec as the multiplication factor

* changed dependency from shirou to renaynay (#20)

* updated dep

* switching back from using renaynay fork to using upstream as PRs were merged on upstream

* removed empty line

* optimized imports

* tidied go mod
* core/vm: implement EIP 2315, subroutines for the EVM

* core/vm: eip 2315 - lintfix + check jump dest validity + check ret stack size constraints

  logger: markdown-friendly traces, validate jumpdest, more testcase, correct opcodes

* core/vm: update subroutines acc to eip: disallow walk-into

* core/vm/eips: gas cost changes for subroutines

* core/vm: update opcodes for EIP-2315

* core/vm: define RETURNSUB as a 'jumping' operation + review concerns

Co-authored-by: Martin Holst Swende <martin@swende.se>
This moves all v4 protocol definitions to a new package, p2p/discover/v4wire.
The new package will be used for low-level protocol tests.
* rpc: send websocket ping when connection is idle

* rpc: use non-blocking send for websocket pingReset
@trianglesphere trianglesphere marked this pull request as draft April 20, 2021 15:54
@hbandura hbandura changed the title [DONT MERGE YET] Upstream merge up to 1.9.15 Upstream merge up to 1.9.15 Apr 21, 2021
@hbandura hbandura marked this pull request as ready for review April 21, 2021 17:28
@trianglesphere trianglesphere self-assigned this Apr 28, 2021
@trianglesphere
Copy link
Contributor

Re the mobile discovery improvements, have we checked that we no longer need our changes for valora?

// enableADX is true if the ADX/BMI2 instruction set was requested for the BLS
// implementation. The system may still fall back to plain ASM if the necessary
// instructions are unavailable on the CPU.
const enableADX = true
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we use enableADX anywhere?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not according to grep, no

@trianglesphere
Copy link
Contributor

I've taken a look at everything but the LES changes. I found one thing where we may have brought in a little too much of the upstream bls changes, but I'm not really familiar with that code.

My only ask is that we follow up on making sure that the LES changes will work with valora and then I think this is good to go.

@hbandura
Copy link
Contributor Author

hbandura commented May 4, 2021

Re the mobile discovery improvements, have we checked that we no longer need our changes for valora?

I checked on the monorepo but will check in some other repos as well

/edit

according to https://github.com/search?q=org%3Acelo-org+serverPoolEntries&type=code we are not using it from our repos

@@ -62,14 +62,6 @@ var (
// JumpTable contains the EVM opcodes supported at a given fork.
type JumpTable [256]operation

func newYoloV1InstructionSet() JumpTable {
Copy link
Contributor

Choose a reason for hiding this comment

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

This is because is not used and the lint failed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

exactly, plus the whole Yolo thing is a test network for ethereum


// ErrAccountAlreadyExists is returned if an account attempted to import is
// already present in the keystore.
ErrAccountAlreadyExists = errors.New("account alreaady exists")
Copy link
Contributor

Choose a reason for hiding this comment

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

the typo guy missed the doble a alreaaaaaaady

Copy link
Contributor Author

Choose a reason for hiding this comment

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

haha nice catch. do you mind if I fix this in the 1.9.16 branch so We don't re run the tests for this?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, of course. I just was hating the typos guy for the big PR and tried to point it out.

cmd/utils/flags.go Show resolved Hide resolved
@@ -32,6 +32,8 @@ func EnableEIP(eipNum int, jt *JumpTable) error {
enable1884(jt)
case 1344:
enable1344(jt)
case 2315:
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we have this as an option? Does this work for us?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do you know of anyone who con led some light into this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

missing the context here?
So there's an EIP 2315, but we don't have an cli option to enable it? Or is the question wether we should ahve the code for 2315?

To me, we should add all code from EIPs since probably we will have them enabled on a future HF. And they should be disable for now, which probalby is already true since they are enabled using a chainConfig flag.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree, this is just the code, I believe it wasn't activated yet

@trianglesphere
Copy link
Contributor

I checked on the monorepo but will check in some other repos as well

Awesome. It seems like we're probably fine to delete this. I'd like to double check with the wallet team, but it seems like we're probably fine to go ahead with the removal.

Copy link
Contributor

@gastonponti gastonponti left a comment

Choose a reason for hiding this comment

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

LGTM

@hbandura hbandura merged commit 6c736da into master May 10, 2021
@hbandura hbandura deleted the hbandura/merge-upstream-1.9.15 branch May 10, 2021 15:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.