diff --git a/application.yaml b/application.yaml index aacbd41..c484c69 100644 --- a/application.yaml +++ b/application.yaml @@ -72,6 +72,7 @@ mining-boost: &mining-boost - https://bsc-dataseed1.binance.org/ paymentAddress: "0x0000000000000000000000000000000000000000" tokenomics: &tokenomics + welcomeBonusV2Amount: 500 defaultReferralName: bogus slashingFloor: 5 adoption: @@ -248,6 +249,7 @@ miner: slashingStartInterval: 1m slashingDaysCount: 10 t1LimitCount: 2 + welcomeBonusV2Amount: 500 kyc/quiz: maxResetCount: 0 maxAttemptsAllowed: 3 diff --git a/go.mod b/go.mod index f860765..cf46959 100644 --- a/go.mod +++ b/go.mod @@ -7,10 +7,10 @@ require ( github.com/alitto/pond v1.9.1 github.com/bsm/redislock v0.9.4 github.com/cenkalti/backoff/v4 v4.3.0 - github.com/ethereum/go-ethereum v1.14.7 + github.com/ethereum/go-ethereum v1.14.8 github.com/goccy/go-json v0.10.3 github.com/hashicorp/go-multierror v1.1.1 - github.com/ice-blockchain/eskimo v1.388.0 + github.com/ice-blockchain/eskimo v1.394.0 github.com/ice-blockchain/go-tarantool-client v0.0.0-20230327200757-4fc71fa3f7bb github.com/ice-blockchain/wintr v1.150.0 github.com/imroc/req/v3 v3.43.7 @@ -22,17 +22,17 @@ require ( github.com/swaggo/swag v1.16.3 github.com/testcontainers/testcontainers-go v0.32.0 go.uber.org/zap v1.27.0 - golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 + golang.org/x/exp v0.0.0-20240808152545-0cdaa3abc0fa ) require ( cloud.google.com/go v0.115.0 // indirect - cloud.google.com/go/auth v0.7.3 // indirect - cloud.google.com/go/auth/oauth2adapt v0.2.3 // indirect + cloud.google.com/go/auth v0.8.0 // indirect + cloud.google.com/go/auth/oauth2adapt v0.2.4 // indirect cloud.google.com/go/compute/metadata v0.5.0 // indirect cloud.google.com/go/firestore v1.16.0 // indirect - cloud.google.com/go/iam v1.1.12 // indirect - cloud.google.com/go/longrunning v0.5.11 // indirect + cloud.google.com/go/iam v1.1.13 // indirect + cloud.google.com/go/longrunning v0.5.12 // indirect cloud.google.com/go/storage v1.43.0 // indirect cosmossdk.io/math v1.3.0 // indirect dario.cat/mergo v1.0.0 // indirect @@ -48,7 +48,7 @@ require ( github.com/beorn7/perks v1.0.1 // indirect github.com/bits-and-blooms/bitset v1.13.0 // indirect github.com/btcsuite/btcd/btcec/v2 v2.3.4 // indirect - github.com/bytedance/sonic v1.12.0 // indirect + github.com/bytedance/sonic v1.12.1 // indirect github.com/bytedance/sonic/loader v0.2.0 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/cloudflare/circl v1.3.9 // indirect @@ -75,7 +75,7 @@ require ( github.com/distribution/reference v0.6.0 // indirect github.com/dmarkham/enumer v1.5.10 // indirect github.com/docker/distribution v2.8.3+incompatible // indirect - github.com/docker/docker v27.1.1+incompatible // indirect + github.com/docker/docker v27.1.2+incompatible // indirect github.com/docker/go-connections v0.5.0 // indirect github.com/docker/go-units v0.5.0 // indirect github.com/ethereum/c-kzg-4844 v1.0.3 // indirect @@ -148,7 +148,7 @@ require ( github.com/morikuni/aec v1.0.0 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/olekukonko/tablewriter v0.0.5 // indirect - github.com/onsi/ginkgo/v2 v2.19.1 // indirect + github.com/onsi/ginkgo/v2 v2.20.0 // indirect github.com/opencontainers/go-digest v1.0.0 // indirect github.com/opencontainers/image-spec v1.1.0 // indirect github.com/opencontainers/runc v1.1.13 // indirect @@ -161,7 +161,7 @@ require ( github.com/prometheus/common v0.55.0 // indirect github.com/prometheus/procfs v0.15.1 // indirect github.com/quic-go/qpack v0.4.0 // indirect - github.com/quic-go/quic-go v0.45.2 // indirect + github.com/quic-go/quic-go v0.46.0 // indirect github.com/refraction-networking/utls v1.6.7 // indirect github.com/rivo/uniseg v0.4.7 // indirect github.com/rogpeppe/go-internal v1.12.0 // indirect @@ -173,7 +173,7 @@ require ( github.com/sirupsen/logrus v1.9.3 // indirect github.com/sourcegraph/conc v0.3.0 // indirect github.com/spf13/afero v1.11.0 // indirect - github.com/spf13/cast v1.6.0 // indirect + github.com/spf13/cast v1.7.0 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/spf13/viper v1.19.0 // indirect github.com/subosito/gotenv v1.6.0 // indirect @@ -201,21 +201,21 @@ require ( go.uber.org/atomic v1.11.0 // indirect go.uber.org/mock v0.4.0 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/arch v0.8.0 // indirect - golang.org/x/crypto v0.25.0 // indirect - golang.org/x/mod v0.19.0 // indirect - golang.org/x/net v0.27.0 // indirect - golang.org/x/oauth2 v0.21.0 // indirect - golang.org/x/sync v0.7.0 // indirect - golang.org/x/sys v0.22.0 // indirect - golang.org/x/text v0.16.0 // indirect - golang.org/x/time v0.5.0 // indirect - golang.org/x/tools v0.23.0 // indirect - google.golang.org/api v0.190.0 // indirect + golang.org/x/arch v0.9.0 // indirect + golang.org/x/crypto v0.26.0 // indirect + golang.org/x/mod v0.20.0 // indirect + golang.org/x/net v0.28.0 // indirect + golang.org/x/oauth2 v0.22.0 // indirect + golang.org/x/sync v0.8.0 // indirect + golang.org/x/sys v0.24.0 // indirect + golang.org/x/text v0.17.0 // indirect + golang.org/x/time v0.6.0 // indirect + golang.org/x/tools v0.24.0 // indirect + google.golang.org/api v0.191.0 // indirect google.golang.org/appengine/v2 v2.0.6 // indirect - google.golang.org/genproto v0.0.0-20240730163845-b1a4ccb954bf // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20240730163845-b1a4ccb954bf // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240730163845-b1a4ccb954bf // indirect + google.golang.org/genproto v0.0.0-20240812133136-8ffd90a71988 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20240812133136-8ffd90a71988 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240812133136-8ffd90a71988 // indirect google.golang.org/grpc v1.65.0 // indirect google.golang.org/protobuf v1.34.2 // indirect gopkg.in/ini.v1 v1.67.0 // indirect @@ -225,7 +225,6 @@ require ( ) replace ( - github.com/btcsuite/btcd/btcec/v2 => github.com/btcsuite/btcd/btcec/v2 v2.3.4-0.20240701131322-c9fae1ac7cca github.com/consensys/gnark-crypto => github.com/consensys/gnark-crypto v0.12.1 github.com/containerd/containerd => github.com/containerd/containerd v1.6.19 github.com/distribution/reference => github.com/distribution/reference v0.5.0 diff --git a/go.sum b/go.sum index 7b61b0a..faa6cc8 100644 --- a/go.sum +++ b/go.sum @@ -1,18 +1,18 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.115.0 h1:CnFSK6Xo3lDYRoBKEcAtia6VSC837/ZkJuRduSFnr14= cloud.google.com/go v0.115.0/go.mod h1:8jIM5vVgoAEoiVxQ/O4BFTfHqulPZgs/ufEzMcFMdWU= -cloud.google.com/go/auth v0.7.3 h1:98Vr+5jMaCZ5NZk6e/uBgf60phTk/XN84r8QEWB9yjY= -cloud.google.com/go/auth v0.7.3/go.mod h1:HJtWUx1P5eqjy/f6Iq5KeytNpbAcGolPhOgyop2LlzA= -cloud.google.com/go/auth/oauth2adapt v0.2.3 h1:MlxF+Pd3OmSudg/b1yZ5lJwoXCEaeedAguodky1PcKI= -cloud.google.com/go/auth/oauth2adapt v0.2.3/go.mod h1:tMQXOfZzFuNuUxOypHlQEXgdfX5cuhwU+ffUuXRJE8I= +cloud.google.com/go/auth v0.8.0 h1:y8jUJLl/Fg+qNBWxP/Hox2ezJvjkrPb952PC1p0G6A4= +cloud.google.com/go/auth v0.8.0/go.mod h1:qGVp/Y3kDRSDZ5gFD/XPUfYQ9xW1iI7q8RIRoCyBbJc= +cloud.google.com/go/auth/oauth2adapt v0.2.4 h1:0GWE/FUsXhf6C+jAkWgYm7X9tK8cuEIfy19DBn6B6bY= +cloud.google.com/go/auth/oauth2adapt v0.2.4/go.mod h1:jC/jOpwFP6JBxhB3P5Rr0a9HLMC/Pe3eaL4NmdvqPtc= cloud.google.com/go/compute/metadata v0.5.0 h1:Zr0eK8JbFv6+Wi4ilXAR8FJ3wyNdpxHKJNPos6LTZOY= cloud.google.com/go/compute/metadata v0.5.0/go.mod h1:aHnloV2TPI38yx4s9+wAZhHykWvVCfu7hQbF+9CWoiY= cloud.google.com/go/firestore v1.16.0 h1:YwmDHcyrxVRErWcgxunzEaZxtNbc8QoFYA/JOEwDPgc= cloud.google.com/go/firestore v1.16.0/go.mod h1:+22v/7p+WNBSQwdSwP57vz47aZiY+HrDkrOsJNhk7rg= -cloud.google.com/go/iam v1.1.12 h1:JixGLimRrNGcxvJEQ8+clfLxPlbeZA6MuRJ+qJNQ5Xw= -cloud.google.com/go/iam v1.1.12/go.mod h1:9LDX8J7dN5YRyzVHxwQzrQs9opFFqn0Mxs9nAeB+Hhg= -cloud.google.com/go/longrunning v0.5.11 h1:Havn1kGjz3whCfoD8dxMLP73Ph5w+ODyZB9RUsDxtGk= -cloud.google.com/go/longrunning v0.5.11/go.mod h1:rDn7//lmlfWV1Dx6IB4RatCPenTwwmqXuiP0/RgoEO4= +cloud.google.com/go/iam v1.1.13 h1:7zWBXG9ERbMLrzQBRhFliAV+kjcRToDTgQT3CTwYyv4= +cloud.google.com/go/iam v1.1.13/go.mod h1:K8mY0uSXwEXS30KrnVb+j54LB/ntfZu1dr+4zFMNbus= +cloud.google.com/go/longrunning v0.5.12 h1:5LqSIdERr71CqfUsFlJdBpOkBH8FBCFD7P1nTWy3TYE= +cloud.google.com/go/longrunning v0.5.12/go.mod h1:S5hMV8CDJ6r50t2ubVJSKQVv5u0rmik5//KgLO3k4lU= cloud.google.com/go/storage v1.43.0 h1:CcxnSohZwizt4LCzQHWvBf1/kvtHUn7gk9QERXPyXFs= cloud.google.com/go/storage v1.43.0/go.mod h1:ajvxEa7WmZS1PxvKRq4bq0tFT3vMd502JwstCcYv0Q0= cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= @@ -54,12 +54,12 @@ github.com/bsm/gomega v1.27.10 h1:yeMWxP2pV2fG3FgAODIY8EiRE3dy0aeFYt4l7wh6yKA= github.com/bsm/gomega v1.27.10/go.mod h1:JyEr/xRbxbtgWNi8tIEVPUYZ5Dzef52k01W3YH0H+O0= github.com/bsm/redislock v0.9.4 h1:X/Wse1DPpiQgHbVYRE9zv6m070UcKoOGekgvpNhiSvw= github.com/bsm/redislock v0.9.4/go.mod h1:Epf7AJLiSFwLCiZcfi6pWFO/8eAYrYpQXFxEDPoDeAk= -github.com/btcsuite/btcd/btcec/v2 v2.3.4-0.20240701131322-c9fae1ac7cca h1:bGLSi3CTLh3pe8BbfWigyirKjGvynPa6BCDjvyx5VZI= -github.com/btcsuite/btcd/btcec/v2 v2.3.4-0.20240701131322-c9fae1ac7cca/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04= +github.com/btcsuite/btcd/btcec/v2 v2.3.4 h1:3EJjcN70HCu/mwqlUsGK8GcNVyLVxFDlWurTXGPFfiQ= +github.com/btcsuite/btcd/btcec/v2 v2.3.4/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04= github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 h1:q0rUy8C/TYNBQS1+CGKw68tLOFYSNEs0TFnxxnS9+4U= github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc= -github.com/bytedance/sonic v1.12.0 h1:YGPgxF9xzaCNvd/ZKdQ28yRovhfMFZQjuk6fKBzZ3ls= -github.com/bytedance/sonic v1.12.0/go.mod h1:B8Gt/XvtZ3Fqj+iSKMypzymZxw/FVwgIGKzMzT9r/rk= +github.com/bytedance/sonic v1.12.1 h1:jWl5Qz1fy7X1ioY74WqO0KjAMtAGQs4sYnjiEBiyX24= +github.com/bytedance/sonic v1.12.1/go.mod h1:B8Gt/XvtZ3Fqj+iSKMypzymZxw/FVwgIGKzMzT9r/rk= github.com/bytedance/sonic/loader v0.1.1/go.mod h1:ncP89zfokxS5LZrJxl5z0UJcsk4M4yY2JpfqGeCtNLU= github.com/bytedance/sonic/loader v0.2.0 h1:zNprn+lsIP06C/IqCHs3gPQIvnvpKbbxyXQP1iU4kWM= github.com/bytedance/sonic/loader v0.2.0/go.mod h1:ncP89zfokxS5LZrJxl5z0UJcsk4M4yY2JpfqGeCtNLU= @@ -150,14 +150,12 @@ github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1m github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/ethereum/c-kzg-4844 v1.0.2 h1:8tV84BCEiPeOkiVgW9mpYBeBUir2bkCNVqxPwwVeO+s= github.com/ethereum/c-kzg-4844 v1.0.2/go.mod h1:VewdlzQmpT5QSrVhbBuGoCdFJkpaJlO1aQputP83wc0= -github.com/ethereum/go-ethereum v1.14.7 h1:EHpv3dE8evQmpVEQ/Ne2ahB06n2mQptdwqaMNhAT29g= -github.com/ethereum/go-ethereum v1.14.7/go.mod h1:Mq0biU2jbdmKSZoqOj29017ygFrMnB5/Rifwp980W4o= +github.com/ethereum/go-ethereum v1.14.8 h1:NgOWvXS+lauK+zFukEvi85UmmsS/OkV0N23UZ1VTIig= +github.com/ethereum/go-ethereum v1.14.8/go.mod h1:TJhyuDq0JDppAkFXgqjwpdlQApywnu/m10kFPxh8vvs= github.com/ethereum/go-verkle v0.1.1-0.20240306133620-7d920df305f0 h1:KrE8I4reeVvf7C1tm8elRjj4BdscTYzz/WAbYyf/JI4= github.com/ethereum/go-verkle v0.1.1-0.20240306133620-7d920df305f0/go.mod h1:D9AJLVXSyZQXJQVk8oh1EwjISE+sJTn2duYIZC0dy3w= github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= -github.com/fjl/memsize v0.0.2 h1:27txuSD9or+NZlnOWdKUxeBzTAUkWCVh+4Gf2dWFOzA= -github.com/fjl/memsize v0.0.2/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0= github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= @@ -304,8 +302,8 @@ github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpO github.com/huin/goupnp v1.3.0 h1:UvLUlWDNpoUdYzb2TCn+MuTWtcjXKSza2n6CBdQ0xXc= github.com/huin/goupnp v1.3.0/go.mod h1:gnGPsThkYa7bFi/KWmEysQRf48l2dvR5bxr2OFckNX8= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/ice-blockchain/eskimo v1.388.0 h1:ao0agIR9TO+jtNvkufx55CDfivlEnoHBdtaKG75n96c= -github.com/ice-blockchain/eskimo v1.388.0/go.mod h1:xkpZN+kXoksxhLGhrkPwkWOROXj9qLKV/E0nLmBeQvI= +github.com/ice-blockchain/eskimo v1.394.0 h1:R/gwgigfmffML+3DCYwtY7eorCmC15SlOSbhV4RZ4sU= +github.com/ice-blockchain/eskimo v1.394.0/go.mod h1:VQKzz0NU3L+LwWENvRHk2XcEVmURVZ87v+luaiFCxlE= github.com/ice-blockchain/go-tarantool-client v0.0.0-20230327200757-4fc71fa3f7bb h1:8TnFP3mc7O+tc44kv2e0/TpZKnEVUaKH+UstwfBwRkk= github.com/ice-blockchain/go-tarantool-client v0.0.0-20230327200757-4fc71fa3f7bb/go.mod h1:ZsQU7i3mxhgBBu43Oev7WPFbIjP4TniN/b1UPNGbrq8= github.com/ice-blockchain/wintr v1.150.0 h1:ZzQrPKPVFYRpD3xgQ7/Cmrjz8eeu6UMQ9TvE+brVK0U= @@ -399,14 +397,14 @@ github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vv github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= github.com/onsi/ginkgo/v2 v2.1.3/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= -github.com/onsi/ginkgo/v2 v2.19.1 h1:QXgq3Z8Crl5EL1WBAC98A5sEBHARrAJNzAmMxzLcRF0= -github.com/onsi/ginkgo/v2 v2.19.1/go.mod h1:O3DtEWQkPa/F7fBMgmZQKKsluAy8pd3rEQdrjkPb9zA= +github.com/onsi/ginkgo/v2 v2.20.0 h1:PE84V2mHqoT1sglvHc8ZdQtPcwmvvt29WLEEO3xmdZw= +github.com/onsi/ginkgo/v2 v2.20.0/go.mod h1:lG9ey2Z29hR41WMVthyJBGUBcBhGOtoPF2VFMvBXFCI= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro= -github.com/onsi/gomega v1.34.0 h1:eSSPsPNp6ZpsG8X1OVmOTxig+CblTc4AxpPBykhe2Os= -github.com/onsi/gomega v1.34.0/go.mod h1:MIKI8c+f+QLWk+hxbePD4i0LMJSExPaZOVfkoex4cAo= +github.com/onsi/gomega v1.34.1 h1:EUMJIKUjM8sKjYbtxQI9A4z2o+rruxnzNvpknOXie6k= +github.com/onsi/gomega v1.34.1/go.mod h1:kU1QgUvBDLXBJq618Xvm2LUX6rSAfRaFRTcdOeDLwwY= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= github.com/opencontainers/image-spec v1.1.0 h1:8SG7/vwALn54lVB/0yZ/MMwhFrPYtpEHQb2IpWsCzug= @@ -439,8 +437,8 @@ github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0leargg github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= github.com/quic-go/qpack v0.4.0 h1:Cr9BXA1sQS2SmDUWjSofMPNKmvF6IiIfDRmgU0w1ZCo= github.com/quic-go/qpack v0.4.0/go.mod h1:UZVnYIfi5GRk+zI9UMaCPsmZ2xKJP7XBUvVyT1Knj9A= -github.com/quic-go/quic-go v0.45.2 h1:DfqBmqjb4ExSdxRIb/+qXhPC+7k6+DUNZha4oeiC9fY= -github.com/quic-go/quic-go v0.45.2/go.mod h1:1dLehS7TIR64+vxGR70GDcatWTOtMX2PUtnKsjbTurI= +github.com/quic-go/quic-go v0.46.0 h1:uuwLClEEyk1DNvchH8uCByQVjo3yKL9opKulExNDs7Y= +github.com/quic-go/quic-go v0.46.0/go.mod h1:1dLehS7TIR64+vxGR70GDcatWTOtMX2PUtnKsjbTurI= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/redis/go-redis/v9 v9.6.1 h1:HHDteefn6ZkTtY5fGUE8tj8uy85AHk6zP7CpzIAM0y4= @@ -475,8 +473,8 @@ github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9yS github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIKqDmF7Mt0= github.com/spf13/afero v1.11.0 h1:WJQKhtpdm3v2IzqG8VMqrr6Rf3UYpEF239Jy9wNepM8= github.com/spf13/afero v1.11.0/go.mod h1:GH9Y3pIexgf1MTIWtNGyogA5MwRIDXGUr+hbWNoBjkY= -github.com/spf13/cast v1.6.0 h1:GEiTHELF+vaR5dhz3VqZfFSzZjYbgeKDpBxQVS4GYJ0= -github.com/spf13/cast v1.6.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= +github.com/spf13/cast v1.7.0 h1:ntdiHjuueXFgm5nzDRdOS4yfT43P5Fnud6DH50rz/7w= +github.com/spf13/cast v1.7.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v1.19.0 h1:RWq5SEjt8o25SROyN3z2OrDB9l7RPd3lwTWU8EcEdcI= @@ -570,25 +568,25 @@ go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8= go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= -golang.org/x/arch v0.8.0 h1:3wRIsP3pM4yUptoR96otTUOXI367OS0+c9eeRi9doIc= -golang.org/x/arch v0.8.0/go.mod h1:FEVrYAQjsQXMVJ1nsMoVVXPZg6p2JE2mx8psSWTDQys= +golang.org/x/arch v0.9.0 h1:ub9TgUInamJ8mrZIGlBG6/4TqWeMszd4N8lNorbrr6k= +golang.org/x/arch v0.9.0/go.mod h1:FEVrYAQjsQXMVJ1nsMoVVXPZg6p2JE2mx8psSWTDQys= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.25.0 h1:ypSNr+bnYL2YhwoMt2zPxHFmbAN1KZs/njMG3hxUp30= -golang.org/x/crypto v0.25.0/go.mod h1:T+wALwcMOSE0kXgUAnPAHqTLW+XHgcELELW8VaDgm/M= +golang.org/x/crypto v0.26.0 h1:RrRspgV4mU+YwB4FYnuBoKsUapNIL5cohGAmSH3azsw= +golang.org/x/crypto v0.26.0/go.mod h1:GY7jblb9wI+FOo5y8/S2oY4zWP07AkOJ4+jxCqdqn54= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 h1:2dVuKD2vS7b0QIHQbpyTISPd0LeHDbnYEryqj5Q1ug8= -golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56/go.mod h1:M4RDyNAINzryxdtnbRXRL/OHtkFuWGRjvuhBJpk2IlY= +golang.org/x/exp v0.0.0-20240808152545-0cdaa3abc0fa h1:ELnwvuAXPNtPk1TJRuGkI9fDTwym6AYBu0qzT8AcHdI= +golang.org/x/exp v0.0.0-20240808152545-0cdaa3abc0fa/go.mod h1:akd2r19cwCdwSwWeIdzYQGa/EZZyqcOdwWiwj5L5eKQ= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.19.0 h1:fEdghXQSo20giMthA7cd28ZC+jts4amQ3YMXiP5oMQ8= -golang.org/x/mod v0.19.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.20.0 h1:utOm6MM3R3dnawAiJgn0y+xvuYRsm1RKM/4giyfDgV0= +golang.org/x/mod v0.20.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -606,19 +604,19 @@ golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys= -golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE= +golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE= +golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.21.0 h1:tsimM75w1tF/uws5rbeHzIWxEqElMehnc+iW793zsZs= -golang.org/x/oauth2 v0.21.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= +golang.org/x/oauth2 v0.22.0 h1:BzDx2FehcG7jJwgWLELCdmLuxk2i+x9UDpSiss2u0ZA= +golang.org/x/oauth2 v0.22.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= -golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= +golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -646,8 +644,8 @@ golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI= -golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= +golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= @@ -657,10 +655,10 @@ golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= -golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= -golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= -golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= +golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc= +golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= +golang.org/x/time v0.6.0 h1:eTDhh4ZXt5Qf0augr54TN6suAUudPcawVZeIAPU7D4U= +golang.org/x/time v0.6.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= @@ -671,15 +669,15 @@ golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roY golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.23.0 h1:SGsXPZ+2l4JsgaCKkx+FQ9YZ5XEtA1GZYuoDjenLjvg= -golang.org/x/tools v0.23.0/go.mod h1:pnu6ufv6vQkll6szChhK3C3L/ruaIv5eBeztNG8wtsI= +golang.org/x/tools v0.24.0 h1:J1shsA93PJUEVaUSaay7UXAyE8aimq3GW0pjlolpa24= +golang.org/x/tools v0.24.0/go.mod h1:YhNqVBIfWHdzvTLs0d8LCuMhkKUgSUKldakyV7W/WDQ= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= -google.golang.org/api v0.190.0 h1:ASM+IhLY1zljNdLu19W1jTmU6A+gMk6M46Wlur61s+Q= -google.golang.org/api v0.190.0/go.mod h1:QIr6I9iedBLnfqoD6L6Vze1UvS5Hzj5r2aUBOaZnLHo= +google.golang.org/api v0.191.0 h1:cJcF09Z+4HAB2t5qTQM1ZtfL/PemsLFkcFG67qq2afk= +google.golang.org/api v0.191.0/go.mod h1:tD5dsFGxFza0hnQveGfVk9QQYKcfp+VzgRqyXFxE0+E= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine/v2 v2.0.6 h1:LvPZLGuchSBslPBp+LAhihBeGSiRh1myRoYK4NtuBIw= @@ -687,12 +685,12 @@ google.golang.org/appengine/v2 v2.0.6/go.mod h1:WoEXGoXNfa0mLvaH5sV3ZSGXwVmy8yf7 google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto v0.0.0-20240730163845-b1a4ccb954bf h1:OqdXDEakZCVtDiZTjcxfwbHPCT11ycCEsTKesBVKvyY= -google.golang.org/genproto v0.0.0-20240730163845-b1a4ccb954bf/go.mod h1:mCr1K1c8kX+1iSBREvU3Juo11CB+QOEWxbRS01wWl5M= -google.golang.org/genproto/googleapis/api v0.0.0-20240730163845-b1a4ccb954bf h1:GillM0Ef0pkZPIB+5iO6SDK+4T9pf6TpaYR6ICD5rVE= -google.golang.org/genproto/googleapis/api v0.0.0-20240730163845-b1a4ccb954bf/go.mod h1:OFMYQFHJ4TM3JRlWDZhJbZfra2uqc3WLBZiaaqP4DtU= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240730163845-b1a4ccb954bf h1:liao9UHurZLtiEwBgT9LMOnKYsHze6eA6w1KQCMVN2Q= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240730163845-b1a4ccb954bf/go.mod h1:Ue6ibwXGpU+dqIcODieyLOcgj7z8+IcskoNIgZxtrFY= +google.golang.org/genproto v0.0.0-20240812133136-8ffd90a71988 h1:CT2Thj5AuPV9phrYMtzX11k+XkzMGfRAet42PmoTATM= +google.golang.org/genproto v0.0.0-20240812133136-8ffd90a71988/go.mod h1:7uvplUBj4RjHAxIZ//98LzOvrQ04JBkaixRmCMI29hc= +google.golang.org/genproto/googleapis/api v0.0.0-20240812133136-8ffd90a71988 h1:+/tmTy5zAieooKIXfzDm9KiA3Bv6JBwriRN9LY+yayk= +google.golang.org/genproto/googleapis/api v0.0.0-20240812133136-8ffd90a71988/go.mod h1:4+X6GvPs+25wZKbQq9qyAXrwIRExv7w0Ea6MgZLZiDM= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240812133136-8ffd90a71988 h1:V71AcdLZr2p8dC9dbOIMCpqi4EmRl8wUwnJzXXLmbmc= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240812133136-8ffd90a71988/go.mod h1:Ue6ibwXGpU+dqIcODieyLOcgj7z8+IcskoNIgZxtrFY= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= diff --git a/miner/.testdata/application.yaml b/miner/.testdata/application.yaml index 5d3675e..bbc61d4 100644 --- a/miner/.testdata/application.yaml +++ b/miner/.testdata/application.yaml @@ -5,6 +5,7 @@ logger: encoder: console level: debug tokenomics: + welcomeBonusV2Amount: 500 slashingFloor: 1 adoption: milestones: 7 @@ -38,6 +39,7 @@ tokenomics: maxT1Referrals: 1 slashingDisabled: false miner: + welcomeBonusV2Amount: 500 ethereumDistributionFrequency: min: 24h max: 672h diff --git a/miner/miner.go b/miner/miner.go index 2e162bc..b890935 100644 --- a/miner/miner.go +++ b/miner/miner.go @@ -419,7 +419,7 @@ func (m *miner) mine(ctx context.Context, workerNumber int64) { if idT0 < 0 { idT0 *= -1 } - balanceT1WelcomeBonusIncr[idT0] += tokenomics.WelcomeBonusV2Amount + balanceT1WelcomeBonusIncr[idT0] += cfg.WelcomeBonusV2Amount } updatedUsers = append(updatedUsers, &updatedUser.UpdatedUser) } else { diff --git a/miner/mining.go b/miner/mining.go index 87c3fe9..de3b6fc 100644 --- a/miner/mining.go +++ b/miner/mining.go @@ -198,13 +198,13 @@ func mine(now *time.Time, usr *user, t0Ref, tMinus1Ref *referral) (updatedUser * updatedUser.SlashingRateForTMinus1 = updatedUser.BalanceForTMinus1 / float64(cfg.SlashingDaysCount) / miningSessionRatio } } - if updatedUser.BalanceT1WelcomeBonusPendingApplied < float64(min(maxT1Referrals, uint64(usr.TotalT1Referrals)))*tokenomics.WelcomeBonusV2Amount { + if updatedUser.BalanceT1WelcomeBonusPendingApplied < float64(min(maxT1Referrals, uint64(usr.TotalT1Referrals)))*cfg.WelcomeBonusV2Amount { if unAppliedT1WelcomeBonusPending := updatedUser.BalanceT1WelcomeBonusPending - updatedUser.BalanceT1WelcomeBonusPendingApplied; unAppliedT1WelcomeBonusPending == 0 { updatedUser.BalanceT1WelcomeBonusPending = 0 updatedUser.BalanceT1WelcomeBonusPendingApplied = 0 } else { - unAppliedT1Pending += min(unAppliedT1WelcomeBonusPending, float64(min(maxT1Referrals, uint64(usr.TotalT1Referrals)))*tokenomics.WelcomeBonusV2Amount-updatedUser.BalanceT1WelcomeBonusPendingApplied) - updatedUser.BalanceT1WelcomeBonusPendingApplied = min(updatedUser.BalanceT1WelcomeBonusPending, float64(min(maxT1Referrals, uint64(usr.TotalT1Referrals)))*tokenomics.WelcomeBonusV2Amount) + unAppliedT1Pending += min(unAppliedT1WelcomeBonusPending, float64(min(maxT1Referrals, uint64(usr.TotalT1Referrals)))*cfg.WelcomeBonusV2Amount-updatedUser.BalanceT1WelcomeBonusPendingApplied) + updatedUser.BalanceT1WelcomeBonusPendingApplied = min(updatedUser.BalanceT1WelcomeBonusPending, float64(min(maxT1Referrals, uint64(usr.TotalT1Referrals)))*cfg.WelcomeBonusV2Amount) } } else { updatedUser.BalanceT1WelcomeBonusPending = 0 @@ -267,7 +267,7 @@ func mine(now *time.Time, usr *user, t0Ref, tMinus1Ref *referral) (updatedUser * slashedAmount = 0 } if updatedUser.WelcomeBonusV2Applied == nil || !*updatedUser.WelcomeBonusV2Applied { - updatedUser.BalanceSolo += tokenomics.WelcomeBonusV2Amount - 10 + updatedUser.BalanceSolo += cfg.WelcomeBonusV2Amount - 10 trueVal := model.FlexibleBool(true) updatedUser.WelcomeBonusV2Applied = &trueVal } else { diff --git a/tokenomics/.testdata/application.yaml b/tokenomics/.testdata/application.yaml index 23bf986..a56edb7 100644 --- a/tokenomics/.testdata/application.yaml +++ b/tokenomics/.testdata/application.yaml @@ -5,6 +5,7 @@ logger: encoder: console level: debug tokenomics: &tokenomics + welcomeBonusV2Amount: 500 wintr/connectors/storage/v3: url: redis://default:@localhost:6379 bookkeeper/storage: diff --git a/tokenomics/adoption.go b/tokenomics/adoption.go index a95ff36..582fb94 100644 --- a/tokenomics/adoption.go +++ b/tokenomics/adoption.go @@ -28,7 +28,7 @@ func (r *repository) GetAdoptionSummary(ctx context.Context, userID string) (as return nil, errors.Wrap(err, "failed to get current totalActiveUsers") } as.Milestones = make([]*Adoption[string], 0, r.cfg.Adoption.Milestones) - id, err := GetOrInitInternalID(ctx, r.db, userID) + id, err := GetOrInitInternalID(ctx, r.db, userID, r.cfg.WelcomeBonusV2Amount) if err != nil { return nil, errors.Wrapf(err, "failed to getOrInitInternalID for userID:%v", userID) } diff --git a/tokenomics/balance.go b/tokenomics/balance.go index a24651a..0f6318f 100644 --- a/tokenomics/balance.go +++ b/tokenomics/balance.go @@ -24,7 +24,7 @@ import ( func (r *repository) GetBalanceSummary( //nolint:lll // . ctx context.Context, userID string, ) (*BalanceSummary, error) { - id, err := GetOrInitInternalID(ctx, r.db, userID) + id, err := GetOrInitInternalID(ctx, r.db, userID, r.cfg.WelcomeBonusV2Amount) if err != nil { return nil, errors.Wrapf(err, "failed to getOrInitInternalID for userID:%v", userID) } @@ -92,7 +92,7 @@ func (r *repository) GetBalanceHistory( //nolint:funlen,gocognit,revive,gocyclo, if len(dates) == 0 { return []*BalanceHistoryEntry{}, nil } - id, gErr := GetOrInitInternalID(ctx, r.db, userID) + id, gErr := GetOrInitInternalID(ctx, r.db, userID, r.cfg.WelcomeBonusV2Amount) if gErr != nil { return nil, errors.Wrapf(gErr, "failed to getOrInitInternalID for userID:%v", userID) } @@ -307,7 +307,7 @@ func (s *completedTasksSource) Process(ctx context.Context, message *messagebrok if err != nil { return errors.Wrap(err, "failed to getCurrentAdoption") } - id, err := GetOrInitInternalID(ctx, s.db, val.UserID) + id, err := GetOrInitInternalID(ctx, s.db, val.UserID, s.cfg.WelcomeBonusV2Amount) if err != nil { return errors.Wrapf(err, "failed to getOrInitInternalID for userID:%v", val.UserID) } diff --git a/tokenomics/contract.go b/tokenomics/contract.go index f13682d..22146de 100644 --- a/tokenomics/contract.go +++ b/tokenomics/contract.go @@ -29,10 +29,6 @@ const ( MaxPreStakingYears = 5 ) -const ( - WelcomeBonusV2Amount = 500.0 -) - const ( PositiveMiningRateType MiningRateType = "positive" NegativeMiningRateType MiningRateType = "negative" @@ -435,9 +431,10 @@ type ( T1 uint32 `yaml:"t1"` T2 uint32 `yaml:"t2"` } `yaml:"referralBonusMiningRates"` - Tenant string `yaml:"tenant"` - DefaultReferralName string `yaml:"defaultReferralName"` - SlashingFloor float64 `yaml:"slashingFloor" mapstructure:"slashingFloor"` + Tenant string `yaml:"tenant"` + DefaultReferralName string `yaml:"defaultReferralName"` + SlashingFloor float64 `yaml:"slashingFloor" mapstructure:"slashingFloor"` + WelcomeBonusV2Amount float64 `yaml:"welcomeBonusV2Amount" mapstructure:"welcomeBonusV2Amount"` } ) diff --git a/tokenomics/extra_bonus.go b/tokenomics/extra_bonus.go index 5bca496..3c3fae1 100644 --- a/tokenomics/extra_bonus.go +++ b/tokenomics/extra_bonus.go @@ -30,7 +30,7 @@ func (r *repository) ClaimExtraBonus(ctx context.Context, ebs *ExtraBonusSummary if ctx.Err() != nil { return errors.Wrap(ctx.Err(), "unexpected deadline") } - id, err := GetOrInitInternalID(ctx, r.db, ebs.UserID) + id, err := GetOrInitInternalID(ctx, r.db, ebs.UserID, r.cfg.WelcomeBonusV2Amount) if err != nil { return errors.Wrapf(err, "failed to getOrInitInternalID for userID:%v", ebs.UserID) } @@ -71,7 +71,7 @@ func (s *deviceMetadataTableSource) Process(ctx context.Context, msg *messagebro if err != nil { return errors.Wrapf(err, "invalid timezone:%#v", &dm) } - id, err := GetOrInitInternalID(ctx, s.db, dm.UserID) + id, err := GetOrInitInternalID(ctx, s.db, dm.UserID, s.cfg.WelcomeBonusV2Amount) if err != nil { return errors.Wrapf(err, "failed to getOrInitInternalID for %#v", &dm) } @@ -121,7 +121,7 @@ func (s *viewedNewsSource) Process(ctx context.Context, msg *messagebroker.Messa ).ErrorOrNil() } }() - id, err := GetOrInitInternalID(ctx, s.db, vn.UserID) + id, err := GetOrInitInternalID(ctx, s.db, vn.UserID, s.cfg.WelcomeBonusV2Amount) if err != nil { return errors.Wrapf(err, "failed to getOrInitInternalID for %#v", &vn) } diff --git a/tokenomics/kyc.go b/tokenomics/kyc.go index 58adce3..98ac0f0 100644 --- a/tokenomics/kyc.go +++ b/tokenomics/kyc.go @@ -544,8 +544,8 @@ func (r *repository) overrideKYCStateWithEskimoKYCState(ctx context.Context, use usr.ProfilePictureName = r.pictureClient.StripDownloadURL(usr.ProfilePictureName) // We cant reset it to proper value in miner cuz we have active users who has zero total refs in state // until they start next mining, we'll lose pending value in such case. - if state.BalanceT1WelcomeBonusPending > float64(usr.TotalT1Referrals)*WelcomeBonusV2Amount { - usr.BalanceT1WelcomeBonusPending = float64(usr.TotalT1Referrals) * WelcomeBonusV2Amount + if state.BalanceT1WelcomeBonusPending > float64(usr.TotalT1Referrals)*r.cfg.WelcomeBonusV2Amount { + usr.BalanceT1WelcomeBonusPending = float64(usr.TotalT1Referrals) * r.cfg.WelcomeBonusV2Amount } return usr.KycFaceAvailable, multierror.Append( errors.Wrapf(r.updateUsernameKeywords(ctx, state.ID, state.Username, usr.Username), "failed to updateUsernameKeywords for oldUser:%#v, user:%#v", state, usr), //nolint:lll // . diff --git a/tokenomics/mining.go b/tokenomics/mining.go index 705c07c..b460f4a 100644 --- a/tokenomics/mining.go +++ b/tokenomics/mining.go @@ -20,7 +20,7 @@ import ( ) func (r *repository) GetRankingSummary(ctx context.Context, userID string) (*RankingSummary, error) { //nolint:funlen // . - id, err := GetOrInitInternalID(ctx, r.db, userID) + id, err := GetOrInitInternalID(ctx, r.db, userID, r.cfg.WelcomeBonusV2Amount) if err != nil { return nil, errors.Wrapf(err, "failed to getOrInitInternalID for userID:%v", userID) } @@ -160,7 +160,7 @@ func (r *repository) GetTopMiners(ctx context.Context, keyword string, limit, of //nolint:funlen // . func (r *repository) GetMiningSummary(ctx context.Context, userID string) (*MiningSummary, error) { - id, err := GetOrInitInternalID(ctx, r.db, userID) + id, err := GetOrInitInternalID(ctx, r.db, userID, r.cfg.WelcomeBonusV2Amount) if err != nil { return nil, errors.Wrapf(err, "failed to getOrInitInternalID for userID:%v", userID) } diff --git a/tokenomics/mining_boost.go b/tokenomics/mining_boost.go index 1001b0c..a934caa 100644 --- a/tokenomics/mining_boost.go +++ b/tokenomics/mining_boost.go @@ -33,7 +33,7 @@ import ( ) func (r *repository) GetMiningBoostSummary(ctx context.Context, userID string) (*MiningBoostSummary, error) { - id, err := GetOrInitInternalID(ctx, r.db, userID) + id, err := GetOrInitInternalID(ctx, r.db, userID, r.cfg.WelcomeBonusV2Amount) if err != nil { return nil, errors.Wrapf(err, "failed to getOrInitInternalID for userID:%v", userID) } @@ -76,7 +76,7 @@ func (r *repository) InitializeMiningBoostUpgrade(ctx context.Context, miningBoo if miningBoostLevelIndex > uint8(len(r.cfg.MiningBoost.Levels)-1) { return nil, errors.New("mining boost already at max level") } - id, err := GetOrInitInternalID(ctx, r.db, userID) + id, err := GetOrInitInternalID(ctx, r.db, userID, r.cfg.WelcomeBonusV2Amount) if err != nil { return nil, errors.Wrapf(err, "failed to getOrInitInternalID for userID:%v", userID) } @@ -124,7 +124,7 @@ func (r *repository) FinalizeMiningBoostUpgrade(ctx context.Context, network Blo if network != BNBBlockchainNetworkType && network != EthereumBlockchainNetworkType && network != ArbitrumBlockchainNetworkType { return nil, errors.Errorf("invalid network %v", network) } - id, err := GetOrInitInternalID(ctx, r.db, userID) + id, err := GetOrInitInternalID(ctx, r.db, userID, r.cfg.WelcomeBonusV2Amount) if err != nil { return nil, errors.Wrapf(err, "failed to getOrInitInternalID for userID:%v", userID) } diff --git a/tokenomics/mining_sessions.go b/tokenomics/mining_sessions.go index 77ca9a7..2c509ca 100644 --- a/tokenomics/mining_sessions.go +++ b/tokenomics/mining_sessions.go @@ -59,7 +59,7 @@ func (r *repository) StartNewMiningSession( //nolint:funlen,gocognit // A lot of ctx context.Context, ms *MiningSummary, rollbackNegativeMiningProgress *bool, skipKYCSteps []users.KYCStep, ) error { userID := *ms.MiningSession.UserID - id, err := GetOrInitInternalID(ctx, r.db, userID) + id, err := GetOrInitInternalID(ctx, r.db, userID, r.cfg.WelcomeBonusV2Amount) if err != nil { return errors.Wrapf(err, "failed to getOrInitInternalID for userID:%v", userID) } @@ -328,7 +328,7 @@ func (s *miningSessionsTableSource) incrementActiveReferralCountForT0AndTMinus1( ).ErrorOrNil() } }() - id, err := GetOrInitInternalID(ctx, s.db, *ms.UserID) + id, err := GetOrInitInternalID(ctx, s.db, *ms.UserID, s.cfg.WelcomeBonusV2Amount) if err != nil { return errors.Wrapf(err, "failed to getOrInitInternalID for userID:%v", *ms.UserID) } diff --git a/tokenomics/pre_staking.go b/tokenomics/pre_staking.go index 9b0ee13..2424f58 100644 --- a/tokenomics/pre_staking.go +++ b/tokenomics/pre_staking.go @@ -35,7 +35,7 @@ func (r *repository) GetPreStakingSummary(ctx context.Context, userID string) (* } func (r *repository) getPreStaking(ctx context.Context, userID string) (*preStaking, int64, error) { - id, err := GetOrInitInternalID(ctx, r.db, userID) + id, err := GetOrInitInternalID(ctx, r.db, userID, r.cfg.WelcomeBonusV2Amount) if err != nil { return nil, 0, errors.Wrapf(err, "failed to getOrInitInternalID for userID:%v", userID) } diff --git a/tokenomics/users.go b/tokenomics/users.go index 026a697..fc64dbd 100644 --- a/tokenomics/users.go +++ b/tokenomics/users.go @@ -4,7 +4,6 @@ package tokenomics import ( "context" - "fmt" "strconv" "strings" stdlibtime "time" @@ -49,7 +48,7 @@ func (s *usersTableSource) Process(ctx context.Context, msg *messagebroker.Messa } func (s *usersTableSource) deleteUser(ctx context.Context, usr *users.User) error { //nolint:funlen // . - id, err := GetOrInitInternalID(ctx, s.db, usr.ID) + id, err := GetOrInitInternalID(ctx, s.db, usr.ID, s.cfg.WelcomeBonusV2Amount) if err != nil { return errors.Wrapf(err, "failed to getInternalID for user:%#v", usr) } @@ -156,7 +155,7 @@ func (s *usersTableSource) deleteUser(ctx context.Context, usr *users.User) erro } func (s *usersTableSource) replaceUser(ctx context.Context, usr *users.User) error { //nolint:funlen // . - internalID, err := GetOrInitInternalID(ctx, s.db, usr.ID) + internalID, err := GetOrInitInternalID(ctx, s.db, usr.ID, s.cfg.WelcomeBonusV2Amount) if err != nil { return errors.Wrapf(err, "failed to getOrInitInternalID for user:%#v", usr) } @@ -246,7 +245,7 @@ func (r *repository) updateReferredBy(ctx context.Context, id int64, oldIDT0, ol referredBy == "icenetwork" { return nil } - idT0, err := GetOrInitInternalID(ctx, r.db, referredBy) + idT0, err := GetOrInitInternalID(ctx, r.db, referredBy, r.cfg.WelcomeBonusV2Amount) if err != nil { return errors.Wrapf(err, "failed to getOrInitInternalID for referredBy:%v", referredBy) } else if (*oldIDT0 == idT0) || (*oldIDT0*-1 == idT0) { @@ -316,7 +315,7 @@ func (r *repository) updateReferredBy(ctx context.Context, id int64, oldIDT0, ol localIDT0 *= -1 } results, err4 := r.db.TxPipelined(ctx, func(pipeliner redis.Pipeliner) error { - if innerErr := pipeliner.HIncrBy(ctx, model.SerializedUsersKey(localIDT0), "balance_t1_welcome_bonus_pending", WelcomeBonusV2Amount).Err(); innerErr != nil { + if innerErr := pipeliner.HIncrBy(ctx, model.SerializedUsersKey(localIDT0), "balance_t1_welcome_bonus_pending", int64(r.cfg.WelcomeBonusV2Amount)).Err(); innerErr != nil { return innerErr } if innerErr := pipeliner.HIncrBy(ctx, model.SerializedUsersKey(localIDT0), "total_t1_referrals", 1).Err(); innerErr != nil { @@ -444,20 +443,20 @@ elseif set_nx_reply == 0 then end return new_id `) - initUserScript = redis.NewScript(fmt.Sprintf(` + initUserScript = redis.NewScript(` local hlen_reply = redis.call('HLEN', KEYS[1]) if hlen_reply ~= 0 then return redis.error_reply('[2]race condition') end -redis.call('HSETNX', KEYS[1], 'balance_total_standard', %[1]v) -redis.call('HSETNX', KEYS[1], 'balance_total_minted', %[1]v) -redis.call('HSETNX', KEYS[1], 'balance_solo', %[1]v) +redis.call('HSETNX', KEYS[1], 'balance_total_standard', ARGV[2]) +redis.call('HSETNX', KEYS[1], 'balance_total_minted', ARGV[2]) +redis.call('HSETNX', KEYS[1], 'balance_solo', ARGV[2]) redis.call('HSETNX', KEYS[1], 'welcome_bonus_v2_applied', 'true') redis.call('HSETNX', KEYS[1], 'user_id', ARGV[1]) -`, strconv.FormatFloat(WelcomeBonusV2Amount, 'f', 1, 64))) +`) ) -func GetOrInitInternalID(ctx context.Context, db storage.DB, userID string) (int64, error) { +func GetOrInitInternalID(ctx context.Context, db storage.DB, userID string, welcomeBonus float64) (int64, error) { if ctx.Err() != nil { return 0, errors.Wrapf(ctx.Err(), "context expired") } @@ -468,12 +467,12 @@ func GetOrInitInternalID(ctx context.Context, db storage.DB, userID string) (int if err != nil && redis.HasErrorPrefix(err, "NOSCRIPT") { log.Error(errors.Wrap(initInternalIDScript.Load(ctx, db).Err(), "failed to load initInternalIDScript")) - return GetOrInitInternalID(ctx, db, userID) + return GetOrInitInternalID(ctx, db, userID, welcomeBonus) } if err == nil { accessibleKeys = append(make([]string, 0, 1), model.SerializedUsersKey(id)) for err = errors.New("init"); ctx.Err() == nil && err != nil; { - if err = initUserScript.EvalSha(ctx, db, accessibleKeys, userID).Err(); err == nil || errors.Is(err, redis.Nil) || strings.Contains(err.Error(), "race condition") { + if err = initUserScript.EvalSha(ctx, db, accessibleKeys, userID, strconv.FormatFloat(welcomeBonus, 'f', 1, 64)).Err(); err == nil || errors.Is(err, redis.Nil) || strings.Contains(err.Error(), "race condition") { if err != nil && strings.Contains(err.Error(), "race condition") { log.Error(errors.Wrapf(err, "[2]race condition while evaling initUserScript for userID:%v", userID)) } @@ -490,7 +489,7 @@ func GetOrInitInternalID(ctx context.Context, db storage.DB, userID string) (int log.Error(err) stdlibtime.Sleep(2 * stdlibtime.Second) - return GetOrInitInternalID(ctx, db, userID) + return GetOrInitInternalID(ctx, db, userID, welcomeBonus) } return id, errors.Wrapf(err, "failed to getInternalID for userID:%#v", userID)