From 1c265396e1a6acaad8956afef6ecdec300c81c2f Mon Sep 17 00:00:00 2001 From: Zach Kelling Date: Mon, 26 Jan 2026 09:10:39 -0800 Subject: [PATCH] fix: update dependencies and fix type errors - Fix ids.ToShortID multi-value error in mldsafx - Add runtime v1.0.1 dependency - Update transferables for consensus compatibility --- addresses.go | 16 +-- base_tx.go | 8 +- context.go | 2 +- go.mod | 49 ++----- go.sum | 126 +++++------------- luxmock/mock_transferable_in.go | 14 +- luxmock/mock_transferable_out.go | 14 +- mldsafx/credential.go | 214 +++++++++++++++++++++++++++++++ mldsafx/output_owners.go | 114 ++++++++++++++++ nftfx/mint_operation.go | 10 +- nftfx/transfer_operation.go | 10 +- propertyfx/burn_operation.go | 6 +- propertyfx/mint_operation.go | 12 +- propertyfx/mint_output.go | 6 +- secp256k1fx/mint_operation.go | 12 +- secp256k1fx/output_owners.go | 30 ++--- secp256k1fx/transfer_input.go | 4 +- secp256k1fx/transfer_output.go | 8 +- test_verifiable.go | 6 +- transferables.go | 8 +- 20 files changed, 456 insertions(+), 213 deletions(-) create mode 100644 mldsafx/credential.go create mode 100644 mldsafx/output_owners.go diff --git a/addresses.go b/addresses.go index 718a8c5..9dd210c 100644 --- a/addresses.go +++ b/addresses.go @@ -7,7 +7,7 @@ import ( "errors" "fmt" - "github.com/luxfi/consensus/runtime" + "github.com/luxfi/runtime" "github.com/luxfi/address" "github.com/luxfi/constants" @@ -45,12 +45,12 @@ type AddressManager interface { } type addressManager struct { - ctx *runtime.Runtime + rt *runtime.Runtime } -func NewAddressManager(ctx *runtime.Runtime) AddressManager { +func NewAddressManager(rt *runtime.Runtime) AddressManager { return &addressManager{ - ctx: ctx, + rt: rt, } } @@ -59,7 +59,7 @@ func (a *addressManager) ParseLocalAddress(addrStr string) (ids.ShortID, error) if err != nil { return ids.ShortID{}, err } - expectedChainID := a.ctx.ChainID + expectedChainID := a.rt.ChainID if chainID != expectedChainID { return ids.ShortID{}, fmt.Errorf( "%w: expected %q but got %q", @@ -83,7 +83,7 @@ func (a *addressManager) ParseAddress(addrStr string) (ids.ID, ids.ShortID, erro return ids.ID{}, ids.ShortID{}, fmt.Errorf("failed to parse chain ID %q: %w", chainIDAlias, err) } - networkID := a.ctx.NetworkID + networkID := a.rt.NetworkID expectedHRP := constants.GetHRP(networkID) if hrp != expectedHRP { return ids.Empty, ids.ShortID{}, fmt.Errorf( @@ -101,14 +101,14 @@ func (a *addressManager) ParseAddress(addrStr string) (ids.ID, ids.ShortID, erro } func (a *addressManager) FormatLocalAddress(addr ids.ShortID) (string, error) { - chainID := a.ctx.ChainID + chainID := a.rt.ChainID return a.FormatAddress(chainID, addr) } func (a *addressManager) FormatAddress(chainID ids.ID, addr ids.ShortID) (string, error) { // Use ChainID directly - consensus context doesn't have BCLookup chainIDAlias := chainID.String() - hrp := constants.GetHRP(a.ctx.NetworkID) + hrp := constants.GetHRP(a.rt.NetworkID) return address.Format(chainIDAlias, hrp, addr.Bytes()) } diff --git a/base_tx.go b/base_tx.go index c1a4fd3..25dcbaf 100644 --- a/base_tx.go +++ b/base_tx.go @@ -7,7 +7,7 @@ import ( "errors" "fmt" - "github.com/luxfi/consensus/runtime" + "github.com/luxfi/runtime" "github.com/luxfi/ids" "github.com/luxfi/vm/types" @@ -47,13 +47,13 @@ func (t *BaseTx) NumCredentials() int { } // Verify ensures that transaction metadata is valid -func (t *BaseTx) Verify(ctx *runtime.Runtime) error { +func (t *BaseTx) Verify(rt *runtime.Runtime) error { switch { case t == nil: return ErrNilTx - case t.NetworkID != ctx.NetworkID: + case t.NetworkID != rt.NetworkID: return ErrWrongNetworkID - case t.BlockchainID != ctx.ChainID: + case t.BlockchainID != rt.ChainID: return ErrWrongChainID case len(t.Memo) > MaxMemoSize: return fmt.Errorf( diff --git a/context.go b/context.go index f1931e9..c3b0284 100644 --- a/context.go +++ b/context.go @@ -7,5 +7,5 @@ import "context" // ContextInitializable can be initialized with a context type ContextInitializable interface { - InitCtx(context.Context) + InitRuntime(context.Context) } diff --git a/go.mod b/go.mod index 29c9ac6..4eb6cbd 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,6 @@ require ( github.com/luxfi/address v1.0.1 github.com/luxfi/cache v1.2.0 github.com/luxfi/codec v1.1.3 - github.com/luxfi/consensus v1.22.53 github.com/luxfi/constants v1.4.3 github.com/luxfi/crypto v1.17.39 github.com/luxfi/database v1.17.38 @@ -14,68 +13,48 @@ require ( github.com/luxfi/geth v1.16.69 github.com/luxfi/ids v1.2.9 github.com/luxfi/keychain v1.0.1 - github.com/luxfi/log v1.3.0 + github.com/luxfi/log v1.4.1 github.com/luxfi/math v1.2.3 - github.com/luxfi/metric v1.4.10 + github.com/luxfi/metric v1.4.11 + github.com/luxfi/runtime v1.0.1 github.com/luxfi/timer v1.0.1 - github.com/luxfi/utils v1.1.1 - github.com/luxfi/vm v1.0.16 + github.com/luxfi/utils v1.1.3 + github.com/luxfi/vm v1.0.20 github.com/stretchr/testify v1.11.1 go.uber.org/mock v0.6.0 ) require ( + github.com/Microsoft/go-winio v0.6.2 // indirect github.com/ProjectZKM/Ziren/crates/go-runtime/zkvm_runtime v0.0.0-20251230134950-44c893854e3f // indirect - github.com/beorn7/perks v1.0.1 // indirect github.com/btcsuite/btcd/btcutil v1.1.6 // indirect - github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/cloudflare/circl v1.6.2 // indirect 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/gorilla/rpc v1.2.1 // indirect - github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect github.com/holiman/uint256 v1.3.2 // indirect - github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/klauspost/compress v1.18.2 // indirect - github.com/kr/fs v0.1.0 // indirect github.com/luxfi/compress v0.0.2 // indirect github.com/luxfi/concurrent v0.0.2 // indirect - github.com/luxfi/container v0.0.2 // indirect + github.com/luxfi/consensus v1.22.56 // indirect + github.com/luxfi/container v0.0.4 // indirect github.com/luxfi/math/big v0.1.0 // indirect - github.com/luxfi/mock v0.1.0 // indirect - github.com/luxfi/rpc v1.0.0 // indirect + github.com/luxfi/mock v0.1.1 // indirect + github.com/luxfi/p2p v1.18.7 // indirect github.com/luxfi/sampler v1.0.0 // indirect - github.com/luxfi/sdk v1.16.42 // indirect - github.com/luxfi/tls v1.0.2 // indirect + github.com/luxfi/validators v1.0.0 // indirect + github.com/luxfi/version v1.0.1 // indirect + github.com/luxfi/warp v1.18.5 // indirect github.com/mattn/go-colorable v0.1.14 // indirect github.com/mattn/go-isatty v0.0.20 // indirect - github.com/melbahja/goph v1.4.0 // indirect github.com/mr-tron/base58 v1.2.0 // indirect - github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect - github.com/pkg/errors v0.9.1 // indirect - github.com/pkg/sftp v1.13.5 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect - github.com/posthog/posthog-go v1.8.2 // indirect - github.com/prometheus/client_golang v1.23.2 // indirect - github.com/prometheus/client_model v0.6.2 // indirect - github.com/prometheus/common v0.67.5 // indirect - github.com/prometheus/procfs v0.19.2 // indirect - github.com/spf13/cobra v1.10.2 // indirect - github.com/spf13/pflag v1.0.10 // indirect github.com/supranational/blst v0.3.16 // indirect - go.uber.org/multierr v1.11.0 // indirect - go.uber.org/zap v1.27.1 // 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/sys v0.39.0 // indirect gonum.org/v1/gonum v0.16.0 // indirect google.golang.org/protobuf v1.36.11 // indirect + gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) - -replace github.com/luxfi/log => ../log - -replace github.com/luxfi/consensus => ../consensus - -replace github.com/luxfi/api => ../api diff --git a/go.sum b/go.sum index 98d7a04..14122b6 100644 --- a/go.sum +++ b/go.sum @@ -1,8 +1,8 @@ +github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY= +github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU= github.com/ProjectZKM/Ziren/crates/go-runtime/zkvm_runtime v0.0.0-20251230134950-44c893854e3f h1:a5PUgHGinaD6XrLmIDLQmGHocjIjBsBAcR5gALjZvMU= github.com/ProjectZKM/Ziren/crates/go-runtime/zkvm_runtime v0.0.0-20251230134950-44c893854e3f/go.mod h1:ioLG6R+5bUSO1oeGSDxOV3FADARuMoytZCSX6MEMQkI= github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII= -github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= -github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/btcsuite/btcd v0.20.1-beta/go.mod h1:wVuoA8VJLEcwgqHBwHmzLRazpKxTv13Px/pDuV7OomQ= github.com/btcsuite/btcd v0.22.0-beta.0.20220111032746-97732e52810c/go.mod h1:tjmYdS6MLJ5/s0Fj4DbLgSbDHbEqLJrtnHecBFkdz5M= github.com/btcsuite/btcd v0.23.5-0.20231215221805-96c9fd8078fd/go.mod h1:nm3Bko6zh6bWP60UxwoT5LzdGJsQJaPo6HjduXq9p6A= @@ -26,11 +26,8 @@ github.com/btcsuite/snappy-go v0.0.0-20151229074030-0bdef8d06723/go.mod h1:8woku github.com/btcsuite/snappy-go v1.0.0/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc= github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792/go.mod h1:ghJtEyQwv5/p4Mg4C0fgbePVuGr935/5ddU9Z3TmDRY= github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs= -github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= -github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= 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/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g= github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -61,27 +58,19 @@ github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX github.com/gorilla/rpc v1.2.1 h1:yC+LMV5esttgpVvNORL/xX4jvTTEUE30UZhZ5JF7K9k= github.com/gorilla/rpc v1.2.1/go.mod h1:uNpOihAlF5xRFLuTYhfR0yfCTm0WTQSQttkMSptRfGk= github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k= -github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= 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= -github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= -github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jrick/logrotate v1.0.0/go.mod h1:LNinyqDIJnpAur+b8yyulnQw/wDuN1+BYKlTRt3OuAQ= 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/kr/fs v0.1.0 h1:Jskdu9ieNAYnjxsi0LbQp1ulIKZV1LAFgK1tWhpZgl8= -github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= 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= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/luxfi/address v1.0.1 h1:Sc4keyuVzBIvHr7uVeYZf2/WY9YDGUgDi/iiWenj49g= github.com/luxfi/address v1.0.1/go.mod h1:5j3Eh66v9zvv1GbNdZwt+23krV8JlSDaRzmWZU8ZRM0= github.com/luxfi/cache v1.2.0 h1:VEk/ue13oi8w3sKBB/Dsv9fnjmfdXgb0NMibcPLVbss= @@ -92,12 +81,12 @@ github.com/luxfi/compress v0.0.2 h1:tPZltN+efOjCvooVNJvNYHslVIm50BDD2ocKMk4chdA= github.com/luxfi/compress v0.0.2/go.mod h1:cfa7L3STdZdsMwJc9faZML1modLNh1n2u72n/DOfuNU= github.com/luxfi/concurrent v0.0.2 h1:DwGQEKOVenqf38t6BAKfoDsAqjiwrpSKm+h22CiT008= github.com/luxfi/concurrent v0.0.2/go.mod h1:SwEDrQXVAXgBiObXVg0pfmLzU1xsa9ZeBRptkBdyNUU= -github.com/luxfi/consensus v1.22.53 h1:iwrnImZJ7Ur6oV7rx0WSrR7n3X92pdnOX3mivCBCuZ4= -github.com/luxfi/consensus v1.22.53/go.mod h1:GicEGtNrPPG6063k/aRFusv87e17i0UwmgeY4D8Vn6s= +github.com/luxfi/consensus v1.22.56 h1:0rvotEBzN9OmMmKIfNqU/vVYyIoAMbxDR1Rr7ZRVgfo= +github.com/luxfi/consensus v1.22.56/go.mod h1:58WFlS5x0/qLxDevt6+Z9Z1zEmQG7KYv6Yfq00PWNys= github.com/luxfi/constants v1.4.3 h1:bcqUO8twMOhHWCgN/RbjfWulVPbvUQcxDkssaRrCx4g= github.com/luxfi/constants v1.4.3/go.mod h1:ENkJ121cmDEkwQPDiKK4QhnTnW9u37PGpepbrdVcAmc= -github.com/luxfi/container v0.0.2 h1:UNt3C5LGlkxU1OJeQUoxRA0AYO0tG35x1ieY9vHdon0= -github.com/luxfi/container v0.0.2/go.mod h1:nnK+TxHmGry0mGnfun4jx0tLqWJgV/GbZXTETMuFJn4= +github.com/luxfi/container v0.0.4 h1:BXhF82WyfqVP5mjlNcr7tP0Fcnvl0Ap1rkiu+rq5XuM= +github.com/luxfi/container v0.0.4/go.mod h1:Z3SpmMF5d4t77MM0nHYXURpn+EMVaeu1fhbd/3BGaek= github.com/luxfi/crypto v1.17.39 h1:dDmktYOD/sU6WjIpitIfuHp7mRbc3izOsyJrQ1c5eOQ= github.com/luxfi/crypto v1.17.39/go.mod h1:mChLWmW4CLR1wAN6CeJTveCzUv0DTzGQnYgq01x3W0U= github.com/luxfi/database v1.17.38 h1:HsjHoUyQI+vn61HNFyyWo/fw+wkd/I7E8LAdIvmN7BU= @@ -110,37 +99,40 @@ github.com/luxfi/ids v1.2.9 h1:+yjdhXW99drnd2Zlp1u/p8k3G23W3/1btJQ4ogHawUI= github.com/luxfi/ids v1.2.9/go.mod h1:khJOEdOPxd22yn0jcVrnbX1ADa0GHn5Y74gvCzN5BYc= github.com/luxfi/keychain v1.0.1 h1:8tTzPnZSi0M6UtKRBCypnGFrLNry9BvWfS5ol33yDF0= github.com/luxfi/keychain v1.0.1/go.mod h1:X7HLk5QRZ1VHJxovAyBL6z7f/nlosoXlveEtvUGhoaw= -github.com/luxfi/logger v1.3.0 h1:Bo0jw40+QTqSBttGCkWe94tVz405Oo5w8qPgCo6Qp1g= +github.com/luxfi/log v1.4.1 h1:rIfFRodb9jrD/w7KayaUk0Oc+37PaQQdKEEMJCjR8gw= +github.com/luxfi/log v1.4.1/go.mod h1:64IE3xRMJcpkQwnPUfJw3pDj7wU0kRS7BZ9wM7R72jk= github.com/luxfi/math v1.2.3 h1:BgvIFw/srPXFLbcqtoDhLJOfmBsn86GPA1iWgsoyUb4= github.com/luxfi/math v1.2.3/go.mod h1:C8STnF2H+D6rqBPt248CiWY2TGuJgdtv/+4UqrT15iM= github.com/luxfi/math/big v0.1.0 h1:Vz4c0RsZVPdIKPsHPgAJChH/R3p15WHRUz7LkLf+NIQ= github.com/luxfi/math/big v0.1.0/go.mod h1:BuxSu22RbO93xBLk5Eam5nldFponoJ73xDFz4uJ3Huk= -github.com/luxfi/metric v1.4.10 h1:uWeLupMLxK7YK1c99gY23cT+hornWg7OmZgHNK4HNbw= -github.com/luxfi/metric v1.4.10/go.mod h1:3OIQ+e6mciesm3cik3Q4CSOAvTlBy4JA0ZoKzCB9APo= -github.com/luxfi/mock v0.1.0 h1:IwElfNu+T9sXvzFX6tudPDx1vqPuACRSRdxpD5lxW+o= -github.com/luxfi/mock v0.1.0/go.mod h1:izF+9K0gGzFC9zERn6Po37v46eLdPB+EIsDjL3GLk+U= -github.com/luxfi/rpc v1.0.0 h1:G8o89gT+CT3SOj08A5FS5G92fovKrWxs941FmUz28CA= -github.com/luxfi/rpc v1.0.0/go.mod h1:dhxzM5rFqNpEOOHB7+8YBQ9d/V4haa6/id9AQTIIJvQ= +github.com/luxfi/metric v1.4.11 h1:XMkJSGasvZ4GMzW45m3utec3d0OhmxvF5xBwrkEYGak= +github.com/luxfi/metric v1.4.11/go.mod h1:EAFmkzd5EX654G48HXKIsyJufOUa4sxmOJKvwSRbjng= +github.com/luxfi/mock v0.1.1 h1:0HEtIjg1J6CWz+IUyP6rsGqNWTcmxjFnSQIhaDuARwY= +github.com/luxfi/mock v0.1.1/go.mod h1:jo35akl3Vtd8LbzDts8VJ0jmSVycrd1/eBi6g6t5hKU= +github.com/luxfi/p2p v1.18.7 h1:TIgSSoSdRa0g61CbvAFovWgb3OwWGfOTh4RWi8en/fw= +github.com/luxfi/p2p v1.18.7/go.mod h1:X829+oxzPyY2e5S9CyyMFiOtk6nyuNnxZSaSxGxrpKw= +github.com/luxfi/runtime v1.0.1 h1:cii3OsRiVSIl9jzfWFM6++62T1r6ZSGP+/3F0Ezhpqw= +github.com/luxfi/runtime v1.0.1/go.mod h1:2hBKjzbEeE4dzrhUKH8dqkRgLEyiXz6GmuVusy3vJMs= github.com/luxfi/sampler v1.0.0 h1:k8Sf6otW83w4pQp0jXLA+g3J/joB7w7SqXQsWmNTOV0= github.com/luxfi/sampler v1.0.0/go.mod h1:f96/ozlj9vFfZj+akLtrHn4VpulQahwB+MQQhpeIekk= -github.com/luxfi/sdk v1.16.42 h1:O4O6NNAc3YLX6Uojv2x7YUxU9Wa3cWrgth7baRy1iQU= -github.com/luxfi/sdk v1.16.42/go.mod h1:CecKZ5Ss+amSbl7/+rRNiUsK34E5xInDKXZVFd54UMM= github.com/luxfi/timer v1.0.1 h1:3lRf3j0L/fA3Ud0j67cm/BW2In1kz+jxd1HqgKyglYY= github.com/luxfi/timer v1.0.1/go.mod h1:PQ15H3AEUfvWVf0kv5WhIGPWmhr9BxBv/VKLyyekpk4= -github.com/luxfi/tls v1.0.2 h1:iWnoBVXmrvOu2Pzs16gMXfZQYpyOGVp92bEmMTW/NzM= -github.com/luxfi/tls v1.0.2/go.mod h1:t6Fr+KYKDZEz1KxciGHzRrj/KsQIx8V3iG/8YiSqpvU= -github.com/luxfi/utils v1.1.1 h1:pbzLLmwt+FPZX23sPur4FHfe0TodnGIj0FK7G/mIxf0= -github.com/luxfi/utils v1.1.1/go.mod h1:DL7634uXEcCu2tCBll0bmX0SVnMJeABbmhm5NkLMu78= -github.com/luxfi/vm v1.0.16 h1:IOTuMZUAKJ5i40GcWHs9FqhnC4Dd/j2Rq34kdPPYb1U= -github.com/luxfi/vm v1.0.16/go.mod h1:WVRRGWk2xbCDEMfsYmTrDIo839O1eIInlR8JT+BhZgo= +github.com/luxfi/utils v1.1.3 h1:yDEuuJ6bm9H8DzOzzveXI1AZlu/AeSpHNRrY1akbyc0= +github.com/luxfi/utils v1.1.3/go.mod h1:lskchZiYYRBFsSyYg3NWLPw211uRyxIs3/wAzrfSIAk= +github.com/luxfi/validators v1.0.0 h1:zE1HJM1lfvC+v1Lalg+MUgkKBGFWnwTfOOmXraiNnpE= +github.com/luxfi/validators v1.0.0/go.mod h1:QGppjtI/gqprbplWc10J+4OIK8UYWpv+53mfH2aKhy4= +github.com/luxfi/version v1.0.1 h1:T/1KYWEMmsrNQk7pN7PFPAwh/7XbeX7cFAKLBqI37Sk= +github.com/luxfi/version v1.0.1/go.mod h1:Y5fPkQ2DB0XRBCxgSPXp4ISzL1/jptKnmFknShRJCyg= +github.com/luxfi/vm v1.0.20 h1:zAaCyb0+Og/6YA5wgzHeBUe2jzhluIXS7deJ4a5e9Lc= +github.com/luxfi/vm v1.0.20/go.mod h1:plLVvTD/ym+RQCYZS91gWYghTu/IUIViLASREJhWnJY= +github.com/luxfi/warp v1.18.5 h1:yXFCT+lnvzJHs8nVvfUCQ9wNvhtgbDGaXJkJeiwgKf4= +github.com/luxfi/warp v1.18.5/go.mod h1:SFyC529HDvbP/TWRAdYQSyJUliMa5JKFRtBrTLEElp4= github.com/mattn/go-colorable v0.1.14 h1:9A9LHSqF/7dyVVX6g0U9cwm9pG3kP9gSzcuIPHPsaIE= +github.com/mattn/go-colorable v0.1.14/go.mod h1:6LmQG8QLFO4G5z1gPvYEzlUgJ2wF+stgPZH1UqBm1s8= github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= -github.com/melbahja/goph v1.4.0 h1:z0PgDbBFe66lRYl3v5dGb9aFgPy0kotuQ37QOwSQFqs= -github.com/melbahja/goph v1.4.0/go.mod h1:uG+VfK2Dlhk+O32zFrRlc3kYKTlV6+BtvPWd/kK7U68= +github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mr-tron/base58 v1.2.0 h1:T/HDJBh4ZCPbU39/+c3rRvE0uKBQlU27+QI8LJ4t64o= github.com/mr-tron/base58 v1.2.0/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc= -github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= -github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= @@ -150,31 +142,11 @@ github.com/onsi/gomega v1.4.1/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5 github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= 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/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= -github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/sftp v1.13.5 h1:a3RLUqkyjYRtBTZJZ1VRrKbN3zhuPLlUc3sphVz81go= -github.com/pkg/sftp v1.13.5/go.mod h1:wHDZ0IZX6JcBYRK1TH9bcVq8G7TLpVHYIGJRFnmPfxg= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/posthog/posthog-go v1.8.2 h1:v/ajsM8lq+2Z3OlQbTVWqiHI+hyh9Cd4uiQt1wFlehE= -github.com/posthog/posthog-go v1.8.2/go.mod h1:ueZiJCmHezyDHI/swIR1RmOfktLehnahJnFxEvQ9mnQ= -github.com/prometheus/client_golang v1.23.2 h1:Je96obch5RDVy3FDMndoUsjAhG5Edi49h0RJWRi/o0o= -github.com/prometheus/client_golang v1.23.2/go.mod h1:Tb1a6LWHB3/SPIzCoaDXI4I8UHKeFTEQ1YCr+0Gyqmg= -github.com/prometheus/client_model v0.6.2 h1:oBsgwpGs7iVziMvrGhE53c/GrLUsZdHnqNwqPLxwZyk= -github.com/prometheus/client_model v0.6.2/go.mod h1:y3m2F6Gdpfy6Ut/GBsUqTWZqCUvMVzSfMLjcu6wAwpE= -github.com/prometheus/common v0.67.5 h1:pIgK94WWlQt1WLwAC5j2ynLaBRDiinoAb86HZHTUGI4= -github.com/prometheus/common v0.67.5/go.mod h1:SjE/0MzDEEAyrdr5Gqc6G+sXI67maCxzaT3A2+HqjUw= -github.com/prometheus/procfs v0.19.2 h1:zUMhqEW66Ex7OXIiDkll3tl9a1ZdilUOd/F6ZXw4Vws= -github.com/prometheus/procfs v0.19.2/go.mod h1:M0aotyiemPhBCM0z5w87kL22CxfcH05ZpYlu+b4J7mw= github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ= github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc= -github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/spf13/cobra v1.10.2 h1:DMTTonx5m65Ic0GOoRY2c16WCbHxOOw6xxezuLaBpcU= -github.com/spf13/cobra v1.10.2/go.mod h1:7C1pvHqHw5A4vrJfjNwvOdzYu0Gml16OCs2GRiTUUS4= -github.com/spf13/pflag v1.0.9/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/spf13/pflag v1.0.10 h1:4EBh2KAYBwaONj6b2Ye1GiHfwjqyROoF4RwYO+vPwFk= -github.com/spf13/pflag v1.0.10/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= @@ -187,42 +159,21 @@ github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD github.com/supranational/blst v0.3.16 h1:bTDadT+3fK497EvLdWRQEjiGnUtzJ7jjIUMF0jqwYhE= github.com/supranational/blst v0.3.16/go.mod h1:jZJtfjgudtNl4en1tzwPIV3KjUnQUvG3/j+w+fVonLw= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc= -github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= -go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/mock v0.6.0 h1:hyF9dfmbgIX5EfOdasqLsWD6xqpNZlXblLB/Dbnwv3Y= go.uber.org/mock v0.6.0/go.mod h1:KiVJ4BqZJaMj4svdfmHM0AUx4NJYO8ZNpPnZn1Z+BBU= -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.1 h1:08RqriUEv8+ArZRYSTXy1LeBScaMpVSTBhCeaZYfMYc= -go.uber.org/zap v1.27.1/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= -go.yaml.in/yaml/v2 v2.4.3 h1:6gvOSjQoTB3vt1l+CU+tSyi/HOjfOjRLJ4YwYZGwRO0= -go.yaml.in/yaml/v2 v2.4.3/go.mod h1:zSxWcmIDjOzPXpjlTTbAsKokqkDNAVtZO0WOMiT90s8= -go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg= golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= 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.0.0-20211215153901-e495a2d5b3d3/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= 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/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= 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-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.19.0 h1:vV+1eWNmZ5geRlYjzm2adRgW2/mcpevXNg50YZtPCE4= golang.org/x/sync v0.19.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -234,30 +185,13 @@ golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200814200057-3d37ad5750ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -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.39.0 h1:CvCKL8MeisomCi6qNZ+wbb0DN9E5AATixKsvNtMoMFk= golang.org/x/sys v0.39.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/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= -golang.org/x/term v0.38.0 h1:PQ5pkm/rLO6HnxFR7N2lJHOZX6Kez5Y1gDSJla6jo7Q= -golang.org/x/term v0.38.0/go.mod h1:bSEAKrOT1W+VSu9TSCMtoGEOUcKxOKgl3LE5QEF/xVg= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= 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.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/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= gonum.org/v1/gonum v0.16.0 h1:5+ul4Swaf3ESvrOnidPp4GZbzf0mxVQpDCYUQE7OJfk= @@ -274,6 +208,8 @@ gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= +gopkg.in/natefinch/lumberjack.v2 v2.2.1 h1:bBRl1b0OH9s/DuPhuXpNl+VtCaJXFZ5/uEFST95x9zc= +gopkg.in/natefinch/lumberjack.v2 v2.2.1/go.mod h1:YD8tP3GAjkrDg1eZH7EGmyESg/lsYskCTPBJVb9jqSc= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/luxmock/mock_transferable_in.go b/luxmock/mock_transferable_in.go index 6653f81..b118655 100644 --- a/luxmock/mock_transferable_in.go +++ b/luxmock/mock_transferable_in.go @@ -17,7 +17,7 @@ import ( reflect "reflect" - "github.com/luxfi/consensus/runtime" + "github.com/luxfi/runtime" gomock "go.uber.org/mock/gomock" ) @@ -74,16 +74,16 @@ func (mr *MockTransferableInMockRecorder) Cost() *gomock.Call { return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Cost", reflect.TypeOf((*MockTransferableIn)(nil).Cost)) } -// InitCtx mocks base method. -func (m *MockTransferableIn) InitCtx(arg0 *runtime.Runtime) { +// InitRuntime mocks base method. +func (m *MockTransferableIn) InitRuntime(arg0 *runtime.Runtime) { m.ctrl.T.Helper() - m.ctrl.Call(m, "InitCtx", arg0) + m.ctrl.Call(m, "InitRuntime", arg0) } -// InitCtx indicates an expected call of InitCtx. -func (mr *MockTransferableInMockRecorder) InitCtx(arg0 any) *gomock.Call { +// InitRuntime indicates an expected call of InitRuntime. +func (mr *MockTransferableInMockRecorder) InitRuntime(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InitCtx", reflect.TypeOf((*MockTransferableIn)(nil).InitCtx), arg0) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InitRuntime", reflect.TypeOf((*MockTransferableIn)(nil).InitRuntime), arg0) } // Verify mocks base method. diff --git a/luxmock/mock_transferable_out.go b/luxmock/mock_transferable_out.go index 7b13ce8..1f4e510 100644 --- a/luxmock/mock_transferable_out.go +++ b/luxmock/mock_transferable_out.go @@ -16,7 +16,7 @@ import ( "context" "reflect" - "github.com/luxfi/consensus/runtime" + "github.com/luxfi/runtime" verify "github.com/luxfi/vm/components/verify" gomock "go.uber.org/mock/gomock" ) @@ -60,16 +60,16 @@ func (mr *MockTransferableOutMockRecorder) Amount() *gomock.Call { return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Amount", reflect.TypeOf((*MockTransferableOut)(nil).Amount)) } -// InitCtx mocks base method. -func (m *MockTransferableOut) InitCtx(arg0 *runtime.Runtime) { +// InitRuntime mocks base method. +func (m *MockTransferableOut) InitRuntime(arg0 *runtime.Runtime) { m.ctrl.T.Helper() - m.ctrl.Call(m, "InitCtx", arg0) + m.ctrl.Call(m, "InitRuntime", arg0) } -// InitCtx indicates an expected call of InitCtx. -func (mr *MockTransferableOutMockRecorder) InitCtx(arg0 any) *gomock.Call { +// InitRuntime indicates an expected call of InitRuntime. +func (mr *MockTransferableOutMockRecorder) InitRuntime(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InitCtx", reflect.TypeOf((*MockTransferableOut)(nil).InitCtx), arg0) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InitRuntime", reflect.TypeOf((*MockTransferableOut)(nil).InitRuntime), arg0) } // Verify mocks base method. diff --git a/mldsafx/credential.go b/mldsafx/credential.go new file mode 100644 index 0000000..d2cde87 --- /dev/null +++ b/mldsafx/credential.go @@ -0,0 +1,214 @@ +// Copyright (C) 2019-2025, Lux Industries, Inc. All rights reserved. +// See the file LICENSE for licensing terms. + +// Package mldsafx provides ML-DSA (Module-Lattice Digital Signature Algorithm) +// credentials for post-quantum secure UTXO spending on X-Chain. +// +// ML-DSA is a NIST FIPS 204 standardized signature scheme that provides +// security against both classical and quantum computer attacks. +// +// This package supports three security levels: +// - ML-DSA-44: 128-bit security (NIST Level 2), smallest signatures +// - ML-DSA-65: 192-bit security (NIST Level 3), balanced +// - ML-DSA-87: 256-bit security (NIST Level 5), highest security +// +// Usage: This credential type is OPTIONAL for X-Chain UTXOs. +// Consensus rules allow both secp256k1fx and mldsafx credentials. +// Wallets choose which signature type to use. Nodes validate both. +package mldsafx + +import ( + "encoding/json" + "errors" + "fmt" + + "github.com/luxfi/formatting" + "github.com/luxfi/ids" +) + +// Security level constants +const ( + // ML-DSA-44 (NIST Level 2, 128-bit security) + MLDSA44PubKeyLen = 1312 + MLDSA44SigLen = 2420 + + // ML-DSA-65 (NIST Level 3, 192-bit security) - DEFAULT + MLDSA65PubKeyLen = 1952 + MLDSA65SigLen = 3309 + + // ML-DSA-87 (NIST Level 5, 256-bit security) + MLDSA87PubKeyLen = 2592 + MLDSA87SigLen = 4627 +) + +// ID is the unique identifier for this Fx +var ID = ids.ID{'m', 'l', 'd', 's', 'a', 'f', 'x'} + +var ( + ErrNilCredential = errors.New("nil ML-DSA credential") + ErrInvalidSignature = errors.New("invalid ML-DSA signature") + ErrInvalidSecLevel = errors.New("invalid ML-DSA security level") + ErrSignatureTooShort = errors.New("ML-DSA signature too short") + ErrMismatchedSecLevel = errors.New("signature length doesn't match security level") +) + +// SecurityLevel indicates the ML-DSA parameter set +type SecurityLevel uint8 + +const ( + // SecLevelMLDSA44 is 128-bit security (smallest signatures) + SecLevelMLDSA44 SecurityLevel = iota + // SecLevelMLDSA65 is 192-bit security (recommended default) + SecLevelMLDSA65 + // SecLevelMLDSA87 is 256-bit security (highest security) + SecLevelMLDSA87 +) + +// SignatureLen returns the signature length for this security level +func (s SecurityLevel) SignatureLen() int { + switch s { + case SecLevelMLDSA44: + return MLDSA44SigLen + case SecLevelMLDSA65: + return MLDSA65SigLen + case SecLevelMLDSA87: + return MLDSA87SigLen + default: + return 0 + } +} + +// PubKeyLen returns the public key length for this security level +func (s SecurityLevel) PubKeyLen() int { + switch s { + case SecLevelMLDSA44: + return MLDSA44PubKeyLen + case SecLevelMLDSA65: + return MLDSA65PubKeyLen + case SecLevelMLDSA87: + return MLDSA87PubKeyLen + default: + return 0 + } +} + +// String returns the human-readable name +func (s SecurityLevel) String() string { + switch s { + case SecLevelMLDSA44: + return "ML-DSA-44" + case SecLevelMLDSA65: + return "ML-DSA-65" + case SecLevelMLDSA87: + return "ML-DSA-87" + default: + return "unknown" + } +} + +// Credential contains ML-DSA signatures for spending UTXOs. +// This is an OPTIONAL credential type - both secp256k1fx and mldsafx +// are valid for spending X-Chain UTXOs. +// +// Wire format: +// - SecurityLevel: 1 byte (0=44, 1=65, 2=87) +// - NumSigs: varint +// - Sigs: [][]byte (variable length based on security level) +type Credential struct { + // Level indicates the ML-DSA parameter set (44, 65, or 87) + Level SecurityLevel `serialize:"true" json:"securityLevel"` + // Sigs contains the ML-DSA signatures + // Length depends on Level: 2420 (44), 3309 (65), or 4627 (87) bytes each + Sigs [][]byte `serialize:"true" json:"signatures"` +} + +// Verify validates the credential structure (not the cryptographic validity). +// Cryptographic verification is done separately by the verifier. +func (cr *Credential) Verify() error { + if cr == nil { + return ErrNilCredential + } + + expectedLen := cr.Level.SignatureLen() + if expectedLen == 0 { + return ErrInvalidSecLevel + } + + for i, sig := range cr.Sigs { + if len(sig) != expectedLen { + return fmt.Errorf("%w: signature %d has length %d, expected %d for %s", + ErrMismatchedSecLevel, i, len(sig), expectedLen, cr.Level) + } + } + + return nil +} + +// MarshalJSON marshals the credential to JSON with hex-encoded signatures +func (cr *Credential) MarshalJSON() ([]byte, error) { + sigs := make([]string, len(cr.Sigs)) + for i, sig := range cr.Sigs { + sigStr, err := formatting.Encode(formatting.HexNC, sig) + if err != nil { + return nil, fmt.Errorf("couldn't encode signature %d: %w", i, err) + } + sigs[i] = sigStr + } + + return json.Marshal(map[string]interface{}{ + "securityLevel": cr.Level.String(), + "signatures": sigs, + }) +} + +// UnmarshalJSON unmarshals JSON into the credential +func (cr *Credential) UnmarshalJSON(b []byte) error { + var raw struct { + SecurityLevel string `json:"securityLevel"` + Signatures []string `json:"signatures"` + } + if err := json.Unmarshal(b, &raw); err != nil { + return err + } + + // Parse security level + switch raw.SecurityLevel { + case "ML-DSA-44", "44": + cr.Level = SecLevelMLDSA44 + case "ML-DSA-65", "65": + cr.Level = SecLevelMLDSA65 + case "ML-DSA-87", "87": + cr.Level = SecLevelMLDSA87 + default: + return fmt.Errorf("%w: %s", ErrInvalidSecLevel, raw.SecurityLevel) + } + + // Decode signatures + cr.Sigs = make([][]byte, len(raw.Signatures)) + for i, sigStr := range raw.Signatures { + sig, err := formatting.Decode(formatting.HexNC, sigStr) + if err != nil { + return fmt.Errorf("couldn't decode signature %d: %w", i, err) + } + cr.Sigs[i] = sig + } + + return nil +} + +// NewCredential creates a new ML-DSA credential at the specified security level +func NewCredential(level SecurityLevel, sigs [][]byte) (*Credential, error) { + cr := &Credential{ + Level: level, + Sigs: sigs, + } + if err := cr.Verify(); err != nil { + return nil, err + } + return cr, nil +} + +// NewCredential65 creates a credential using the recommended ML-DSA-65 level +func NewCredential65(sigs [][]byte) (*Credential, error) { + return NewCredential(SecLevelMLDSA65, sigs) +} diff --git a/mldsafx/output_owners.go b/mldsafx/output_owners.go new file mode 100644 index 0000000..b91abfe --- /dev/null +++ b/mldsafx/output_owners.go @@ -0,0 +1,114 @@ +// Copyright (C) 2019-2025, Lux Industries, Inc. All rights reserved. +// See the file LICENSE for licensing terms. + +package mldsafx + +import ( + "encoding/json" + "errors" + "fmt" + + "github.com/luxfi/formatting" + "github.com/luxfi/ids" +) + +var ( + ErrNilOutputOwners = errors.New("nil ML-DSA output owners") + ErrNilPublicKey = errors.New("nil ML-DSA public key") + ErrThresholdExceeded = errors.New("threshold exceeds number of addresses") + ErrOutputNotSpendable = errors.New("output not yet spendable") + ErrInvalidPubKeyLength = errors.New("invalid ML-DSA public key length") +) + +// OutputOwners describes who can spend an output locked with ML-DSA keys. +// This is the post-quantum alternative to secp256k1fx.OutputOwners. +// +// Spending requires [Threshold] signatures from the [Addrs] public keys. +// All addresses are ML-DSA public keys (1312, 1952, or 2592 bytes depending on level). +type OutputOwners struct { + // Level indicates the ML-DSA parameter set for all addresses + Level SecurityLevel `serialize:"true" json:"securityLevel"` + // Locktime is the Unix timestamp after which this output can be spent + Locktime uint64 `serialize:"true" json:"locktime"` + // Threshold is the number of signatures required to spend + Threshold uint32 `serialize:"true" json:"threshold"` + // Addrs are the ML-DSA public keys that can sign to spend + // Must be sorted in lexicographic order + Addrs [][]byte `serialize:"true" json:"addresses"` +} + +// Verify validates the output owners structure +func (out *OutputOwners) Verify() error { + if out == nil { + return ErrNilOutputOwners + } + + if out.Threshold > uint32(len(out.Addrs)) { + return ErrThresholdExceeded + } + + expectedPKLen := out.Level.PubKeyLen() + if expectedPKLen == 0 { + return ErrInvalidSecLevel + } + + for i, addr := range out.Addrs { + if len(addr) != expectedPKLen { + return fmt.Errorf("%w: address %d has length %d, expected %d for %s", + ErrInvalidPubKeyLength, i, len(addr), expectedPKLen, out.Level) + } + } + + // Verify sorted order + for i := 1; i < len(out.Addrs); i++ { + if string(out.Addrs[i-1]) >= string(out.Addrs[i]) { + return fmt.Errorf("addresses not sorted at index %d", i) + } + } + + return nil +} + +// Addresses returns short IDs derived from the ML-DSA public keys +func (out *OutputOwners) Addresses() []ids.ShortID { + addrs := make([]ids.ShortID, len(out.Addrs)) + for i, pk := range out.Addrs { + // Hash the public key to get a 20-byte address + addr, _ := ids.ToShortID(pk) + addrs[i] = addr + } + return addrs +} + +// MarshalJSON marshals the output owners to JSON +func (out *OutputOwners) MarshalJSON() ([]byte, error) { + addrs := make([]string, len(out.Addrs)) + for i, addr := range out.Addrs { + addrStr, err := formatting.Encode(formatting.HexNC, addr) + if err != nil { + return nil, fmt.Errorf("couldn't encode address %d: %w", i, err) + } + addrs[i] = addrStr + } + + return json.Marshal(map[string]interface{}{ + "securityLevel": out.Level.String(), + "locktime": out.Locktime, + "threshold": out.Threshold, + "addresses": addrs, + }) +} + +// NewOutputOwners creates a new ML-DSA output owners +func NewOutputOwners(level SecurityLevel, locktime uint64, threshold uint32, addrs [][]byte) (*OutputOwners, error) { + out := &OutputOwners{ + Level: level, + Locktime: locktime, + Threshold: threshold, + Addrs: addrs, + } + if err := out.Verify(); err != nil { + return nil, err + } + return out, nil +} diff --git a/nftfx/mint_operation.go b/nftfx/mint_operation.go index 58b27ee..12ef69b 100644 --- a/nftfx/mint_operation.go +++ b/nftfx/mint_operation.go @@ -6,7 +6,7 @@ package nftfx import ( "errors" - "github.com/luxfi/consensus/runtime" + "github.com/luxfi/runtime" "github.com/luxfi/vm/components/verify" "github.com/luxfi/utxo/secp256k1fx" @@ -22,14 +22,14 @@ type MintOperation struct { Outputs []*secp256k1fx.OutputOwners `serialize:"true" json:"outputs"` } -func (op *MintOperation) InitCtx(ctx *runtime.Runtime) { +func (op *MintOperation) InitRuntime(rt *runtime.Runtime) { for _, out := range op.Outputs { - out.InitCtx(ctx) + out.InitRuntime(rt) } } -func (op *MintOperation) InitializeContext(ctx *runtime.Runtime) error { - op.InitCtx(ctx) +func (op *MintOperation) InitializeRuntime(rt *runtime.Runtime) error { + op.InitRuntime(rt) return nil } diff --git a/nftfx/transfer_operation.go b/nftfx/transfer_operation.go index ce7302c..4c96bdd 100644 --- a/nftfx/transfer_operation.go +++ b/nftfx/transfer_operation.go @@ -6,7 +6,7 @@ package nftfx import ( "errors" - "github.com/luxfi/consensus/runtime" + "github.com/luxfi/runtime" "github.com/luxfi/vm/components/verify" "github.com/luxfi/utxo/secp256k1fx" @@ -19,12 +19,12 @@ type TransferOperation struct { Output TransferOutput `serialize:"true" json:"output"` } -func (op *TransferOperation) InitCtx(ctx *runtime.Runtime) { - op.Output.OutputOwners.InitCtx(ctx) +func (op *TransferOperation) InitRuntime(rt *runtime.Runtime) { + op.Output.OutputOwners.InitRuntime(rt) } -func (op *TransferOperation) InitializeContext(ctx *runtime.Runtime) error { - op.InitCtx(ctx) +func (op *TransferOperation) InitializeRuntime(rt *runtime.Runtime) error { + op.InitRuntime(rt) return nil } diff --git a/propertyfx/burn_operation.go b/propertyfx/burn_operation.go index 1f573a7..bd6444d 100644 --- a/propertyfx/burn_operation.go +++ b/propertyfx/burn_operation.go @@ -4,7 +4,7 @@ package propertyfx import ( - "github.com/luxfi/consensus/runtime" + "github.com/luxfi/runtime" "github.com/luxfi/vm/components/verify" "github.com/luxfi/utxo/secp256k1fx" ) @@ -13,10 +13,10 @@ type BurnOperation struct { secp256k1fx.Input `serialize:"true"` } -func (*BurnOperation) InitCtx(*runtime.Runtime) {} +func (*BurnOperation) InitRuntime(*runtime.Runtime) {} // InitializeContext implements the fxs.FxOperation interface -func (*BurnOperation) InitializeContext(*runtime.Runtime) error { +func (*BurnOperation) InitializeRuntime(*runtime.Runtime) error { return nil } diff --git a/propertyfx/mint_operation.go b/propertyfx/mint_operation.go index 6dd4f46..44fbc29 100644 --- a/propertyfx/mint_operation.go +++ b/propertyfx/mint_operation.go @@ -6,7 +6,7 @@ package propertyfx import ( "errors" - "github.com/luxfi/consensus/runtime" + "github.com/luxfi/runtime" "github.com/luxfi/vm/components/verify" "github.com/luxfi/utxo/secp256k1fx" @@ -20,14 +20,14 @@ type MintOperation struct { OwnedOutput OwnedOutput `serialize:"true" json:"ownedOutput"` } -func (op *MintOperation) InitCtx(ctx *runtime.Runtime) { - op.MintOutput.OutputOwners.InitCtx(ctx) - op.OwnedOutput.OutputOwners.InitCtx(ctx) +func (op *MintOperation) InitRuntime(rt *runtime.Runtime) { + op.MintOutput.OutputOwners.InitRuntime(rt) + op.OwnedOutput.OutputOwners.InitRuntime(rt) } // InitializeContext implements the fxs.FxOperation interface -func (op *MintOperation) InitializeContext(ctx *runtime.Runtime) error { - op.InitCtx(ctx) +func (op *MintOperation) InitializeRuntime(rt *runtime.Runtime) error { + op.InitRuntime(rt) return nil } diff --git a/propertyfx/mint_output.go b/propertyfx/mint_output.go index 936d3d2..d62c397 100644 --- a/propertyfx/mint_output.go +++ b/propertyfx/mint_output.go @@ -4,7 +4,7 @@ package propertyfx import ( - "github.com/luxfi/consensus/runtime" + "github.com/luxfi/runtime" "github.com/luxfi/vm/components/verify" "github.com/luxfi/utxo/secp256k1fx" @@ -18,6 +18,6 @@ type MintOutput struct { secp256k1fx.OutputOwners `serialize:"true"` } -func (out *MintOutput) InitCtx(ctx *runtime.Runtime) { - out.OutputOwners.InitCtx(ctx) +func (out *MintOutput) InitRuntime(rt *runtime.Runtime) { + out.OutputOwners.InitRuntime(rt) } diff --git a/secp256k1fx/mint_operation.go b/secp256k1fx/mint_operation.go index cb0f13f..11a0f23 100644 --- a/secp256k1fx/mint_operation.go +++ b/secp256k1fx/mint_operation.go @@ -6,7 +6,7 @@ package secp256k1fx import ( "errors" - "github.com/luxfi/consensus/runtime" + "github.com/luxfi/runtime" "github.com/luxfi/vm/components/verify" ) @@ -18,13 +18,13 @@ type MintOperation struct { TransferOutput TransferOutput `serialize:"true" json:"transferOutput"` } -func (op *MintOperation) InitCtx(ctx *runtime.Runtime) { - op.MintOutput.OutputOwners.InitCtx(ctx) - op.TransferOutput.OutputOwners.InitCtx(ctx) +func (op *MintOperation) InitRuntime(rt *runtime.Runtime) { + op.MintOutput.OutputOwners.InitRuntime(rt) + op.TransferOutput.OutputOwners.InitRuntime(rt) } -func (op *MintOperation) InitializeContext(ctx *runtime.Runtime) error { - op.InitCtx(ctx) +func (op *MintOperation) InitializeRuntime(rt *runtime.Runtime) error { + op.InitRuntime(rt) return nil } diff --git a/secp256k1fx/output_owners.go b/secp256k1fx/output_owners.go index 84652e3..4d92860 100644 --- a/secp256k1fx/output_owners.go +++ b/secp256k1fx/output_owners.go @@ -8,7 +8,7 @@ import ( "errors" "reflect" - "github.com/luxfi/consensus/runtime" + "github.com/luxfi/runtime" "github.com/luxfi/address" "github.com/luxfi/ids" @@ -30,22 +30,22 @@ type OutputOwners struct { Threshold uint32 `serialize:"true" json:"threshold"` Addrs []ids.ShortID `serialize:"true" json:"addresses"` - // ctx is used in MarshalJSON to convert Addrs into human readable + // rt is used in MarshalJSON to convert Addrs into human readable // format with ChainID and NetworkID. Unexported because we don't use // it outside this object. - ctx *runtime.Runtime `serialize:"-"` + rt *runtime.Runtime `serialize:"-"` } -// InitCtx allows addresses to be formatted into their human readable format +// InitRuntime allows addresses to be formatted into their human readable format // during json marshalling. -func (out *OutputOwners) InitCtx(ctx *runtime.Runtime) { - out.ctx = ctx +func (out *OutputOwners) InitRuntime(rt *runtime.Runtime) { + out.rt = rt } // MarshalJSON marshals OutputOwners as JSON with human readable addresses. -// OutputOwners.InitCtx must be called before marshalling this or one of -// the parent objects to json. Uses the OutputOwners.ctx method to format -// the addresses. Returns errMarshal error if OutputOwners.ctx is not set. +// OutputOwners.InitRuntime must be called before marshalling this or one of +// the parent objects to json. Uses the OutputOwners.rt method to format +// the addresses. Returns errMarshal error if OutputOwners.rt is not set. func (out *OutputOwners) MarshalJSON() ([]byte, error) { result, err := out.Fields() if err != nil { @@ -61,8 +61,8 @@ func (out *OutputOwners) Fields() (map[string]interface{}, error) { addresses := make([]string, len(out.Addrs)) for i, addr := range out.Addrs { // for each [addr] in [Addrs] we attempt to format it given - // the [out.ctx] object - fAddr, err := formatAddress(out.ctx, addr) + // the [out.rt] object + fAddr, err := formatAddress(out.rt, addr) if err != nil { // we expect these addresses to be valid, return error // if they are not @@ -130,15 +130,15 @@ func (out *OutputOwners) Sort() { } // formatAddress formats a given [addr] into human readable format using -// [ChainID] and [NetworkID] if a non-nil [ctx] is provided. If [ctx] is not +// [ChainID] and [NetworkID] if a non-nil [rt] is provided. If [rt] is not // provided, the address will be returned in cb58 format. -func formatAddress(ctx *runtime.Runtime, addr ids.ShortID) (string, error) { - if ctx == nil { +func formatAddress(rt *runtime.Runtime, addr ids.ShortID) (string, error) { + if rt == nil { return addr.String(), nil } // Use ChainID directly - consensus context doesn't have BCLookup - ctxValue := reflect.ValueOf(ctx).Elem() + ctxValue := reflect.ValueOf(rt).Elem() if ctxValue.Kind() == reflect.Struct { bcLookupField := ctxValue.FieldByName("BCLookup") diff --git a/secp256k1fx/transfer_input.go b/secp256k1fx/transfer_input.go index 6de3654..175d1bb 100644 --- a/secp256k1fx/transfer_input.go +++ b/secp256k1fx/transfer_input.go @@ -6,7 +6,7 @@ package secp256k1fx import ( "errors" - "github.com/luxfi/consensus/runtime" + "github.com/luxfi/runtime" ) var ErrNoValueInput = errors.New("input has no value") @@ -16,7 +16,7 @@ type TransferInput struct { Input `serialize:"true"` } -func (*TransferInput) InitCtx(*runtime.Runtime) {} +func (*TransferInput) InitRuntime(*runtime.Runtime) {} // Amount returns the quantity of the asset this input produces func (in *TransferInput) Amount() uint64 { diff --git a/secp256k1fx/transfer_output.go b/secp256k1fx/transfer_output.go index 4646288..4fddfb8 100644 --- a/secp256k1fx/transfer_output.go +++ b/secp256k1fx/transfer_output.go @@ -8,7 +8,7 @@ import ( "encoding/json" "errors" - "github.com/luxfi/consensus/runtime" + "github.com/luxfi/runtime" "github.com/luxfi/vm/components/verify" ) @@ -30,9 +30,9 @@ func (out *TransferOutput) InitializeWithContext(ctx context.Context) error { return nil } -// InitCtx sets the context for address formatting -func (out *TransferOutput) InitCtx(ctx *runtime.Runtime) { - out.OutputOwners.InitCtx(ctx) +// InitRuntime sets the context for address formatting +func (out *TransferOutput) InitRuntime(rt *runtime.Runtime) { + out.OutputOwners.InitRuntime(rt) } // MarshalJSON marshals Amt and the embedded OutputOwners struct diff --git a/test_verifiable.go b/test_verifiable.go index e964bc2..01e468e 100644 --- a/test_verifiable.go +++ b/test_verifiable.go @@ -4,7 +4,7 @@ package utxo import ( - "github.com/luxfi/consensus/runtime" + "github.com/luxfi/runtime" "github.com/luxfi/vm/components/verify" ) @@ -20,7 +20,7 @@ type TestState struct { Err error `serialize:"-" json:"-"` } -func (*TestState) InitCtx(*runtime.Runtime) {} +func (*TestState) InitRuntime(*runtime.Runtime) {} func (v *TestState) Verify() error { return v.Err @@ -32,7 +32,7 @@ type TestTransferable struct { Val uint64 `serialize:"true"` } -func (*TestTransferable) InitCtx(*runtime.Runtime) {} +func (*TestTransferable) InitRuntime(*runtime.Runtime) {} func (t *TestTransferable) Amount() uint64 { return t.Val diff --git a/transferables.go b/transferables.go index edab636..6decde7 100644 --- a/transferables.go +++ b/transferables.go @@ -9,7 +9,7 @@ import ( "sort" "github.com/luxfi/codec" - "github.com/luxfi/consensus/runtime" + "github.com/luxfi/runtime" "github.com/luxfi/crypto/secp256k1" "github.com/luxfi/ids" "github.com/luxfi/vm/components/verify" @@ -56,7 +56,7 @@ type TransferableIn interface { type TransferableOut interface { verify.State Amounter - InitCtx(*runtime.Runtime) + InitRuntime(*runtime.Runtime) } type TransferableOutput struct { @@ -66,8 +66,8 @@ type TransferableOutput struct { Out TransferableOut `serialize:"true" json:"output"` } -func (out *TransferableOutput) InitCtx(ctx *runtime.Runtime) { - out.Out.InitCtx(ctx) +func (out *TransferableOutput) InitRuntime(rt *runtime.Runtime) { + out.Out.InitRuntime(rt) } // Output returns the feature extension output that this Output is using.