Commit Graph

1145 Commits

Author SHA1 Message Date
Felix Lange
be12392fba core/vm: track 63/64 call gas off stack (#15563)
* core/vm: track 63/64 call gas off stack

Gas calculations in gasCall* relayed the available gas for calls by
replacing it on the stack. This lead to inconsistent traces, which we
papered over by copying the pre-execution stack in trace mode.

This change relays available gas using a temporary variable, off the
stack, and allows removing the weird copy.

* core/vm: remove stackCopy

* core/vm: pop call gas into pool

* core/vm: to -> addr
2017-11-28 21:05:49 +02:00
Péter Szilágyi
5dea0f2aa4
core/state: copy trie too, not just content 2017-11-24 14:20:49 +02:00
Ricardo Domingos
9ff9d04a69 all: fix code comment typos (#15547)
* console: fix typo in comment

* contracts/release: fix typo in comment

* core: fix typo in comment

* eth: fix typo in comment

* miner: fix typo in comment
2017-11-24 11:20:01 +02:00
Péter Szilágyi
b0190189a3
core/vm, internal/ethapi: tracer no full storage, nicer json output (#15499)
* core/vm, internal/ethapi: tracer no full storage, nicer json output

* core/vm, internal/ethapi: omit disabled trace fields
2017-11-16 18:53:18 +02:00
Péter Szilágyi
463014126f
core/bloombits: handle non 8-bit boundary section matches 2017-11-15 14:10:35 +02:00
Péter Szilágyi
bce5d837b5
Merge pull request #14582 from holiman/jumpdest_improv
core/vm: improve jumpdest analysis
2017-11-15 10:52:14 +02:00
Péter Szilágyi
43c8a1914c
Merge pull request #15470 from karalabe/clique-sametd-splitter
core: split same-td blocks on block height
2017-11-15 10:44:18 +02:00
Jay Guo
924098c6e5 core/vm: fix typos in jump_table.go 2017-11-14 17:57:37 +08:00
Martin Holst Swende
96ddf27a48
core/vm: copyright header on test-file 2017-11-13 22:04:53 +01:00
Péter Szilágyi
54ce3887d8
core: split same-td blocks on block height 2017-11-13 17:07:05 +02:00
ferhat elmas
86f6568f66 build: enable unconvert linter (#15456)
* build: enable unconvert linter

 - fixes #15453
 - update code base for failing cases

* cmd/puppeth: replace syscall.Stdin with os.Stdin.Fd() for unconvert linter
2017-11-10 19:06:45 +02:00
ferhat elmas
9619a61024 all: gofmt -w -s (#15419) 2017-11-08 11:45:52 +01:00
Jim McDonald
0131bd6ff9 core: respect price bump threshold (#15401)
* core: allow price bump at threshold

* core: test changes to allow price bump at threshold

* core: reinstate tx replacement test underneath threshold

* core: minor test failure message cleanups
2017-10-30 13:05:00 +02:00
ferhat elmas
07e8c177e7 core, swarm: typo fixes 2017-10-30 01:23:23 +01:00
Felföldi Zsolt
8d434f6a6f les, core/bloombits: post-LES/2 fixes (#15391)
* les: fix topic ID

* core/bloombits: fix interface conversion
2017-10-27 17:18:53 +03:00
Péter Szilágyi
0095531a58 core, eth, les: fix messy code (#15367)
* core, eth, les: fix messy code

* les: fixed tx status test and rlp encoding

* core: add a workaround for light sync
2017-10-25 12:18:44 +03:00
Felföldi Zsolt
ca376ead88 les, light: LES/2 protocol version (#14970)
This PR implements the new LES protocol version extensions:

* new and more efficient Merkle proofs reply format (when replying to
  a multiple Merkle proofs request, we just send a single set of trie
  nodes containing all necessary nodes)
* BBT (BloomBitsTrie) works similarly to the existing CHT and contains
  the bloombits search data to speed up log searches
* GetTxStatusMsg returns the inclusion position or the
  pending/queued/unknown state of a transaction referenced by hash
* an optional signature of new block data (number/hash/td) can be
  included in AnnounceMsg to provide an option for "very light
  clients" (mobile/embedded devices) to skip expensive Ethash check
  and accept multiple signatures of somewhat trusted servers (still a
  lot better than trusting a single server completely and retrieving
  everything through RPC). The new client mode is not implemented in
  this PR, just the protocol extension.
2017-10-24 15:19:09 +02:00
Péter Szilágyi
6d6a5a9337 cmd, consensus, core, miner: instatx clique for --dev (#15323)
* cmd, consensus, core, miner: instatx clique for --dev

* cmd, consensus, clique: support configurable --dev block times

* cmd, core: allow --dev to use persistent storage too
2017-10-24 13:40:42 +03:00
Péter Szilágyi
0af1ab0c86
core: avoid warning when loading the transaction journal 2017-10-20 14:42:20 +03:00
Péter Szilágyi
0e7d019e0e
core: fire tx event on replace, expand tests 2017-10-20 14:42:19 +03:00
Péter Szilágyi
a91e682234
core/vm: check opcode stack before readonly enforcement 2017-10-14 15:42:48 +03:00
Jim McDonald
c599b78f62 core/types: fix test for TransactionsByPriceAndNonce 2017-10-11 11:35:44 +01:00
Péter Szilágyi
629b5837e9 core: revert invalid block dedup code (#15235) 2017-10-03 18:59:53 +02:00
Péter Szilágyi
7e9e3a134b
core/types, internal: swap Receipt.Failed to Status 2017-10-02 14:04:22 +03:00
Felix Lange
d78ad226c2 ethclient, mobile: add TransactionSender (#15127)
* core/types: make Signer derive address instead of public key

There are two reasons to do this now: The upcoming ethclient signer
doesn't know the public key, just the address. EIP 208 will introduce a
new signer which derives the 'entry point' address for transactions with
zero signature. The entry point has no public key.

Other changes to the interface ease the path make to moving signature
crypto out of core/types later.

* ethclient, mobile: add TransactionSender

The new method can get the right signer without any crypto, and without
knowledge of the signature scheme that was used when the transaction was
included.
2017-10-01 11:03:28 +02:00
Péter Szilágyi
2ab2a9f131 core/bloombits, eth/filters: handle null topics (#15195)
When implementing the new bloombits based filter, I've accidentally broke null
topics by removing the special casing of common.Hash{} filter rules, which
acted as the wildcard topic until now.

This PR fixes the regression, but instead of using the magic hash
common.Hash{} as the null wildcard, the PR reworks the code to handle nil
topics during parsing, converting a JSON null into nil []common.Hash topic.
2017-09-27 12:14:52 +02:00
Péter Szilágyi
229bf51f0d Merge pull request #15181 from fjl/state-revert-log-index
core/state: revert log index when removing logs
2017-09-26 17:11:46 +03:00
cdetrio
673007d7ae core/vm: standard vm traces (#15035) 2017-09-22 10:22:56 +02:00
Felix Lange
a0d783094e core/state: revert log index when removing logs 2017-09-21 20:46:21 +02:00
Péter Szilágyi
701d60c889
params: enable Byzantium on Ropsten/tests, fix failures 2017-09-14 10:59:05 +03:00
Martin Holst Swende
9be07de539 params: Updated finalized gascosts for ECMUL/MODEXP (#15135)
* params: Updated finalized gascosts for ECMUL/MODEXP

* core,tests: Updates pending new tests

* tests: Updated with new tests

* core: revert state transition bugfix

* tests: Add expected failures due to  #15119
2017-09-14 10:35:54 +03:00
Péter Szilágyi
5bbd7fb390
consensus, core, params: rebrand Metro to Byzantium 2017-09-14 10:10:46 +03:00
Péter Szilágyi
10b3f97c9d core: only fire one chain head per batch (#15123)
* core: only fire one chain head per batch

* miner: announce chan events synchronously
2017-09-11 13:13:05 +03:00
Felix Lange
42a5b54bf5 core/vm: improve bitvec comments 2017-09-10 21:04:36 +02:00
Felix Lange
10181b57a9 core, eth/downloader: commit block data using batches (#15115)
* ethdb: add Putter interface and Has method

* ethdb: improve docs and add IdealBatchSize

* ethdb: remove memory batch lock

Batches are not safe for concurrent use.

* core: use ethdb.Putter for Write* functions

This covers the easy cases.

* core/state: simplify StateSync

* trie: optimize local node check

* ethdb: add ValueSize to Batch

* core: optimize HasHeader check

This avoids one random database read get the block number. For many uses
of HasHeader, the expectation is that it's actually there. Using Has
avoids a load + decode of the value.

* core: write fast sync block data in batches

Collect writes into batches up to the ideal size instead of issuing many
small, concurrent writes.

* eth/downloader: commit larger state batches

Collect nodes into a batch up to the ideal size instead of committing
whenever a node is received.

* core: optimize HasBlock check

This avoids a random database read to get the number.

* core: use numberCache in HasHeader

numberCache has higher capacity, increasing the odds of finding the
header without a database lookup.

* core: write imported block data using a batch

Restore batch writes of state and add blocks, tx entries, receipts to
the same batch. The change also simplifies the miner.

This commit also removes posting of logs when a forked block is imported.

* core: fix DB write error handling

* ethdb: use RLock for Has

* core: fix HasBlock comment
2017-09-09 19:03:07 +03:00
Martin Holst Swende
d6681ed360 core/vm: Rename + updated doc on jumpdest analysis 2017-09-08 12:47:44 +02:00
Mark
c1740e4540 core/types, miner: avoid tx sender miscaching (#14773) 2017-09-07 23:22:27 +02:00
Fiisio
02b4d074f6 core/asm: use ContainsRune instead of IndexRune (#15098) 2017-09-07 23:11:48 +02:00
Pawan Singh Pal
69c8be7c86 core: delete dao.go (#15113)
- dao.go is already present in consensus/misc
- core/dao.go is not used anywhere in the codebase
2017-09-07 23:08:06 +02:00
Péter Szilágyi
c4d21bc8e5 Merge pull request #14631 from zsfelfoldi/bloombits2
core/bloombits, eth/filter: transformed bloom bitmap based log search
2017-09-06 13:00:35 +03:00
Péter Szilágyi
564c8f3ae6
core/bloombits: drop nil-matcher special case 2017-09-06 11:14:22 +03:00
Zsolt Felfoldi
451ffdb62b
core/bloombits: use general filters instead of addresses and topics 2017-09-06 11:14:21 +03:00
Zsolt Felfoldi
6ff2c02991
core/bloombits: AddBloom index parameter and fixes variable names 2017-09-06 11:14:20 +03:00
Péter Szilágyi
f585f9eee8
core, eth: clean up bloom filtering, add some tests 2017-09-06 11:14:19 +03:00
Zsolt Felfoldi
4ea4d2dc34
core, eth: add bloombit indexer, filter based on it 2017-09-06 11:13:13 +03:00
Péter Szilágyi
cc313e78b7
core: use blocks and avoid deep reorgs in txpool 2017-09-05 19:50:29 +03:00
Péter Szilágyi
da7d57e07c
core: make txpool operate on immutable state 2017-09-05 13:34:41 +03:00
Martin Holst Swende
e7408b5552 core/vm: Make MaxCodesize non-retroactive (#15072)
* core/vm: Make max_codesize only applicable post Spurious Dragon/158/155/161/170

* tests: Remove expected failure
2017-09-04 12:53:25 +03:00
Martin Holst Swende
1901521ed0 core: Fix flaw where underpriced locals were removed (#15081)
* core: Fix flaw where underpriced locals were removed

* core: minor code cleanups for tx pool tests
2017-09-04 12:48:36 +03:00
Martin Holst Swende
23b51a68cb core/vm: avoid state lookup during gas calc for call (#15061) 2017-09-04 10:56:45 +02:00