Skip to content

Instantly share code, notes, and snippets.

View YazzyYaz's full-sized avatar
💭
Coding 💻

Yaz Khoury YazzyYaz

💭
Coding 💻
View GitHub Profile
ERROR[03-13|15:44:34.914]
########## BAD BLOCK #########
Chain config: NetworkID: 6, ChainID: 6 Engine: clique EIP1014: 1705549 EIP1052: 1705549 EIP1108: 2200013 EIP1344: 2200013 EIP140: 716617 EIP145: 1705549 EIP150: 0 EIP152: 2200013 EIP155: 0 EIP160: 0 EIP161abc: 716617 EIP161d: 716617 EIP170: 716617 EIP1884: 2200013 EIP198: 716617 EIP2028: 2200013 EIP211: 716617 EIP212: 716617 EIP213: 716617 EIP214: 716617 EIP2200: 2200013 EIP658: 716617 EIP7: 0 EthashECIP1010Continue: 2000000 EthashECIP1010Pause: 0 EthashECIP1017: 5000000 EthashECIP1041: 0 EthashEIP100B: 716617 EthashEIP2: 0 EthashHomestead: 0
Number: 2058192
Hash: 0xf56efd9b074eed67c79d903c26bd0059e701c37200dc3cb86cc6c38159406d36
0: cumulative: 25352 gas: 25352 contract: 0x0000000000000000000000000000000000000000 status: 1 tx: 0x0ae3504d52fed3fdc92fb4267d6b36523d022b33663fc44b4eeddea0bcaa51cb logs: [] bloom: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
2020-03-11T01:27:47.095 fetcher=block_uncle count=10 [error] Task #PID<0.740.0> started from Indexer.Fetcher.UncleBlock terminating
** (FunctionClauseError) no function clause matching in EthereumJSONRPC.Block.elixir_to_params/1
(ethereum_jsonrpc) lib/ethereum_jsonrpc/block.ex:194: EthereumJSONRPC.Block.elixir_to_params(%{"difficulty" => 2882419, "extraData" => "0x", "gasLimit" => 4712388, "gasUsed" => 0, "hash" => "0xfdfadc3248673ce3f4bbe591db323b2de74862fc1fef85057
995c26c9e418ffc", "logsBloom" => "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000
@YazzyYaz
YazzyYaz / total_fees_daily.sql
Created January 23, 2020 02:27
Total Gas Fees Every Day
WITH transactions_by_block AS (
SELECT t.block_number, t.block_timestamp, t.hash, t.gas, t.gas_price, t.receipt_gas_used, t.receipt_cumulative_gas_used
FROM `bigquery-public-data.crypto_ethereum_classic.transactions` t
),
fees_by_block AS (SELECT t.block_number, t.block_timestamp, SUM((t.receipt_gas_used/1000000000) * (t.gas_price / 1000000000)) as total_fees from transactions_by_block t
group by t.block_timestamp, t.block_number)
SELECT TIMESTAMP_TRUNC(f.block_timestamp, DAY) as block_day,
SUM(f.total_fees) as total_fees,
FROM fees_by_block f
GROUP BY TIMESTAMP_TRUNC(f.block_timestamp, DAY)
@YazzyYaz
YazzyYaz / gas_fees_by_specific_date.sql
Created January 23, 2020 02:06
Gas Fees By Specific Date
WITH block_book AS (
SELECT b.number,
FROM `bigquery-public-data.crypto_ethereum_classic.blocks` b
WHERE DATE(timestamp) = "2020-01-05"
),
transactions_by_block AS (
SELECT t.block_number, t.hash, t.gas, t.gas_price, t.receipt_gas_used, t.receipt_cumulative_gas_used
FROM `bigquery-public-data.crypto_ethereum_classic.transactions` t
)
SELECT t.block_number, SUM((t.receipt_gas_used/1000000000) * (t.gas_price / 1000000000)) as total_fees from transactions_by_block t JOIN block_book b on t.block_number = b.number
@YazzyYaz
YazzyYaz / gas_used_daily_avg.sql
Created December 27, 2019 13:59
ETC/ETH Daily Gas Usage Average
WITH ethereum_avg_gas as (
SELECT AVG(gas_used) as eth_avg_gas,
TIMESTAMP_TRUNC(timestamp, DAY) as eth_date,
FROM `bigquery-public-data.crypto_ethereum.blocks`
GROUP BY eth_date),
etc_avg_gas as (
SELECT AVG(gas_used) as etc_avg_gas,
TIMESTAMP_TRUNC(timestamp, DAY) as etc_date,
FROM `bigquery-public-data.crypto_ethereum_classic.blocks`
GROUP BY etc_date),
@YazzyYaz
YazzyYaz / gas_used_daily_total.sql
Last active December 27, 2019 13:58
ETC/ETH Daily Gas Usage Total
WITH ethereum_total_gas as (
SELECT SUM(gas_used) as eth_sum_gas,
TIMESTAMP_TRUNC(timestamp, DAY) as eth_date,
FROM `bigquery-public-data.crypto_ethereum.blocks`
GROUP BY eth_date),
etc_total_gas as (
SELECT SUM(gas_used) as etc_sum_gas,
TIMESTAMP_TRUNC(timestamp, DAY) as etc_date,
FROM `bigquery-public-data.crypto_ethereum_classic.blocks`
GROUP BY etc_date
@YazzyYaz
YazzyYaz / etcaddressgrowth.sql
Created November 25, 2019 17:36
ETC Address Growth
#standardSQL
-- MIT License
-- Copyright (c) 2018 Evgeny Medvedev, evge.medvedev@gmail.com
with double_entry_book as (
-- debits
select to_address as address, value as value, block_timestamp
from `bigquery-public-data.crypto_ethereum.traces`
where to_address is not null
and status = 1
and (call_type not in ('delegatecall', 'callcode', 'staticcall') or call_type is null)
@YazzyYaz
YazzyYaz / prod.exs
Created October 24, 2019 19:53
Prod.exs for Blockscout
use Mix.Config
# Configures the database
config :explorer, Explorer.Repo,
url: System.get_env("DATABASE_URL"),
pool_size: String.to_integer(System.get_env("POOL_SIZE") || "10"),
ssl: String.equivalent?(System.get_env("ECTO_USE_SSL") || "true", "true"),
prepare: :unnamed,
timeout: :timer.seconds(60),
queue_target: 5000,
2019-10-04 18:54:26 UTC Starting Parity-Ethereum/v2.5.9-stable-06c7096-20190926/x86_64-linux-gnu/rustc1.36.0
2019-10-04 18:54:26 UTC Keys path /mordor-parity-data/keys/mordor
2019-10-04 18:54:26 UTC DB path /mordor-parity-data/chains/mordor/db/a681e59b5a3e4f3a
2019-10-04 18:54:26 UTC State DB configuration: fast
2019-10-04 18:54:26 UTC Operating mode: active
2019-10-04 18:54:26 UTC Configured for Mordor Classic Testnet using Ethash engine
2019-10-04 18:54:27 UTC Listening for new connections on 127.0.0.1:8546.
2019-10-04 18:54:32 UTC Public node URL: enode://1813e90a0afdd7c1e4892c5376960e3577a9e6c5a4f86fa405a405c7421a4a1608248d77cc90333842f13d8954d82113dec480cfb76b4fef
8cb475157cf4d5f2@10.28.224.2:30000
====================
@YazzyYaz
YazzyYaz / twentyone.cpp
Created April 22, 2019 16:35
Code for bitcoin reward reduction
int64 CBlock::GetBlockValue(int64 nFees) const
{
int64 nSubsidy = 50 * COIN;
// Subsidy is cut in half every 4 years
nSubsidy >>= (nBestHeight / 210000);
return nSubsidy + nFees;
}