Commit Graph

174 Commits

Author SHA1 Message Date
vsmk98 7e35574def merge with 1.8.12 version 2018-08-17 03:20:33 +00:00
vsmk98 4e3c907531 additionla log messages for permissioning 2018-07-31 01:42:51 +00:00
amalraj.manigmail.com 7c548e0f74 Merge remote-tracking branch 'remotes/geth/release/1.8' into merge-193
changes related  to merge conflicts
2018-07-24 16:15:38 +08:00
amalraj.manigmail.com c3c479d2aa Merge remote-tracking branch 'remotes/geth/release/1.8' into merge-193
# Conflicts:
#	.github/CODEOWNERS
#	.travis.yml
#	README.md
#	VERSION
#	accounts/abi/argument.go
#	accounts/abi/bind/backends/simulated.go
#	accounts/abi/bind/bind_test.go
#	accounts/abi/event_test.go
#	accounts/abi/numbers.go
#	accounts/abi/numbers_test.go
#	accounts/abi/reflect.go
#	accounts/accounts.go
#	accounts/keystore/keystore.go
#	accounts/keystore/keystore_wallet.go
#	accounts/usbwallet/internal/trezor/trezor.go
#	accounts/usbwallet/ledger.go
#	accounts/usbwallet/wallet.go
#	appveyor.yml
#	build/ci.go
#	build/goimports.sh
#	cmd/ethkey/generate.go
#	cmd/ethkey/inspect.go
#	cmd/ethkey/main.go
#	cmd/ethkey/message.go
#	cmd/ethkey/utils.go
#	cmd/faucet/faucet.go
#	cmd/geth/chaincmd.go
#	cmd/geth/config.go
#	cmd/geth/main.go
#	cmd/geth/misccmd.go
#	cmd/geth/usage.go
#	cmd/p2psim/main.go
#	cmd/puppeth/genesis.go
#	cmd/puppeth/module_dashboard.go
#	cmd/puppeth/wizard_faucet.go
#	cmd/puppeth/wizard_genesis.go
#	cmd/puppeth/wizard_netstats.go
#	cmd/puppeth/wizard_node.go
#	cmd/puppeth/wizard_wallet.go
#	cmd/swarm/config.go
#	cmd/swarm/config_test.go
#	cmd/swarm/db.go
#	cmd/swarm/hash.go
#	cmd/swarm/main.go
#	cmd/swarm/manifest.go
#	cmd/swarm/run_test.go
#	cmd/swarm/upload.go
#	cmd/swarm/upload_test.go
#	cmd/utils/flags.go
#	cmd/wnode/main.go
#	common/bytes.go
#	common/compiler/solidity.go
#	common/hexutil/hexutil.go
#	common/math/big.go
#	common/math/integer.go
#	common/mclock/mclock.go
#	common/types.go
#	common/types_template.go
#	consensus/clique/clique.go
#	consensus/consensus.go
#	consensus/ethash/algorithm.go
#	consensus/ethash/consensus.go
#	consensus/ethash/ethash.go
#	containers/vagrant/Vagrantfile
#	contracts/ens/ens_test.go
#	core/asm/compiler.go
#	core/asm/lexer.go
#	core/block_validator.go
#	core/blockchain.go
#	core/blockchain_test.go
#	core/chain_makers.go
#	core/database_util.go
#	core/database_util_test.go
#	core/events.go
#	core/genesis.go
#	core/genesis_alloc.go
#	core/genesis_test.go
#	core/headerchain.go
#	core/rawdb/accessors_chain.go
#	core/rawdb/accessors_indexes.go
#	core/rawdb/accessors_metadata.go
#	core/rawdb/schema.go
#	core/state/state_test.go
#	core/state/statedb.go
#	core/state/sync.go
#	core/state_processor.go
#	core/state_transition.go
#	core/tx_journal.go
#	core/tx_list.go
#	core/tx_pool.go
#	core/tx_pool_test.go
#	core/types.go
#	core/types/block.go
#	core/types/block_test.go
#	core/types/gen_receipt_json.go
#	core/types/log.go
#	core/types/receipt.go
#	core/types/transaction.go
#	core/types/transaction_signing.go
#	core/types/transaction_signing_test.go
#	core/types/transaction_test.go
#	core/vm/errors.go
#	core/vm/evm.go
#	core/vm/gas.go
#	core/vm/gas_table.go
#	core/vm/instructions.go
#	core/vm/instructions_test.go
#	core/vm/interface.go
#	core/vm/interpreter.go
#	core/vm/intpool.go
#	core/vm/jump_table.go
#	core/vm/logger.go
#	core/vm/logger_test.go
#	core/vm/memory_table.go
#	core/vm/opcodes.go
#	core/vm/runtime/env.go
#	core/vm/runtime/runtime.go
#	crypto/crypto.go
#	crypto/crypto_test.go
#	eth/api.go
#	eth/api_backend.go
#	eth/api_tracer.go
#	eth/backend.go
#	eth/config.go
#	eth/downloader/downloader.go
#	eth/downloader/queue.go
#	eth/downloader/statesync.go
#	eth/filters/filter.go
#	eth/filters/filter_system.go
#	eth/filters/filter_system_test.go
#	eth/gen_config.go
#	eth/handler.go
#	eth/handler_test.go
#	eth/helper_test.go
#	eth/protocol.go
#	eth/sync.go
#	eth/tracers/internal/tracers/4byte_tracer.js
#	eth/tracers/internal/tracers/assets.go
#	eth/tracers/tracer_test.go
#	eth/tracers/tracers_test.go
#	ethclient/ethclient.go
#	ethdb/database.go
#	ethdb/interface.go
#	ethdb/memory_database.go
#	ethstats/ethstats.go
#	event/feed.go
#	internal/ethapi/api.go
#	internal/ethapi/backend.go
#	internal/guide/guide_test.go
#	internal/web3ext/web3ext.go
#	les/api_backend.go
#	les/backend.go
#	les/fetcher.go
#	les/handler.go
#	les/helper_test.go
#	les/odr_requests.go
#	les/odr_test.go
#	les/retrieve.go
#	les/server.go
#	les/serverpool.go
#	light/lightchain.go
#	light/odr_test.go
#	light/postprocess.go
#	light/txpool.go
#	log/README.md
#	log/doc.go
#	log/format.go
#	log/handler.go
#	log/logger.go
#	log/root.go
#	metrics/exp/exp.go
#	metrics/influxdb/influxdb.go
#	metrics/metrics.go
#	metrics/resetting_timer.go
#	metrics/resetting_timer_test.go
#	metrics/timer_test.go
#	miner/worker.go
#	mobile/accounts.go
#	mobile/ethereum.go
#	mobile/geth.go
#	node/config.go
#	node/doc.go
#	p2p/discover/database.go
#	p2p/discover/database_test.go
#	p2p/discover/table.go
#	p2p/discover/table_test.go
#	p2p/discover/udp.go
#	p2p/discover/udp_test.go
#	p2p/discv5/udp.go
#	p2p/enr/enr.go
#	p2p/enr/enr_test.go
#	p2p/enr/entries.go
#	p2p/protocols/protocol.go
#	p2p/protocols/protocol_test.go
#	p2p/rlpx_test.go
#	p2p/server.go
#	p2p/simulations/adapters/docker.go
#	p2p/simulations/adapters/exec.go
#	p2p/simulations/adapters/inproc.go
#	p2p/simulations/adapters/types.go
#	p2p/simulations/http.go
#	p2p/simulations/http_test.go
#	p2p/simulations/mocker.go
#	p2p/simulations/network.go
#	p2p/simulations/network_test.go
#	p2p/testing/protocolsession.go
#	params/bootnodes.go
#	params/config.go
#	params/denomination.go
#	params/gas_table.go
#	params/protocol_params.go
#	params/version.go
#	rpc/http.go
#	rpc/json.go
#	rpc/utils.go
#	signer/core/api.go
#	swarm/api/api.go
#	swarm/api/api_test.go
#	swarm/api/client/client.go
#	swarm/api/client/client_test.go
#	swarm/api/config.go
#	swarm/api/config_test.go
#	swarm/api/filesystem.go
#	swarm/api/filesystem_test.go
#	swarm/api/http/error.go
#	swarm/api/http/error_templates.go
#	swarm/api/http/error_test.go
#	swarm/api/http/roundtripper.go
#	swarm/api/http/server.go
#	swarm/api/http/server_test.go
#	swarm/api/http/templates.go
#	swarm/api/manifest.go
#	swarm/api/manifest_test.go
#	swarm/api/storage.go
#	swarm/api/storage_test.go
#	swarm/api/uri.go
#	swarm/api/uri_test.go
#	swarm/fuse/fuse_dir.go
#	swarm/fuse/fuse_file.go
#	swarm/fuse/swarmfs.go
#	swarm/fuse/swarmfs_test.go
#	swarm/fuse/swarmfs_unix.go
#	swarm/fuse/swarmfs_util.go
#	swarm/metrics/flags.go
#	swarm/network/depo.go
#	swarm/network/forwarding.go
#	swarm/network/hive.go
#	swarm/network/kademlia/address.go
#	swarm/network/kademlia/kaddb.go
#	swarm/network/kademlia/kademlia.go
#	swarm/network/kademlia/kademlia_test.go
#	swarm/network/messages.go
#	swarm/network/protocol.go
#	swarm/network/syncdb.go
#	swarm/network/syncdb_test.go
#	swarm/network/syncer.go
#	swarm/services/swap/swap.go
#	swarm/services/swap/swap/swap.go
#	swarm/storage/chunker.go
#	swarm/storage/chunker_test.go
#	swarm/storage/common_test.go
#	swarm/storage/database.go
#	swarm/storage/dbstore.go
#	swarm/storage/dbstore_test.go
#	swarm/storage/dpa.go
#	swarm/storage/dpa_test.go
#	swarm/storage/localstore.go
#	swarm/storage/memstore.go
#	swarm/storage/netstore.go
#	swarm/storage/pyramid.go
#	swarm/storage/swarmhasher.go
#	swarm/storage/types.go
#	swarm/swarm.go
#	swarm/swarm_test.go
#	swarm/testutil/http.go
#	tests/block_test_util.go
#	tests/difficulty_test.go
#	tests/init.go
#	tests/state_test_util.go
#	tests/transaction_test.go
#	tests/util.go
#	tests/vm_test_util.go
#	trie/database.go
#	trie/encoding.go
#	trie/hasher.go
#	trie/iterator.go
#	trie/proof.go
#	trie/proof_test.go
#	trie/secure_trie.go
#	trie/sync.go
#	trie/sync_test.go
#	trie/trie.go
#	vendor/github.com/docker/docker/pkg/reexec/command_linux.go
#	vendor/github.com/docker/docker/pkg/reexec/command_unix.go
#	vendor/github.com/docker/docker/pkg/reexec/command_unsupported.go
#	vendor/github.com/docker/docker/pkg/reexec/command_windows.go
#	vendor/github.com/docker/docker/pkg/reexec/reexec.go
#	vendor/github.com/eapache/channels/.gitignore
#	vendor/github.com/eapache/queue/.gitignore
#	vendor/github.com/naoina/toml/encode.go
#	vendor/github.com/naoina/toml/parse.go
#	vendor/github.com/naoina/toml/parse.peg
#	vendor/github.com/naoina/toml/parse.peg.go
#	vendor/github.com/rcrowley/go-metrics/.gitignore
#	vendor/github.com/rcrowley/go-metrics/.travis.yml
#	vendor/github.com/rcrowley/go-metrics/README.md
#	vendor/github.com/rcrowley/go-metrics/counter.go
#	vendor/github.com/rcrowley/go-metrics/debug.go
#	vendor/github.com/rcrowley/go-metrics/ewma.go
#	vendor/github.com/rcrowley/go-metrics/exp/exp.go
#	vendor/github.com/rcrowley/go-metrics/gauge.go
#	vendor/github.com/rcrowley/go-metrics/gauge_float64.go
#	vendor/github.com/rcrowley/go-metrics/graphite.go
#	vendor/github.com/rcrowley/go-metrics/healthcheck.go
#	vendor/github.com/rcrowley/go-metrics/histogram.go
#	vendor/github.com/rcrowley/go-metrics/json.go
#	vendor/github.com/rcrowley/go-metrics/log.go
#	vendor/github.com/rcrowley/go-metrics/meter.go
#	vendor/github.com/rcrowley/go-metrics/metrics.go
#	vendor/github.com/rcrowley/go-metrics/opentsdb.go
#	vendor/github.com/rcrowley/go-metrics/registry.go
#	vendor/github.com/rcrowley/go-metrics/runtime.go
#	vendor/github.com/rcrowley/go-metrics/sample.go
#	vendor/github.com/rcrowley/go-metrics/syslog.go
#	vendor/github.com/rcrowley/go-metrics/timer.go
#	vendor/github.com/rcrowley/go-metrics/writer.go
#	vendor/github.com/syndtr/goleveldb/leveldb/db.go
#	vendor/golang.org/x/sys/unix/mksysnum_linux.pl
#	vendor/golang.org/x/sys/unix/types_linux.go
#	vendor/vendor.json
#	whisper/shhclient/client.go
#	whisper/whisperv5/api.go
#	whisper/whisperv5/peer_test.go
#	whisper/whisperv5/whisper.go
#	whisper/whisperv6/api.go
#	whisper/whisperv6/peer_test.go
#	whisper/whisperv6/whisper.go
2018-07-24 16:11:05 +08:00
amalrajmani b40cc3b1f8 bind: fix bind_test.go update code and abi of some contracts that failed 2018-07-13 08:18:20 +00:00
Wenbiao Zheng 61a5976368 accounts: remove deadcode isSigned (#16990) 2018-06-20 11:46:29 +02:00
Qvintvs a67eccbcd8 debug tests 2018-06-01 12:51:35 +08:00
Qvintvs 622e98ad51 debug merge attempt 2018-05-31 14:21:16 +08:00
Qvintvs 4b44bea1d7 Merge attempt 2018-05-31 14:16:44 +08:00
Péter Szilágyi 49719e21bc
core, eth: minor txpool event cleanups 2018-05-18 12:08:24 +03:00
rjl493456442 a2e43d28d0
all: collate new transaction events together 2018-05-18 11:46:44 +03:00
Guillaume Ballet 247b5f0369
accounts/abi: allow abi: tags when unpacking structs
Go code users can now tag event struct members with `abi:` to specify in what fields the event will be de-serialized.

See PR #16648 for details.
2018-05-14 14:47:31 +02:00
gary rong 7beccb29be all: get rid of error when creating memory database (#16716)
* all: get rid of error when create mdb

* core: clean up variables definition

* all: inline mdb definition
2018-05-09 15:24:25 +03:00
Péter Szilágyi 6cf0ab38bd
core/rawdb: separate raw database access to own package (#16666) 2018-05-07 14:35:06 +03:00
kiel barry c1ea527573 accounts: golint updates for this or self warning (#16627) 2018-05-02 11:17:52 +03:00
Ricardo Domingos 6ab9f0a19f accounts/abi: improve test coverage (#16044) 2018-04-04 13:42:36 +02:00
Martin Holst Swende 933972d139
Merge pull request #16256 from epiclabs-io/unpack_one_arg_event
Fix issue unmarshaling single parameter events from abigen generated go code #16208
2018-03-21 10:11:37 +01:00
Martin Holst Swende faed47b3c5
Merge pull request #15990 from markya0616/sim_backend_block_hash
accounts/abi, core: add AddTxWithChain in BlockGen for simulation
2018-03-19 08:29:54 +01:00
Mark cddb529d70 accounts/abi: normalize method name to a camel-case string (#15976) 2018-03-07 14:34:53 +02:00
Javier Peletier 60a999f238 accounts/abi: Modified unpackAtomic to accept struct lvalues 2018-03-05 16:01:40 +01:00
Javier Peletier 13b566e06e accounts/abi: Add one-parameter event test case from enriquefynn/unpack_one_arg_event 2018-03-05 16:00:03 +01:00
protolambda 0b814d32f8 accounts/abi: Abi binding support for nested arrays, fixes #15648, including nested array unpack fix (#15676)
* accounts/abi/bind: support for multi-dim arrays

Also:
- reduce usage of regexes a bit.
- fix minor Java syntax problems

Fixes #15648

* accounts/abi/bind: Add some more documentation

* accounts/abi/bind: Improve code readability

* accounts/abi: bugfix for unpacking nested arrays

The code previously assumed the arrays/slices were always 1 level
deep. While the packing supports nested arrays (!!!).

The current code for unpacking doesn't return the "consumed" length, so
this fix had to work around that by calculating it (i.e. packing and
 getting resulting length) after the unpacking of the array element.
It's far from ideal, but unpacking behaviour is fixed now.

* accounts/abi: Fix unpacking of nested arrays

Removed the temporary workaround of packing to calculate size, which was
incorrect for slice-like types anyway.
Full size of nested arrays is used now.

* accounts/abi: deeply nested array unpack test

Test unpacking of an array nested more than one level.

* accounts/abi: Add deeply nested array pack test

Same as the deep nested array unpack test, but the other way around.

* accounts/abi/bind: deeply nested arrays bind test

Test the usage of bindings that were generated
for methods with multi-dimensional (and not
just a single extra dimension, like foo[2][3])
array arguments and returns.

edit: trigger rebuild, CI failed to fetch linter module.

* accounts/abi/bind: improve array binding

wrapArray uses a regex now, and arrayBindingJava is improved.

* accounts/abi: Improve naming of element size func

The full step size for unpacking an array
 is now retrieved with "getFullElemSize".

* accounts/abi: support nested nested array args

Previously, the code only considered the outer-size of the array,
ignoring the size of the contents. This was fine for most types,
but nested arrays are packed directly into it, and count towards
the total size. This resulted in arguments following a nested
array to replicate some of the binary contents of the array.

The fix: for arrays, calculate their complete contents size:
 count the arg.Type.Elem.Size when Elem is an Array, and
 repeat when their child is an array too, etc.
The count is the number of 32 byte elements, similar to how it
 previously counted, but nested.

* accounts/abi: Test deep nested arr multi-arguments

Arguments with a deeply nested array should not cause the next arguments
to be read from the wrong position.
2018-03-04 23:24:17 +01:00
Péter Szilágyi 5cf1d35470
eth, les, light: filter on logs only, derive receipts on demand 2018-02-22 19:12:43 +02:00
Martin Holst Swende 61f2279bde
abi: fix missing method on go 1.7/1.8 2018-02-21 12:27:50 +01:00
Martin Holst Swende bd6ed23899
accounts/abi: harden unpacking against malicious input 2018-02-21 12:27:50 +01:00
Martin Holst Swende 08c5d4dd27
accounts/abi: address review concerns 2018-02-21 12:27:50 +01:00
Martin Holst Swende f0f594d045
accounts/abi: Deduplicate code in unpacker 2018-02-21 12:27:50 +01:00
Martin Holst Swende 1ede68355d
accounts/abi: add another unpack interface 2018-02-21 12:27:50 +01:00
Fynn 1e72271f57
accounts/abi: use unpackTuple to unpack event arguments
Events with just 1 argument fail before this change
2018-02-16 11:46:25 +01:00
Felix Lange a5c0bbb4f4
all: update license information (#16089) 2018-02-14 13:49:11 +01:00
Péter Szilágyi 55599ee95d core, trie: intermediate mempool between trie and database (#15857)
This commit reduces database I/O by not writing every state trie to disk.
2018-02-05 17:40:32 +01:00
mark.lin c1d70ea970 accounts/abi, core: add AddTxWithChain in BlockGen for simulation 2018-01-29 18:47:08 +08:00
Péter Szilágyi 1bf508b449
accounts/abi/bind: support event filtering in abigen 2018-01-24 10:54:13 +02:00
Péter Szilágyi 6f69cdd109
all: switch gas limits from big.Int to uint64 2018-01-03 14:45:35 +02:00
Furkan KAMACI b8caba9709 various: remove redundant parentheses (#15793) 2018-01-03 14:14:47 +02:00
Péter Szilágyi b9731767af
accounts/abi: handle named ouputs prefixed with underscores (#15766)
* accounts/abi: handle named ouputs prefixed with underscores

* accounts/abi: handle collinding outputs for struct unpacks

* accounts: handle purely underscore output names
2017-12-29 23:20:02 +02:00
Martin Holst Swende 9d187f0238
Merge pull request #15731 from holiman/revamp_abi
accounts/abi refactor
2017-12-22 20:59:41 +01:00
Martin Holst Swende c095c87e11
accounts/abi: merging of https://github.com/ethereum/go-ethereum/pull/15452 + lookup by id 2017-12-22 19:26:57 +01:00
Martin Holst Swende 73d4a57d47
acounts/abi: refactor abi, generalize abi pack/unpack to Arguments 2017-12-22 19:26:52 +01:00
gary rong 5f8888e116 accounts, consensus, core, eth: make chain maker consensus agnostic (#15497)
* accounts, consensus, core, eth: make chain maker consensus agnostic

* consensus, core: move CalcDifficulty to Engine interface

* consensus: add docs for calcDifficulty function

* consensus, core: minor comment fixups
2017-12-22 14:37:50 +02:00
Robert Zaremba 81d4cafb32
accounts/abi: add unpack into array test 2017-12-21 15:14:50 +01:00
Robert Zaremba 1afca33eac
accounts/abi: add Method Unpack tests
+ Reworked Method Unpack tests into more readable components
+ Added Method Unpack into slice test
2017-12-21 15:14:50 +01:00
Robert Zaremba 95461e8b22
accounts/abi: satisfy most of the linter warnings
+ adding missing comments
+ small cleanups which won't significantly change
  function body.
+ unify Method receiver name
2017-12-21 15:14:50 +01:00
Robert Zaremba 0ed8b838a9
accounts/abi: fix event unpack into slice
+ The event slice unpacker doesn't correctly extract element from the
slice. The indexed arguments are not ignored as they should be
(the data offset should not include the indexed arguments).

+ The `Elem()` call in the slice unpack doesn't work.
The Slice related tests fails because of that.

+ the check in the loop are suboptimal and have been extracted
out of the loop.

+ extracted common code from event and method tupleUnpack
2017-12-21 15:14:50 +01:00
Robert Zaremba 9becba5540
accounts/abi: fix event tupleUnpack
Event.tupleUnpack doesn't handle correctly Indexed arguments,
hence it can't unpack an event with indexed arguments.
2017-12-21 15:14:50 +01:00
Robert Zaremba 3511904aad
accounts/abi: adding event unpacker tests 2017-12-21 15:14:50 +01:00
Martin Holst Swende b0d41e386e
Merge pull request #15285 from yondonfu/abi-offset-fixed-arrays
accounts/abi: include fixed array size in offset for dynamic type
2017-12-21 14:42:03 +01:00
Bob Glickstein e21aa0fda3 accounts/abi: remove check for len%32==0 when unpacking events (#15670)
This change inlines the logic of bytesAreProper at its sole
callsite, ABI.Unpack, and applies the multiple-of-32 test only in
the case of unpacking methods. Event data is not required to be a
multiple of 32 bytes long.
2017-12-21 10:59:14 +01:00
Dmitry Shulyak da58afcea0 accounts/abi: update array length after parsing array (#15618)
Fixes #15617
2017-12-20 15:09:23 +01:00
Yondon Fu cf7aba36c8 accounts/abi: update array type check in method.go. Add more packing tests 2017-12-18 21:16:25 -05:00