Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

do not merge: testing CI with all DB / logs changes #876

Closed
wants to merge 70 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
a406f7f
feat: add new txIndex column to event meta response
paologalligit Sep 24, 2024
e22616b
test: add convert event test
paologalligit Sep 25, 2024
856701b
feat: make txLog and txIndex as optional return params
paologalligit Sep 26, 2024
37920c1
chore: update swagger with new event optional data
paologalligit Sep 26, 2024
c30b6a0
feat: save logIndex in sequence
paologalligit Oct 7, 2024
99d5fff
feat: tweaked bits in sequence
paologalligit Oct 11, 2024
5663cb4
refactor: rename optional log meta field
paologalligit Oct 11, 2024
10a4bc0
refactor: comments, yaml and txIndex counts
paologalligit Nov 5, 2024
ca8b38b
Darren/logdb remove leading zeros (#865)
darrenvechain Oct 29, 2024
f9173e4
feat: add new txIndex column to event meta response
paologalligit Sep 24, 2024
f3bd272
test: add convert event test
paologalligit Sep 25, 2024
c5b3c63
feat: make txLog and txIndex as optional return params
paologalligit Sep 26, 2024
76a38d9
chore: update swagger with new event optional data
paologalligit Sep 26, 2024
ad6204e
feat: save logIndex in sequence
paologalligit Oct 7, 2024
1415b40
feat: tweaked bits in sequence
paologalligit Oct 11, 2024
94f4070
refactor: rename optional log meta field
paologalligit Oct 11, 2024
464f530
refactor: comments, yaml and txIndex counts
paologalligit Nov 5, 2024
9114c0b
rebase to master
paologalligit Nov 7, 2024
a80a62a
fix: remove stale struct
paologalligit Nov 6, 2024
9217741
add txIndex to returned logdb query
paologalligit Nov 7, 2024
297ffd5
reset to 0 eventCount and transferCount each receipt and write blockI…
paologalligit Nov 7, 2024
9ff47cb
fix lint
paologalligit Nov 7, 2024
6f4c9ef
rephrase logIndex description in yaml file
paologalligit Nov 7, 2024
f81bc85
refactor: use filter.Option instead of eventFilter.Option
paologalligit Nov 7, 2024
a2a74f8
move includeIndexes to api
libotony Nov 8, 2024
d3e7903
Darren/logdb remove leading zeros (#865)
darrenvechain Oct 29, 2024
a7cf6fd
cmd/thor: update instance dir to v4
qianbin Dec 14, 2023
b81910e
trie: implement varint-prefix coder
qianbin Jan 9, 2024
19c7810
deps: add github.com/qianbin/drlp
qianbin Jan 9, 2024
7edff9c
trie: implement appendHexToCompact & compactLen
qianbin Jan 9, 2024
997429c
trie: temporarily remove merkle proof stuff
qianbin Jan 9, 2024
e0ceb39
trie: many changes
qianbin Jan 11, 2024
08d2283
trie: optimize full-node encoding/decoding
qianbin Jan 18, 2024
3260ede
trie: tweak shortnode encoding
qianbin Jan 19, 2024
4c83982
muxdb: move engine pkg
qianbin Jan 19, 2024
97debf7
trie: add Version() method for node interface
qianbin Jan 26, 2024
da44763
muxdb: refactor due to trie updates and:
qianbin Jan 26, 2024
5a7942f
chain: a lot of changes
qianbin Jan 28, 2024
acf9b3c
state: changes due to update of trie
qianbin Feb 1, 2024
f4d7ec1
lowrlp: remove this pkg
qianbin Feb 1, 2024
5f85854
txpool: changes due to underlying pkg update
qianbin Feb 2, 2024
2801e81
genesis: changes due to underlying pkg update
qianbin Feb 2, 2024
4f437c7
consensus: changes due to underlying pkg update
qianbin Feb 2, 2024
547c8f9
builtin: changes due to underlying pkg update
qianbin Feb 2, 2024
356a0ba
runtime: changes due to underlying pkg update
qianbin Feb 2, 2024
d3040c1
api: changes due to underlying pkg update
qianbin Feb 2, 2024
aaa4b8f
cmd/thor/pruner: rename pkg optimizer to pruner
qianbin Feb 2, 2024
aa2f9a4
cmd/thor: changes due to underlying pkg update
qianbin Feb 2, 2024
73213b2
muxdb: abandon leaf filter
qianbin Feb 12, 2024
63d8853
cmd/thor/pruner: use smaller period when nearly synced
qianbin Feb 12, 2024
b66b4ed
muxdb: improve trie node path encoding
qianbin Feb 12, 2024
982e02e
trie: treat short nodes as standalone nodes when skipping hash
qianbin Feb 12, 2024
235c964
cmd/thor: fix disablePrunerFlag not work
qianbin Feb 13, 2024
79ece8f
trie: improve refNode encoding/decoding
qianbin Feb 19, 2024
b6cb3f6
muxdb: improve history node key encoding
qianbin Feb 19, 2024
bc552d6
cmd/thor: adjust pruner parameters
qianbin Feb 20, 2024
f550058
build: fix test cases
qianbin Feb 21, 2024
e1d7f4a
lint: fix lint error
qianbin Feb 21, 2024
6f40214
muxdb: fix ver encoding in node blob cache
qianbin Feb 28, 2024
55e7f76
muxdb: add test cases for cache
qianbin Feb 28, 2024
16eaa32
runtime: fix test compile error
qianbin Mar 25, 2024
230ecf7
make build and test pass after rebase
libotony Aug 6, 2024
c649d54
add back pruner tests
libotony Oct 25, 2024
29f904a
add tests for node encoding
libotony Nov 1, 2024
b7a42b3
minor typo
libotony Nov 1, 2024
ae23b6d
update named store space prefix
libotony Nov 5, 2024
7b883f1
add more tests
libotony Nov 6, 2024
67da142
fix block summary in repo
libotony Nov 6, 2024
ca14f79
merge branch 'feat/tx-log-seq' into feat/maindb-v4-candidate-pre-logdb
darrenvechain Nov 8, 2024
08def69
Merge branch 'feat/tx-log-seq' into feat/maindb-v4-candidate-pre-logdb
darrenvechain Nov 8, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
refactor: rename optional log meta field
  • Loading branch information
paologalligit committed Nov 7, 2024
commit 94f4070428729dce7fd3e02413f7c9a038e1c3f5
8 changes: 4 additions & 4 deletions api/doc/thor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1371,11 +1371,11 @@ components:
description: The index of the clause in the transaction, from which the log was generated.
example: 0
nullable: false
optionalData:
$ref: '#/components/schemas/LogOptionalData'
extendedLogMeta:
$ref: '#/components/schemas/ExtendedLogMeta'

LogOptionalData:
title: optionalData
ExtendedLogMeta:
title: ExtendedLogMeta
type: object
nullable: true
properties:
Expand Down
10 changes: 5 additions & 5 deletions api/events/events_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func TestOptionalData(t *testing.T) {
testCases := []struct {
name string
optData *events.EventOptionalData
expected *events.LogOptionalData
expected *events.ExtendedLogMeta
}{
{
name: "empty optional data",
Expand All @@ -77,7 +77,7 @@ func TestOptionalData(t *testing.T) {
optData: &events.EventOptionalData{
TxIndex: true,
},
expected: &events.LogOptionalData{
expected: &events.ExtendedLogMeta{
TxIndex: new(uint32),
},
},
Expand All @@ -86,7 +86,7 @@ func TestOptionalData(t *testing.T) {
optData: &events.EventOptionalData{
LogIndex: true,
},
expected: &events.LogOptionalData{
expected: &events.ExtendedLogMeta{
LogIndex: new(uint32),
},
},
Expand All @@ -96,7 +96,7 @@ func TestOptionalData(t *testing.T) {
TxIndex: true,
LogIndex: true,
},
expected: &events.LogOptionalData{
expected: &events.ExtendedLogMeta{
TxIndex: new(uint32),
LogIndex: new(uint32),
},
Expand All @@ -123,7 +123,7 @@ func TestOptionalData(t *testing.T) {
assert.Equal(t, 5, len(tLogs))

for _, tLog := range tLogs {
assert.Equal(t, tc.expected, tLog.Meta.OptionalData)
assert.Equal(t, tc.expected, tLog.Meta.ExtendedLogMeta)
}
})
}
Expand Down
26 changes: 13 additions & 13 deletions api/events/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,25 @@ import (
)

type LogMeta struct {
BlockID thor.Bytes32 `json:"blockID"`
BlockNumber uint32 `json:"blockNumber"`
BlockTimestamp uint64 `json:"blockTimestamp"`
TxID thor.Bytes32 `json:"txID"`
TxOrigin thor.Address `json:"txOrigin"`
ClauseIndex uint32 `json:"clauseIndex"`
OptionalData *LogOptionalData `json:"optionalData,omitempty"`
BlockID thor.Bytes32 `json:"blockID"`
BlockNumber uint32 `json:"blockNumber"`
BlockTimestamp uint64 `json:"blockTimestamp"`
TxID thor.Bytes32 `json:"txID"`
TxOrigin thor.Address `json:"txOrigin"`
ClauseIndex uint32 `json:"clauseIndex"`
ExtendedLogMeta *ExtendedLogMeta `json:"extendedLogMeta,omitempty"`
}

type LogOptionalData struct {
type ExtendedLogMeta struct {
TxIndex *uint32 `json:"txIndex,omitempty"`
LogIndex *uint32 `json:"logIndex,omitempty"`
}

func (opt *LogOptionalData) Empty() bool {
func (opt *ExtendedLogMeta) Empty() bool {
return opt == nil || (opt.TxIndex == nil && opt.LogIndex == nil)
}

func (opt *LogOptionalData) String() string {
func (opt *ExtendedLogMeta) String() string {
var parts []string
if opt.TxIndex != nil {
parts = append(parts, fmt.Sprintf("txIndex: %v", *opt.TxIndex))
Expand Down Expand Up @@ -89,7 +89,7 @@ func convertEvent(event *logdb.Event, eventOptionalData *EventOptionalData) *Fil

func addOptionalData(fe *FilteredEvent, event *logdb.Event, eventOptionalData *EventOptionalData) *FilteredEvent {
if eventOptionalData != nil {
opt := &LogOptionalData{}
opt := &ExtendedLogMeta{}

if eventOptionalData.LogIndex {
opt.LogIndex = &event.Index
Expand All @@ -99,7 +99,7 @@ func addOptionalData(fe *FilteredEvent, event *logdb.Event, eventOptionalData *E
}

if !opt.Empty() {
fe.Meta.OptionalData = opt
fe.Meta.ExtendedLogMeta = opt
}
}
return fe
Expand Down Expand Up @@ -128,7 +128,7 @@ func (e *FilteredEvent) String() string {
e.Meta.TxID,
e.Meta.TxOrigin,
e.Meta.ClauseIndex,
e.Meta.OptionalData,
e.Meta.ExtendedLogMeta,
)
}

Expand Down
16 changes: 8 additions & 8 deletions api/events/types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,39 +164,39 @@ func TestConvertEvent(t *testing.T) {
assert.Equal(t, event.BlockNumber, result.Meta.BlockNumber)
assert.Equal(t, event.BlockTime, result.Meta.BlockTimestamp)
assert.Equal(t, event.TxID, result.Meta.TxID)
assert.Equal(t, event.TxIndex, *result.Meta.OptionalData.TxIndex)
assert.Equal(t, event.Index, *result.Meta.OptionalData.LogIndex)
assert.Equal(t, event.TxIndex, *result.Meta.ExtendedLogMeta.TxIndex)
assert.Equal(t, event.Index, *result.Meta.ExtendedLogMeta.LogIndex)
assert.Equal(t, event.TxOrigin, result.Meta.TxOrigin)
assert.Equal(t, event.ClauseIndex, result.Meta.ClauseIndex)
assert.Equal(t, expectedTopics, result.Topics)
}

func TestIsEmpty(t *testing.T) {
// Empty cases
var nilCase *LogOptionalData
var nilCase *ExtendedLogMeta
assert.True(t, nilCase.Empty())

emptyCase := &LogOptionalData{}
emptyCase := &ExtendedLogMeta{}
assert.True(t, emptyCase.Empty())

emptyCase = &LogOptionalData{
emptyCase = &ExtendedLogMeta{
LogIndex: nil,
}
assert.True(t, emptyCase.Empty())

emptyCase = &LogOptionalData{
emptyCase = &ExtendedLogMeta{
TxIndex: nil,
}
assert.True(t, emptyCase.Empty())

// Not empty cases
val := uint32(1)
notEmptyCase := &LogOptionalData{
notEmptyCase := &ExtendedLogMeta{
LogIndex: &val,
}
assert.False(t, notEmptyCase.Empty())

notEmptyCase = &LogOptionalData{
notEmptyCase = &ExtendedLogMeta{
TxIndex: &val,
}
assert.False(t, notEmptyCase.Empty())
Expand Down