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

module independent #103

Open
wants to merge 79 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
27daa65
split modules
sin3A Jun 20, 2024
c0f6dc2
update proto file
sin3A Jun 20, 2024
28c835c
update simapp
sin3A Jun 21, 2024
c7371ce
update node
sin3A Jun 21, 2024
03e049c
update dependence
sin3A Jun 21, 2024
d6f2277
add junit test
sin3A Jun 26, 2024
ceb7b2c
add slashing junit test
sin3A Jun 27, 2024
054a877
update simapp mod
sin3A Jun 27, 2024
3c640d2
update go mod
sin3A Jun 27, 2024
e6ba840
update simapp mod
sin3A Jun 27, 2024
1002689
update go mod
sin3A Jun 27, 2024
b8ddab1
update node test
sin3A Jul 1, 2024
1f772b8
add file
sin3A Jul 1, 2024
716b8b7
separate modules
sin3A Jul 2, 2024
07b132d
add api
sin3A Jul 2, 2024
9115d13
update cosmos-sdk version
sin3A Jul 2, 2024
fad8db2
update node
sin3A Jul 2, 2024
37e22e1
update idenrity node
sin3A Jul 5, 2024
e6e188b
update go mod
cyilong Jul 5, 2024
2fc74c8
update
sin3A Jul 5, 2024
455266e
Merge branch 'sv/module-independent' of https://github.com/bianjieai/…
sin3A Jul 5, 2024
59438b6
update simapp api
sin3A Jul 8, 2024
0a6305d
update simapp
sin3A Jul 8, 2024
9c7e750
update node upgrade
sin3A Jul 9, 2024
b21710d
update api
sin3A Jul 9, 2024
586a8e9
update simapp
sin3A Jul 9, 2024
bd39030
update node identity
sin3A Jul 9, 2024
a653ae1
update genutil upgrade slashing
sin3A Jul 9, 2024
813edb2
update params
sin3A Jul 9, 2024
ce7bbd0
delete bak file
sin3A Jul 9, 2024
0cce404
add proto script
sin3A Jul 9, 2024
6acdc32
update dependence
sin3A Jun 21, 2024
9cfefe1
add junit test
sin3A Jun 26, 2024
854aaee
add slashing junit test
sin3A Jun 27, 2024
4a29aa8
update go mod
sin3A Jun 27, 2024
e35fdd3
separate modules
sin3A Jul 2, 2024
6b21754
add api
sin3A Jul 2, 2024
bd80eaa
update cosmos-sdk version
sin3A Jul 2, 2024
7c1bd37
update node
sin3A Jul 2, 2024
5dfaba7
update idenrity node
sin3A Jul 5, 2024
cd55497
update go mod
cyilong Jul 5, 2024
6bff400
update simapp api
sin3A Jul 8, 2024
c9a18f9
update node identity upgrade
sin3A Jul 9, 2024
c46ee37
update genutil upgrade slashing
sin3A Jul 9, 2024
b96c053
update params
sin3A Jul 9, 2024
a6290b9
add proto script
sin3A Jul 9, 2024
21c712d
Merge branch 'sv/module-independent' of https://github.com/bianjieai/…
sin3A Jul 15, 2024
c9745cb
update simapp
sin3A Jul 15, 2024
5c05cef
update identity node params upgrade
sin3A Jul 15, 2024
96110b2
update genutil slashing
sin3A Jul 15, 2024
4441ad5
Merge branch 'master' into sv/module-independent
sin3A Jul 16, 2024
ae5f4e4
update upgrade
sin3A Jul 16, 2024
e786a36
clear expired codes
sin3A Jul 16, 2024
936a181
clear expired codes
sin3A Jul 16, 2024
cd8c733
clear codes、update injected
sin3A Jul 16, 2024
100f16a
Merge branch 'sv/module-independent' of https://github.com/bianjieai/…
sin3A Jul 16, 2024
bfc468a
fix HomePath
sin3A Jul 16, 2024
eceb239
update upgrade api
sin3A Jul 16, 2024
9ffd22d
update upgrade test
sin3A Jul 16, 2024
57da399
update genutils
sin3A Jul 22, 2024
08d88a4
update node modules
sin3A Jul 22, 2024
0cfdc43
update slashing node
sin3A Jul 23, 2024
5ee596c
update slashing API
sin3A Jul 23, 2024
5882101
add file update slashing module.proto
sin3A Jul 23, 2024
0822c26
update
sin3A Jul 23, 2024
0aaf460
update
sin3A Jul 24, 2024
cc544d3
update
sin3A Jul 24, 2024
f4802d3
update node module
sin3A Jul 24, 2024
23073a8
update
sin3A Jul 24, 2024
6672f90
update
sin3A Jul 24, 2024
13ed118
update params
sin3A Jul 24, 2024
411c44c
update node
sin3A Jul 24, 2024
9674aa5
update params
sin3A Jul 24, 2024
a42b13b
update upgrade
sin3A Jul 25, 2024
8a6a833
update upgrade init_genesis
sin3A Jul 25, 2024
2fe96dc
refactor code
dreamer-zq Jul 25, 2024
3774a91
fix node_test
sin3A Jul 29, 2024
39af267
fix the issue of not being able to obtain parameters
sin3A Aug 2, 2024
e1cc878
add slashing ConsensusVersion&Migration
sin3A Aug 14, 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
150 changes: 150 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
run:
tests: true
timeout: 15m
allow-parallel-runners: true
build-tags:
- e2e
- ledger
- test_ledger_mock


linters:
disable-all: true
enable:
- dogsled
- errcheck
- errorlint
- exportloopref
- gci
- goconst
- gocritic
- gofumpt
- gosec
- gosimple
- govet
- ineffassign
- misspell
- nakedret
- nolintlint
- revive
- staticcheck
- stylecheck
- thelper
- typecheck
- unconvert
- unused

issues:
exclude-dirs:
- testutil/testdata
exclude-files:
- server/grpc/gogoreflection/fix_registration.go
- "fix_registration.go"
- ".*\\.pb\\.go$"
- ".*\\.pb\\.gw\\.go$"
- ".*\\.pulsar\\.go$"
exclude-rules:
- text: "Use of weak random number generator"
linters:
- gosec
- text: "ST1003:"
linters:
- stylecheck
# FIXME: Disabled until golangci-lint updates stylecheck with this fix:
# https://github.com/dominikh/go-tools/issues/389
- text: "ST1016:"
linters:
- stylecheck
- path: "migrations"
text: "SA1019:"
linters:
- staticcheck
- text: "SA1019: codec.NewAminoCodec is deprecated" # TODO remove once migration path is set out
linters:
- staticcheck
- text: "SA1019: legacybech32.MustMarshalPubKey" # TODO remove once ready to remove from the sdk
linters:
- staticcheck
- text: "SA1019: legacybech32.MarshalPubKey" # TODO remove once ready to remove from the sdk
linters:
- staticcheck
- text: "SA1019: legacybech32.UnmarshalPubKey" # TODO remove once ready to remove from the sdk
linters:
- staticcheck
- text: "SA1019: params.SendEnabled is deprecated" # TODO remove once ready to remove from the sdk
linters:
- staticcheck
- text: "leading space"
linters:
- nolintlint
max-issues-per-linter: 10000
max-same-issues: 10000

linters-settings:
gci:
custom-order: true
sections:
- standard # Standard section: captures all standard packages.
- default # Default section: contains all imports that could not be matched to another section type.
- prefix(iritamod.bianjie.ai)
revive:
rules:
- name: redefines-builtin-id
disabled: true

gosec:
# To select a subset of rules to run.
# Available rules: https://github.com/securego/gosec#available-rules
# Default: [] - means include all rules
includes:
# - G101 # Look for hard coded credentials
- G102 # Bind to all interfaces
- G103 # Audit the use of unsafe block
- G104 # Audit errors not checked
- G106 # Audit the use of ssh.InsecureIgnoreHostKey
- G107 # Url provided to HTTP request as taint input
- G108 # Profiling endpoint automatically exposed on /debug/pprof
- G109 # Potential Integer overflow made by strconv.Atoi result conversion to int16/32
- G110 # Potential DoS vulnerability via decompression bomb
- G111 # Potential directory traversal
- G112 # Potential slowloris attack
- G113 # Usage of Rat.SetString in math/big with an overflow (CVE-2022-23772)
- G114 # Use of net/http serve function that has no support for setting timeouts
- G201 # SQL query construction using format string
- G202 # SQL query construction using string concatenation
- G203 # Use of unescaped data in HTML templates
- G204 # Audit use of command execution
- G301 # Poor file permissions used when creating a directory
- G302 # Poor file permissions used with chmod
- G303 # Creating tempfile using a predictable path
- G304 # File path provided as taint input
- G305 # File traversal when extracting zip/tar archive
- G306 # Poor file permissions used when writing to a new file
- G307 # Deferring a method which returns an error
- G401 # Detect the usage of DES, RC4, MD5 or SHA1
- G402 # Look for bad TLS connection settings
- G403 # Ensure minimum RSA key length of 2048 bits
- G404 # Insecure random number source (rand)
- G501 # Import blocklist: crypto/md5
- G502 # Import blocklist: crypto/des
- G503 # Import blocklist: crypto/rc4
- G504 # Import blocklist: net/http/cgi
- G505 # Import blocklist: crypto/sha1
- G601 # Implicit memory aliasing of items from a range statement
misspell:
locale: US
gofumpt:
extra-rules: true
dogsled:
max-blank-identifiers: 6
nolintlint:
allow-unused: false
require-explanation: true
require-specific: false
gosimple:
checks: ["all"]
gocritic:
disabled-checks:
- regexpMust
- appendAssign
- ifElseChain
61 changes: 6 additions & 55 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,57 +1,8 @@
#!/usr/bin/make -f

PACKAGES_SIMTEST=$(shell go list ./... | grep '/simulation')
PACKAGES_UNITTEST=$(shell go list ./... | grep -v '/simulation' | grep -v '/cli_test')

all: tools lint

# The below include contains the tools.
include contrib/devtools/Makefile

########################################
### Tools & dependencies

go-mod-cache: go.sum
@echo "--> Download go modules to local cache"
@go mod download

go.sum: go.mod
@echo "--> Ensure dependencies have not been modified"
@go mod verify

draw-deps:
@# requires brew install graphviz or apt-get install graphviz
go get github.com/RobotsAndPencils/goviz
@goviz -i ./cmd/iris -d 2 | dot -Tpng -o dependency-graph.png

clean:
rm -rf snapcraft-local.yaml build/

distclean: clean
rm -rf vendor/

proto-all: proto-tools proto-gen

proto-gen:
@./scripts/protocgen.sh

########################################
### Testing

test: test-unit

test-unit:
@VERSION=$(VERSION) go test -mod=readonly -tags='ledger test_ledger_mock' ${PACKAGES_UNITTEST}

lint: golangci-lint
golangci-lint run
find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./lite/*/statik.go" -not -path "*.pb.go" | xargs gofmt -d -s
go mod verify

format:
find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./lite/*/statik.go" -not -path "*.pb.go" | xargs gofmt -w -s
find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./lite/*/statik.go" -not -path "*.pb.go" | xargs misspell -w
find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./lite/*/statik.go" -not -path "*.pb.go" | xargs goimports -w -local github.com/bianjieai/iritamod

benchmark:
@go test -mod=readonly -bench=. ./...
include scripts/build/build.mk
include scripts/build/godoc.mk
#include scripts/build/contract.mk
include scripts/build/protobuf.mk
#include scripts/build/testing.mk
include scripts/build/linting.mk
23 changes: 23 additions & 0 deletions api/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
module iritamod.bianjie.ai/api

go 1.19

require (
cosmossdk.io/api v0.3.1
github.com/cosmos/cosmos-proto v1.0.0-beta.4
github.com/cosmos/gogoproto v1.4.10
google.golang.org/genproto/googleapis/api v0.0.0-20231212172506-995d672761c0
google.golang.org/grpc v1.60.1
google.golang.org/protobuf v1.32.0
)

require (
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/go-cmp v0.6.0 // indirect
golang.org/x/exp v0.0.0-20230711153332-06a737ee72cb // indirect
golang.org/x/net v0.19.0 // indirect
golang.org/x/sys v0.16.0 // indirect
golang.org/x/text v0.14.0 // indirect
google.golang.org/genproto v0.0.0-20240102182953-50ed04b92917 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240108191215-35c7eff3a6b1 // indirect
)
33 changes: 33 additions & 0 deletions api/go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
cosmossdk.io/api v0.3.1 h1:NNiOclKRR0AOlO4KIqeaG6PS6kswOMhHD0ir0SscNXE=
cosmossdk.io/api v0.3.1/go.mod h1:DfHfMkiNA2Uhy8fj0JJlOCYOBp4eWUUJ1te5zBGNyIw=
github.com/cosmos/cosmos-proto v1.0.0-beta.4 h1:aEL7tU/rLOmxZQ9z4i7mzxcLbSCY48OdY7lIWTLG7oU=
github.com/cosmos/cosmos-proto v1.0.0-beta.4/go.mod h1:oeB+FyVzG3XrQJbJng0EnV8Vljfk9XvTIpGILNU/9Co=
github.com/cosmos/gogoproto v1.4.10 h1:QH/yT8X+c0F4ZDacDv3z+xE3WU1P1Z3wQoLMBRJoKuI=
github.com/cosmos/gogoproto v1.4.10/go.mod h1:3aAZzeRWpAwr+SS/LLkICX2/kDFyaYVzckBDzygIxek=
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg=
github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
golang.org/x/exp v0.0.0-20230711153332-06a737ee72cb h1:xIApU0ow1zwMa2uL1VDNeQlNVFTWMQxZUZCMDy0Q4Us=
golang.org/x/exp v0.0.0-20230711153332-06a737ee72cb/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc=
golang.org/x/net v0.19.0 h1:zTwKpTd2XuCqf8huc7Fo2iSy+4RHPd10s4KzeTnVr1c=
golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U=
golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU=
golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/genproto v0.0.0-20240102182953-50ed04b92917 h1:nz5NESFLZbJGPFxDT/HCn+V1mZ8JGNoY4nUpmW/Y2eg=
google.golang.org/genproto v0.0.0-20240102182953-50ed04b92917/go.mod h1:pZqR+glSb11aJ+JQcczCvgf47+duRuzNSKqE8YAQnV0=
google.golang.org/genproto/googleapis/api v0.0.0-20231212172506-995d672761c0 h1:s1w3X6gQxwrLEpxnLd/qXTVLgQE2yXwaOaoa6IlY/+o=
google.golang.org/genproto/googleapis/api v0.0.0-20231212172506-995d672761c0/go.mod h1:CAny0tYF+0/9rmDB9fahA9YLzX3+AEVl1qXbv5hhj6c=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240108191215-35c7eff3a6b1 h1:gphdwh0npgs8elJ4T6J+DQJHPVF7RsuJHCfwztUb4J4=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240108191215-35c7eff3a6b1/go.mod h1:daQN87bsDqDoe316QbbvX60nMoJQa4r6Ds0ZuoAe5yA=
google.golang.org/grpc v1.60.1 h1:26+wFr+cNqSGFcOXcabYC0lUVJVRa2Sb2ortSK7VrEU=
google.golang.org/grpc v1.60.1/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I=
google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
Loading
Loading