Skip to content

Commit

Permalink
shovel: add tx_max_fee_per_gas, tx_max_priority_fee_per_gas to tx ind…
Browse files Browse the repository at this point in the history
…exing
  • Loading branch information
ryandotsmith committed Jul 8, 2024
1 parent 0686d65 commit 57fd7e5
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 28 deletions.
4 changes: 4 additions & 0 deletions dig/dig.go
Original file line number Diff line number Diff line change
Expand Up @@ -934,6 +934,10 @@ func (lwc *logWithCtx) get(name string) any {
return &lwc.t.GasPrice
case "tx_effective_gas_price":
return &lwc.t.EffectiveGasPrice
case "tx_max_priority_fee_per_gas":
return &lwc.t.MaxPriorityFeePerGas
case "tx_max_fee_per_gas":
return &lwc.t.MaxFeePerGas
case "tx_nonce":
return lwc.t.Nonce
case "log_addr":
Expand Down
4 changes: 2 additions & 2 deletions eth/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -337,8 +337,8 @@ type Tx struct {
AccessList AccessTuples `json:"-"` // TODO

// EIP-1559
MaxPriorityFeePerGas uint256.Int
MaxFeePerGas uint256.Int
MaxPriorityFeePerGas uint256.Int `json:"maxPriorityFeePerGas"`
MaxFeePerGas uint256.Int `json:"maxFeePerGas"`

PrecompHash Bytes `json:"hash"`
cacheMut sync.Mutex
Expand Down
55 changes: 29 additions & 26 deletions indexsupply.com/shovel/docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ The following resources are automatically deployed on a main commit:

On main but not yet associated with a new version tag.

- add tx_max_fee_per_gas, tx_max_priority_fee_per_gas to tx indexing
- add tx_nonce, tx_gas_price to tx indexing
- fix multiple filters per block/event
- fix filter operations on trace_action_value
Expand Down Expand Up @@ -975,32 +976,34 @@ An integration that indexes `trace_` data cannot also index ABI encoded event da
Shovel will optimize its Ethereum JSON RPC API method choice based on the data that your integration requires. Integrations that only require data from `eth_getLogs` will be the most performant since `eth_getLogs` can filter and batch in ways that the other Eth APIs cannot. Whereas `eth_getBlockReceipts` and `trace_block` are extremely slow. Keep in mind that integrations are run independently so that you can partition your workload accordingly.


| Name | Eth Type | Postgres Type | Eth API |
|------------------------|-----------------|------------------|------------------|
| chain_id | int | int | `n/a` |
| block_num | numeric | numeric | `l, h, b, r, t` |
| block_hash | bytea | bytea | `l, h, b, r, t` |
| block_time | int | int | `h, b` |
| tx_hash | bytes32 | bytea | `l, h, b, r, t` |
| tx_idx | int | int | `l, h, b, r, t` |
| tx_signer | address | bytea | `b, r` |
| tx_to | address | bytea | `b, r` |
| tx_value | uint256 | numeric | `b, r` |
| tx_input | bytes | bytea | `b, r` |
| tx_type | byte | int | `b, r` |
| tx_nonce | uint64 | bigint | `b, r` |
| tx_status | byte | int | `r` |
| tx_gas_used | uint64 | bigint | `r` |
| tx_gas_price | uint256 | numeric | `b` |
| tx_effective_gas_price | uint256 | numeric | `r` |
| log_idx | int | int | `l, r` |
| log_addr | address | bytea | `l, r` |
| event data | n/a | n/a | `l` |
| trace_action_call_type | string | text | `t` |
| trace_action_idx | int | int | `t` |
| trace_action_from | address | bytea | `t` |
| trace_action_to | address | bytea | `t` |
| trace_action_value | uint256 | numeric | `t` |
| Name | Eth Type | Postgres Type | Eth API |
|------------------------------|-----------------|------------------|------------------|
| chain_id | int | int | `n/a` |
| block_num | numeric | numeric | `l, h, b, r, t` |
| block_hash | bytea | bytea | `l, h, b, r, t` |
| block_time | int | int | `h, b` |
| tx_hash | bytes32 | bytea | `l, h, b, r, t` |
| tx_idx | int | int | `l, h, b, r, t` |
| tx_signer | address | bytea | `b, r` |
| tx_to | address | bytea | `b, r` |
| tx_value | uint256 | numeric | `b, r` |
| tx_input | bytes | bytea | `b, r` |
| tx_type | byte | int | `b, r` |
| tx_nonce | uint64 | bigint | `b, r` |
| tx_status | byte | int | `r` |
| tx_gas_used | uint64 | bigint | `r` |
| tx_gas_price | uint256 | numeric | `b` |
| tx_max_priority_fee_per_gas | uint256 | numeric | `b` |
| tx_max_fee_per_gas | uint256 | numeric | `b` |
| tx_effective_gas_price | uint256 | numeric | `r` |
| log_idx | int | int | `l, r` |
| log_addr | address | bytea | `l, r` |
| event data | n/a | n/a | `l` |
| trace_action_call_type | string | text | `t` |
| trace_action_idx | int | int | `t` |
| trace_action_from | address | bytea | `t` |
| trace_action_to | address | bytea | `t` |
| trace_action_value | uint256 | numeric | `t` |

The Eth API can be one of (in asc order of perf cost):

Expand Down
2 changes: 2 additions & 0 deletions shovel/glf/filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ var (
"tx_input",
"tx_value",
"tx_type",
"tx_max_priority_fee_per_gas",
"tx_max_fee_per_gas",
}
receipt = []string{
"block_hash",
Expand Down

0 comments on commit 57fd7e5

Please sign in to comment.