The Status module that consumes go-ethereum
https://status.im
63efa6ae84
Implement fetching of balance history from the database if it exists, otherwise retrieves it using a RPC calls. Every balance is stored in DB as an entry. Also fetch regularly balance history for all enabled networks, accounts and tokens. Fetching for a specific configuration will pause the full update which will resume after the specific configuration is fetched. The granularity of data points returned is defined by the constant increment step define in `timeIntervalToHoursPerStep` for each interval. The `timeIntervalToHoursPerStep` values have a common divisor to have cache hit between requests. To ensure cache hit the requested blocks are "snapped" to specific time points defined by the `timeIntervalToSnapUnit` enumeration The cached data is stored in `balance_history` table. The "calibration" data, special case, used for bloc average timestamp is stored with address `0x0` and balance is not fetched/used. Uniqueness constrained is enforced by the `balance_history_identify_entry` UNIQUE index. Optimal DB fetching is ensured by the `balance_history_filter_entries` index Tests are implemented using a mock of `BlockInfoSource` interface used to intercept the RPC calls. `getBalanceHistoryFromBlocksSource` contains main functionality independent of the `chainClientSource`, `BlockInfoSource`'s concrete implementation. Notes: - the timestamp for a block balance is approximate and based on a very rough heuristic: blocks in between data points have a constant timestamp (average of the fist and last block in the one year rage) - this is a complete refactoring of the logic used to fetch due to the nature of the heuristic chosen to ensure cache hit independent of the time interval if the granularity matches the cache Updates status-desktop #8226 |
||
---|---|---|
.dependabot | ||
.github | ||
.vscode | ||
_assets | ||
_docs | ||
_examples | ||
abi-spec | ||
account | ||
api | ||
appdatabase | ||
appmetrics | ||
build/bin | ||
cmd | ||
common | ||
config | ||
connection | ||
contracts | ||
db | ||
discovery | ||
eth-node | ||
exportlogs | ||
extkeys | ||
images | ||
ipfs | ||
logutils | ||
mailserver | ||
metrics | ||
mobile | ||
multiaccounts | ||
node | ||
nodecfg | ||
notifier | ||
params | ||
peers | ||
postgres | ||
profiling | ||
protocol | ||
rpc | ||
rtt | ||
server | ||
services | ||
signal | ||
sqlite | ||
static | ||
t | ||
telemetry | ||
timesource | ||
transactions | ||
vendor | ||
waku | ||
wakuv2 | ||
.codeclimate.yml | ||
.dockerignore | ||
.gitignore | ||
.golangci.yml | ||
.travis.yml | ||
BOOTNODE.md | ||
CMakeLists.txt | ||
CONTRIBUTING.md | ||
LICENSE.md | ||
MAILSERVER.md | ||
Makefile | ||
README.md | ||
RELEASING.md | ||
VERSION | ||
WAKU.md | ||
go.mod | ||
go.sum | ||
nix.conf | ||
shell.nix |
README.md
Status bindings for go-ethereum
Docs
- How to Build
- How to Contribute
- How to Release
- How to run a Bootnode
- How to run a Mailserver
- How to run a Waku node
- How to configure status-go