Skip to content

Instantly share code, notes, and snippets.

View rjl493456442's full-sized avatar
🐢

rjl493456442

🐢
View GitHub Profile
// Copyright 2019 The go-ethereum Authors
// This file is part of the go-ethereum library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
This file has been truncated, but you can view the full file.
Last login: Wed Oct 16 13:55:39 on ttys000
/System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python: No module named virtualenvwrapper
virtualenvwrapper.sh: There was a problem running the initialization hooks.
If Python could not import the module virtualenvwrapper.hook_loader,
check that virtualenvwrapper has been installed for
VIRTUALENVWRAPPER_PYTHON=/Users/gary/.pyenv/shims/python and that PATH is
set properly.
# gary @ garydeMacBook-Pro in ~ [14:36:26]
This file has been truncated, but you can view the full file.
Last login: Tue Oct 15 22:33:56 on ttys000
g/System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python: No module named virtualenvwrapper
virtualenvwrapper.sh: There was a problem running the initialization hooks.
If Python could not import the module virtualenvwrapper.hook_loader,
check that virtualenvwrapper has been installed for
VIRTUALENVWRAPPER_PYTHON=/Users/gary/.pyenv/shims/python and that PATH is
set properly.
eto%

Keybase proof

I hereby claim:

  • I am rjl493456442 on github.
  • I am gary_rong (https://keybase.io/gary_rong) on keybase.
  • I have a public key ASA1pLfN83kyiC2fggAXKXUYTsF7og8asNqaJHjz0dlIpAo

To claim this, I am signing this object:

```
// Copyright 2018 The go-ethereum Authors
// This file is part of the go-ethereum library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
Hi Suryandaru,
It's me again :) I have a few questions regarding the seek compaction want to ask.
Each file has a counter which is size/16KB. When the counter goes down to 0, then the file is compacted.
The rationale behinds this(in the code comment) is: the cost of file compaction is approximate with cumulative seek cost.
Regarding the deep reason of seek compaction, my guess is:
(1) If we try to lookup one entry in level X, and there exists a file has the overlapped key range, so we will try to look up the entry

TxIndexTail

  • Nil
    • Empty node
      • Full Sync:
        • All indices are generated
        • Import a batch of blocks, emit NewHeadEvent
        • Truncate extra indices in runtime
        • For the first NewHeadEvent, TxIndexTail is nil, assign it to Head-txlookuplimt
  • Fast Sync:
diff --git a/trie/database.go b/trie/database.go
index c24d9b61f..e49751f55 100644
--- a/trie/database.go
+++ b/trie/database.go
@@ -55,8 +55,13 @@ var (
 // secureKeyPrefix is the database key prefix used to store trie node preimages.
 var secureKeyPrefix = []byte("secure-key-")
 
-// secureKeyLength is the length of the above prefix + 32byte hash.
Function: &Indexer.Block.Realtime.Fetcher.fetch_and_import_block/3
    Args: [27239, %Indexer.Block.Fetcher{broadcast: :realtime, callback_module: Indexer.Block.Realtime.Fetcher, json_rpc_named_arguments: [transport: EthereumJSONRPC.HTTP, transport_options: [http: EthereumJSONRPC.HTTP.HTTPoison, url: "http://localhost:8545", http_options: [recv_timeout: 600000, timeout: 600000, hackney: [pool: :ethereum_jsonrpc]]], variant: EthereumJSONRPC.Geth], receipts_batch_size: 250, receipts_concurrency: 10}, false]
2019-07-16T02:32:14.659 [error] Task #PID<0.13837.0> started from Indexer.Block.Realtime.Fetcher terminating
** (DBConnection.ConnectionError) connection not available and request was dropped from queue after 104ms. You can configure how long requests wait in the queue using :queue_target and :queue_interval. See DBConnection.start_link/2 for more information
    (db_connection) lib/db_connection.ex:778: DBConnection.transaction/3
    (ecto) lib/ecto/repo/transaction.ex:16: Ecto.Repo.Transaction.transact