Commit Graph

11797 Commits

Author SHA1 Message Date
Péter Szilágyi 2d3ef53c53
accounts, console, internal, rpc: minor error interface cleanups 2020-06-05 12:10:03 +03:00
rjl493456442 53508c5d46
accounts/abi/bind/backends: fix EstimateGas 2020-06-05 10:47:08 +03:00
Marius van der Wijden 7cdf4eea7e
internal/ethapi: refactored unpacking logic into newRevertError 2020-06-05 10:47:07 +03:00
Marius van der Wijden c9deb8a227
internal/ethapi: added binary data to revertError data 2020-06-05 10:47:06 +03:00
rjl493456442 4515f84958
accounts/abi/bind/backends: unify simulatedBackend and RPC 2020-06-05 10:47:05 +03:00
rjl493456442 c7765c0abb
rpc: print error data field 2020-06-05 10:47:05 +03:00
Marius van der Wijden 5048fd1028
internal/ethapi: unified handling of errors in DoEstimateGas 2020-06-05 10:47:04 +03:00
Marius van der Wijden 693db4dc17
internal/ethapi: unified estimateGasErrors, simplified logic 2020-06-05 10:47:03 +03:00
Marius van der Wijden 304a63c298
internal/ethapi: add errorCode of 3 to revertError 2020-06-05 10:47:02 +03:00
Marius van der Wijden d9b4bc76d4
internal/ethapi: add errorCode to revert error 2020-06-05 10:47:01 +03:00
Marius van der Wijden cc37ce796b
accounts/abi/bind/backends: added tests for revert reason 2020-06-05 10:47:01 +03:00
Marius van der Wijden 9f13c66fbd
graphql: use returndata instead of return
Return() checks if there is an error. If an error is found, we return nil.
For most use cases it can be beneficial to return the output even if there
was an error. This code should be changed anyway once the spec supports
error reasons in graphql responses
2020-06-05 10:47:00 +03:00
Marius van der Wijden d77770d96e
rpc: internal/ethapi: added custom error types 2020-06-05 10:46:59 +03:00
Marius van der Wijden ca35628cc2
graphql: removed revert logic until spec change 2020-06-05 10:46:58 +03:00
Marius van der Wijden 7b6fbcadc3
internal/ethapi: move handling of revert out of docall 2020-06-05 10:46:58 +03:00
Marius van der Wijden 9f8a0b597e
internal/ethapi: return vmError() 2020-06-05 10:46:57 +03:00
Marius van der Wijden fbdc6bba66
internal/ethapi: simplify logic 2020-06-05 10:46:56 +03:00
Marius van der Wijden 024e5a74f2
internal/ethapi: better error logic 2020-06-05 10:46:55 +03:00
Marius van der Wijden 92bee6b037
internal/ethapi: check if require reason can be unpacked 2020-06-05 10:46:55 +03:00
Marius van der Wijden 05eb3d5f0f
internal/ethapi: fixed linting error 2020-06-05 10:46:54 +03:00
Marius van der Wijden 23312e0716
accounts/abi/bind/backends: added revert reason logic to simulated backend 2020-06-05 10:46:53 +03:00
Marius van der Wijden 6d13d42e71
internal/ethapi: moved revert reason logic to doCall 2020-06-05 10:46:52 +03:00
Marius van der Wijden fd70cfe87a
internal/ethapi: return revert reason for eth_call 2020-06-05 10:46:30 +03:00
ucwong 4b2ff1457a
go.mod: upgrade go-duktape to hide unused function warning (#21168) 2020-06-04 17:42:05 +02:00
Péter Szilágyi cefa2ab1bd
Merge pull request #21173 from karalabe/faucet-delete-oldaccs
cmd/faucet: delete old keystore when importing new faucet key
2020-06-04 11:58:40 +03:00
Péter Szilágyi b1b75f0089
accounts/keystore, cmd/faucet: return old account to allow unlock 2020-06-04 10:57:21 +03:00
Péter Szilágyi 201e345c65
Merge pull request #21172 from karalabe/faucet-twitter-mobile
acounts/keystore, cmd/faucet: fix faucet double import, fix twitter url
2020-06-04 09:30:40 +03:00
Péter Szilágyi 469b8739eb
acounts/keystore, cmd/faucet: fix faucet double import, fix twitter url 2020-06-04 08:59:26 +03:00
Péter Szilágyi 8b83125739
Merge pull request #21162 from karalabe/daofork-order-check-fix
cmd/geth: fix the fork orders for DAO tests
2020-06-03 12:20:57 +03:00
Péter Szilágyi f52ff0f1e9
cmd/geth: fix the fork orders for DAO tests 2020-06-03 12:17:54 +03:00
Martin Holst Swende 890757f03a
cmd, core, params: inital support for yolo-v1 testnet (#21154)
* core,params,puppeth: inital support for yolo-v1 testnet

* cmd/geth, core: add yolov1 console flag

* cmd, core, params: YoloV1 bakein fixups

Co-authored-by: Péter Szilágyi <peterke@gmail.com>
2020-06-03 12:05:15 +03:00
kilic 4fc678542d
core/vm, crypto/bls12381, params: add bls12-381 elliptic curve precompiles (#21018)
* crypto: add bls12-381 elliptic curve wrapper

* params: add bls12-381 precompile gas parameters

* core/vm: add bls12-381 precompiles

* core/vm: add bls12-381 precompile tests

* go.mod, go.sum: use latest bls12381 lib

* core/vm: move point encode/decode functions to base library

* crypto/bls12381: introduce bls12-381 library init function

* crypto/bls12381: import bls12381 elliptic curve implementation

* go.mod, go.sum: remove bls12-381 library

* remove unsued frobenious coeffs

supress warning for inp that used in asm

* add mappings tests for zero inputs

fix swu g2 minus z inverse constant

* crypto/bls12381: fix typo

* crypto/bls12381: better comments for bls12381 constants

* crypto/bls12381: swu, use single conditional for e2

* crypto/bls12381: utils, delete empty line

* crypto/bls12381: utils, use FromHex for string to big

* crypto/bls12381: g1, g2, strict length check for FromBytes

* crypto/bls12381: field_element, comparision changes

* crypto/bls12381: change swu, isogeny constants with hex values

* core/vm: fix point multiplication comments

* core/vm: fix multiexp gas calculation and lookup for g1 and g2

* core/vm: simpler imput length check for multiexp and pairing precompiles

* core/vm: rm empty multiexp result declarations

* crypto/bls12381: remove modulus type definition

* crypto/bls12381: use proper init function

* crypto/bls12381: get rid of new lines at fatal desciprtions

* crypto/bls12-381: fix no-adx assembly multiplication

* crypto/bls12-381: remove old config function

* crypto/bls12381: update multiplication backend

this commit changes mul backend to 6limb eip1962 backend

mul assign operations are dropped

* core/vm/contracts_tests: externalize test vectors for precompiles

* core/vm/contracts_test: externalize failure-cases for precompiles

* core/vm: linting

* go.mod: tiny up sum file

* core/vm: fix goimports linter issues

* crypto/bls12381: build tags for plain ASM or ADX implementation

Co-authored-by: Martin Holst Swende <martin@swende.se>
Co-authored-by: Péter Szilágyi <peterke@gmail.com>
2020-06-03 09:44:32 +03:00
chenglin 3f649d4852
core: collect NewTxsEvent items without holding reorg lock (#21145) 2020-06-02 18:52:20 +02:00
Guillaume Ballet 5f6f5e345e
console: handle undefined + null in console funcs (#21160) 2020-06-02 18:06:22 +02:00
Felix Lange d98c42c0e3
rpc: send websocket ping when connection is idle (#21142)
* rpc: send websocket ping when connection is idle

* rpc: use non-blocking send for websocket pingReset
2020-06-02 15:04:44 +03:00
Felix Lange 723bd8c17f
p2p/discover: move discv4 encoding to new 'v4wire' package (#21147)
This moves all v4 protocol definitions to a new package, p2p/discover/v4wire.
The new package will be used for low-level protocol tests.
2020-06-02 13:20:19 +02:00
Greg Colvin cd57d5cd38
core/vm: EIP-2315, JUMPSUB for the EVM (#20619)
* 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>
2020-06-02 13:30:16 +03:00
rene a35382de94
metrics: replace gosigar with gopsutil (#21041)
* 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
2020-06-02 12:08:33 +03:00
Martin Holst Swende a5eee8d1dc
eth/downloader: more context in errors (#21067)
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.
2020-05-29 11:12:43 +02:00
gary rong 389da6aa48
trie: enforce monotonic range in prover and return end marker (#21130)
* 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>
2020-05-27 17:37:37 +03:00
sixdays b2c59e297b
consensus/clique: make internal error private (#21132)
Co-authored-by: linjing <linjingjing@baidu.com>
2020-05-27 17:12:13 +03:00
Felix Lange 9219e0fba4
eth: interrupt chain insertion on shutdown (#21114)
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.
2020-05-26 21:37:37 +02:00
Felix Lange 4873a9d3c3
build: upgrade to golangci lint v1.27.0 (#21127)
* build: upgrade to golangci-lint v1.27.0

* build: raise lint timeout to 3 minutes
2020-05-26 14:24:22 +03:00
gary rong 070a5e1252
trie: fix for range proof (#21107)
* trie: fix for range proof

* trie: fix typo
2020-05-26 13:11:29 +03:00
Hao Duan 81e9caed7d
ethstats: avoid blocking chan when received invalid stats request (#21073)
* ethstats: avoid blocking chan when received invalid stats request

* ethstats: minor code polishes

Co-authored-by: Péter Szilágyi <peterke@gmail.com>
2020-05-26 13:09:00 +03:00
ucwong 7ddb40239b
ethdb/leveldb: use timer instead of time.After (#21066) 2020-05-26 11:03:37 +02:00
Richard Patel 2f66a8d614
metrics/prometheus: define TYPE once, add tests (#21068)
* metrics/prometheus: define type once for histograms

* metrics/prometheus: test collector
2020-05-26 12:00:09 +03:00
Felix Lange dbf6b8a797
cmd/utils: fix default DNS discovery configuration (#21124) 2020-05-25 19:50:36 +02:00
meowsbits befecc9fdf
consensus/ethash: fix flaky test by reading seal results (#21085) 2020-05-25 18:01:03 +02:00
Martin Holst Swende e868adde30
core/vm: improve jumpdest lookup (#21123) 2020-05-25 16:12:48 +02:00