Skip to content

Commit

Permalink
Blob gas price not in receipt if trx type != blob
Browse files Browse the repository at this point in the history
  • Loading branch information
maoueh committed Jan 15, 2024
1 parent ab7ead7 commit e7898e3
Show file tree
Hide file tree
Showing 6 changed files with 9,737 additions and 9,732 deletions.
9 changes: 6 additions & 3 deletions codec/console_reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -901,10 +901,13 @@ func (ctx *parseCtx) readApplyTrxEnd(line string) error {
var blobGasPrice *pbeth.BigInt
if ctx.readBlobGasUsed {
logChunkNum = 7
blobGasUsed = FromUint64(chunks[5], "END_APPLY_TRX blobGasUsed")
blobGasPrice = pbeth.BigIntFromBytes(FromHex(chunks[6], "END_APPLY_TRX blogGasPrice"))
}

// Only in the blob trx type we compute those field for the receipt
if ctx.currentTrace.Type == pbeth.TransactionTrace_TRX_TYPE_BLOB {
blobGasUsed = FromUint64(chunks[5], "END_APPLY_TRX blobGasUsed")
blobGasPrice = pbeth.BigIntFromBytes(FromHex(chunks[6], "END_APPLY_TRX blogGasPrice"))
}
}
var logs []*Log
if err := json.Unmarshal([]byte(chunks[logChunkNum]), &logs); err != nil {
return err
Expand Down
19,241 changes: 9,621 additions & 9,620 deletions codec/testdata/firehose-logs.dmlog.golden.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -663,4 +663,4 @@
],
"ver": 3
}
]
]
111 changes: 56 additions & 55 deletions codec/testdata/read_transaction_blob.dmlog.golden.json
Original file line number Diff line number Diff line change
@@ -1,56 +1,57 @@
[{
"to": "79f19a189068a79ec01343b8c70096114f048753",
"nonce": "110",
"gasPrice": "0ba43b7400",
"gasLimit": "966000",
"input": "f93d3def0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004b7265616c79206c6f6e6720737472696e67206c6172676572207468616e20333220627974657320746f2074657374206f757420736f6c69646974792073706c697474696e67207374756666000000000000000000000000000000000000000000",
"v": "29",
"r": "9b7b4ad21ac016e1766749e203d4776d351ac9c7d56cdd9b3c2d5b4f940c1f7e",
"s": "5b08a942dbc15ff47f7f40d4519fe2e20948579b0baebaca66a7b651f6f483ed",
"gasUsed": "23358",
"type": "TRX_TYPE_BLOB",
"accessList": [
{
"address": "1234567890123456789012345678901234567890",
"storageKeys": [
"00000000000000000000000000000000000000000000000000000000000000ab",
"00000000000000000000000000000000000000000000000000000000000000ef"
]
[
{
"accessList": [
{
"address": "1234567890123456789012345678901234567890",
"storageKeys": [
"00000000000000000000000000000000000000000000000000000000000000ab",
"00000000000000000000000000000000000000000000000000000000000000ef"
]
},
{
"address": "abcdefabcdefabcdefabcdefabcdefabcdef0910"
},
{
"address": "1234567890123456789012345678901234567890",
"storageKeys": [
"0000000000000000000000000000000000000000000000000000000000000012"
]
}
],
"beginOrdinal": "1",
"blobGas": "99",
"blobGasFeeCap": "ab",
"blobHashes": [
"0174b9554595faea99f11f5310c086acaec4686ef94b30466f966d67071b228b65",
"0184b9554595faea99f11f5310c086acaec4686ef94b30466f966d67071b228b64"
],
"calls": [
{
"address": "79f19a189068a79ec01343b8c70096114f048753",
"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",
"cumulativeGasUsed": "23358",
"logsBloom": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
},
{
"address": "abcdefabcdefabcdefabcdefabcdefabcdef0910"
},
{
"address": "1234567890123456789012345678901234567890",
"storageKeys": [
"0000000000000000000000000000000000000000000000000000000000000012"
]
}
],
"maxFeePerGas": "fe",
"maxPriorityFeePerGas": "56",
"hash": "74b9554595faea99f11f5310c086acaec4686ef94b30466f966d67071b228b65",
"from": "ab07a50ad459b41fe065f7bbab866d5390e9f705",
"beginOrdinal": "1",
"endOrdinal": "11",
"receipt": {
"cumulativeGasUsed": "23358",
"logsBloom": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"blobGasPrice": "00"
},
"calls": [
{
"index": 1,
"callType": "CALL",
"caller": "ab07a50ad459b41fe065f7bbab866d5390e9f705",
"address": "79f19a189068a79ec01343b8c70096114f048753"
}
],
"blobGas": "99",
"blobGasFeeCap": "ab",
"blobHashes": [
"0174b9554595faea99f11f5310c086acaec4686ef94b30466f966d67071b228b65",
"0184b9554595faea99f11f5310c086acaec4686ef94b30466f966d67071b228b64"
]
}
]
"s": "5b08a942dbc15ff47f7f40d4519fe2e20948579b0baebaca66a7b651f6f483ed",
"to": "79f19a189068a79ec01343b8c70096114f048753",
"type": "TRX_TYPE_BLOB",
"v": "29"
}
]
103 changes: 52 additions & 51 deletions codec/testdata/read_transaction_blob_no_hashes.dmlog.golden.json
Original file line number Diff line number Diff line change
@@ -1,52 +1,53 @@
[{
"to": "79f19a189068a79ec01343b8c70096114f048753",
"nonce": "110",
"gasPrice": "0ba43b7400",
"gasLimit": "966000",
"input": "f93d3def0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004b7265616c79206c6f6e6720737472696e67206c6172676572207468616e20333220627974657320746f2074657374206f757420736f6c69646974792073706c697474696e67207374756666000000000000000000000000000000000000000000",
"v": "29",
"r": "9b7b4ad21ac016e1766749e203d4776d351ac9c7d56cdd9b3c2d5b4f940c1f7e",
"s": "5b08a942dbc15ff47f7f40d4519fe2e20948579b0baebaca66a7b651f6f483ed",
"gasUsed": "23358",
"type": "TRX_TYPE_BLOB",
"accessList": [
{
"address": "1234567890123456789012345678901234567890",
"storageKeys": [
"00000000000000000000000000000000000000000000000000000000000000ab",
"00000000000000000000000000000000000000000000000000000000000000ef"
]
[
{
"accessList": [
{
"address": "1234567890123456789012345678901234567890",
"storageKeys": [
"00000000000000000000000000000000000000000000000000000000000000ab",
"00000000000000000000000000000000000000000000000000000000000000ef"
]
},
{
"address": "abcdefabcdefabcdefabcdefabcdefabcdef0910"
},
{
"address": "1234567890123456789012345678901234567890",
"storageKeys": [
"0000000000000000000000000000000000000000000000000000000000000012"
]
}
],
"beginOrdinal": "1",
"blobGas": "99",
"blobGasFeeCap": "ab",
"calls": [
{
"address": "79f19a189068a79ec01343b8c70096114f048753",
"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",
"cumulativeGasUsed": "23358",
"logsBloom": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
},
{
"address": "abcdefabcdefabcdefabcdefabcdefabcdef0910"
},
{
"address": "1234567890123456789012345678901234567890",
"storageKeys": [
"0000000000000000000000000000000000000000000000000000000000000012"
]
}
],
"maxFeePerGas": "fe",
"maxPriorityFeePerGas": "56",
"hash": "74b9554595faea99f11f5310c086acaec4686ef94b30466f966d67071b228b65",
"from": "ab07a50ad459b41fe065f7bbab866d5390e9f705",
"beginOrdinal": "1",
"endOrdinal": "11",
"receipt": {
"cumulativeGasUsed": "23358",
"logsBloom": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"blobGasPrice": "00"
},
"calls": [
{
"index": 1,
"callType": "CALL",
"caller": "ab07a50ad459b41fe065f7bbab866d5390e9f705",
"address": "79f19a189068a79ec01343b8c70096114f048753"
}
],
"blobGas": "99",
"blobGasFeeCap": "ab"
}
]
"s": "5b08a942dbc15ff47f7f40d4519fe2e20948579b0baebaca66a7b651f6f483ed",
"to": "79f19a189068a79ec01343b8c70096114f048753",
"type": "TRX_TYPE_BLOB",
"v": "29"
}
]
3 changes: 1 addition & 2 deletions codec/testdata/system_call.dmlog.golden.json
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,7 @@
"r": "65be28c68d069343be8d7a22fb91bf2a4e2ff3b2fcab0f1666aaeba1191c9a75",
"receipt": {
"cumulativeGasUsed": "21000",
"logsBloom": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"blobGasPrice": "00"
"logsBloom": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
},
"s": "718c7e77cdf0108190821b01704d3474adb939726767022ec2bccc39c74a2668",
"status": "SUCCEEDED",
Expand Down

0 comments on commit e7898e3

Please sign in to comment.