1. 15 Dec, 2021 1 commit
  2. 14 Dec, 2021 4 commits
  3. 11 Dec, 2021 1 commit
  4. 09 Dec, 2021 1 commit
  5. 07 Dec, 2021 3 commits
    • Martin Holst Swende's avatar
      core, eth: improve delivery speed on header requests (#23105) · db03faa1
      Martin Holst Swende authored
      This PR reduces the amount of work we do when answering header queries, e.g. when a peer
      is syncing from us.
      
      For some items, e.g block bodies, when we read the rlp-data from database, we plug it
      directly into the response package. We didn't do that for headers, but instead read
      headers-rlp, decode to types.Header, and re-encode to rlp. This PR changes that to keep it
      in RLP-form as much as possible. When a node is syncing from us, it typically requests 192
      contiguous headers. On master it has the following effect:
      
      - For headers not in ancient: 2 db lookups. One for translating hash->number (even though
        the request is by number), and another for reading by hash (this latter one is sometimes
        cached).
        
      - For headers in ancient: 1 file lookup/syscall for translating hash->number (even though
        the request is by number), and another for reading the header itself. After this, it
        also performes a hashing of the header, to ensure that the hash is what it expected. In
        this PR, I instead move the logic for "give me a sequence of blocks" into the lower
        layers, where the database can determine how and what to read from leveldb and/or
        ancients.
      
      There are basically four types of requests; three of them are improved this way. The
      fourth, by hash going backwards, is more tricky to optimize. However, since we know that
      the gap is 0, we can look up by the parentHash, and stlil shave off all the number->hash
      lookups.
      
      The gapped collection can be optimized similarly, as a follow-up, at least in three out of
      four cases.
      Co-authored-by: 's avatarFelix Lange <fjl@twurst.com>
      db03faa1
    • rjl493456442's avatar
    • aaronbuchwald's avatar
  6. 06 Dec, 2021 5 commits
  7. 05 Dec, 2021 1 commit
  8. 03 Dec, 2021 8 commits
  9. 02 Dec, 2021 3 commits
  10. 01 Dec, 2021 5 commits
  11. 30 Nov, 2021 2 commits
  12. 29 Nov, 2021 2 commits
    • Paweł Bylica's avatar
      core/vm: simplify error handling in interpreter loop (#23952) · 1fa91729
      Paweł Bylica authored
      * core/vm: break loop on any error
      
      * core/vm: move ErrExecutionReverted to opRevert()
      
      * core/vm: use "stop token" to stop the loop
      
      * core/vm: unconditionally pc++ in the loop
      
      * core/vm: set return data in instruction impls
      1fa91729
    • Paweł Bylica's avatar
      trie: simplify StackTrie implementation (#23950) · 86fe359a
      Paweł Bylica authored
      Trim the search key from head as it's being pushed deeper into the trie. Previously the search key was never modified but each node kept information how to slice and compare it in keyOffset. Now the keyOffset is not needed as this information is included in the slice of the search key. This way the keyOffset can be removed and key manipulation
      simplified.
      86fe359a
  13. 26 Nov, 2021 2 commits
    • Péter Szilágyi's avatar
      eth: request id dispatcher and direct req/reply APIs (#23576) · c10a0a62
      Péter Szilágyi authored
      * eth: request ID based message dispatcher
      
      * eth: fix dispatcher cancellation, rework fetchers idleness tracker
      
      * eth/downloader: drop peers who refuse to serve advertised chains
      c10a0a62
    • Marius van der Wijden's avatar
      all: core rework for the merge transition (#23761) · 3038e480
      Marius van der Wijden authored
      * all: work for eth1/2 transtition
      
      * consensus/beacon, eth: change beacon difficulty to 0
      
      * eth: updates
      
      * all: add terminalBlockDifficulty config, fix rebasing issues
      
      * eth: implemented merge interop spec
      
      * internal/ethapi: update to v1.0.0.alpha.2
      
                                                                       This commit updates the code to the new spec, moving payloadId into
                                                                       it's own object. It also fixes an issue with finalizing an empty blockhash.
                                                                       It also properly sets the basefee
      
      * all: sync polishes, other fixes + refactors
      
      * core, eth: correct semantics for LeavePoW, EnterPoS
      
      * core: fixed rebasing artifacts
      
      * core: light: performance improvements
      
      * core: use keyed field (f)
      
      * core: eth: fix compilation issues + tests
      
      * eth/catalyst: dbetter error codes
      
      * all: move Merger to consensus/, remove reliance on it in bc
      
      * all: renamed EnterPoS and LeavePoW to ReachTDD and FinalizePoS
      
      * core: make mergelogs a function
      
      * core: use InsertChain instead of InsertBlock
      
      * les: drop merger from lightchain object
      
      * consensus: add merger
      
      * core: recoverAncestors in catalyst mode
      
      * core: fix nitpick
      
      * all: removed merger from beacon, use TTD, nitpicks
      
      * consensus: eth: add docstring, removed unnecessary code duplication
      
      * consensus/beacon: better comment
      
      * all: easy to fix nitpicks by karalabe
      
      * consensus/beacon: verify known headers to be sure
      
      * core: comments
      
      * core: eth: don't drop peers who advertise blocks, nitpicks
      
      * core: never add beacon blocks to the future queue
      
      * core: fixed nitpicks
      
      * consensus/beacon: simplify IsTTDReached check
      
      * consensus/beacon: correct IsTTDReached check
      Co-authored-by: 's avatarrjl493456442 <garyrong0905@gmail.com>
      Co-authored-by: 's avatarPéter Szilágyi <peterke@gmail.com>
      3038e480
  14. 25 Nov, 2021 2 commits