Skip to content

Commit 2625ad6

Browse files
authored
chore(sensor): reduce datastore indexes (#768)
1 parent 9c78f4e commit 2625ad6

1 file changed

Lines changed: 15 additions & 15 deletions

File tree

p2p/database/datastore.go

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -58,21 +58,21 @@ type DatastoreEvent struct {
5858
// loss of precision.
5959
type DatastoreHeader struct {
6060
ParentHash *datastore.Key
61-
UncleHash string
62-
Coinbase string
63-
Root string
64-
TxHash string
65-
ReceiptHash string
61+
UncleHash string `datastore:",noindex"`
62+
Coinbase string `datastore:",noindex"`
63+
Root string `datastore:",noindex"`
64+
TxHash string `datastore:",noindex"`
65+
ReceiptHash string `datastore:",noindex"`
6666
Bloom []byte `datastore:",noindex"`
67-
Difficulty string
67+
Difficulty string `datastore:",noindex"`
6868
Number string
69-
GasLimit string
69+
GasLimit string `datastore:",noindex"`
7070
GasUsed string
7171
Time time.Time
7272
Extra []byte `datastore:",noindex"`
73-
MixDigest string
74-
Nonce string
75-
BaseFee string
73+
MixDigest string `datastore:",noindex"`
74+
Nonce string `datastore:",noindex"`
75+
BaseFee string `datastore:",noindex"`
7676
TimeFirstSeen time.Time
7777
TTL time.Time
7878
IsParent bool
@@ -81,9 +81,9 @@ type DatastoreHeader struct {
8181
// DatastoreBlock represents a block stored in datastore.
8282
type DatastoreBlock struct {
8383
*DatastoreHeader
84-
TotalDifficulty string
85-
Transactions []*datastore.Key
86-
Uncles []*datastore.Key
84+
TotalDifficulty string `datastore:",noindex"`
85+
Transactions []*datastore.Key `datastore:",noindex"`
86+
Uncles []*datastore.Key `datastore:",noindex"`
8787
}
8888

8989
// DatastoreTransaction represents a transaction stored in datastore. Data is
@@ -99,7 +99,7 @@ type DatastoreTransaction struct {
9999
Nonce string
100100
To string
101101
Value string
102-
V, R, S string
102+
V, R, S string `datastore:",noindex"`
103103
Time time.Time
104104
TimeFirstSeen time.Time
105105
TTL time.Time
@@ -108,7 +108,7 @@ type DatastoreTransaction struct {
108108

109109
type DatastorePeer struct {
110110
Name string
111-
Caps []string
111+
Caps []string `datastore:",noindex"`
112112
URL string
113113
LastSeenBy string
114114
TimeLastSeen time.Time

0 commit comments

Comments
 (0)