Skip to content

Commit

Permalink
Added reward blob fee needed for BSC Tycho hard-fork
Browse files Browse the repository at this point in the history
  • Loading branch information
maoueh committed Apr 17, 2024
1 parent af4bbdd commit 6607bf5
Show file tree
Hide file tree
Showing 7 changed files with 222 additions and 134 deletions.
8 changes: 6 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). See [MAINTAINERS.md](./MAINTAINERS.md)
for instructions to keep up to date.

## v2.4.5

* Updated block model to add `BalanceChange#Reason.REWARD_BLOB_FEE` for BSC Tycho hard-fork.

## v2.4.4

### Substreams fixes
Expand Down Expand Up @@ -51,7 +55,7 @@ for instructions to keep up to date.
> [!IMPORTANT]
> Since the `tier2` services will now get the network information from the `tier1` request, you must make sure that the file paths and network addresses will be the same for both tiers.
> ex: if `--common-merged-blocks-store-url=/data/merged` is set on tier1, make sure the merged blocks are also available from tier2 under the path `/data/merged`.
> The flags `--substreams-state-store-url`, `--substreams-state-store-default-tag`, `--common-merged-blocks-store-url`, `--substreams-rpc-endpoints stringArray` and `--substreams-rpc-gas-limit` are now ignored on tier2.
> The flags `--substreams-state-store-url`, `--substreams-state-store-default-tag`, `--common-merged-blocks-store-url`, `--substreams-rpc-endpoints stringArray` and `--substreams-rpc-gas-limit` are now ignored on tier2.
> The flag `--common-first-streamable-block` should be set to 0 to accommodate every chain.
> Non-ethereum chains can query a `firehose-ethereum` tier2, but the opposite is not true, since only the `firehose-ethereum` implements the `eth_call` WASM extension.
Expand All @@ -60,7 +64,7 @@ for instructions to keep up to date.
#### Performance improvements

* All module outputs are now cached. (previously, only the last module was cached, along with the "store snapshots", to allow parallel processing).
* All module outputs are now cached. (previously, only the last module was cached, along with the "store snapshots", to allow parallel processing).
* Tier2 will now read back mapper outputs (if they exist) to prevent running them again. Additionally, it will not read back the full blocks if its inputs can be satisfied from existing cached mapper outputs.
* Tier2 will skip processing completely if it's processing the last stage and the `output_module` is a mapper that has already been processed (ex: when multiple requests are indexing the same data at the same time)
* Tier2 will skip processing completely if it's processing a stage where all the stores and outputs have been processed and cached.
Expand Down
1 change: 1 addition & 0 deletions codec/console_reader_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ func TestParseFromFile(t *testing.T) {
{"testdata/read_transaction_dynamic_fee.dmlog", nil, nil, true},
{"testdata/read_transaction_blob.dmlog", nil, nil, true},
{"testdata/read_transaction_blob_no_hashes.dmlog", nil, nil, true},
{"testdata/read_reward_blob_fee_balance_change.dmlog", nil, nil, true},
{"testdata/system_call.dmlog", nil, nil, false},
{"testdata/polygon_calls_after_finalize.dmlog", nil, nil, false},
{"testdata/polygon_add_log_0.dmlog", nil, nil, false},
Expand Down
5 changes: 5 additions & 0 deletions codec/testdata/read_reward_blob_fee_balance_change.dmlog
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FIRE INIT 2.4 geth 1.10.17-dm-stable
FIRE BEGIN_APPLY_TRX 74b9554595faea99f11f5310c086acaec4686ef94b30466f966d67071b228b65 79f19a189068a79ec01343b8c70096114f048753 . 29 9b7b4ad21ac016e1766749e203d4776d351ac9c7d56cdd9b3c2d5b4f940c1f7e 5b08a942dbc15ff47f7f40d4519fe2e20948579b0baebaca66a7b651f6f483ed 966000 0ba43b7400 110 f93d3def0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004b7265616c79206c6f6e6720737472696e67206c6172676572207468616e20333220627974657320746f2074657374206f757420736f6c69646974792073706c697474696e67207374756666000000000000000000000000000000000000000000 0312345678901234567890123456789012345678900200000000000000000000000000000000000000000000000000000000000000ab00000000000000000000000000000000000000000000000000000000000000efabcdefabcdefabcdefabcdefabcdefabcdef0910001234567890123456789012345678901234567890010000000000000000000000000000000000000000000000000000000000000012 fe 56 3 1 0 99 ab 0174b9554595faea99f11f5310c086acaec4686ef94b30466f966d67071b228b65,0184b9554595faea99f11f5310c086acaec4686ef94b30466f966d67071b228b64
FIRE TRX_FROM ab07a50ad459b41fe065f7bbab866d5390e9f705
FIRE BALANCE_CHANGE 1 5973918275c01f50555d44e92c9d9b353cadad54 3635c99aac6d15b002 3635c99aac6d15afec reward_blob_fee 2
FIRE END_APPLY_TRX 23358 . 23358 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 11 0 0 []
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
[
{
"accessList": [
{
"address": "1234567890123456789012345678901234567890",
"storageKeys": [
"00000000000000000000000000000000000000000000000000000000000000ab",
"00000000000000000000000000000000000000000000000000000000000000ef"
]
},
{
"address": "abcdefabcdefabcdefabcdefabcdefabcdef0910"
},
{
"address": "1234567890123456789012345678901234567890",
"storageKeys": [
"0000000000000000000000000000000000000000000000000000000000000012"
]
}
],
"beginOrdinal": "1",
"blobGas": "99",
"blobGasFeeCap": "ab",
"blobHashes": [
"0174b9554595faea99f11f5310c086acaec4686ef94b30466f966d67071b228b65",
"0184b9554595faea99f11f5310c086acaec4686ef94b30466f966d67071b228b64"
],
"calls": [
{
"address": "79f19a189068a79ec01343b8c70096114f048753",
"balanceChanges": [
{
"address": "5973918275c01f50555d44e92c9d9b353cadad54",
"newValue": "3635c99aac6d15afec",
"oldValue": "3635c99aac6d15b002",
"ordinal": "2",
"reason": "REASON_REWARD_BLOB_FEE"
}
],
"callType": "CALL",
"caller": "ab07a50ad459b41fe065f7bbab866d5390e9f705",
"index": 1
}
],
"endOrdinal": "11",
"from": "ab07a50ad459b41fe065f7bbab866d5390e9f705",
"gasLimit": "966000",
"gasPrice": "0ba43b7400",
"gasUsed": "23358",
"hash": "74b9554595faea99f11f5310c086acaec4686ef94b30466f966d67071b228b65",
"input": "f93d3def0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004b7265616c79206c6f6e6720737472696e67206c6172676572207468616e20333220627974657320746f2074657374206f757420736f6c69646974792073706c697474696e67207374756666000000000000000000000000000000000000000000",
"maxFeePerGas": "fe",
"maxPriorityFeePerGas": "56",
"nonce": "110",
"r": "9b7b4ad21ac016e1766749e203d4776d351ac9c7d56cdd9b3c2d5b4f940c1f7e",
"receipt": {
"blobGasPrice": "00",
"blobGasUsed": "0",
"cumulativeGasUsed": "23358",
"logsBloom": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
},
"s": "5b08a942dbc15ff47f7f40d4519fe2e20948579b0baebaca66a7b651f6f483ed",
"to": "79f19a189068a79ec01343b8c70096114f048753",
"type": "TRX_TYPE_BLOB",
"v": "29"
}
]
4 changes: 4 additions & 0 deletions proto/sf/ethereum/type/v2/type.proto
Original file line number Diff line number Diff line change
Expand Up @@ -673,6 +673,10 @@ message BalanceChange {
// Used on chain(s) where some Ether burning happens
REASON_BURN = 15;
REASON_WITHDRAWAL = 16;

// Rewards for Blob processing on BNB chain added in Tycho hard-fork, refers
// to BNB documentation to check the timestamp at which it was activated.
REASON_REWARD_BLOB_FEE = 17;
}

// The block's global ordinal when the balance change was recorded, refer to [Block]
Expand Down
4 changes: 2 additions & 2 deletions types/pb/last_generate.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
generate.sh - Wed Mar 20 10:22:42 EDT 2024 - maoueh
generate.sh - Wed Apr 17 09:14:53 EDT 2024 - maoueh
streamingfast/proto revision: 67073d7d67736a3d36e8b4181ccdd7dcf406a4f6
streamingfast/firehose-ethereum/proto revision: 9ef6e8d
streamingfast/firehose-ethereum/proto revision: cafe819
Loading

0 comments on commit 6607bf5

Please sign in to comment.