Skip to content

Commit 8330250

Browse files
committed
Corrected grammer, simplifed the makefile so it installs only the main binary, removed expermintal-install option from the make file
1 parent aa49536 commit 8330250

6 files changed

Lines changed: 19 additions & 18 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ Mostly it has some bug fixes.
1111

1212
### Fixed
1313

14-
- The indexer would go into the blocks data and store the signers from the last commit, which is actually all of the block signers from the previous block. So it woult insert it like it was meant for that block height. From now on the indexer will fetch data from the /commit method and insert it properly. [de40740](https://github.com/Cogwheel-Validator/spectra-gnoland-indexer/commit/de407407e67ae588141b361307fae18215f53a18)
15-
- Gnoland can indeed execute multiple message types in the same transaction. The indexer wasn't able to hold this data properly and would cause and error because in the postgres primary key was attached making each message type unique. Now each message type has a message_counter which is a smallint(int16) which is used as a index for that transaction. [d647901](https://github.com/Cogwheel-Validator/spectra-gnoland-indexer/commit/d64790181c626e2ac0137dd9cce08d10ec2b6a7c)
14+
- The indexer would go into the blocks data and store the signers from the last commit, which is actually all of the block signers from the previous block. So it would insert it like it was meant for that block height. From now on the indexer will fetch data from the /commit method and insert it properly. [de40740](https://github.com/Cogwheel-Validator/spectra-gnoland-indexer/commit/de407407e67ae588141b361307fae18215f53a18)
15+
- Gnoland can indeed execute multiple message types in the same transaction. The indexer wasn't able to hold this data properly and would cause an error because in the postgres primary key was attached making each message type unique. Now each message type has a message_counter which is a smallint(int16) which is used as a index for that transaction. [d647901](https://github.com/Cogwheel-Validator/spectra-gnoland-indexer/commit/d64790181c626e2ac0137dd9cce08d10ec2b6a7c)
1616

1717
### Changes
1818

1919
- The REST API now returns a map of int16 and message data for the `/transaction/{tx_hash}/message` route. [74a35b30](https://github.com/Cogwheel-Validator/spectra-gnoland-indexer/commit/74a35b301070bb1dab5cbadec6fe64b16ad7eb3b)
2020
- The indexer should stop using sync.Map and use sync.Mutex with regular map to store the addresses before handing the operation to the AddressSolver function. [dde82a4](https://github.com/Cogwheel-Validator/spectra-gnoland-indexer/commit/dde82a4ecc9bce50963fbff3f4e13a3a20b47f9d)
21-
- The Orchestrator needs to make a fetch to the commit RPC method. This operation is done side by side with fetching the blocks method. A side effect of this is that indexer at that moment will fecth 2X times more request to the RPC, and if the Gnoland node has a limit on the amount of RPC clients that can use it, it might cause the indexer to slow down and throw errors on this requests. In future releases this should be improved. [d647901](https://github.com/Cogwheel-Validator/spectra-gnoland-indexer/commit/d64790181c626e2ac0137dd9cce08d10ec2b6a7c)
21+
- The Orchestrator needs to make a fetch to the commit RPC method. This operation is done side by side with fetching the blocks method. A side effect of this is that indexer at that moment will fetch 2 times more request to the RPC, and if the Gnoland node has a limit on the amount of RPC clients that can use it, it might cause the indexer to slow down and throw errors on this requests. In future releases this should be improved. [d647901](https://github.com/Cogwheel-Validator/spectra-gnoland-indexer/commit/d64790181c626e2ac0137dd9cce08d10ec2b6a7c)
2222
- Updated the go version to 1.25.4
2323

2424
## [0.3.0] - 2025-11-10

Makefile

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ VERSION := $(if $(GIT_TAG),$(GIT_TAG),$(GIT_BRANCH)-$(GIT_COMMIT))
1313

1414
build:
1515
mkdir -p build
16-
go build -ldflags="-X github.com/Cogwheel-Validator/spectra-gnoland-indexer/indexer/cmd.Commit=$(GIT_COMMIT) -X github.com/Cogwheel-Validator/spectra-gnoland-indexer/indexer/cmd.Version=$(VERSION)" -o build/indexer indexer/main.go
16+
go build -ldflags="-X github.com/Cogwheel-Validator/spectra-gnoland-indexer/indexer/cmd.Commit=$(GIT_COMMIT) -X github.com/Cogwheel-Validator/spectra-gnoland-indexer/indexer/cmd.Version=$(VERSION)" -o build/indexer indexer/indexer.go
1717

1818
install:
19-
go install -ldflags="-X github.com/Cogwheel-Validator/spectra-gnoland-indexer/indexer/cmd.Commit=$(GIT_COMMIT) -X github.com/Cogwheel-Validator/spectra-gnoland-indexer/indexer/cmd.Version=$(VERSION)" indexer/main.go
19+
go install -ldflags="-X github.com/Cogwheel-Validator/spectra-gnoland-indexer/indexer/cmd.Commit=$(GIT_COMMIT) -X github.com/Cogwheel-Validator/spectra-gnoland-indexer/indexer/cmd.Version=$(VERSION)" indexer/indexer.go
2020

2121
build-api:
2222
mkdir -p build
@@ -28,12 +28,7 @@ clean:
2828
# experimental build with greentea garbage collection
2929
# use at your own risk
3030
build-experimental:
31-
GOEXPERIMENT=greenteagc go build -ldflags="-X github.com/Cogwheel-Validator/spectra-gnoland-indexer/indexer/cmd.Commit=$(GIT_COMMIT) -X github.com/Cogwheel-Validator/spectra-gnoland-indexer/indexer/cmd.Version=$(VERSION)" -o build/indexer-tea indexer/main.go
32-
33-
# experimental install with greentea garbage collection
34-
# use at your own risk
35-
install-experimental:
36-
cd indexer && GOEXPERIMENT=greenteagc go install ./... -ldflags="-X github.com/Cogwheel-Validator/spectra-gnoland-indexer/indexer/cmd.Commit=$(GIT_COMMIT) -X github.com/Cogwheel-Validator/spectra-gnoland-indexer/indexer/cmd.Version=$(VERSION)"
31+
GOEXPERIMENT=greenteagc go build -ldflags="-X github.com/Cogwheel-Validator/spectra-gnoland-indexer/indexer/cmd.Commit=$(GIT_COMMIT) -X github.com/Cogwheel-Validator/spectra-gnoland-indexer/indexer/cmd.Version=$(VERSION)" -o build/indexer-tea indexer/indexer.go
3732

3833
########################################################
3934
# Test the indexer

api/main.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,9 @@ var rootCmd = &cobra.Command{
153153
w.Header().Set("Content-Type", "image/x-icon")
154154
_, err := w.Write(favicon)
155155
if err != nil {
156-
log.Fatalf("failed to write favicon: %v", err)
156+
log.Printf("failed to write favicon: %v", err)
157+
http.Error(w, "Internal Server Error", http.StatusInternalServerError)
158+
return
157159
}
158160
})
159161

indexer/data_processor/operator.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ func (d *DataProcessor) insertDbMessageGroups(groups *decoder.DbMessageGroups) e
449449

450450
// Insert DbMsgSend messages with address IDs
451451
if msgSendCount > 0 {
452-
timeout := 10*time.Second + time.Duration(msgSendCount)
452+
timeout := 10*time.Second + (time.Duration(msgSendCount) * time.Second / 5)
453453
ctx, cancel := context.WithTimeout(context.Background(), timeout)
454454
err := d.dbPool.InsertMsgSend(ctx, groups.MsgSend)
455455
cancel()
@@ -464,7 +464,7 @@ func (d *DataProcessor) insertDbMessageGroups(groups *decoder.DbMessageGroups) e
464464

465465
// Insert DbMsgCall messages with address IDs
466466
if msgCallCount > 0 {
467-
timeout := 10*time.Second + time.Duration(msgCallCount)
467+
timeout := 10*time.Second + (time.Duration(msgCallCount) * time.Second / 5)
468468
ctx, cancel := context.WithTimeout(context.Background(), timeout)
469469
err := d.dbPool.InsertMsgCall(ctx, groups.MsgCall)
470470
cancel()
@@ -479,7 +479,7 @@ func (d *DataProcessor) insertDbMessageGroups(groups *decoder.DbMessageGroups) e
479479

480480
// Insert DbMsgAddPackage messages with address IDs
481481
if msgAddPkgCount > 0 {
482-
timeout := 10*time.Second + time.Duration(msgAddPkgCount)
482+
timeout := 10*time.Second + (time.Duration(msgAddPkgCount) * time.Second / 5)
483483
ctx, cancel := context.WithTimeout(context.Background(), timeout)
484484
err := d.dbPool.InsertMsgAddPackage(ctx, groups.MsgAddPkg)
485485
cancel()
@@ -494,7 +494,7 @@ func (d *DataProcessor) insertDbMessageGroups(groups *decoder.DbMessageGroups) e
494494

495495
// Insert DbMsgRun messages with address IDs
496496
if msgRunCount > 0 {
497-
timeout := 10*time.Second + time.Duration(msgRunCount)
497+
timeout := 10*time.Second + (time.Duration(msgRunCount) * time.Second / 5)
498498
ctx, cancel := context.WithTimeout(context.Background(), timeout)
499499
err := d.dbPool.InsertMsgRun(ctx, groups.MsgRun)
500500
cancel()
File renamed without changes.

pkgs/generator/generator_test.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,19 @@ func TestAuthenticGeneration(t *testing.T) {
2727

2828
// Test key pair access
2929
for range 500 {
30-
generator.GetRandomKeyPair()
30+
kp := generator.GetRandomKeyPair()
31+
assert.NotNil(t, kp)
32+
assert.NotEmpty(t, kp.Address)
33+
assert.NotEmpty(t, kp.PublicKey)
3134
}
3235

3336
// Test synthetic transaction generation 500 times
3437
for range 500 {
3538
events, tx := generator.GenerateTransaction()
3639
assert.NotNil(t, tx)
37-
assert.NotNil(t, events)
40+
assert.NotNil(t, events.Events)
3841
}
42+
3943
}
4044

4145
// RunAllTests runs all the test functions

0 commit comments

Comments
 (0)