chore: align struct fields, fix import ordering, update dependencies

This commit is contained in:
Zach Kelling
2026-02-13 15:12:43 -08:00
parent 124167f43e
commit 579887fc11
112 changed files with 336 additions and 340 deletions
+12 -12
View File
@@ -3,7 +3,7 @@ module github.com/luxfi/protocol
go 1.25.5
require (
github.com/cloudflare/circl v1.6.2
github.com/cloudflare/circl v1.6.3
github.com/google/btree v1.1.3
github.com/gorilla/rpc v1.2.1
github.com/luxfi/accel v1.0.1
@@ -61,7 +61,7 @@ require (
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.0 // indirect
github.com/dgraph-io/badger/v4 v4.9.0 // indirect
github.com/dgraph-io/ristretto/v2 v2.3.0 // indirect
github.com/dgraph-io/ristretto/v2 v2.4.0 // indirect
github.com/dustin/go-humanize v1.0.1 // indirect
github.com/getsentry/sentry-go v0.40.0 // indirect
github.com/go-logr/logr v1.4.3 // indirect
@@ -70,13 +70,13 @@ require (
github.com/golang/mock v1.7.0-rc.1 // indirect
github.com/golang/snappy v1.0.0 // indirect
github.com/google/flatbuffers v25.12.19+incompatible // indirect
github.com/google/renameio/v2 v2.0.1 // indirect
github.com/google/renameio/v2 v2.0.2 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/gorilla/mux v1.8.1 // indirect
github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.4 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.5 // indirect
github.com/holiman/uint256 v1.3.2 // indirect
github.com/klauspost/compress v1.18.2 // indirect
github.com/klauspost/compress v1.18.3 // indirect
github.com/kr/pretty v0.3.1 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/luxfi/api v1.0.1 // indirect
@@ -120,15 +120,15 @@ require (
go.opentelemetry.io/proto/otlp v1.9.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.yaml.in/yaml/v2 v2.4.3 // indirect
golang.org/x/crypto v0.46.0 // indirect
golang.org/x/exp v0.0.0-20251219203646-944ab1f22d93 // indirect
golang.org/x/net v0.48.0 // indirect
golang.org/x/sys v0.39.0 // indirect
golang.org/x/text v0.32.0 // indirect
golang.org/x/crypto v0.47.0 // indirect
golang.org/x/exp v0.0.0-20260112195511-716be5621a96 // indirect
golang.org/x/net v0.49.0 // indirect
golang.org/x/sys v0.40.0 // indirect
golang.org/x/text v0.33.0 // indirect
golang.org/x/time v0.14.0 // indirect
gonum.org/v1/gonum v0.16.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20251222181119-0a764e51fe1b // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20251222181119-0a764e51fe1b // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20260120221211-b8f7ae30c516 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20260120221211-b8f7ae30c516 // indirect
google.golang.org/grpc v1.78.0 // indirect
gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
+20 -24
View File
@@ -37,8 +37,8 @@ github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XL
github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=
github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
github.com/cloudflare/circl v1.6.2 h1:hL7VBpHHKzrV5WTfHCaBsgx/HGbBYlgrwvNXEVDYYsQ=
github.com/cloudflare/circl v1.6.2/go.mod h1:2eXP6Qfat4O/Yhh8BznvKnJ+uzEoTQ6jVKJRn81BiS4=
github.com/cloudflare/circl v1.6.3 h1:9GPOhQGF9MCYUeXyMYlqTR6a5gTrgR/fBLXvUgtVcg8=
github.com/cloudflare/circl v1.6.3/go.mod h1:2eXP6Qfat4O/Yhh8BznvKnJ+uzEoTQ6jVKJRn81BiS4=
github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f h1:otljaYPt5hWxV3MUfO5dFPFiOXg9CyG5/kCfayTqsJ4=
github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU=
github.com/cockroachdb/errors v1.12.0 h1:d7oCs6vuIMUQRVbi6jWWWEJZahLCfJpnJSVobd1/sUo=
@@ -69,8 +69,8 @@ github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.0/go.mod h1:ZXNYxsqcloTdSy/rNShjY
github.com/decred/dcrd/lru v1.0.0/go.mod h1:mxKOwFd7lFjN2GZYsiz/ecgqR6kkYAl+0pz0tEMk218=
github.com/dgraph-io/badger/v4 v4.9.0 h1:tpqWb0NewSrCYqTvywbcXOhQdWcqephkVkbBmaaqHzc=
github.com/dgraph-io/badger/v4 v4.9.0/go.mod h1:5/MEx97uzdPUHR4KtkNt8asfI2T4JiEiQlV7kWUo8c0=
github.com/dgraph-io/ristretto/v2 v2.3.0 h1:qTQ38m7oIyd4GAed/QkUZyPFNMnvVWyazGXRwvOt5zk=
github.com/dgraph-io/ristretto/v2 v2.3.0/go.mod h1:gpoRV3VzrEY1a9dWAYV6T1U7YzfgttXdd/ZzL1s9OZM=
github.com/dgraph-io/ristretto/v2 v2.4.0 h1:I/w09yLjhdcVD2QV192UJcq8dPBaAJb9pOuMyNy0XlU=
github.com/dgraph-io/ristretto/v2 v2.4.0/go.mod h1:0KsrXtXvnv0EqnzyowllbVJB8yBonswa2lTCK2gGo9E=
github.com/dgryski/go-farm v0.0.0-20240924180020-3414d57e47da h1:aIftn67I1fkbMa512G+w+Pxci9hJPB8oMnkcP3iZF38=
github.com/dgryski/go-farm v0.0.0-20240924180020-3414d57e47da/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw=
github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY=
@@ -119,8 +119,7 @@ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
github.com/google/renameio/v2 v2.0.1 h1:HyOM6qd9gF9sf15AvhbptGHUnaLTpEI9akAFFU3VyW0=
github.com/google/renameio/v2 v2.0.1/go.mod h1:BtmJXm5YlszgC+TD4HOEEUFgkJP3nLxehU6hfe7jRt4=
github.com/google/renameio/v2 v2.0.2 h1:qKZs+tfn+arruZZhQ7TKC/ergJunuJicWS6gLDt/dGw=
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY=
@@ -132,8 +131,7 @@ github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 h1:JeSE6pjso5T
github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674/go.mod h1:r4w70xmWCQKmi1ONH4KIaBptdivuRPyosB9RmPlGEwA=
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 h1:Ovs26xHkKqVztRpIrF/92BcuyuQ/YW4NSIpoGtfXNho=
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.4 h1:kEISI/Gx67NzH3nJxAmY/dGac80kKZgZt134u7Y/k1s=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.4/go.mod h1:6Nz966r3vQYCqIzWsuEl9d7cf7mRhtDmm++sOxlnfxI=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.5 h1:jP1RStw811EvUDzsUQ9oESqw2e4RqCjSAD9qIL8eMns=
github.com/holiman/uint256 v1.3.2 h1:a9EgMPSC1AAaj1SZL5zIQD3WbwTuHrMGOerLjGmM/TA=
github.com/holiman/uint256 v1.3.2/go.mod h1:EOMSn4q6Nyt9P6efbI3bueV4e1b3dGlUCXeiRV4ng7E=
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
@@ -144,8 +142,8 @@ github.com/jrick/logrotate v1.0.0/go.mod h1:LNinyqDIJnpAur+b8yyulnQw/wDuN1+BYKlT
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6CZQHDETBtE9HaSEkGmuNXF86RwHhHUvq4=
github.com/klauspost/compress v1.18.2 h1:iiPHWW0YrcFgpBYhsA6D1+fqHssJscY/Tm/y2Uqnapk=
github.com/klauspost/compress v1.18.2/go.mod h1:R0h/fSBs8DE4ENlcrlib3PsXS61voFxhIs2DeRhCvJ4=
github.com/klauspost/compress v1.18.3 h1:9PJRvfbmTabkOX8moIpXPbMMbYN60bWImDDU7L+/6zw=
github.com/klauspost/compress v1.18.3/go.mod h1:R0h/fSBs8DE4ENlcrlib3PsXS61voFxhIs2DeRhCvJ4=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
@@ -353,10 +351,10 @@ golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnf
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.46.0 h1:cKRW/pmt1pKAfetfu+RCEvjvZkA9RimPbh7bhFjGVBU=
golang.org/x/crypto v0.46.0/go.mod h1:Evb/oLKmMraqjZ2iQTwDwvCtJkczlDuTmdJXoZVzqU0=
golang.org/x/exp v0.0.0-20251219203646-944ab1f22d93 h1:fQsdNF2N+/YewlRZiricy4P1iimyPKZ/xwniHj8Q2a0=
golang.org/x/exp v0.0.0-20251219203646-944ab1f22d93/go.mod h1:EPRbTFwzwjXj9NpYyyrvenVh9Y+GFeEvMNh7Xuz7xgU=
golang.org/x/crypto v0.47.0 h1:V6e3FRj+n4dbpw86FJ8Fv7XVOql7TEwpHapKoMJ/GO8=
golang.org/x/crypto v0.47.0/go.mod h1:ff3Y9VzzKbwSSEzWqJsJVBnWmRwRSHt/6Op5n9bQc4A=
golang.org/x/exp v0.0.0-20260112195511-716be5621a96 h1:Z/6YuSHTLOHfNFdb8zVZomZr7cqNgTJvA8+Qz75D8gU=
golang.org/x/exp v0.0.0-20260112195511-716be5621a96/go.mod h1:nzimsREAkjBCIEFtHiYkrJyT+2uy9YZJB7H1k68CXZU=
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.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro=
@@ -372,8 +370,8 @@ golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT
golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
golang.org/x/net v0.48.0 h1:zyQRTTrjc33Lhh0fBgT/H3oZq9WuvRR5gPC70xpDiQU=
golang.org/x/net v0.48.0/go.mod h1:+ndRgGjkh8FGtu1w1FGbEC31if4VrNVMuKTgcAAnQRY=
golang.org/x/net v0.49.0 h1:eeHFmOGUTtaaPSGNmjBKpbng9MulQsJURQUAfUwY++o=
golang.org/x/net v0.49.0/go.mod h1:/ysNB2EvaqvesRkuLAyjI1ycPZlQHM3q01F02UY/MV8=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/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=
@@ -401,8 +399,8 @@ golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.39.0 h1:CvCKL8MeisomCi6qNZ+wbb0DN9E5AATixKsvNtMoMFk=
golang.org/x/sys v0.39.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
golang.org/x/sys v0.40.0 h1:DBZZqJ2Rkml6QMQsZywtnjnnGvHza6BTfYFWY9kjEWQ=
golang.org/x/sys v0.40.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
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/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
@@ -410,8 +408,8 @@ golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
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.32.0 h1:ZD01bjUt1FQ9WJ0ClOL5vxgxOI/sVCNgX1YtKwcY0mU=
golang.org/x/text v0.32.0/go.mod h1:o/rUWzghvpD5TXrTIBuJU77MTaN0ljMWE47kxGJQ7jY=
golang.org/x/text v0.33.0 h1:B3njUFyqtHDUI5jMn1YIr5B0IE2U0qck04r6d4KPAxE=
golang.org/x/text v0.33.0/go.mod h1:LuMebE6+rBincTi9+xWTY8TztLzKHc/9C1uBCG27+q8=
golang.org/x/time v0.14.0 h1:MRx4UaLrDotUKUdCIqzPC48t1Y9hANFKIRpNx+Te8PI=
golang.org/x/time v0.14.0/go.mod h1:eL/Oa2bBBK0TkX57Fyni+NgnyQQN4LitPmob2Hjnqw4=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
@@ -427,10 +425,8 @@ golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8T
golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8=
gonum.org/v1/gonum v0.16.0 h1:5+ul4Swaf3ESvrOnidPp4GZbzf0mxVQpDCYUQE7OJfk=
gonum.org/v1/gonum v0.16.0/go.mod h1:fef3am4MQ93R2HHpKnLk4/Tbh/s0+wqD5nfa6Pnwy4E=
google.golang.org/genproto/googleapis/api v0.0.0-20251222181119-0a764e51fe1b h1:uA40e2M6fYRBf0+8uN5mLlqUtV192iiksiICIBkYJ1E=
google.golang.org/genproto/googleapis/api v0.0.0-20251222181119-0a764e51fe1b/go.mod h1:Xa7le7qx2vmqB/SzWUBa7KdMjpdpAHlh5QCSnjessQk=
google.golang.org/genproto/googleapis/rpc v0.0.0-20251222181119-0a764e51fe1b h1:Mv8VFug0MP9e5vUxfBcE3vUkV6CImK3cMNMIDFjmzxU=
google.golang.org/genproto/googleapis/rpc v0.0.0-20251222181119-0a764e51fe1b/go.mod h1:j9x/tPzZkyxcgEFkiKEEGxfvyumM01BEtsW8xzOahRQ=
google.golang.org/genproto/googleapis/api v0.0.0-20260120221211-b8f7ae30c516 h1:vmC/ws+pLzWjj/gzApyoZuSVrDtF1aod4u/+bbj8hgM=
google.golang.org/genproto/googleapis/rpc v0.0.0-20260120221211-b8f7ae30c516 h1:sNrWoksmOyF5bvJUcnmbeAmQi8baNhqg5IWaI3llQqU=
google.golang.org/grpc v1.78.0 h1:K1XZG/yGDJnzMdd/uZHAkVqJE+xIDOcmdSFZkBUicNc=
google.golang.org/grpc v1.78.0/go.mod h1:I47qjTo4OKbMkjA/aOOwxDIiPSBofUtQUI5EfpWvW7U=
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
+21 -21
View File
@@ -12,12 +12,12 @@ import (
// Staker is the representation of a staker sent via RPC.
type Staker struct {
TxID ids.ID `json:"txID"`
StartTime json.Uint64 `json:"startTime"`
EndTime json.Uint64 `json:"endTime"`
Weight json.Uint64 `json:"weight,omitempty"`
TxID ids.ID `json:"txID"`
StartTime json.Uint64 `json:"startTime"`
EndTime json.Uint64 `json:"endTime"`
Weight json.Uint64 `json:"weight,omitempty"`
StakeAmount *json.Uint64 `json:"stakeAmount,omitempty"`
NodeID ids.NodeID `json:"nodeID"`
NodeID ids.NodeID `json:"nodeID"`
}
// Owner is the representation of an owner sent via RPC.
@@ -52,26 +52,26 @@ type PermissionlessValidator struct {
Balance *json.Uint64 `json:"balance,omitempty"`
// Standard validator fields
ValidationRewardOwner *Owner `json:"validationRewardOwner,omitempty"`
DelegationRewardOwner *Owner `json:"delegationRewardOwner,omitempty"`
PotentialReward *json.Uint64 `json:"potentialReward,omitempty"`
AccruedDelegateeReward *json.Uint64 `json:"accruedDelegateeReward,omitempty"`
DelegationFee json.Float32 `json:"delegationFee"`
Uptime *json.Float32 `json:"uptime,omitempty"`
Connected *bool `json:"connected,omitempty"`
Signer *signer.ProofOfPossession `json:"signer,omitempty"`
DelegatorCount *json.Uint64 `json:"delegatorCount,omitempty"`
DelegatorWeight *json.Uint64 `json:"delegatorWeight,omitempty"`
Delegators *[]PrimaryDelegator `json:"delegators,omitempty"`
ValidationRewardOwner *Owner `json:"validationRewardOwner,omitempty"`
DelegationRewardOwner *Owner `json:"delegationRewardOwner,omitempty"`
PotentialReward *json.Uint64 `json:"potentialReward,omitempty"`
AccruedDelegateeReward *json.Uint64 `json:"accruedDelegateeReward,omitempty"`
DelegationFee json.Float32 `json:"delegationFee"`
Uptime *json.Float32 `json:"uptime,omitempty"`
Connected *bool `json:"connected,omitempty"`
Signer *signer.ProofOfPossession `json:"signer,omitempty"`
DelegatorCount *json.Uint64 `json:"delegatorCount,omitempty"`
DelegatorWeight *json.Uint64 `json:"delegatorWeight,omitempty"`
Delegators *[]PrimaryDelegator `json:"delegators,omitempty"`
}
// BaseL1Validator contains the shared fields for L1 validators.
type BaseL1Validator struct {
ValidationID *ids.ID `json:"validationID,omitempty"`
PublicKey *types.JSONByteSlice `json:"publicKey,omitempty"`
RemainingBalanceOwner *Owner `json:"remainingBalanceOwner,omitempty"`
DeactivationOwner *Owner `json:"deactivationOwner,omitempty"`
MinNonce *json.Uint64 `json:"minNonce,omitempty"`
ValidationID *ids.ID `json:"validationID,omitempty"`
PublicKey *types.JSONByteSlice `json:"publicKey,omitempty"`
RemainingBalanceOwner *Owner `json:"remainingBalanceOwner,omitempty"`
DeactivationOwner *Owner `json:"deactivationOwner,omitempty"`
MinNonce *json.Uint64 `json:"minNonce,omitempty"`
}
// APIL1Validator is the representation of an L1 validator sent via RPC.
+1 -1
View File
@@ -7,9 +7,9 @@ import (
"context"
"time"
"github.com/luxfi/runtime"
"github.com/luxfi/ids"
"github.com/luxfi/protocol/p/txs"
"github.com/luxfi/runtime"
)
var (
+1 -1
View File
@@ -7,9 +7,9 @@ import (
"context"
"fmt"
"github.com/luxfi/runtime"
"github.com/luxfi/ids"
"github.com/luxfi/protocol/p/txs"
"github.com/luxfi/runtime"
)
var _ Block = (*ApricotAtomicBlock)(nil)
+31 -29
View File
@@ -15,7 +15,6 @@ import (
log "github.com/luxfi/log"
consensuscore "github.com/luxfi/consensus/core"
validators "github.com/luxfi/validators"
"github.com/luxfi/constants"
"github.com/luxfi/ids"
"github.com/luxfi/math/set"
@@ -23,15 +22,16 @@ import (
"github.com/luxfi/protocol/p/status"
"github.com/luxfi/protocol/p/txs"
"github.com/luxfi/protocol/p/txs/fee"
"github.com/luxfi/timer/mockable"
"github.com/luxfi/vm/components/gas"
"github.com/luxfi/protocol/txs/mempool"
"github.com/luxfi/timer/mockable"
validators "github.com/luxfi/validators"
"github.com/luxfi/vm/components/gas"
"github.com/luxfi/runtime"
chainblock "github.com/luxfi/consensus/engine/chain/block"
platformblock "github.com/luxfi/protocol/p/block"
blockexecutor "github.com/luxfi/protocol/p/block/executor"
txexecutor "github.com/luxfi/protocol/p/txs/executor"
"github.com/luxfi/runtime"
)
// validatorStateAdapter adapts runtime.ValidatorState to validators.State
@@ -40,19 +40,7 @@ type validatorStateAdapter struct {
}
func (a *validatorStateAdapter) GetValidatorSet(ctx context.Context, height uint64, netID ids.ID) (map[ids.NodeID]*validators.GetValidatorOutput, error) {
weights, err := a.state.GetValidatorSet(height, netID)
if err != nil {
return nil, err
}
result := make(map[ids.NodeID]*validators.GetValidatorOutput, len(weights))
for nodeID, weight := range weights {
result[nodeID] = &validators.GetValidatorOutput{
NodeID: nodeID,
Light: weight,
}
}
return result, nil
return a.state.GetValidatorSet(ctx, height, netID)
}
func (a *validatorStateAdapter) GetCurrentValidators(ctx context.Context, height uint64, netID ids.ID) (map[ids.NodeID]*validators.GetValidatorOutput, error) {
@@ -111,6 +99,20 @@ func (a *validatorStateAdapter) GetWarpValidatorSets(ctx context.Context, height
return result, nil
}
func (a *validatorStateAdapter) GetMinimumHeight(ctx context.Context) (uint64, error) {
return a.state.GetMinimumHeight(ctx)
}
func (a *validatorStateAdapter) GetChainID(netID ids.ID) (ids.ID, error) {
// TODO: Implement proper network ID to chain ID lookup
return netID, nil
}
func (a *validatorStateAdapter) GetNetworkID(chainID ids.ID) (ids.ID, error) {
// TODO: Implement proper chain ID to network ID lookup
return chainID, nil
}
const (
// targetBlockSize is maximum number of transaction bytes to place into a
// StandardBlock
@@ -184,7 +186,7 @@ func (b *builder) Disconnected(ctx context.Context, nodeID ids.NodeID) error {
}
func (b *builder) WaitForEvent(ctx context.Context) (consensuscore.Message, error) {
logger := b.txExecutorBackend.Ctx.Log.(log.Logger)
logger := b.txExecutorBackend.Rt.Log.(log.Logger)
consecutiveErrors := 0
for {
if err := ctx.Err(); err != nil {
@@ -278,7 +280,7 @@ func (b *builder) BuildBlockWithContext(
ctx context.Context,
blockContext *chainblock.Context,
) (chainblock.Block, error) {
logger := b.txExecutorBackend.Ctx.Log.(log.Logger)
logger := b.txExecutorBackend.Rt.Log.(log.Logger)
logger.Debug("starting to attempt to build a block")
// Get the block to build on top of and retrieve the new block's context.
@@ -338,8 +340,8 @@ func (b *builder) PackAllBlockTxs() ([]*txs.Tx, error) {
// Type assert ValidatorState to get GetMinimumHeight method
// ValidatorState may be nil during initialization, use 0 as default
var recommendedPChainHeight uint64
if b.txExecutorBackend.Ctx.ValidatorState != nil {
validatorState := b.txExecutorBackend.Ctx.ValidatorState.(interface {
if b.txExecutorBackend.Rt.ValidatorState != nil {
validatorState := b.txExecutorBackend.Rt.ValidatorState.(interface {
GetMinimumHeight(context.Context) (uint64, error)
})
var err error
@@ -416,7 +418,7 @@ func buildBlock(
)
}
if err != nil {
logger := builder.txExecutorBackend.Ctx.Log.(log.Logger)
logger := builder.txExecutorBackend.Rt.Log.(log.Logger)
logger.Warn("failed to pack block transactions: " + err.Error())
return nil, fmt.Errorf("failed to pack block txs: %w", err)
}
@@ -469,7 +471,7 @@ func packDurangoBlockTxs(
pChainHeight uint64,
remainingSize int,
) ([]*txs.Tx, error) {
logger := backend.Ctx.Log.(log.Logger)
logger := backend.Rt.Log.(log.Logger)
logger.Debug("packDurangoBlockTxs starting",
log.Time("timestamp", timestamp),
log.Uint64("pChainHeight", pChainHeight),
@@ -558,7 +560,7 @@ func packEtnaBlockTxs(
feeCalculator = state.PickFeeCalculator(backend.Config, stateDiff)
)
logger := backend.Ctx.Log.(log.Logger)
logger := backend.Rt.Log.(log.Logger)
logger.Debug("starting to pack block txs",
log.Stringer("parentID", parentID),
log.Time("blockTimestamp", timestamp),
@@ -645,24 +647,24 @@ func executeTx(
// Invariant: [tx] has already been syntactically verified.
logger := backend.Ctx.Log.(log.Logger)
logger := backend.Rt.Log.(log.Logger)
txID := tx.ID()
// Get validator state - handle both validators.State (from node) and runtime.ValidatorState (from tests)
var stateAdapter validators.State
if vs, ok := backend.Ctx.ValidatorState.(validators.State); ok {
if vs, ok := backend.Rt.ValidatorState.(validators.State); ok {
// Node provides validators.State directly
stateAdapter = vs
} else if vs, ok := backend.Ctx.ValidatorState.(runtime.ValidatorState); ok {
} else if vs, ok := backend.Rt.ValidatorState.(runtime.ValidatorState); ok {
// Tests may provide runtime.ValidatorState, wrap it
stateAdapter = &validatorStateAdapter{state: vs}
} else {
return false, fmt.Errorf("invalid validator state type: %T", backend.Ctx.ValidatorState)
return false, fmt.Errorf("invalid validator state type: %T", backend.Rt.ValidatorState)
}
err := txexecutor.VerifyWarpMessages(
ctx,
backend.Ctx.NetworkID,
backend.Rt.NetworkID,
stateAdapter,
pChainHeight,
tx.Unsigned,
+1 -1
View File
@@ -23,8 +23,8 @@ import (
"github.com/luxfi/protocol/p/txs"
"github.com/luxfi/timer/mockable"
"github.com/luxfi/upgrade/upgradetest"
"github.com/luxfi/vm/chain"
"github.com/luxfi/utxo/secp256k1fx"
"github.com/luxfi/vm/chain"
blockexecutor "github.com/luxfi/protocol/p/block/executor"
txexecutor "github.com/luxfi/protocol/p/txs/executor"
+8 -8
View File
@@ -11,10 +11,8 @@ import (
"github.com/luxfi/metric"
"github.com/stretchr/testify/require"
"github.com/luxfi/runtime"
"github.com/luxfi/consensus/core/coremock"
consensustest "github.com/luxfi/consensus/test/helpers"
"github.com/luxfi/validators/uptime"
"github.com/luxfi/crypto/secp256k1"
"github.com/luxfi/database/memdb"
"github.com/luxfi/database/prefixdb"
@@ -22,11 +20,14 @@ import (
"github.com/luxfi/ids"
log "github.com/luxfi/log"
"github.com/luxfi/p2p"
"github.com/luxfi/runtime"
"github.com/luxfi/validators/uptime"
"github.com/luxfi/atomic"
"github.com/luxfi/codec"
"github.com/luxfi/codec/linearcodec"
"github.com/luxfi/constants"
"github.com/luxfi/node/chains"
"github.com/luxfi/protocol/p/config"
"github.com/luxfi/protocol/p/fx"
"github.com/luxfi/protocol/p/genesis/genesistest"
@@ -44,9 +45,8 @@ import (
"github.com/luxfi/sdk/wallet/chain/p/wallet"
"github.com/luxfi/timer/mockable"
"github.com/luxfi/upgrade/upgradetest"
"github.com/luxfi/node/chains"
chainatomic "github.com/luxfi/vm/chains/atomic"
"github.com/luxfi/utxo/secp256k1fx"
chainatomic "github.com/luxfi/vm/chains/atomic"
blockexecutor "github.com/luxfi/protocol/p/block/executor"
"github.com/luxfi/protocol/p/testcontext"
@@ -291,10 +291,10 @@ func newWallet(t testing.TB, e *environment, c walletConfig) wallet.Wallet {
}
// Create a minimal Config for the wallet
walletCfg := &config.Config{
TxFee: constants.MilliLux,
CreateAssetTxFee: constants.MilliLux,
CreateNetworkTxFee: constants.Lux,
CreateChainTxFee: constants.Lux,
TxFee: constants.MilliLux,
CreateAssetTxFee: constants.MilliLux,
CreateNetworkTxFee: constants.Lux,
CreateChainTxFee: constants.Lux,
AddNetworkValidatorFee: 0,
AddNetworkDelegatorFee: 0,
}
+1 -1
View File
@@ -17,8 +17,8 @@ import (
"github.com/luxfi/protocol/p/txs"
"github.com/luxfi/upgrade/upgradetest"
lux "github.com/luxfi/utxo"
"github.com/luxfi/vm/chains/atomic"
"github.com/luxfi/utxo/secp256k1fx"
"github.com/luxfi/vm/chains/atomic"
)
func TestAtomicTxImports(t *testing.T) {
+1 -1
View File
@@ -9,8 +9,8 @@ import (
"github.com/luxfi/codec"
"github.com/luxfi/codec/linearcodec"
"github.com/luxfi/protocol/p/txs"
"github.com/luxfi/codec/wrappers"
"github.com/luxfi/protocol/p/txs"
)
const CodecVersion = txs.CodecVersion
+1 -1
View File
@@ -7,9 +7,9 @@ import (
"context"
"time"
"github.com/luxfi/runtime"
"github.com/luxfi/ids"
"github.com/luxfi/protocol/p/txs"
"github.com/luxfi/runtime"
)
var (
+6 -6
View File
@@ -95,8 +95,8 @@ func (a *acceptor) ApricotAtomicBlock(b *block.ApricotAtomicBlock) error {
// Note that this method writes [batch] to the database.
// Apply atomic requests via SharedMemory from context
if a.ctx.SharedMemory != nil {
sharedMemory := a.ctx.SharedMemory.(atomic.SharedMemory)
if a.rt.SharedMemory != nil {
sharedMemory := a.rt.SharedMemory.(atomic.SharedMemory)
if err := sharedMemory.Apply(blkState.atomicRequests, batch); err != nil {
return fmt.Errorf(
"failed to atomically accept tx %s in block %s: %w",
@@ -177,8 +177,8 @@ func (a *acceptor) optionBlock(b block.Block, blockType string) error {
// Note that this method writes [batch] to the database.
// Apply atomic requests via SharedMemory from context
if a.ctx.SharedMemory != nil {
sharedMemory := a.ctx.SharedMemory.(atomic.SharedMemory)
if a.rt.SharedMemory != nil {
sharedMemory := a.rt.SharedMemory.(atomic.SharedMemory)
if err := sharedMemory.Apply(parentState.atomicRequests, batch); err != nil {
return fmt.Errorf("failed to apply vm's state to shared memory: %w", err)
}
@@ -265,8 +265,8 @@ func (a *acceptor) standardBlock(b block.Block, blockType string) error {
// Note that this method writes [batch] to the database.
// Apply atomic requests via SharedMemory from context
if a.ctx.SharedMemory != nil {
sharedMemory := a.ctx.SharedMemory.(atomic.SharedMemory)
if a.rt.SharedMemory != nil {
sharedMemory := a.rt.SharedMemory.(atomic.SharedMemory)
if err := sharedMemory.Apply(blkState.atomicRequests, batch); err != nil {
return fmt.Errorf("failed to apply vm's state to shared memory: %w", err)
}
+6 -6
View File
@@ -17,12 +17,12 @@ import (
"github.com/luxfi/protocol/p/block"
"github.com/luxfi/protocol/p/metrics"
"github.com/luxfi/protocol/p/state"
"github.com/luxfi/protocol/p/validators"
"github.com/luxfi/protocol/p/txs"
"github.com/luxfi/protocol/p/validators"
"github.com/luxfi/timer/mockable"
"github.com/luxfi/utxo/secp256k1fx"
"github.com/luxfi/vm/chains/atomic"
"github.com/luxfi/vm/components/verify"
"github.com/luxfi/utxo/secp256k1fx"
)
func TestAcceptorVisitProposalBlock(t *testing.T) {
@@ -119,7 +119,7 @@ func TestAcceptorVisitAtomicBlock(t *testing.T) {
lastAccepted: parentID,
blkIDToState: make(map[ids.ID]*blockState),
state: s,
rt: rt,
rt: rt,
},
metrics: metrics.Noop,
validators: validators.TestManager,
@@ -201,7 +201,7 @@ func TestAcceptorVisitStandardBlock(t *testing.T) {
lastAccepted: parentID,
blkIDToState: make(map[ids.ID]*blockState),
state: s,
rt: rt,
rt: rt,
},
metrics: metrics.Noop,
validators: validators.TestManager,
@@ -292,7 +292,7 @@ func TestAcceptorVisitCommitBlock(t *testing.T) {
lastAccepted: parentID,
blkIDToState: make(map[ids.ID]*blockState),
state: s,
rt: rt,
rt: rt,
},
metrics: metrics.Noop,
validators: validators.TestManager,
@@ -403,7 +403,7 @@ func TestAcceptorVisitAbortBlock(t *testing.T) {
lastAccepted: parentID,
blkIDToState: make(map[ids.ID]*blockState),
state: s,
rt: rt,
rt: rt,
},
metrics: metrics.Noop,
validators: validators.TestManager,
+1 -1
View File
@@ -8,13 +8,13 @@ import (
"sync"
"time"
"github.com/luxfi/runtime"
"github.com/luxfi/ids"
"github.com/luxfi/math/set"
"github.com/luxfi/protocol/p/block"
"github.com/luxfi/protocol/p/state"
"github.com/luxfi/protocol/p/txs"
"github.com/luxfi/protocol/txs/mempool"
"github.com/luxfi/runtime"
)
var errConflictingParentTxs = errors.New("block contains a transaction that conflicts with a transaction in a parent block")
+1 -1
View File
@@ -50,7 +50,7 @@ func (b *Block) VerifyWithContext(ctx context.Context, blockContext *block.Conte
if !warpAlreadyVerified && b.manager.txExecutorBackend.Bootstrapped.Get() {
err := VerifyWarpMessages(
ctx,
b.manager.ctx.NetworkID,
b.manager.rt.NetworkID,
b.manager.validatorManager,
blockContext.PChainHeight,
b,
+1 -1
View File
@@ -12,7 +12,6 @@ import (
"github.com/stretchr/testify/require"
consensustest "github.com/luxfi/consensus/test/helpers"
"github.com/luxfi/validators/uptime"
"github.com/luxfi/constants"
"github.com/luxfi/database"
"github.com/luxfi/ids"
@@ -24,6 +23,7 @@ import (
"github.com/luxfi/protocol/p/status"
"github.com/luxfi/protocol/p/txs"
"github.com/luxfi/protocol/p/txs/executor"
"github.com/luxfi/validators/uptime"
)
func TestBlockOptions(t *testing.T) {
+3 -3
View File
@@ -18,8 +18,6 @@ import (
"github.com/luxfi/codec"
"github.com/luxfi/codec/linearcodec"
consensustest "github.com/luxfi/consensus/test/helpers"
validators "github.com/luxfi/validators"
"github.com/luxfi/validators/uptime"
"github.com/luxfi/constants"
"github.com/luxfi/crypto/secp256k1"
"github.com/luxfi/database/memdb"
@@ -28,6 +26,7 @@ import (
"github.com/luxfi/ids"
log "github.com/luxfi/log"
"github.com/luxfi/math/set"
"github.com/luxfi/node/chains"
"github.com/luxfi/protocol/p/config"
"github.com/luxfi/protocol/p/fx"
"github.com/luxfi/protocol/p/genesis/genesistest"
@@ -41,7 +40,8 @@ import (
"github.com/luxfi/protocol/txs/mempool"
"github.com/luxfi/timer/mockable"
"github.com/luxfi/upgrade/upgradetest"
"github.com/luxfi/node/chains"
validators "github.com/luxfi/validators"
"github.com/luxfi/validators/uptime"
chainatomic "github.com/luxfi/vm/chains/atomic"
"github.com/luxfi/protocol/p/txs/txstest"
+3 -3
View File
@@ -15,10 +15,10 @@ import (
platformblock "github.com/luxfi/protocol/p/block"
"github.com/luxfi/protocol/p/metrics"
"github.com/luxfi/protocol/p/state"
"github.com/luxfi/protocol/p/validators"
"github.com/luxfi/protocol/p/txs"
"github.com/luxfi/protocol/p/txs/executor"
"github.com/luxfi/protocol/p/txs/fee"
"github.com/luxfi/protocol/p/validators"
"github.com/luxfi/protocol/txs/mempool"
)
@@ -63,7 +63,7 @@ func NewManager(
Mempool: mempool,
lastAccepted: lastAccepted,
state: s,
ctx: txExecutorBackend.Ctx,
rt: txExecutorBackend.Rt,
blkIDToState: map[ids.ID]*blockState{},
}
@@ -144,7 +144,7 @@ func (m *manager) VerifyTx(tx *txs.Tx) error {
}
err = executor.VerifyWarpMessages(
context.TODO(),
m.ctx.NetworkID,
m.rt.NetworkID,
m.validatorManager,
recommendedPChainHeight,
tx.Unsigned,
+1 -1
View File
@@ -7,7 +7,6 @@ import (
"errors"
"fmt"
"github.com/luxfi/validators/uptime"
"github.com/luxfi/constants"
log "github.com/luxfi/log"
"github.com/luxfi/protocol/p/block"
@@ -15,6 +14,7 @@ import (
"github.com/luxfi/protocol/p/state"
"github.com/luxfi/protocol/p/txs"
txexecutor "github.com/luxfi/protocol/p/txs/executor"
"github.com/luxfi/validators/uptime"
)
var (
+2 -2
View File
@@ -12,9 +12,9 @@ import (
"github.com/luxfi/mock/gomock"
"github.com/stretchr/testify/require"
"github.com/luxfi/runtime"
"github.com/luxfi/database"
"github.com/luxfi/ids"
"github.com/luxfi/runtime"
"github.com/luxfi/constants"
"github.com/luxfi/container/iterator"
@@ -32,9 +32,9 @@ import (
"github.com/luxfi/timer/mockable"
"github.com/luxfi/upgrade/upgradetest"
lux "github.com/luxfi/utxo"
"github.com/luxfi/utxo/secp256k1fx"
"github.com/luxfi/vm/chain"
"github.com/luxfi/vm/components/gas"
"github.com/luxfi/utxo/secp256k1fx"
walletcommon "github.com/luxfi/sdk/wallet/primary/common"
)
+2 -2
View File
@@ -13,15 +13,15 @@ import (
"github.com/luxfi/metric"
"github.com/stretchr/testify/require"
"github.com/luxfi/runtime"
"github.com/luxfi/ids"
"github.com/luxfi/protocol/p/block"
"github.com/luxfi/protocol/p/state"
"github.com/luxfi/protocol/p/testcontext"
"github.com/luxfi/protocol/p/txs"
"github.com/luxfi/protocol/txs/mempool"
"github.com/luxfi/vm/components/verify"
"github.com/luxfi/runtime"
"github.com/luxfi/utxo/secp256k1fx"
"github.com/luxfi/vm/components/verify"
)
func TestRejectBlock(t *testing.T) {
+1 -1
View File
@@ -25,8 +25,8 @@ import (
"github.com/luxfi/protocol/p/txs/executor"
"github.com/luxfi/upgrade/upgradetest"
lux "github.com/luxfi/utxo"
"github.com/luxfi/vm/components/gas"
"github.com/luxfi/utxo/secp256k1fx"
"github.com/luxfi/vm/components/gas"
)
func TestApricotStandardBlockTimeVerification(t *testing.T) {
+1 -1
View File
@@ -19,8 +19,8 @@ import (
txexecutor "github.com/luxfi/protocol/p/txs/executor"
"github.com/luxfi/vm/chains/atomic"
validatorfee "github.com/luxfi/protocol/p/validators/fee"
txfee "github.com/luxfi/protocol/p/txs/fee"
validatorfee "github.com/luxfi/protocol/p/validators/fee"
"github.com/luxfi/vm/components/gas"
)
+5 -5
View File
@@ -12,7 +12,6 @@ import (
"go.uber.org/mock/gomock"
"github.com/luxfi/atomic"
consensuscontext "github.com/luxfi/runtime"
consensustest "github.com/luxfi/consensus/test/helpers"
"github.com/luxfi/constants"
"github.com/luxfi/container/iterator"
@@ -38,14 +37,15 @@ import (
"github.com/luxfi/protocol/p/txs/txstest"
"github.com/luxfi/protocol/p/utxo"
"github.com/luxfi/protocol/txs/mempool"
consensuscontext "github.com/luxfi/runtime"
"github.com/luxfi/timer/mockable"
"github.com/luxfi/upgrade"
"github.com/luxfi/upgrade/upgradetest"
lux "github.com/luxfi/utxo"
"github.com/luxfi/utxo/secp256k1fx"
chainatomic "github.com/luxfi/vm/chains/atomic"
"github.com/luxfi/vm/components/gas"
"github.com/luxfi/vm/components/verify"
"github.com/luxfi/utxo/secp256k1fx"
txfee "github.com/luxfi/protocol/p/txs/fee"
validatorfee "github.com/luxfi/protocol/p/validators/fee"
@@ -98,7 +98,7 @@ func newTestVerifier(t testing.TB, c testVerifierConfig) *verifier {
lastAccepted: state.GetLastAccepted(),
blkIDToState: make(map[ids.ID]*blockState),
state: state,
rt: c.Context,
rt: c.Context,
},
txExecutorBackend: &executor.Backend{
Config: &config.Internal{
@@ -366,8 +366,8 @@ func TestVerifierVisitStandardBlock(t *testing.T) {
},
verifier.state,
secp256k1fx.NewKeychain(genesistest.DefaultFundedKeys[0]),
nil, // chainIDs
nil, // validationIDs
nil, // chainIDs
nil, // validationIDs
[]ids.ID{rt.XChainID}, // Read the UTXO to import
)
initialTimestamp = verifier.state.GetTimestamp()
+1 -1
View File
@@ -6,9 +6,9 @@ package executor
import (
"context"
validators "github.com/luxfi/validators"
"github.com/luxfi/protocol/p/block"
txexecutor "github.com/luxfi/protocol/p/txs/executor"
validators "github.com/luxfi/validators"
)
// VerifyWarpMessages verifies all warp messages in the block. If any of the
+1 -1
View File
@@ -12,9 +12,9 @@ package block
import (
reflect "reflect"
context "github.com/luxfi/runtime"
ids "github.com/luxfi/ids"
txs "github.com/luxfi/protocol/p/txs"
context "github.com/luxfi/runtime"
gomock "go.uber.org/mock/gomock"
)
+1 -1
View File
@@ -8,9 +8,9 @@ import (
"fmt"
"time"
"github.com/luxfi/runtime"
"github.com/luxfi/ids"
"github.com/luxfi/protocol/p/txs"
"github.com/luxfi/runtime"
)
var (
+1 -1
View File
@@ -8,9 +8,9 @@ import (
"fmt"
"time"
"github.com/luxfi/runtime"
"github.com/luxfi/ids"
"github.com/luxfi/protocol/p/txs"
"github.com/luxfi/runtime"
)
var (
+1 -1
View File
@@ -12,8 +12,8 @@ import (
"github.com/luxfi/ids"
"github.com/luxfi/protocol/p/txs"
lux "github.com/luxfi/utxo"
"github.com/luxfi/vm/components/verify"
"github.com/luxfi/utxo/secp256k1fx"
"github.com/luxfi/vm/components/verify"
)
func TestNewBanffStandardBlock(t *testing.T) {
+6 -6
View File
@@ -33,8 +33,8 @@ var Default = Config{
CreateAssetTxFee: constants.MilliLux,
CreateNetworkTxFee: constants.Lux,
CreateChainTxFee: constants.Lux,
AddNetworkValidatorFee: 0,
AddNetworkDelegatorFee: 0,
AddNetworkValidatorFee: 0,
AddNetworkDelegatorFee: 0,
}
// Config contains all of the user-configurable parameters of the PlatformVM.
@@ -59,10 +59,10 @@ type Config struct {
Chains chains.Manager `json:"-"`
// Transaction fees
TxFee uint64 `json:"tx-fee"`
CreateAssetTxFee uint64 `json:"create-asset-tx-fee"`
CreateNetworkTxFee uint64 `json:"create-network-tx-fee"`
CreateChainTxFee uint64 `json:"create-chain-tx-fee"`
TxFee uint64 `json:"tx-fee"`
CreateAssetTxFee uint64 `json:"create-asset-tx-fee"`
CreateNetworkTxFee uint64 `json:"create-network-tx-fee"`
CreateChainTxFee uint64 `json:"create-chain-tx-fee"`
AddNetworkValidatorFee uint64 `json:"add-primary-network-validator-fee"`
AddNetworkDelegatorFee uint64 `json:"add-primary-network-delegator-fee"`
}
+2 -2
View File
@@ -113,8 +113,8 @@ func TestConfigUnmarshal(t *testing.T) {
CreateAssetTxFee: 15,
CreateNetworkTxFee: 16,
CreateChainTxFee: 17,
AddNetworkValidatorFee: 18,
AddNetworkDelegatorFee: 19,
AddNetworkValidatorFee: 18,
AddNetworkDelegatorFee: 19,
}
verifyInitializedStruct(t, *expected)
verifyInitializedStruct(t, expected.Network)
+6 -6
View File
@@ -6,16 +6,16 @@ package config
import (
"time"
validators "github.com/luxfi/validators"
"github.com/luxfi/validators/uptime"
"github.com/luxfi/constants"
"github.com/luxfi/ids"
"github.com/luxfi/math/set"
"github.com/luxfi/protocol/p/reward"
"github.com/luxfi/protocol/p/validators/fee"
"github.com/luxfi/protocol/p/txs"
"github.com/luxfi/upgrade"
"github.com/luxfi/node/chains"
"github.com/luxfi/protocol/p/reward"
"github.com/luxfi/protocol/p/txs"
"github.com/luxfi/protocol/p/validators/fee"
"github.com/luxfi/upgrade"
validators "github.com/luxfi/validators"
"github.com/luxfi/validators/uptime"
"github.com/luxfi/vm/components/gas"
)
+1 -1
View File
@@ -4,8 +4,8 @@
package fx
import (
"github.com/luxfi/vm/components/verify"
"github.com/luxfi/utxo/secp256k1fx"
"github.com/luxfi/vm/components/verify"
)
var (
+1 -1
View File
@@ -9,10 +9,10 @@ import (
"github.com/luxfi/metric"
"github.com/luxfi/codec/wrappers"
"github.com/luxfi/ids"
utilmetric "github.com/luxfi/metric"
"github.com/luxfi/protocol/p/block"
"github.com/luxfi/codec/wrappers"
"github.com/luxfi/vm/components/gas"
)
+4 -4
View File
@@ -12,15 +12,15 @@ import (
"github.com/luxfi/metric"
"github.com/luxfi/cache"
validators "github.com/luxfi/validators"
"github.com/luxfi/ids"
"github.com/luxfi/protocol/p/config"
"github.com/luxfi/protocol/p/state"
"github.com/luxfi/protocol/p/warp"
"github.com/luxfi/p2p"
"github.com/luxfi/p2p/gossip"
"github.com/luxfi/protocol/p/config"
"github.com/luxfi/protocol/p/state"
"github.com/luxfi/protocol/p/txs"
"github.com/luxfi/protocol/p/warp"
"github.com/luxfi/protocol/txs/mempool"
validators "github.com/luxfi/validators"
extwarp "github.com/luxfi/warp"
)
+1 -1
View File
@@ -14,7 +14,6 @@ import (
"github.com/stretchr/testify/require"
consensustest "github.com/luxfi/consensus/test/helpers"
validators "github.com/luxfi/validators"
"github.com/luxfi/crypto/bls"
"github.com/luxfi/ids"
log "github.com/luxfi/log"
@@ -23,6 +22,7 @@ import (
"github.com/luxfi/protocol/p/txs"
"github.com/luxfi/protocol/txs/mempool"
lux "github.com/luxfi/utxo"
validators "github.com/luxfi/validators"
"github.com/luxfi/warp"
pmempool "github.com/luxfi/protocol/txs/mempool"
+2 -2
View File
@@ -13,11 +13,11 @@ import (
"github.com/luxfi/database"
"github.com/luxfi/ids"
"github.com/luxfi/node/proto/pb/platformvm"
"github.com/luxfi/p2p"
"github.com/luxfi/protocol/p/state"
"github.com/luxfi/protocol/p/warp/message"
"github.com/luxfi/protocol/p/warp/payload"
"github.com/luxfi/p2p"
"github.com/luxfi/node/proto/pb/platformvm"
"github.com/luxfi/warp"
)
+1 -1
View File
@@ -13,8 +13,8 @@ import (
"github.com/luxfi/timer/mockable"
"github.com/luxfi/vm/components/gas"
validatorfee "github.com/luxfi/protocol/p/validators/fee"
txfee "github.com/luxfi/protocol/p/txs/fee"
validatorfee "github.com/luxfi/protocol/p/validators/fee"
)
func NextBlockTime(
+1 -1
View File
@@ -20,8 +20,8 @@ import (
"github.com/luxfi/upgrade/upgradetest"
"github.com/luxfi/vm/components/gas"
validatorfee "github.com/luxfi/protocol/p/validators/fee"
txfee "github.com/luxfi/protocol/p/txs/fee"
validatorfee "github.com/luxfi/protocol/p/validators/fee"
)
func TestNextBlockTime(t *testing.T) {
+1 -1
View File
@@ -11,7 +11,6 @@ import (
"github.com/google/btree"
"github.com/luxfi/cache"
validators "github.com/luxfi/validators"
"github.com/luxfi/container/iterator"
"github.com/luxfi/container/maybe"
"github.com/luxfi/crypto/bls"
@@ -20,6 +19,7 @@ import (
"github.com/luxfi/math"
"github.com/luxfi/ordering"
"github.com/luxfi/protocol/p/block"
validators "github.com/luxfi/validators"
)
var (
+1 -1
View File
@@ -9,9 +9,9 @@ import (
"github.com/stretchr/testify/require"
"github.com/luxfi/codec"
"github.com/luxfi/codec/wrappers"
"github.com/luxfi/database/memdb"
"github.com/luxfi/ids"
"github.com/luxfi/codec/wrappers"
)
func TestParseDelegatorMetadata(t *testing.T) {
+1 -1
View File
@@ -7,11 +7,11 @@ import (
"time"
"github.com/luxfi/codec"
"github.com/luxfi/codec/wrappers"
"github.com/luxfi/constants"
"github.com/luxfi/database"
"github.com/luxfi/ids"
"github.com/luxfi/math/set"
"github.com/luxfi/codec/wrappers"
)
// preDelegateeRewardSize is the size of codec marshalling
+1 -1
View File
@@ -10,10 +10,10 @@ import (
"github.com/stretchr/testify/require"
"github.com/luxfi/codec"
"github.com/luxfi/codec/wrappers"
"github.com/luxfi/database"
"github.com/luxfi/database/memdb"
"github.com/luxfi/ids"
"github.com/luxfi/codec/wrappers"
)
func TestValidatorUptimes(t *testing.T) {
+1 -16
View File
@@ -15,7 +15,6 @@ import (
sync "sync"
time "time"
validators "github.com/luxfi/validators"
iterator "github.com/luxfi/container/iterator"
database "github.com/luxfi/database"
ids "github.com/luxfi/ids"
@@ -25,6 +24,7 @@ import (
status "github.com/luxfi/protocol/p/status"
txs "github.com/luxfi/protocol/p/txs"
lux "github.com/luxfi/utxo"
validators "github.com/luxfi/validators"
gas "github.com/luxfi/vm/components/gas"
gomock "go.uber.org/mock/gomock"
)
@@ -559,21 +559,6 @@ func (mr *MockStateMockRecorder) GetLastAccepted() *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetLastAccepted", reflect.TypeOf((*MockState)(nil).GetLastAccepted))
}
// GetChainIDs mocks base method.
func (m *MockState) GetChainIDs() ([]ids.ID, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetChainIDs")
ret0, _ := ret[0].([]ids.ID)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// GetChainIDs indicates an expected call of GetChainIDs.
func (mr *MockStateMockRecorder) GetChainIDs() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetChainIDs", reflect.TypeOf((*MockState)(nil).GetChainIDs))
}
// GetNetOwner mocks base method.
func (m *MockState) GetNetOwner(netID ids.ID) (fx.Owner, error) {
m.ctrl.T.Helper()
+12 -17
View File
@@ -22,9 +22,7 @@ import (
"github.com/luxfi/cache/lru"
"github.com/luxfi/cache/metercacher"
"github.com/luxfi/codec"
"github.com/luxfi/runtime"
validators "github.com/luxfi/validators"
"github.com/luxfi/validators/uptime"
"github.com/luxfi/codec/wrappers"
"github.com/luxfi/constants"
"github.com/luxfi/container/iterator"
"github.com/luxfi/container/maybe"
@@ -44,10 +42,12 @@ import (
"github.com/luxfi/protocol/p/reward"
"github.com/luxfi/protocol/p/status"
"github.com/luxfi/protocol/p/txs"
"github.com/luxfi/runtime"
"github.com/luxfi/timer"
"github.com/luxfi/upgrade"
"github.com/luxfi/codec/wrappers"
lux "github.com/luxfi/utxo"
validators "github.com/luxfi/validators"
"github.com/luxfi/validators/uptime"
"github.com/luxfi/vm/components/gas"
safemath "github.com/luxfi/math"
@@ -180,7 +180,6 @@ type State interface {
GetRewardUTXOs(txID ids.ID) ([]*lux.UTXO, error)
GetChainIDs() ([]ids.ID, error)
GetChainIDs() ([]ids.ID, error)
GetChains(netID ids.ID) ([]*txs.Tx, error)
// ApplyValidatorWeightDiffs iterates from [startHeight] towards the genesis
@@ -363,7 +362,7 @@ type state struct {
validatorState
validators validators.Manager
ctx *runtime.Runtime
runtime *runtime.Runtime
upgrades upgrade.Config
metrics metrics.Metrics
rewards reward.Calculator
@@ -768,7 +767,7 @@ func New(
validatorState: newValidatorState(),
validators: validators,
ctx: ctx,
runtime: rt,
upgrades: upgrades,
metrics: metrics,
rewards: rewards,
@@ -915,7 +914,7 @@ func (s *state) GetCurrentValidators(ctx context.Context, chainID ids.ID) ([]*St
defer validationIDIter.Release()
for validationIDIter.Next() {
if err := rt.Err(); err != nil {
if err := ctx.Err(); err != nil {
return nil, nil, 0, err
}
@@ -1101,10 +1100,6 @@ func (s *state) GetChainIDs() ([]ids.ID, error) {
return chainIDs, nil
}
func (s *state) GetChainIDs() ([]ids.ID, error) {
return s.GetChainIDs()
}
func (s *state) AddNet(chainID ids.ID) {
s.addedChainIDs = append(s.addedChainIDs, chainID)
if s.cachedChainIDs != nil {
@@ -1521,7 +1516,7 @@ func (s *state) ApplyValidatorWeightDiffs(
prevHeight := startHeight + 1
for diffIter.Next() {
if err := rt.Err(); err != nil {
if err := ctx.Err(); err != nil {
return err
}
@@ -1624,7 +1619,7 @@ func (s *state) ApplyValidatorPublicKeyDiffs(
defer diffIter.Release()
for diffIter.Next() {
if err := rt.Err(); err != nil {
if err := ctx.Err(); err != nil {
return err
}
@@ -1734,7 +1729,7 @@ func (s *state) syncGenesis(genesisBlk block.Block, genesis *genesis.Genesis) er
// Ensure all chains that the genesis bytes say to create have the right
// network ID
networkID := s.rt.NetworkID
networkID := s.runtime.NetworkID
if false && unsignedChain.NetworkID != networkID { // Temporarily disabled for genesis compatibility
return lux.ErrWrongNetworkID
}
@@ -2240,7 +2235,7 @@ func (s *state) initValidatorSets() error {
}
}
s.metrics.SetLocalStake(s.validators.GetWeight(constants.PrimaryNetworkID, s.rt.NodeID))
s.metrics.SetLocalStake(s.validators.GetWeight(constants.PrimaryNetworkID, s.runtime.NodeID))
totalWeight, err := s.validators.TotalWeight(constants.PrimaryNetworkID)
if err != nil {
return fmt.Errorf("failed to get total weight of primary network validators: %w", err)
@@ -2662,7 +2657,7 @@ func (s *state) updateValidatorManager(updateValidators bool) error {
return fmt.Errorf("failed to get total weight of primary network: %w", err)
}
s.metrics.SetLocalStake(s.validators.GetWeight(constants.PrimaryNetworkID, s.rt.NodeID))
s.metrics.SetLocalStake(s.validators.GetWeight(constants.PrimaryNetworkID, s.runtime.NodeID))
s.metrics.SetTotalStake(totalWeight)
return nil
}
+2 -2
View File
@@ -20,9 +20,7 @@ import (
"github.com/luxfi/metric"
"github.com/luxfi/codec"
"github.com/luxfi/runtime"
"github.com/luxfi/consensus/core/choices"
validators "github.com/luxfi/validators"
"github.com/luxfi/constants"
"github.com/luxfi/container/iterator"
"github.com/luxfi/crypto"
@@ -34,7 +32,9 @@ import (
log "github.com/luxfi/log"
"github.com/luxfi/math/set"
"github.com/luxfi/ordering"
"github.com/luxfi/runtime"
"github.com/luxfi/upgrade/upgradetest"
validators "github.com/luxfi/validators"
"github.com/luxfi/codec/wrappers"
+2 -2
View File
@@ -10,8 +10,6 @@ import (
"github.com/luxfi/metric"
"github.com/stretchr/testify/require"
"github.com/luxfi/runtime"
validators "github.com/luxfi/validators"
"github.com/luxfi/constants"
"github.com/luxfi/database"
"github.com/luxfi/database/memdb"
@@ -22,8 +20,10 @@ import (
"github.com/luxfi/protocol/p/metrics"
"github.com/luxfi/protocol/p/reward"
"github.com/luxfi/protocol/p/state"
"github.com/luxfi/runtime"
"github.com/luxfi/upgrade"
"github.com/luxfi/upgrade/upgradetest"
validators "github.com/luxfi/validators"
)
var DefaultNodeID = ids.GenerateTestNodeID()
+1 -1
View File
@@ -8,9 +8,9 @@ import (
"context"
"sync"
consensuscontext "github.com/luxfi/runtime"
"github.com/luxfi/ids"
log "github.com/luxfi/log"
consensuscontext "github.com/luxfi/runtime"
"github.com/luxfi/vm/chains/atomic"
)
+1 -1
View File
@@ -9,11 +9,11 @@ import (
"github.com/stretchr/testify/require"
"github.com/luxfi/runtime"
"github.com/luxfi/constants"
"github.com/luxfi/crypto/secp256k1"
"github.com/luxfi/ids"
"github.com/luxfi/protocol/p/stakeable"
"github.com/luxfi/runtime"
"github.com/luxfi/timer/mockable"
lux "github.com/luxfi/utxo"
"github.com/luxfi/utxo/secp256k1fx"
@@ -12,11 +12,11 @@ import (
"github.com/luxfi/mock/gomock"
"github.com/stretchr/testify/require"
"github.com/luxfi/runtime"
"github.com/luxfi/constants"
"github.com/luxfi/ids"
"github.com/luxfi/protocol/p/fx/fxmock"
"github.com/luxfi/protocol/p/stakeable"
"github.com/luxfi/runtime"
lux "github.com/luxfi/utxo"
"github.com/luxfi/utxo/luxmock"
"github.com/luxfi/utxo/secp256k1fx"
@@ -11,7 +11,6 @@ import (
"github.com/luxfi/mock/gomock"
"github.com/stretchr/testify/require"
"github.com/luxfi/runtime"
"github.com/luxfi/constants"
"github.com/luxfi/crypto/bls/signer/localsigner"
"github.com/luxfi/ids"
@@ -19,6 +18,7 @@ import (
"github.com/luxfi/protocol/p/reward"
"github.com/luxfi/protocol/p/signer"
"github.com/luxfi/protocol/p/stakeable"
"github.com/luxfi/runtime"
lux "github.com/luxfi/utxo"
"github.com/luxfi/utxo/luxmock"
"github.com/luxfi/utxo/secp256k1fx"
+1 -1
View File
@@ -9,12 +9,12 @@ import (
"github.com/stretchr/testify/require"
"github.com/luxfi/runtime"
"github.com/luxfi/constants"
"github.com/luxfi/crypto/secp256k1"
"github.com/luxfi/ids"
"github.com/luxfi/protocol/p/reward"
"github.com/luxfi/protocol/p/stakeable"
"github.com/luxfi/runtime"
"github.com/luxfi/timer/mockable"
lux "github.com/luxfi/utxo"
"github.com/luxfi/utxo/secp256k1fx"
+3 -3
View File
@@ -9,7 +9,6 @@ import (
"slices"
"time"
"github.com/luxfi/runtime"
"github.com/luxfi/crypto/secp256k1"
"github.com/luxfi/ids"
"github.com/luxfi/math"
@@ -18,6 +17,7 @@ import (
"github.com/luxfi/protocol/p/state"
"github.com/luxfi/protocol/p/txs"
"github.com/luxfi/protocol/p/utxo"
"github.com/luxfi/runtime"
"github.com/luxfi/timer/mockable"
lux "github.com/luxfi/utxo"
"github.com/luxfi/utxo/secp256k1fx"
@@ -212,7 +212,7 @@ func New(
Spender: utxoSpender,
state: state,
cfg: cfg,
rt: rt,
rt: rt,
NetworkID: rt.NetworkID,
ChainID: rt.ChainID,
XAssetID: rt.XAssetID,
@@ -227,7 +227,7 @@ type builder struct {
state state.State
cfg *config.Config
rt *runtime.Runtime
rt *runtime.Runtime
NetworkID uint32
ChainID ids.ID
XAssetID ids.ID
+1 -1
View File
@@ -9,9 +9,9 @@ import (
"github.com/luxfi/codec"
"github.com/luxfi/codec/linearcodec"
"github.com/luxfi/codec/wrappers"
"github.com/luxfi/protocol/p/signer"
"github.com/luxfi/protocol/p/stakeable"
"github.com/luxfi/codec/wrappers"
"github.com/luxfi/utxo/secp256k1fx"
)
+1 -1
View File
@@ -561,7 +561,7 @@ func TestConvertChainToL1TxSyntacticVerify(t *testing.T) {
require.NoError(t, err)
var (
rt = consensustest.Runtime(t, ids.GenerateTestID())
rt = consensustest.Runtime(t, ids.GenerateTestID())
validBaseTx = BaseTx{
BaseTx: lux.BaseTx{
NetworkID: rt.NetworkID,
+1 -1
View File
@@ -8,9 +8,9 @@ import (
"errors"
"unicode"
"github.com/luxfi/runtime"
"github.com/luxfi/constants"
"github.com/luxfi/ids"
"github.com/luxfi/runtime"
"github.com/luxfi/vm/components/verify"
)
+2 -2
View File
@@ -16,8 +16,8 @@ import (
"github.com/luxfi/ids"
"github.com/luxfi/protocol/p/stakeable"
lux "github.com/luxfi/utxo"
"github.com/luxfi/vm/components/verify"
"github.com/luxfi/utxo/secp256k1fx"
"github.com/luxfi/vm/components/verify"
"github.com/luxfi/vm/types"
)
@@ -318,7 +318,7 @@ func TestDisableL1ValidatorTxSerialization(t *testing.T) {
func TestDisableL1ValidatorTxSyntacticVerify(t *testing.T) {
var (
rt = consensustest.Runtime(t, ids.GenerateTestID())
rt = consensustest.Runtime(t, ids.GenerateTestID())
validBaseTx = BaseTx{
BaseTx: lux.BaseTx{
NetworkID: rt.NetworkID,
+3 -3
View File
@@ -5,20 +5,20 @@ package executor
import (
"github.com/luxfi/atomic"
"github.com/luxfi/runtime"
"github.com/luxfi/validators/uptime"
"github.com/luxfi/ids"
log "github.com/luxfi/log"
"github.com/luxfi/protocol/p/config"
"github.com/luxfi/protocol/p/fx"
"github.com/luxfi/protocol/p/reward"
"github.com/luxfi/protocol/p/utxo"
"github.com/luxfi/runtime"
"github.com/luxfi/timer/mockable"
"github.com/luxfi/validators/uptime"
)
type Backend struct {
Config *config.Internal
Ctx *runtime.Runtime
Rt *runtime.Runtime
Clk *mockable.Clock
Fx fx.Fx
FlowChecker utxo.Verifier
+4 -4
View File
@@ -14,15 +14,15 @@ import (
"github.com/luxfi/codec"
"github.com/luxfi/codec/linearcodec"
consensuscontext "github.com/luxfi/runtime"
validators "github.com/luxfi/validators"
consensusuptime "github.com/luxfi/validators/uptime"
"github.com/luxfi/database/memdb"
"github.com/luxfi/database/versiondb"
"github.com/luxfi/ids"
"github.com/luxfi/math/set"
"github.com/luxfi/upgrade/upgradetest"
"github.com/luxfi/node/chains"
consensuscontext "github.com/luxfi/runtime"
"github.com/luxfi/upgrade/upgradetest"
validators "github.com/luxfi/validators"
consensusuptime "github.com/luxfi/validators/uptime"
chainatomic "github.com/luxfi/vm/chains/atomic"
"github.com/luxfi/atomic"
+1 -1
View File
@@ -18,8 +18,8 @@ import (
"github.com/luxfi/sdk/wallet/chain/p/builder"
"github.com/luxfi/upgrade/upgradetest"
lux "github.com/luxfi/utxo"
"github.com/luxfi/vm/chains/atomic"
"github.com/luxfi/utxo/secp256k1fx"
"github.com/luxfi/vm/chains/atomic"
)
var fundedSharedMemoryCalls byte
+14 -14
View File
@@ -104,7 +104,7 @@ func verifyAddValidatorTx(
}
// Verify the tx is well-formed
if err := sTx.SyntacticVerify(backend.Ctx); err != nil {
if err := sTx.SyntacticVerify(backend.Rt); err != nil {
return nil, err
}
@@ -176,7 +176,7 @@ func verifyAddValidatorTx(
outs,
sTx.Creds,
map[ids.ID]uint64{
backend.Ctx.XAssetID: fee,
backend.Rt.XAssetID: fee,
},
); err != nil {
return nil, fmt.Errorf("%w: %w", ErrFlowCheckFailed, err)
@@ -195,7 +195,7 @@ func verifyAddChainValidatorTx(
tx *txs.AddChainValidatorTx,
) error {
// Verify the tx is well-formed
if err := sTx.SyntacticVerify(backend.Ctx); err != nil {
if err := sTx.SyntacticVerify(backend.Rt); err != nil {
return err
}
@@ -269,7 +269,7 @@ func verifyAddChainValidatorTx(
tx.Outs,
baseTxCreds,
map[ids.ID]uint64{
backend.Ctx.XAssetID: fee,
backend.Rt.XAssetID: fee,
},
); err != nil {
return fmt.Errorf("%w: %w", ErrFlowCheckFailed, err)
@@ -294,7 +294,7 @@ func verifyRemoveChainValidatorTx(
tx *txs.RemoveChainValidatorTx,
) (*state.Staker, bool, error) {
// Verify the tx is well-formed
if err := sTx.SyntacticVerify(backend.Ctx); err != nil {
if err := sTx.SyntacticVerify(backend.Rt); err != nil {
return nil, false, err
}
@@ -349,7 +349,7 @@ func verifyRemoveChainValidatorTx(
tx.Outs,
baseTxCreds,
map[ids.ID]uint64{
backend.Ctx.XAssetID: fee,
backend.Rt.XAssetID: fee,
},
); err != nil {
return nil, false, fmt.Errorf("%w: %w", ErrFlowCheckFailed, err)
@@ -377,7 +377,7 @@ func verifyAddDelegatorTx(
}
// Verify the tx is well-formed
if err := sTx.SyntacticVerify(backend.Ctx); err != nil {
if err := sTx.SyntacticVerify(backend.Rt); err != nil {
return nil, err
}
@@ -469,7 +469,7 @@ func verifyAddDelegatorTx(
outs,
sTx.Creds,
map[ids.ID]uint64{
backend.Ctx.XAssetID: fee,
backend.Rt.XAssetID: fee,
},
); err != nil {
return nil, fmt.Errorf("%w: %w", ErrFlowCheckFailed, err)
@@ -488,7 +488,7 @@ func verifyAddPermissionlessValidatorTx(
tx *txs.AddPermissionlessValidatorTx,
) error {
// Verify the tx is well-formed
if err := sTx.SyntacticVerify(backend.Ctx); err != nil {
if err := sTx.SyntacticVerify(backend.Rt); err != nil {
return err
}
@@ -591,7 +591,7 @@ func verifyAddPermissionlessValidatorTx(
outs,
sTx.Creds,
map[ids.ID]uint64{
backend.Ctx.XAssetID: fee,
backend.Rt.XAssetID: fee,
},
); err != nil {
return fmt.Errorf("%w: %w", ErrFlowCheckFailed, err)
@@ -610,7 +610,7 @@ func verifyAddPermissionlessDelegatorTx(
tx *txs.AddPermissionlessDelegatorTx,
) error {
// Verify the tx is well-formed
if err := sTx.SyntacticVerify(backend.Ctx); err != nil {
if err := sTx.SyntacticVerify(backend.Rt); err != nil {
return err
}
@@ -738,7 +738,7 @@ func verifyAddPermissionlessDelegatorTx(
outs,
sTx.Creds,
map[ids.ID]uint64{
backend.Ctx.XAssetID: fee,
backend.Rt.XAssetID: fee,
},
); err != nil {
return fmt.Errorf("%w: %w", ErrFlowCheckFailed, err)
@@ -768,7 +768,7 @@ func verifyTransferChainOwnershipTx(
}
// Verify the tx is well-formed
if err := sTx.SyntacticVerify(backend.Ctx); err != nil {
if err := sTx.SyntacticVerify(backend.Rt); err != nil {
return err
}
@@ -798,7 +798,7 @@ func verifyTransferChainOwnershipTx(
tx.Outs,
baseTxCreds,
map[ids.ID]uint64{
backend.Ctx.XAssetID: fee,
backend.Rt.XAssetID: fee,
},
); err != nil {
return fmt.Errorf("%w: %w", ErrFlowCheckFailed, err)
@@ -30,7 +30,7 @@ func getValidatorRules(
) (*addValidatorRules, error) {
if netID == constants.PrimaryNetworkID {
return &addValidatorRules{
assetID: backend.Ctx.XAssetID,
assetID: backend.Rt.XAssetID,
minValidatorStake: backend.Config.MinValidatorStake,
maxValidatorStake: backend.Config.MaxValidatorStake,
minStakeDuration: backend.Config.MinStakeDuration,
@@ -70,7 +70,7 @@ func getDelegatorRules(
) (*addDelegatorRules, error) {
if netID == constants.PrimaryNetworkID {
return &addDelegatorRules{
assetID: backend.Ctx.XAssetID,
assetID: backend.Rt.XAssetID,
minDelegatorStake: backend.Config.MinDelegatorStake,
maxValidatorStake: backend.Config.MaxValidatorStake,
minStakeDuration: backend.Config.MinStakeDuration,
@@ -22,8 +22,8 @@ import (
"github.com/luxfi/timer/mockable"
"github.com/luxfi/upgrade/upgradetest"
lux "github.com/luxfi/utxo"
"github.com/luxfi/vm/components/verify"
"github.com/luxfi/utxo/secp256k1fx"
"github.com/luxfi/vm/components/verify"
"github.com/stretchr/testify/require"
)
+31 -31
View File
@@ -24,9 +24,9 @@ import (
"github.com/luxfi/protocol/p/warp/message"
"github.com/luxfi/protocol/p/warp/payload"
lux "github.com/luxfi/utxo"
"github.com/luxfi/utxo/secp256k1fx"
chainatomic "github.com/luxfi/vm/chains/atomic"
"github.com/luxfi/vm/components/gas"
"github.com/luxfi/utxo/secp256k1fx"
)
// TODO: Before Etna, ensure that the maximum number of expiries to track is
@@ -134,7 +134,7 @@ func (e *standardTxExecutor) AddValidatorTx(tx *txs.AddValidatorTx) error {
lux.Consume(e.state, tx.Ins)
lux.Produce(e.state, txID, tx.Outs)
if e.backend.Config.PartialSyncPrimaryNetwork && tx.Validator.NodeID == e.backend.Ctx.NodeID {
if e.backend.Config.PartialSyncPrimaryNetwork && tx.Validator.NodeID == e.backend.Rt.NodeID {
e.backend.Log.Warn("verified transaction that would cause this node to become unhealthy",
log.String("reason", "primary network is not being fully synced"),
log.Stringer("txID", txID),
@@ -188,7 +188,7 @@ func (e *standardTxExecutor) AddDelegatorTx(tx *txs.AddDelegatorTx) error {
}
func (e *standardTxExecutor) CreateChainTx(tx *txs.CreateChainTx) error {
if err := e.tx.SyntacticVerify(e.backend.Ctx); err != nil {
if err := e.tx.SyntacticVerify(e.backend.Rt); err != nil {
return err
}
@@ -222,7 +222,7 @@ func (e *standardTxExecutor) CreateChainTx(tx *txs.CreateChainTx) error {
tx.Outs,
baseTxCreds,
map[ids.ID]uint64{
e.backend.Ctx.XAssetID: fee,
e.backend.Rt.XAssetID: fee,
},
); err != nil {
return err
@@ -247,7 +247,7 @@ func (e *standardTxExecutor) CreateChainTx(tx *txs.CreateChainTx) error {
func (e *standardTxExecutor) CreateNetworkTx(tx *txs.CreateNetworkTx) error {
// Make sure this transaction is well formed.
if err := e.tx.SyntacticVerify(e.backend.Ctx); err != nil {
if err := e.tx.SyntacticVerify(e.backend.Rt); err != nil {
return err
}
@@ -271,7 +271,7 @@ func (e *standardTxExecutor) CreateNetworkTx(tx *txs.CreateNetworkTx) error {
tx.Outs,
e.tx.Creds,
map[ids.ID]uint64{
e.backend.Ctx.XAssetID: fee,
e.backend.Rt.XAssetID: fee,
},
); err != nil {
return err
@@ -290,7 +290,7 @@ func (e *standardTxExecutor) CreateNetworkTx(tx *txs.CreateNetworkTx) error {
}
func (e *standardTxExecutor) ImportTx(tx *txs.ImportTx) error {
if err := e.tx.SyntacticVerify(e.backend.Ctx); err != nil {
if err := e.tx.SyntacticVerify(e.backend.Rt); err != nil {
return err
}
@@ -316,12 +316,12 @@ func (e *standardTxExecutor) ImportTx(tx *txs.ImportTx) error {
var allUTXOBytes [][]byte
if e.backend.Bootstrapped.Get() && !e.backend.Config.PartialSyncPrimaryNetwork {
// TODO: Restore SameNet check once ChainContext types are aligned
// if err := verify.SameNet(context.TODO(), e.backend.Ctx, tx.SourceChain); err != nil {
// if err := verify.SameNet(context.TODO(), e.backend.Rt, tx.SourceChain); err != nil {
// return err
// }
if e.backend.Ctx.SharedMemory != nil {
if sm, ok := e.backend.Ctx.SharedMemory.(chainatomic.SharedMemory); ok {
if e.backend.Rt.SharedMemory != nil {
if sm, ok := e.backend.Rt.SharedMemory.(chainatomic.SharedMemory); ok {
var err error
allUTXOBytes, err = sm.Get(tx.SourceChain, utxoIDs)
if err != nil {
@@ -362,7 +362,7 @@ func (e *standardTxExecutor) ImportTx(tx *txs.ImportTx) error {
tx.Outs,
e.tx.Creds,
map[ids.ID]uint64{
e.backend.Ctx.XAssetID: fee,
e.backend.Rt.XAssetID: fee,
},
); err != nil {
return err
@@ -388,7 +388,7 @@ func (e *standardTxExecutor) ImportTx(tx *txs.ImportTx) error {
}
func (e *standardTxExecutor) ExportTx(tx *txs.ExportTx) error {
if err := e.tx.SyntacticVerify(e.backend.Ctx); err != nil {
if err := e.tx.SyntacticVerify(e.backend.Rt); err != nil {
return err
}
@@ -406,7 +406,7 @@ func (e *standardTxExecutor) ExportTx(tx *txs.ExportTx) error {
if e.backend.Bootstrapped.Get() {
// TODO: Fix ChainContext type mismatch
// if err := verify.SameNet(context.TODO(), e.backend.Ctx, tx.DestinationChain); err != nil {
// if err := verify.SameNet(context.TODO(), e.backend.Rt, tx.DestinationChain); err != nil {
// return err
// }
}
@@ -423,7 +423,7 @@ func (e *standardTxExecutor) ExportTx(tx *txs.ExportTx) error {
outs,
e.tx.Creds,
map[ids.ID]uint64{
e.backend.Ctx.XAssetID: fee,
e.backend.Rt.XAssetID: fee,
},
); err != nil {
return fmt.Errorf("failed verifySpend: %w", err)
@@ -511,7 +511,7 @@ func (e *standardTxExecutor) TransformChainTx(tx *txs.TransformChainTx) error {
return errTransformChainTxPostEtna
}
if err := e.tx.SyntacticVerify(e.backend.Ctx); err != nil {
if err := e.tx.SyntacticVerify(e.backend.Rt); err != nil {
return err
}
@@ -547,7 +547,7 @@ func (e *standardTxExecutor) TransformChainTx(tx *txs.TransformChainTx) error {
// entry in this map literal from being overwritten by the
// second entry.
map[ids.ID]uint64{
e.backend.Ctx.XAssetID: fee,
e.backend.Rt.XAssetID: fee,
tx.AssetID: totalRewardAmount,
},
); err != nil {
@@ -587,7 +587,7 @@ func (e *standardTxExecutor) AddPermissionlessValidatorTx(tx *txs.AddPermissionl
if e.backend.Config.PartialSyncPrimaryNetwork &&
tx.Chain == constants.PrimaryNetworkID &&
tx.Validator.NodeID == e.backend.Ctx.NodeID {
tx.Validator.NodeID == e.backend.Rt.NodeID {
e.backend.Log.Warn("verified transaction that would cause this node to become unhealthy",
log.String("reason", "primary network is not being fully synced"),
log.Stringer("txID", txID),
@@ -654,7 +654,7 @@ func (e *standardTxExecutor) BaseTx(tx *txs.BaseTx) error {
}
// Verify the tx is well-formed
if err := e.tx.SyntacticVerify(e.backend.Ctx); err != nil {
if err := e.tx.SyntacticVerify(e.backend.Rt); err != nil {
return err
}
@@ -674,7 +674,7 @@ func (e *standardTxExecutor) BaseTx(tx *txs.BaseTx) error {
tx.Outs,
e.tx.Creds,
map[ids.ID]uint64{
e.backend.Ctx.XAssetID: fee,
e.backend.Rt.XAssetID: fee,
},
); err != nil {
return err
@@ -697,7 +697,7 @@ func (e *standardTxExecutor) ConvertChainToL1Tx(tx *txs.ConvertChainToL1Tx) erro
return errEtnaUpgradeNotActive
}
if err := e.tx.SyntacticVerify(e.backend.Ctx); err != nil {
if err := e.tx.SyntacticVerify(e.backend.Rt); err != nil {
return err
}
@@ -787,7 +787,7 @@ func (e *standardTxExecutor) ConvertChainToL1Tx(tx *txs.ConvertChainToL1Tx) erro
tx.Outs,
baseTxCreds,
map[ids.ID]uint64{
e.backend.Ctx.XAssetID: fee,
e.backend.Rt.XAssetID: fee,
},
); err != nil {
return err
@@ -825,7 +825,7 @@ func (e *standardTxExecutor) RegisterL1ValidatorTx(tx *txs.RegisterL1ValidatorTx
return errEtnaUpgradeNotActive
}
if err := e.tx.SyntacticVerify(e.backend.Ctx); err != nil {
if err := e.tx.SyntacticVerify(e.backend.Rt); err != nil {
return err
}
@@ -850,7 +850,7 @@ func (e *standardTxExecutor) RegisterL1ValidatorTx(tx *txs.RegisterL1ValidatorTx
tx.Outs,
e.tx.Creds,
map[ids.ID]uint64{
e.backend.Ctx.XAssetID: fee,
e.backend.Rt.XAssetID: fee,
},
); err != nil {
return err
@@ -977,7 +977,7 @@ func (e *standardTxExecutor) SetL1ValidatorWeightTx(tx *txs.SetL1ValidatorWeight
return errEtnaUpgradeNotActive
}
if err := e.tx.SyntacticVerify(e.backend.Ctx); err != nil {
if err := e.tx.SyntacticVerify(e.backend.Rt); err != nil {
return err
}
@@ -998,7 +998,7 @@ func (e *standardTxExecutor) SetL1ValidatorWeightTx(tx *txs.SetL1ValidatorWeight
tx.Outs,
e.tx.Creds,
map[ids.ID]uint64{
e.backend.Ctx.XAssetID: fee,
e.backend.Rt.XAssetID: fee,
},
); err != nil {
return err
@@ -1072,7 +1072,7 @@ func (e *standardTxExecutor) SetL1ValidatorWeightTx(tx *txs.SetL1ValidatorWeight
OutputIndex: uint32(len(tx.Outs)),
},
Asset: lux.Asset{
ID: e.backend.Ctx.XAssetID,
ID: e.backend.Rt.XAssetID,
},
Out: &secp256k1fx.TransferOutput{
Amt: remainingBalance,
@@ -1113,7 +1113,7 @@ func (e *standardTxExecutor) IncreaseL1ValidatorBalanceTx(tx *txs.IncreaseL1Vali
return errEtnaUpgradeNotActive
}
if err := e.tx.SyntacticVerify(e.backend.Ctx); err != nil {
if err := e.tx.SyntacticVerify(e.backend.Rt); err != nil {
return err
}
@@ -1139,7 +1139,7 @@ func (e *standardTxExecutor) IncreaseL1ValidatorBalanceTx(tx *txs.IncreaseL1Vali
tx.Outs,
e.tx.Creds,
map[ids.ID]uint64{
e.backend.Ctx.XAssetID: fee,
e.backend.Rt.XAssetID: fee,
},
); err != nil {
return err
@@ -1185,7 +1185,7 @@ func (e *standardTxExecutor) DisableL1ValidatorTx(tx *txs.DisableL1ValidatorTx)
return errEtnaUpgradeNotActive
}
if err := e.tx.SyntacticVerify(e.backend.Ctx); err != nil {
if err := e.tx.SyntacticVerify(e.backend.Rt); err != nil {
return err
}
@@ -1229,7 +1229,7 @@ func (e *standardTxExecutor) DisableL1ValidatorTx(tx *txs.DisableL1ValidatorTx)
tx.Outs,
baseTxCreds,
map[ids.ID]uint64{
e.backend.Ctx.XAssetID: fee,
e.backend.Rt.XAssetID: fee,
},
); err != nil {
return err
@@ -1267,7 +1267,7 @@ func (e *standardTxExecutor) DisableL1ValidatorTx(tx *txs.DisableL1ValidatorTx)
OutputIndex: uint32(len(tx.Outs)),
},
Asset: lux.Asset{
ID: e.backend.Ctx.XAssetID,
ID: e.backend.Rt.XAssetID,
},
Out: &secp256k1fx.TransferOutput{
Amt: remainingBalance,
+7 -7
View File
@@ -17,7 +17,6 @@ import (
"github.com/luxfi/atomic"
"github.com/luxfi/codec"
"github.com/luxfi/consensus"
"github.com/luxfi/runtime"
consensustest "github.com/luxfi/consensus/test/helpers"
"github.com/luxfi/constants"
"github.com/luxfi/crypto"
@@ -45,11 +44,12 @@ import (
"github.com/luxfi/protocol/p/warp"
"github.com/luxfi/protocol/p/warp/message"
"github.com/luxfi/protocol/p/warp/payload"
"github.com/luxfi/runtime"
"github.com/luxfi/sdk/wallet/primary/common"
"github.com/luxfi/upgrade/upgradetest"
lux "github.com/luxfi/utxo"
"github.com/luxfi/vm/components/verify"
"github.com/luxfi/utxo/secp256k1fx"
"github.com/luxfi/vm/components/verify"
safemath "github.com/luxfi/math"
txfee "github.com/luxfi/protocol/p/txs/fee"
@@ -2457,7 +2457,7 @@ func TestStandardExecutorConvertChainToL1Tx(t *testing.T) {
{
name: "tx fails syntactic verification",
updateExecutor: func(e *standardTxExecutor) error {
e.backend.Ctx = consensustest.Runtime(t, ids.GenerateTestID())
e.backend.Rt = consensustest.Runtime(t, ids.GenerateTestID())
return nil
},
expectedErr: lux.ErrWrongChainID,
@@ -2893,7 +2893,7 @@ func TestStandardExecutorRegisterL1ValidatorTx(t *testing.T) {
{
name: "tx fails syntactic verification",
updateExecutor: func(e *standardTxExecutor) error {
e.backend.Ctx = consensustest.Runtime(t, ids.GenerateTestID())
e.backend.Rt = consensustest.Runtime(t, ids.GenerateTestID())
return nil
},
expectedErr: lux.ErrWrongChainID,
@@ -3442,7 +3442,7 @@ func TestStandardExecutorSetL1ValidatorWeightTx(t *testing.T) {
{
name: "tx fails syntactic verification",
updateExecutor: func(e *standardTxExecutor) error {
e.backend.Ctx = consensustest.Runtime(t, ids.GenerateTestID())
e.backend.Rt = consensustest.Runtime(t, ids.GenerateTestID())
return nil
},
expectedErr: lux.ErrWrongChainID,
@@ -3897,7 +3897,7 @@ func TestStandardExecutorIncreaseL1ValidatorBalanceTx(t *testing.T) {
{
name: "tx fails syntactic verification",
updateExecutor: func(e *standardTxExecutor) error {
e.backend.Ctx = consensustest.Runtime(t, ids.GenerateTestID())
e.backend.Rt = consensustest.Runtime(t, ids.GenerateTestID())
return nil
},
expectedErr: lux.ErrWrongChainID,
@@ -4201,7 +4201,7 @@ func TestStandardExecutorDisableL1ValidatorTx(t *testing.T) {
{
name: "tx fails syntactic verification",
updateExecutor: func(e *standardTxExecutor) error {
e.backend.Ctx = consensustest.Runtime(t, ids.GenerateTestID())
e.backend.Rt = consensustest.Runtime(t, ids.GenerateTestID())
return nil
},
expectedErr: lux.ErrWrongChainID,
+1 -1
View File
@@ -13,8 +13,8 @@ import (
"github.com/luxfi/math"
"github.com/luxfi/protocol/p/reward"
"github.com/luxfi/protocol/p/state"
"github.com/luxfi/protocol/p/validators/fee"
"github.com/luxfi/protocol/p/txs"
"github.com/luxfi/protocol/p/validators/fee"
"github.com/luxfi/vm/components/gas"
)
+2 -2
View File
@@ -6,9 +6,9 @@ package executor
import (
"context"
validators "github.com/luxfi/validators"
"github.com/luxfi/protocol/p/warp"
"github.com/luxfi/protocol/p/txs"
"github.com/luxfi/protocol/p/warp"
validators "github.com/luxfi/validators"
)
const (
+3 -3
View File
@@ -10,15 +10,15 @@ import (
"github.com/stretchr/testify/require"
"github.com/luxfi/codec"
validators "github.com/luxfi/validators"
validatorstest "github.com/luxfi/validators/validatorstest"
"github.com/luxfi/constants"
"github.com/luxfi/crypto/bls"
"github.com/luxfi/crypto/bls/signer/localsigner"
"github.com/luxfi/ids"
"github.com/luxfi/math/set"
"github.com/luxfi/protocol/p/warp"
"github.com/luxfi/protocol/p/txs"
"github.com/luxfi/protocol/p/warp"
validators "github.com/luxfi/validators"
validatorstest "github.com/luxfi/validators/validatorstest"
)
func TestVerifyWarpMessages(t *testing.T) {
+3 -3
View File
@@ -9,6 +9,7 @@ import (
"errors"
"github.com/luxfi/codec"
"github.com/luxfi/codec/wrappers"
"github.com/luxfi/crypto/bls"
"github.com/luxfi/crypto/secp256k1"
"github.com/luxfi/ids"
@@ -16,13 +17,12 @@ import (
"github.com/luxfi/protocol/p/fx"
"github.com/luxfi/protocol/p/signer"
"github.com/luxfi/protocol/p/stakeable"
"github.com/luxfi/protocol/p/warp"
"github.com/luxfi/protocol/p/txs"
"github.com/luxfi/codec/wrappers"
"github.com/luxfi/protocol/p/warp"
lux "github.com/luxfi/utxo"
"github.com/luxfi/utxo/secp256k1fx"
"github.com/luxfi/vm/components/gas"
"github.com/luxfi/vm/components/verify"
"github.com/luxfi/utxo/secp256k1fx"
)
// Signature verification costs were conservatively based on benchmarks run on
+2 -2
View File
@@ -16,12 +16,12 @@ import (
"github.com/luxfi/protocol/p/fx"
"github.com/luxfi/protocol/p/signer"
"github.com/luxfi/protocol/p/stakeable"
"github.com/luxfi/protocol/p/warp/message"
"github.com/luxfi/protocol/p/txs"
"github.com/luxfi/protocol/p/warp/message"
lux "github.com/luxfi/utxo"
"github.com/luxfi/utxo/secp256k1fx"
"github.com/luxfi/vm/components/gas"
"github.com/luxfi/vm/components/verify"
"github.com/luxfi/utxo/secp256k1fx"
)
func TestTxComplexity_Individual(t *testing.T) {
@@ -312,7 +312,7 @@ func TestIncreaseL1ValidatorBalanceTxSerialization(t *testing.T) {
func TestIncreaseL1ValidatorBalanceTxSyntacticVerify(t *testing.T) {
var (
rt = consensustest.Runtime(t, ids.GenerateTestID())
rt = consensustest.Runtime(t, ids.GenerateTestID())
validBaseTx = BaseTx{
BaseTx: lux.BaseTx{
NetworkID: rt.NetworkID,
+1 -1
View File
@@ -7,9 +7,9 @@ import (
"context"
"errors"
"github.com/luxfi/runtime"
"github.com/luxfi/constants"
"github.com/luxfi/ids"
"github.com/luxfi/runtime"
"github.com/luxfi/vm/components/verify"
)
+1 -1
View File
@@ -17,8 +17,8 @@ import (
"github.com/luxfi/ids"
"github.com/luxfi/protocol/p/stakeable"
lux "github.com/luxfi/utxo"
"github.com/luxfi/vm/components/verify/verifymock"
"github.com/luxfi/utxo/secp256k1fx"
"github.com/luxfi/vm/components/verify/verifymock"
"github.com/luxfi/vm/types"
)
+1 -1
View File
@@ -13,8 +13,8 @@ import (
"github.com/luxfi/constants"
"github.com/luxfi/ids"
"github.com/luxfi/protocol/p/fx"
"github.com/luxfi/vm/components/verify"
"github.com/luxfi/utxo/secp256k1fx"
"github.com/luxfi/vm/components/verify"
)
var (
+1 -1
View File
@@ -17,8 +17,8 @@ import (
"github.com/luxfi/protocol/p/fx/fxmock"
"github.com/luxfi/protocol/p/stakeable"
lux "github.com/luxfi/utxo"
"github.com/luxfi/vm/components/verify/verifymock"
"github.com/luxfi/utxo/secp256k1fx"
"github.com/luxfi/vm/components/verify/verifymock"
"github.com/luxfi/vm/types"
)
+1 -1
View File
@@ -17,8 +17,8 @@ import (
"github.com/luxfi/protocol/p/reward"
"github.com/luxfi/protocol/p/stakeable"
lux "github.com/luxfi/utxo"
"github.com/luxfi/vm/components/verify/verifymock"
"github.com/luxfi/utxo/secp256k1fx"
"github.com/luxfi/vm/components/verify/verifymock"
"github.com/luxfi/vm/types"
)
+2 -2
View File
@@ -8,15 +8,15 @@ import (
"fmt"
"github.com/luxfi/codec"
"github.com/luxfi/runtime"
"github.com/luxfi/crypto/hash"
"github.com/luxfi/crypto/secp256k1"
"github.com/luxfi/ids"
"github.com/luxfi/math/set"
"github.com/luxfi/p2p/gossip"
"github.com/luxfi/runtime"
lux "github.com/luxfi/utxo"
"github.com/luxfi/vm/components/verify"
"github.com/luxfi/utxo/secp256k1fx"
"github.com/luxfi/vm/components/verify"
)
var (
+1 -1
View File
@@ -13,8 +13,8 @@ import (
"github.com/luxfi/crypto/secp256k1"
"github.com/luxfi/ids"
lux "github.com/luxfi/utxo"
"github.com/luxfi/vm/components/verify"
"github.com/luxfi/utxo/secp256k1fx"
"github.com/luxfi/vm/components/verify"
)
// FuzzTransactionParsing tests transaction parsing with random data
+1 -1
View File
@@ -12,10 +12,10 @@ package txsmock
import (
reflect "reflect"
"github.com/luxfi/runtime"
ids "github.com/luxfi/ids"
set "github.com/luxfi/math/set"
txs "github.com/luxfi/protocol/p/txs"
"github.com/luxfi/runtime"
lux "github.com/luxfi/utxo"
gomock "go.uber.org/mock/gomock"
)
+1 -1
View File
@@ -4,13 +4,13 @@
package txstest
import (
"github.com/luxfi/runtime"
"github.com/luxfi/crypto/secp256k1"
"github.com/luxfi/ids"
wkeychain "github.com/luxfi/keychain"
"github.com/luxfi/math/set"
"github.com/luxfi/protocol/p/config"
"github.com/luxfi/protocol/p/state"
"github.com/luxfi/runtime"
"github.com/luxfi/sdk/wallet/chain/p/builder"
"github.com/luxfi/sdk/wallet/chain/p/signer"
"github.com/luxfi/utxo/secp256k1fx"
+1 -1
View File
@@ -6,10 +6,10 @@ package txstest
import (
"time"
"github.com/luxfi/runtime"
"github.com/luxfi/ids"
"github.com/luxfi/protocol/p/config"
"github.com/luxfi/protocol/p/txs/fee"
"github.com/luxfi/runtime"
"github.com/luxfi/sdk/wallet/chain/p/builder"
"github.com/luxfi/vm/components/gas"
)
+2 -2
View File
@@ -9,14 +9,14 @@ import (
"github.com/stretchr/testify/require"
"github.com/luxfi/runtime"
"github.com/luxfi/constants"
"github.com/luxfi/ids"
"github.com/luxfi/protocol/p/config"
"github.com/luxfi/protocol/p/fx"
"github.com/luxfi/protocol/p/state"
"github.com/luxfi/protocol/p/warp/message"
"github.com/luxfi/protocol/p/txs"
"github.com/luxfi/protocol/p/warp/message"
"github.com/luxfi/runtime"
"github.com/luxfi/sdk/wallet/chain/p/builder"
"github.com/luxfi/sdk/wallet/chain/p/signer"
"github.com/luxfi/sdk/wallet/chain/p/wallet"
+1 -1
View File
@@ -4,9 +4,9 @@
package txs
import (
"github.com/luxfi/runtime"
"github.com/luxfi/ids"
"github.com/luxfi/math/set"
"github.com/luxfi/runtime"
lux "github.com/luxfi/utxo"
"github.com/luxfi/utxo/secp256k1fx"
)
+1 -1
View File
@@ -19,8 +19,8 @@ import (
"github.com/luxfi/protocol/p/txs"
"github.com/luxfi/timer/mockable"
lux "github.com/luxfi/utxo"
"github.com/luxfi/vm/components/verify"
"github.com/luxfi/utxo/secp256k1fx"
"github.com/luxfi/vm/components/verify"
)
var (
+1 -1
View File
@@ -17,8 +17,8 @@ import (
"github.com/luxfi/protocol/p/txs"
"github.com/luxfi/timer/mockable"
lux "github.com/luxfi/utxo"
"github.com/luxfi/vm/components/verify"
"github.com/luxfi/utxo/secp256k1fx"
"github.com/luxfi/vm/components/verify"
safemath "github.com/luxfi/math"
)
+1 -1
View File
@@ -7,8 +7,8 @@ import (
"context"
"sync"
validators "github.com/luxfi/validators"
"github.com/luxfi/ids"
validators "github.com/luxfi/validators"
)
// NewLockedState creates a new locked validator state
+8 -2
View File
@@ -12,7 +12,6 @@ import (
"github.com/luxfi/cache"
"github.com/luxfi/cache/lru"
validators "github.com/luxfi/validators"
"github.com/luxfi/constants"
"github.com/luxfi/container/window"
"github.com/luxfi/crypto/bls"
@@ -24,6 +23,7 @@ import (
"github.com/luxfi/protocol/p/status"
"github.com/luxfi/protocol/p/txs"
"github.com/luxfi/timer/mockable"
validators "github.com/luxfi/validators"
)
const (
@@ -374,7 +374,13 @@ func (m *manager) getCurrentValidatorSet(
return result, nil
}
func (m *manager) GetChainID(_ context.Context, chainID ids.ID) (ids.ID, error) {
func (m *manager) GetChainID(netID ids.ID) (ids.ID, error) {
// TODO: Implement proper network ID to chain ID lookup
// For now, return the same ID (most chains have same network and chain ID)
return netID, nil
}
func (m *manager) GetNetworkID(chainID ids.ID) (ids.ID, error) {
if chainID == constants.PlatformChainID {
return constants.PrimaryNetworkID, nil
}
+1 -1
View File
@@ -11,12 +11,12 @@ import (
"github.com/stretchr/testify/require"
validators "github.com/luxfi/validators"
"github.com/luxfi/constants"
"github.com/luxfi/crypto/bls/signer/localsigner"
"github.com/luxfi/database/badgerdb"
"github.com/luxfi/ids"
"github.com/luxfi/timer/mockable"
validators "github.com/luxfi/validators"
"github.com/luxfi/protocol/p/block"
+1 -1
View File
@@ -10,7 +10,6 @@ import (
"github.com/stretchr/testify/require"
validators "github.com/luxfi/validators"
"github.com/luxfi/constants"
"github.com/luxfi/crypto/bls"
"github.com/luxfi/crypto/bls/signer/localsigner"
@@ -23,6 +22,7 @@ import (
"github.com/luxfi/protocol/p/state/statetest"
"github.com/luxfi/timer/mockable"
"github.com/luxfi/upgrade/upgradetest"
validators "github.com/luxfi/validators"
. "github.com/luxfi/protocol/p/validators"
)
+6 -2
View File
@@ -7,8 +7,8 @@ import (
"context"
consensusset "github.com/luxfi/consensus/utils/set"
validators "github.com/luxfi/validators"
"github.com/luxfi/ids"
validators "github.com/luxfi/validators"
)
var TestManager Manager = testManager{}
@@ -23,7 +23,11 @@ func (testManager) GetCurrentHeight(context.Context) (uint64, error) {
return 0, nil
}
func (testManager) GetChainID(context.Context, ids.ID) (ids.ID, error) {
func (testManager) GetChainID(ids.ID) (ids.ID, error) {
return ids.Empty, nil
}
func (testManager) GetNetworkID(ids.ID) (ids.ID, error) {
return ids.Empty, nil
}
+6 -2
View File
@@ -8,8 +8,8 @@ import (
"github.com/luxfi/ids"
consensusvalidators "github.com/luxfi/validators"
vmvalidators "github.com/luxfi/protocol/p/validators"
consensusvalidators "github.com/luxfi/validators"
)
var Manager vmvalidators.Manager = manager{}
@@ -24,7 +24,11 @@ func (manager) GetCurrentHeight(context.Context) (uint64, error) {
return 0, nil
}
func (manager) GetChainID(context.Context, ids.ID) (ids.ID, error) {
func (manager) GetChainID(ids.ID) (ids.ID, error) {
return ids.Empty, nil
}
func (manager) GetNetworkID(ids.ID) (ids.ID, error) {
return ids.Empty, nil
}
+2
View File
@@ -1,3 +1,5 @@
//go:build grpc
// Copyright (C) 2019-2025, Lux Industries, Inc. All rights reserved.
// See the file LICENSE for licensing terms.
+2
View File
@@ -1,3 +1,5 @@
//go:build grpc
// Copyright (C) 2019-2025, Lux Industries, Inc. All rights reserved.
// See the file LICENSE for licensing terms.
+1 -1
View File
@@ -1,7 +1,7 @@
// Copyright (C) 2019-2025, Lux Industries, Inc. All rights reserved.
// See the file LICENSE for licensing terms.
//go:build test
//go:build grpc && test
package gwarp
+1 -1
View File
@@ -11,8 +11,8 @@ import (
"github.com/luxfi/crypto/bls"
"github.com/luxfi/crypto/hash"
"github.com/luxfi/ids"
"github.com/luxfi/vm/components/verify"
"github.com/luxfi/utxo/secp256k1fx"
"github.com/luxfi/vm/components/verify"
"github.com/luxfi/vm/types"
)
+2 -2
View File
@@ -11,12 +11,12 @@ import (
"github.com/stretchr/testify/require"
"go.uber.org/mock/gomock"
validators "github.com/luxfi/validators"
"github.com/luxfi/validators/validatorsmock"
"github.com/luxfi/constants"
"github.com/luxfi/crypto/bls"
"github.com/luxfi/ids"
"github.com/luxfi/math/set"
validators "github.com/luxfi/validators"
"github.com/luxfi/validators/validatorsmock"
)
var (
+2 -2
View File
@@ -13,8 +13,6 @@ import (
"github.com/stretchr/testify/require"
"go.uber.org/mock/gomock"
validators "github.com/luxfi/validators"
"github.com/luxfi/validators/validatorsmock"
"github.com/luxfi/constants"
"github.com/luxfi/crypto/bls"
"github.com/luxfi/crypto/bls/signer/localsigner"
@@ -22,6 +20,8 @@ import (
"github.com/luxfi/math/set"
"github.com/luxfi/metric"
"github.com/luxfi/upgrade"
validators "github.com/luxfi/validators"
"github.com/luxfi/validators/validatorsmock"
)
var (
+2 -2
View File
@@ -10,13 +10,13 @@ import (
"sync"
"github.com/luxfi/cache/lru"
"github.com/luxfi/concurrent/lock"
"github.com/luxfi/consensus/engine"
"github.com/luxfi/constants"
"github.com/luxfi/container/linked"
"github.com/luxfi/container/setmap"
"github.com/luxfi/ids"
"github.com/luxfi/math/set"
"github.com/luxfi/container/linked"
"github.com/luxfi/concurrent/lock"
)
const (
+1 -1
View File
@@ -6,10 +6,10 @@ package fxs
import (
"github.com/luxfi/ids"
lux "github.com/luxfi/utxo"
"github.com/luxfi/vm/components/verify"
"github.com/luxfi/utxo/nftfx"
"github.com/luxfi/utxo/propertyfx"
"github.com/luxfi/utxo/secp256k1fx"
"github.com/luxfi/vm/components/verify"
)
var (
+1 -1
View File
@@ -8,8 +8,8 @@ import (
lux "github.com/luxfi/utxo"
"github.com/luxfi/utxo/secp256k1fx"
"github.com/luxfi/runtime"
"github.com/luxfi/math/set"
"github.com/luxfi/runtime"
)
var (

Some files were not shown because too many files have changed in this diff Show More