Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
ca5a6f7
[repo] message: add cache for messages count
iam047801 Jun 20, 2025
93f24dd
[repo] account: simplify states counting on filter
iam047801 Jun 20, 2025
d438121
[core] write to the new table for latest parsed account states
iam047801 Jun 20, 2025
8f7704e
[migrations] fix latest parsed account states migration
iam047801 Jun 20, 2025
62cb136
[core] remove latest_parsed_account_states table, write to latest_acc…
iam047801 Jun 21, 2025
2162cf2
[migrations] fix latest_account_states procedure for table population
iam047801 Jun 21, 2025
1549ace
[repo] filterAccountStates: use latest_account_states for types and o…
iam047801 Jun 21, 2025
87c99c4
[api] internalErr: print url on error
iam047801 Jun 21, 2025
a1b2420
[api] handle context cancellation properly
iam047801 Jun 21, 2025
3f0d63c
[core] latest_account_states: add created_lt
iam047801 Jun 21, 2025
79339f7
[migrations] comment out procedures
iam047801 Jun 21, 2025
8dd969b
[migrations] account_states created_lt: fix procedure
iam047801 Jun 21, 2025
40ca1b1
[repo] countMsgFullScan: handle empty messages table and unfiltered m…
iam047801 Jun 21, 2025
8edec35
[repo] countMsgPartialScan: unfiltered max created lt and handle case…
iam047801 Jun 21, 2025
e300b31
[repo] account filter: cache counting, do full scan on types/owner/mi…
iam047801 Jun 21, 2025
45ce9d3
[repo] countAccountStates / countMsg: handle full scan not found erro…
iam047801 Jun 21, 2025
e66ab92
[repo] transaction: cache counting
iam047801 Jun 21, 2025
b1f50bd
[core] convert SkipAddress function to SkippedAddresses map
iam047801 Jun 22, 2025
6aa631d
[fetcher] simplify getAccount
iam047801 Jun 22, 2025
c9825d4
some simple linter fixes
iam047801 Jun 22, 2025
acdea88
remove nolint directives
iam047801 Jun 22, 2025
cbdca81
[migration] add db transactions
iam047801 Jun 22, 2025
c2f547f
[repo] tune filter cache ttl
iam047801 Jun 22, 2025
1d6db34
[repo] tune messages filter cache ttl
iam047801 Jun 22, 2025
900653e
[repo] messages filter counting: round created_lt for cache
iam047801 Jun 22, 2025
c68fef7
[repo] countMsgPartialScan: fix query
iam047801 Jun 22, 2025
cc59ec6
[migrations] fix batch_fill_account_states_created_lt procedure
iam047801 Jun 23, 2025
8885e84
upgrade tonutils-go to v1.13.0
iam047801 Jun 23, 2025
509777b
github actions: update go version for golangci-lint
iam047801 Jun 23, 2025
110bc33
golangci-lint: migrate to v2.1
iam047801 Jun 23, 2025
ff4a2de
[repo] message: only 1 hour cache
iam047801 Jun 23, 2025
d75ca38
.golangci.yaml: remove depguard
iam047801 Jun 23, 2025
9633147
go.mod: go version 1.23.0
iam047801 Jun 23, 2025
88bca32
[migrations] fix comments
iam047801 Jun 23, 2025
4af29b6
[migrations] latest_account_states created_lt as not null
iam047801 Jun 23, 2025
956cc51
[fetcher] getAccountLibraries: skip nil libraries
iam047801 Jun 24, 2025
fa0a123
[query] FilterAccounts: validate contract types
iam047801 Jun 24, 2025
ab5bcd9
[query] AggregateAccountsHistory: validate contract types
iam047801 Jun 24, 2025
f496a0b
[query] FilterMessages/AggregateMessagesHistory: validate contract ty…
iam047801 Jun 24, 2025
b28ec85
[abi] move emulator to a separate package
iam047801 Jun 24, 2025
ec148bc
README.md: provide emulator library path to run tests
iam047801 Jun 24, 2025
4d6db49
[filter] cache: cleanup old entries on Get
iam047801 Jun 24, 2025
203c890
[statistics] getTransactionStatistics: do not panic if there are no m…
iam047801 Jun 25, 2025
f34d06e
[indexer] getMessagesSource: fail on unknown message source after 16 …
iam047801 Jun 25, 2025
7970fa5
[fetcher] mapMessage: calculate message hash as in old versions of to…
iam047801 Jun 25, 2025
89d8d3b
[repo] message filter hash: lag for rounded max_lt
iam047801 Jun 25, 2025
8e6a81f
.golangci.yaml: do not check msg_hash folder
iam047801 Jun 25, 2025
625bc80
[rndm] unify lt counter for tests
iam047801 Jun 25, 2025
4b59dd8
[repo] message filter counting: fix tests and since_start_count in pa…
iam047801 Jun 25, 2025
9cbc6df
[repo] countAccountStates: use rounded counting
iam047801 Jun 25, 2025
c451cf2
[repo] account filter counting: remove countLatestAccountStatesFullSc…
iam047801 Jun 25, 2025
7c4bc66
[repo] countAccountStatesFullScan: remove filter check
iam047801 Jun 25, 2025
caa6129
[repo] countAccountStates: full scan postgresql instead of clickhouse
iam047801 Jun 25, 2025
7f74263
[repo] tx filter count: round max lt
iam047801 Jun 26, 2025
5a2bce5
[repo] countAccountStates: nolint nestif
iam047801 Jun 26, 2025
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
11 changes: 5 additions & 6 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,11 @@ jobs:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v4
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.19'
cache: false
- uses: actions/checkout@v3
go-version: stable
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
uses: golangci/golangci-lint-action@v8
with:
version: v1.52.2
version: v2.1
124 changes: 69 additions & 55 deletions .golangci.yaml
Original file line number Diff line number Diff line change
@@ -1,46 +1,36 @@
version: "2"
run:
go: '1.19'
concurrency: 4
timeout: 5m
go: "1.23"
modules-download-mode: readonly
issues-exit-code: 2
tests: true
modules-download-mode: readonly
allow-parallel-runners: false
skip-files:
- main.go
linters:
disable-all: true
default: none
enable:
- errcheck
- gosimple
- govet
- ineffassign
- staticcheck
- unused
- asciicheck
- asciicheck
- bidichk
- decorder
- depguard
# - depguard
- dupl
- durationcheck
- errcheck
- errchkjson
- errname
- errorlint
- execinquery
- exportloopref
- forbidigo
- forcetypeassert
- goimports
- gocognit
- goconst
- gocritic
- gocyclo
- gofmt
- goheader
- gosec
- govet
- grouper
- importas
- ineffassign
- ireturn
- maintidx
- makezero
Expand All @@ -51,42 +41,66 @@ linters:
- nolintlint
- predeclared
- promlinter
- staticcheck
- unconvert
- unused
- whitespace
linters-settings:
gocyclo:
min-complexity: 18
gosec:
excludes:
- G404
gocritic:
disabled-checks:
- regexpMust
- commentedOutCode
- docStub
enabled-tags:
- diagnostic
- style
- performance
- experimental
- opinionated
settings:
captLocal:
paramsOnly: false
elseif:
skipBalanced: false
nestingReduce:
bodyWidth: 4
rangeValCopy:
sizeThreshold: 64
skipTestFuncs: false
tooManyResultsChecker:
maxResults: 100
truncateCmp:
skipArchDependent: false
underef:
skipRecvDeref: false
unnamedResult:
checkExported: true
hugeParam:
sizeThreshold: 64
settings:
gocritic:
disabled-checks:
- regexpMust
- commentedOutCode
- docStub
enabled-tags:
- diagnostic
- style
- performance
- experimental
- opinionated
settings:
captLocal:
paramsOnly: false
elseif:
skipBalanced: false
hugeParam:
sizeThreshold: 64
nestingReduce:
bodyWidth: 4
rangeValCopy:
sizeThreshold: 64
skipTestFuncs: false
tooManyResultsChecker:
maxResults: 100
truncateCmp:
skipArchDependent: false
underef:
skipRecvDeref: false
unnamedResult:
checkExported: true
gocyclo:
min-complexity: 18
gosec:
excludes:
- G404
exclusions:
generated: lax
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
paths:
- third_party$
- builtin$
- examples$
- internal/app/fetcher/msg_hash/store.go
formatters:
enable:
- gofmt
- goimports
exclusions:
generated: lax
paths:
- third_party$
- builtin$
- examples$
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ RUN mkdir /output && cp build/emulator/libemulator.so /output


# build
FROM golang:1.21.4-bookworm AS builder
FROM golang:1.23-bookworm AS builder

RUN apt-get update && \
apt-get install -y libsecp256k1-1 libsodium23
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,12 @@ Run tests on abi package:
go test -p 1 $(go list ./... | grep /abi) -covermode=count
```

To run the tests you might need to provide a path to the emulator library. For example:

```shell
CGO_LDFLAGS="-L /Users/user/go/src/github.com/tonkeeper/tongo/lib/darwin/ -Wl,-rpath,/Users/user/go/src/github.com/tonkeeper/tongo/lib/darwin/ -l emulator" go test -p 1 $(go list ./... | grep /abi) -covermode=count
```

Run repositories tests:

```shell
Expand Down
7 changes: 7 additions & 0 deletions abi/abi.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ type InterfaceDesc struct {
ContractData TLBFieldsDesc `json:"contract_data,omitempty"`
}

var registeredDefinitions = map[TLBType]TLBFieldsDesc{}

func RegisterDefinitions(definitions map[TLBType]TLBFieldsDesc, depth ...int) error {
noDef := map[TLBType]TLBFieldsDesc{}
for dn, d := range definitions {
Expand Down Expand Up @@ -67,3 +69,8 @@ func RegisterDefinitions(definitions map[TLBType]TLBFieldsDesc, depth ...int) er

return RegisterDefinitions(noDef, currentDepth+1, maxDepth)
}

func GetRegisteredDefinition(t TLBType) (TLBFieldsDesc, bool) {
desc, ok := registeredDefinitions[t]
return desc, ok
}
Loading