Skip to content

Commit 9e98531

Browse files
authored
add support for op-stack specific receipt fields (#287)
1 parent af0736e commit 9e98531

File tree

4 files changed

+36
-0
lines changed

4 files changed

+36
-0
lines changed

dig/dig.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -944,6 +944,18 @@ func (lwc *logWithCtx) get(name string) any {
944944
return &lwc.t.MaxFeePerGas
945945
case "tx_nonce":
946946
return lwc.t.Nonce
947+
case "tx_l1_base_fee_scalar":
948+
return lwc.t.L1BaseFeeScalar
949+
case "tx_l1_blob_base_fee":
950+
return lwc.t.L1BlobBaseFee
951+
case "tx_l1_blob_base_fee_scalar":
952+
return lwc.t.L1BlobBaseFeeScalar
953+
case "tx_l1_fee":
954+
return lwc.t.L1Fee
955+
case "tx_l1_gas_price":
956+
return lwc.t.L1GasPrice
957+
case "tx_l1_gas_used":
958+
return lwc.t.L1GasUsed
947959
case "log_addr":
948960
return lwc.l.Address.Bytes()
949961
case "trace_action_call_type":

eth/types.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,12 @@ type Receipt struct {
173173
EffectiveGasPrice uint256.Int
174174
Logs Logs
175175
ContractAddress Bytes
176+
L1BaseFeeScalar *uint256.Int `json:"l1BaseFeeScalar,omitempty"`
177+
L1BlobBaseFee *uint256.Int `json:"l1BlobBaseFee,omitempty"`
178+
L1BlobBaseFeeScalar *uint256.Int `json:"l1BlobBaseFeeScalar,omitempty"`
179+
L1Fee *uint256.Int `json:"l1Fee,omitempty"`
180+
L1GasPrice *uint256.Int `json:"l1GasPrice,omitempty"`
181+
L1GasUsed *Uint64 `json:"l1GasUsed,omitempty"`
176182
}
177183

178184
type Header struct {

jrpc2/client.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -655,6 +655,12 @@ type receiptResult struct {
655655
EffectiveGasPrice uint256.Int `json:"effectiveGasPrice"`
656656
Logs eth.Logs `json:"logs"`
657657
ContractAddress eth.Bytes `json:"contractAddress"`
658+
L1BaseFeeScalar *uint256.Int `json:"l1BaseFeeScalar,omitempty"`
659+
L1BlobBaseFee *uint256.Int `json:"l1BlobBaseFee,omitempty"`
660+
L1BlobBaseFeeScalar *uint256.Int `json:"l1BlobBaseFeeScalar,omitempty"`
661+
L1Fee *uint256.Int `json:"l1Fee,omitempty"`
662+
L1GasPrice *uint256.Int `json:"l1GasPrice,omitempty"`
663+
L1GasUsed *eth.Uint64 `json:"l1GasUsed,omitempty"`
658664
}
659665

660666
type receiptResp struct {
@@ -712,6 +718,12 @@ func (c *Client) receipts(ctx context.Context, url string, bm blockmap, start, l
712718
tx.Logs = make([]eth.Log, len(resps[i].Result[j].Logs))
713719
tx.ContractAddress.Write(resps[i].Result[j].ContractAddress)
714720
copy(tx.Logs, resps[i].Result[j].Logs)
721+
tx.L1BaseFeeScalar = resps[i].Result[j].L1BaseFeeScalar
722+
tx.L1BlobBaseFee = resps[i].Result[j].L1BlobBaseFee
723+
tx.L1BlobBaseFeeScalar = resps[i].Result[j].L1BlobBaseFeeScalar
724+
tx.L1Fee = resps[i].Result[j].L1Fee
725+
tx.L1GasPrice = resps[i].Result[j].L1GasPrice
726+
tx.L1GasUsed = resps[i].Result[j].L1GasUsed
715727
}
716728
}
717729
return nil

shovel/glf/filter.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,12 @@ var (
127127
"tx_status",
128128
"tx_gas_used",
129129
"tx_contract_address",
130+
"tx_l1_base_fee_scalar",
131+
"tx_l1_blob_base_fee",
132+
"tx_l1_blob_base_fee_scalar",
133+
"tx_l1_fee",
134+
"tx_l1_gas_price",
135+
"tx_l1_gas_used",
130136
"log_addr",
131137
"log_idx",
132138
}

0 commit comments

Comments
 (0)