diff --git a/CHANGELOG.md b/CHANGELOG.md index c355a6874f..657ede80d0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,19 @@ +# v0.9.4 - 2022-08-08 + +> This release mostly include maintenance changes to the deployment scripts and minor bug fixes. + +- readLoop errors should lead to neighbor's disconnection (#2375) +- Enable debug logging on Devnet (#2374) +- Update hive.go version (#2369) +- Increase delimiter to avoid deserialization error (#2370) +- Streamable Snapshot (#2358) +- Refactor: renamed tangle package (#2352) +- Refactor: Refactored package structure (#2350) +- Fix: syncing and bootstrapping (#2349) +- Build(deps): bump terser in /plugins/dagsvisualizer/frontend (#2354) +- Build(deps): bump terser in /plugins/dashboard/frontend (#2355) +- Build(deps): bump terser in /plugins/analysis/dashboard/frontend (#2356) + # v0.9.3 - 2022-07-19 > This release introduces bugfixes and improvements found in the previous release. @@ -323,12 +339,12 @@ if you want to automatically override the already stored private key, use `node. We have also created a more streamlined deployment for our infrastructure which means that IF provided endpoints have changed: -| Service | Old | New | -| ----------------------------------- | ---------------------------------- | ---------------------------------------------------------- | -| Analysis Server | ressims.iota.cafe:21888 | analysisentry-01.devnet.shimmer.iota.cafe:21888 | -| IOTA 2.0 DevNet Analyzer | http://ressims.iota.cafe:28080 | http://analysisentry-01.devnet.shimmer.iota.cafe:28080 | -| Autopeering Entry Node "2PV5487..." | [identity]@ressims.iota.cafe:15626 | [identity]@analysisentry-01.devnet.shimmer.iota.cafe:15626 | -| LogStash Remote Log | ressims.iota.cafe:5213 | metrics-01.devnet.shimmer.iota.cafe:5213 | +| Service | Old | New | +| ----------------------------------- | ---------------------------------- | ------------------------------------------------------------------------------------------ | +| Analysis Server | ressims.iota.cafe:21888 | analysisentry-01.devnet.shimmer.iota.cafe:21888 | +| IOTA 2.0 DevNet Analyzer | http://ressims.iota.cafe:28080 | http://analysisentry-01.devnet.shimmer.iota.cafe:28080 | +| Autopeering Entry Node "2PV5487..." | [identity]@ressims.iota.cafe:15626 | [identity]@analysisentry-01.devnet.shimmer.iota.cafe:15626 | +| LogStash Remote Log | ressims.iota.cafe:5213 | metrics-01.devnet.shimmer.iota.cafe:5213 | | Daily Database | N/A | https://dbfiles-goshimmer.s3.eu-central-1.amazonaws.com/dbs/nectar/automated/latest-db.tgz | Other changes: diff --git a/client/autopeering.go b/client/autopeering.go index 10567d256d..4b1d1ffb74 100644 --- a/client/autopeering.go +++ b/client/autopeering.go @@ -4,7 +4,7 @@ import ( "fmt" "net/http" - "github.com/iotaledger/goshimmer/packages/jsonmodels" + "github.com/iotaledger/goshimmer/packages/app/jsonmodels" ) const ( diff --git a/client/data.go b/client/data.go index 1d5c9fcec6..f4bc8b5e9b 100644 --- a/client/data.go +++ b/client/data.go @@ -3,7 +3,7 @@ package client import ( "net/http" - "github.com/iotaledger/goshimmer/packages/jsonmodels" + "github.com/iotaledger/goshimmer/packages/app/jsonmodels" ) const ( diff --git a/client/evilspammer/spammer.go b/client/evilspammer/spammer.go index 8427f2234a..dd41c1ca5c 100644 --- a/client/evilspammer/spammer.go +++ b/client/evilspammer/spammer.go @@ -6,12 +6,12 @@ import ( "github.com/cockroachdb/errors" "github.com/iotaledger/goshimmer/client/evilwallet" - "github.com/iotaledger/goshimmer/packages/ledger/utxo" - "github.com/iotaledger/goshimmer/packages/ledger/vm/devnetvm" + "github.com/iotaledger/goshimmer/packages/core/ledger/utxo" + "github.com/iotaledger/goshimmer/packages/core/ledger/vm/devnetvm" - "github.com/iotaledger/hive.go/configuration" - "github.com/iotaledger/hive.go/logger" - "github.com/iotaledger/hive.go/types" + "github.com/iotaledger/hive.go/core/configuration" + "github.com/iotaledger/hive.go/core/logger" + "github.com/iotaledger/hive.go/core/types" "go.uber.org/atomic" ) diff --git a/client/evilspammer/spamming_functions.go b/client/evilspammer/spamming_functions.go index 737fe2022c..f203526343 100644 --- a/client/evilspammer/spamming_functions.go +++ b/client/evilspammer/spamming_functions.go @@ -9,7 +9,7 @@ import ( "github.com/cockroachdb/errors" "github.com/iotaledger/goshimmer/client/evilwallet" - "github.com/iotaledger/goshimmer/packages/ledger/vm/devnetvm" + "github.com/iotaledger/goshimmer/packages/core/ledger/vm/devnetvm" ) func DataSpammingFunction(s *Spammer) { diff --git a/client/evilwallet/aliasmanager.go b/client/evilwallet/aliasmanager.go index ea7cd49239..37d64e72f9 100644 --- a/client/evilwallet/aliasmanager.go +++ b/client/evilwallet/aliasmanager.go @@ -6,7 +6,7 @@ import ( "github.com/cockroachdb/errors" "go.uber.org/atomic" - "github.com/iotaledger/goshimmer/packages/ledger/vm/devnetvm" + "github.com/iotaledger/goshimmer/packages/core/ledger/vm/devnetvm" ) // region AliasManager ///////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/client/evilwallet/connector.go b/client/evilwallet/connector.go index 52c9a0a7fd..0793db2d62 100644 --- a/client/evilwallet/connector.go +++ b/client/evilwallet/connector.go @@ -4,14 +4,14 @@ import ( "sync" "time" - "github.com/iotaledger/hive.go/identity" - "github.com/iotaledger/hive.go/types/confirmation" + "github.com/iotaledger/hive.go/core/identity" + "github.com/iotaledger/hive.go/core/types/confirmation" "github.com/iotaledger/goshimmer/client" "github.com/iotaledger/goshimmer/client/wallet" - "github.com/iotaledger/goshimmer/packages/jsonmodels" - "github.com/iotaledger/goshimmer/packages/ledger/utxo" - "github.com/iotaledger/goshimmer/packages/ledger/vm/devnetvm" + "github.com/iotaledger/goshimmer/packages/app/jsonmodels" + "github.com/iotaledger/goshimmer/packages/core/ledger/utxo" + "github.com/iotaledger/goshimmer/packages/core/ledger/vm/devnetvm" ) type ServersStatus []*wallet.ServerStatus diff --git a/client/evilwallet/evilscenario.go b/client/evilwallet/evilscenario.go index 9ae2338b29..1775e99b6a 100644 --- a/client/evilwallet/evilscenario.go +++ b/client/evilwallet/evilscenario.go @@ -7,7 +7,7 @@ import ( "github.com/mr-tron/base58" "go.uber.org/atomic" - "github.com/iotaledger/hive.go/types" + "github.com/iotaledger/hive.go/core/types" ) // The custom conflict in spammer can be provided like this: diff --git a/client/evilwallet/evilwallet.go b/client/evilwallet/evilwallet.go index 9bc0c2e202..6065720b75 100644 --- a/client/evilwallet/evilwallet.go +++ b/client/evilwallet/evilwallet.go @@ -6,12 +6,12 @@ import ( "time" "github.com/cockroachdb/errors" - "github.com/iotaledger/hive.go/identity" - "github.com/iotaledger/hive.go/types" + "github.com/iotaledger/hive.go/core/identity" + "github.com/iotaledger/hive.go/core/types" "github.com/iotaledger/goshimmer/client/wallet/packages/address" - "github.com/iotaledger/goshimmer/packages/ledger/utxo" - "github.com/iotaledger/goshimmer/packages/ledger/vm/devnetvm" + "github.com/iotaledger/goshimmer/packages/core/ledger/utxo" + "github.com/iotaledger/goshimmer/packages/core/ledger/vm/devnetvm" ) const ( diff --git a/client/evilwallet/options.go b/client/evilwallet/options.go index a7502ee06b..62830fb680 100644 --- a/client/evilwallet/options.go +++ b/client/evilwallet/options.go @@ -5,10 +5,10 @@ import ( "github.com/cockroachdb/errors" - "github.com/iotaledger/hive.go/types" + "github.com/iotaledger/hive.go/core/types" - "github.com/iotaledger/goshimmer/packages/ledger/utxo" - "github.com/iotaledger/goshimmer/packages/ledger/vm/devnetvm" + "github.com/iotaledger/goshimmer/packages/core/ledger/utxo" + "github.com/iotaledger/goshimmer/packages/core/ledger/vm/devnetvm" ) // region Options /////////////////////////////////////////////////////////////////////////// diff --git a/client/evilwallet/output_manager.go b/client/evilwallet/output_manager.go index d8f0c3b822..675cab2930 100644 --- a/client/evilwallet/output_manager.go +++ b/client/evilwallet/output_manager.go @@ -6,11 +6,11 @@ import ( "time" "github.com/cockroachdb/errors" - "github.com/iotaledger/hive.go/types" + "github.com/iotaledger/hive.go/core/types" "github.com/iotaledger/goshimmer/client/wallet/packages/address" - "github.com/iotaledger/goshimmer/packages/ledger/utxo" - "github.com/iotaledger/goshimmer/packages/ledger/vm/devnetvm" + "github.com/iotaledger/goshimmer/packages/core/ledger/utxo" + "github.com/iotaledger/goshimmer/packages/core/ledger/vm/devnetvm" ) var ( diff --git a/client/evilwallet/utils.go b/client/evilwallet/utils.go index 3551865fc9..1cbb93a1fc 100644 --- a/client/evilwallet/utils.go +++ b/client/evilwallet/utils.go @@ -1,9 +1,9 @@ package evilwallet import ( - "github.com/iotaledger/goshimmer/packages/jsonmodels" - "github.com/iotaledger/goshimmer/packages/ledger/utxo" - "github.com/iotaledger/goshimmer/packages/ledger/vm/devnetvm" + "github.com/iotaledger/goshimmer/packages/app/jsonmodels" + "github.com/iotaledger/goshimmer/packages/core/ledger/utxo" + "github.com/iotaledger/goshimmer/packages/core/ledger/vm/devnetvm" ) // SplitBalanceEqually splits the balance equally between `splitNumber` outputs. diff --git a/client/evilwallet/wallets.go b/client/evilwallet/wallets.go index 1a2b68f013..3698d8c79a 100644 --- a/client/evilwallet/wallets.go +++ b/client/evilwallet/wallets.go @@ -4,15 +4,15 @@ import ( "sync" "github.com/cockroachdb/errors" - "github.com/iotaledger/hive.go/generics/lo" + "github.com/iotaledger/hive.go/core/generics/lo" - "github.com/iotaledger/hive.go/types" + "github.com/iotaledger/hive.go/core/types" "go.uber.org/atomic" "github.com/iotaledger/goshimmer/client/wallet/packages/address" "github.com/iotaledger/goshimmer/client/wallet/packages/seed" - "github.com/iotaledger/goshimmer/packages/ledger/utxo" - "github.com/iotaledger/goshimmer/packages/ledger/vm/devnetvm" + "github.com/iotaledger/goshimmer/packages/core/ledger/utxo" + "github.com/iotaledger/goshimmer/packages/core/ledger/vm/devnetvm" ) type walletID int diff --git a/client/faucet.go b/client/faucet.go index c05d6e746b..5c34695ba3 100644 --- a/client/faucet.go +++ b/client/faucet.go @@ -5,13 +5,13 @@ import ( "net/http" "github.com/cockroachdb/errors" - "github.com/iotaledger/hive.go/identity" + "github.com/iotaledger/hive.go/core/identity" - "github.com/iotaledger/goshimmer/packages/faucet" - "github.com/iotaledger/goshimmer/packages/jsonmodels" - "github.com/iotaledger/goshimmer/packages/ledger/vm/devnetvm" - "github.com/iotaledger/goshimmer/packages/mana" - "github.com/iotaledger/goshimmer/packages/pow" + "github.com/iotaledger/goshimmer/packages/app/faucet" + "github.com/iotaledger/goshimmer/packages/app/jsonmodels" + "github.com/iotaledger/goshimmer/packages/core/ledger/vm/devnetvm" + "github.com/iotaledger/goshimmer/packages/core/mana" + "github.com/iotaledger/goshimmer/packages/core/pow" ) const ( diff --git a/client/firewall.go b/client/firewall.go index 7a30254d70..98ff441fee 100644 --- a/client/firewall.go +++ b/client/firewall.go @@ -5,7 +5,7 @@ import ( "net/http" "github.com/cockroachdb/errors" - "github.com/iotaledger/hive.go/identity" + "github.com/iotaledger/hive.go/core/identity" ) const ( diff --git a/client/info.go b/client/info.go index 2ab364daa2..02d830fd79 100644 --- a/client/info.go +++ b/client/info.go @@ -3,7 +3,7 @@ package client import ( "net/http" - "github.com/iotaledger/goshimmer/packages/jsonmodels" + "github.com/iotaledger/goshimmer/packages/app/jsonmodels" ) const ( diff --git a/client/ledgerstate.go b/client/ledgerstate.go index bd8ca19834..a6d0f66b98 100644 --- a/client/ledgerstate.go +++ b/client/ledgerstate.go @@ -4,7 +4,7 @@ import ( "net/http" "strings" - "github.com/iotaledger/goshimmer/packages/jsonmodels" + "github.com/iotaledger/goshimmer/packages/app/jsonmodels" ) const ( diff --git a/client/mana.go b/client/mana.go index d43a41874f..d1cb07c7fe 100644 --- a/client/mana.go +++ b/client/mana.go @@ -4,7 +4,7 @@ import ( "fmt" "net/http" - "github.com/iotaledger/goshimmer/packages/jsonmodels" + "github.com/iotaledger/goshimmer/packages/app/jsonmodels" ) const ( diff --git a/client/manualpeering.go b/client/manualpeering.go index 38c4040bcc..86b83bbbe9 100644 --- a/client/manualpeering.go +++ b/client/manualpeering.go @@ -4,10 +4,10 @@ import ( "net/http" "github.com/cockroachdb/errors" - "github.com/iotaledger/hive.go/crypto/ed25519" + "github.com/iotaledger/hive.go/core/crypto/ed25519" - "github.com/iotaledger/goshimmer/packages/jsonmodels" - "github.com/iotaledger/goshimmer/packages/manualpeering" + "github.com/iotaledger/goshimmer/packages/app/jsonmodels" + "github.com/iotaledger/goshimmer/packages/node/manualpeering" ) const ( diff --git a/client/message.go b/client/message.go index 09ee67dc51..ed04f60f6e 100644 --- a/client/message.go +++ b/client/message.go @@ -3,7 +3,7 @@ package client import ( "net/http" - "github.com/iotaledger/goshimmer/packages/jsonmodels" + "github.com/iotaledger/goshimmer/packages/app/jsonmodels" ) const ( diff --git a/client/ratesetter.go b/client/ratesetter.go index 22de868270..0048ac6514 100644 --- a/client/ratesetter.go +++ b/client/ratesetter.go @@ -4,7 +4,7 @@ import ( "net/http" "time" - "github.com/iotaledger/goshimmer/packages/jsonmodels" + "github.com/iotaledger/goshimmer/packages/app/jsonmodels" ) const ( diff --git a/client/spammer.go b/client/spammer.go index 90bfb2f2d7..8b007880fc 100644 --- a/client/spammer.go +++ b/client/spammer.go @@ -4,7 +4,7 @@ import ( "fmt" "net/http" - "github.com/iotaledger/goshimmer/packages/jsonmodels" + "github.com/iotaledger/goshimmer/packages/app/jsonmodels" ) const ( diff --git a/client/wallet/address_manager.go b/client/wallet/address_manager.go index daffc63e02..c33315b008 100644 --- a/client/wallet/address_manager.go +++ b/client/wallet/address_manager.go @@ -3,7 +3,7 @@ package wallet import ( "runtime" - "github.com/iotaledger/hive.go/bitmask" + "github.com/iotaledger/hive.go/core/bitmask" "github.com/iotaledger/goshimmer/client/wallet/packages/address" "github.com/iotaledger/goshimmer/client/wallet/packages/seed" diff --git a/client/wallet/asset.go b/client/wallet/asset.go index 63757ecbf8..fae240d43d 100644 --- a/client/wallet/asset.go +++ b/client/wallet/asset.go @@ -4,8 +4,8 @@ import ( "github.com/capossele/asset-registry/pkg/registry" "github.com/cockroachdb/errors" - "github.com/iotaledger/goshimmer/packages/ledger/utxo" - "github.com/iotaledger/goshimmer/packages/ledger/vm/devnetvm" + "github.com/iotaledger/goshimmer/packages/core/ledger/utxo" + "github.com/iotaledger/goshimmer/packages/core/ledger/vm/devnetvm" ) // Asset represents a container for all the information regarding a colored coin. diff --git a/client/wallet/assetregistry.go b/client/wallet/assetregistry.go index b936dc545a..512547c5ef 100644 --- a/client/wallet/assetregistry.go +++ b/client/wallet/assetregistry.go @@ -7,10 +7,10 @@ import ( "github.com/capossele/asset-registry/pkg/registryclient" "github.com/cockroachdb/errors" "github.com/go-resty/resty/v2" - "github.com/iotaledger/hive.go/marshalutil" - "github.com/iotaledger/hive.go/serix" + "github.com/iotaledger/hive.go/core/marshalutil" + "github.com/iotaledger/hive.go/core/serix" - "github.com/iotaledger/goshimmer/packages/ledger/vm/devnetvm" + "github.com/iotaledger/goshimmer/packages/core/ledger/vm/devnetvm" ) const ( diff --git a/client/wallet/balances.go b/client/wallet/balances.go index 607db29a68..3320a7fd1f 100644 --- a/client/wallet/balances.go +++ b/client/wallet/balances.go @@ -4,7 +4,7 @@ import ( "sort" "time" - "github.com/iotaledger/goshimmer/packages/ledger/vm/devnetvm" + "github.com/iotaledger/goshimmer/packages/core/ledger/vm/devnetvm" ) // TimedBalance represents a balance that is time dependent. diff --git a/client/wallet/connector.go b/client/wallet/connector.go index ce21978bd3..b89c6956d7 100644 --- a/client/wallet/connector.go +++ b/client/wallet/connector.go @@ -1,12 +1,12 @@ package wallet import ( - "github.com/iotaledger/hive.go/types/confirmation" + "github.com/iotaledger/hive.go/core/types/confirmation" "github.com/iotaledger/goshimmer/client/wallet/packages/address" - "github.com/iotaledger/goshimmer/packages/ledger/utxo" - "github.com/iotaledger/goshimmer/packages/ledger/vm/devnetvm" - "github.com/iotaledger/goshimmer/packages/mana" + "github.com/iotaledger/goshimmer/packages/core/ledger/utxo" + "github.com/iotaledger/goshimmer/packages/core/ledger/vm/devnetvm" + "github.com/iotaledger/goshimmer/packages/core/mana" ) // Connector represents an interface that defines how the wallet interacts with the network. A wallet can either be used diff --git a/client/wallet/options.go b/client/wallet/options.go index 1b7bf4109f..4349d6cf2c 100644 --- a/client/wallet/options.go +++ b/client/wallet/options.go @@ -4,7 +4,7 @@ import ( "time" "github.com/capossele/asset-registry/pkg/registryservice" - "github.com/iotaledger/hive.go/bitmask" + "github.com/iotaledger/hive.go/core/bitmask" "github.com/iotaledger/goshimmer/client" "github.com/iotaledger/goshimmer/client/wallet/packages/seed" diff --git a/client/wallet/output.go b/client/wallet/output.go index 1a4a40be95..73b0a9a8e3 100644 --- a/client/wallet/output.go +++ b/client/wallet/output.go @@ -4,8 +4,8 @@ import ( "time" "github.com/iotaledger/goshimmer/client/wallet/packages/address" - "github.com/iotaledger/goshimmer/packages/ledger/utxo" - "github.com/iotaledger/goshimmer/packages/ledger/vm/devnetvm" + "github.com/iotaledger/goshimmer/packages/core/ledger/utxo" + "github.com/iotaledger/goshimmer/packages/core/ledger/vm/devnetvm" ) // Output is a wallet specific representation of an output in the IOTA network. diff --git a/client/wallet/output_manager.go b/client/wallet/output_manager.go index f3fa94f2ed..12e2072bc1 100644 --- a/client/wallet/output_manager.go +++ b/client/wallet/output_manager.go @@ -2,7 +2,7 @@ package wallet import ( "github.com/iotaledger/goshimmer/client/wallet/packages/address" - "github.com/iotaledger/goshimmer/packages/ledger/utxo" + "github.com/iotaledger/goshimmer/packages/core/ledger/utxo" ) // OutputManager keeps track of the outputs. diff --git a/client/wallet/packages/address/address.go b/client/wallet/packages/address/address.go index dc21bd610b..e10127eaaf 100644 --- a/client/wallet/packages/address/address.go +++ b/client/wallet/packages/address/address.go @@ -1,10 +1,10 @@ package address import ( - "github.com/iotaledger/hive.go/stringify" + "github.com/iotaledger/hive.go/core/stringify" "github.com/mr-tron/base58" - "github.com/iotaledger/goshimmer/packages/ledger/vm/devnetvm" + "github.com/iotaledger/goshimmer/packages/core/ledger/vm/devnetvm" ) // Address represents an address in a wallet. It extends the normal address type with an index number that was used to diff --git a/client/wallet/packages/createnftoptions/options.go b/client/wallet/packages/createnftoptions/options.go index 8688f788d6..dc3004c573 100644 --- a/client/wallet/packages/createnftoptions/options.go +++ b/client/wallet/packages/createnftoptions/options.go @@ -3,7 +3,7 @@ package createnftoptions import ( "github.com/cockroachdb/errors" - "github.com/iotaledger/goshimmer/packages/ledger/vm/devnetvm" + "github.com/iotaledger/goshimmer/packages/core/ledger/vm/devnetvm" ) // CreateNFTOption is a function that provides options. diff --git a/client/wallet/packages/delegateoptions/options.go b/client/wallet/packages/delegateoptions/options.go index 1be24fe7d4..100f06e8d5 100644 --- a/client/wallet/packages/delegateoptions/options.go +++ b/client/wallet/packages/delegateoptions/options.go @@ -4,7 +4,7 @@ import ( "time" "github.com/iotaledger/goshimmer/client/wallet/packages/address" - "github.com/iotaledger/goshimmer/packages/ledger/vm/devnetvm" + "github.com/iotaledger/goshimmer/packages/core/ledger/vm/devnetvm" ) // DelegateFundsOptions is a struct that is used to aggregate the optional parameters provided in the DelegateFunds call. diff --git a/client/wallet/packages/deposittonftoptions/options.go b/client/wallet/packages/deposittonftoptions/options.go index efaebe30b1..465990bd1b 100644 --- a/client/wallet/packages/deposittonftoptions/options.go +++ b/client/wallet/packages/deposittonftoptions/options.go @@ -3,7 +3,7 @@ package deposittonftoptions import ( "github.com/cockroachdb/errors" - "github.com/iotaledger/goshimmer/packages/ledger/vm/devnetvm" + "github.com/iotaledger/goshimmer/packages/core/ledger/vm/devnetvm" ) // DepositFundsToNFTOption is a function that provides options. diff --git a/client/wallet/packages/destroynftoptions/options.go b/client/wallet/packages/destroynftoptions/options.go index 8b4f4d039a..fdbb891523 100644 --- a/client/wallet/packages/destroynftoptions/options.go +++ b/client/wallet/packages/destroynftoptions/options.go @@ -3,7 +3,7 @@ package destroynftoptions import ( "github.com/cockroachdb/errors" - "github.com/iotaledger/goshimmer/packages/ledger/vm/devnetvm" + "github.com/iotaledger/goshimmer/packages/core/ledger/vm/devnetvm" ) // DestroyNFTOption is a function that provides options. diff --git a/client/wallet/packages/reclaimoptions/options.go b/client/wallet/packages/reclaimoptions/options.go index 0e75b0fcfb..f846939391 100644 --- a/client/wallet/packages/reclaimoptions/options.go +++ b/client/wallet/packages/reclaimoptions/options.go @@ -3,7 +3,7 @@ package reclaimoptions import ( "github.com/cockroachdb/errors" - "github.com/iotaledger/goshimmer/packages/ledger/vm/devnetvm" + "github.com/iotaledger/goshimmer/packages/core/ledger/vm/devnetvm" ) // ReclaimFundsOption is a function that provides an option. diff --git a/client/wallet/packages/seed/seed.go b/client/wallet/packages/seed/seed.go index c8822d6470..61cd0d0426 100644 --- a/client/wallet/packages/seed/seed.go +++ b/client/wallet/packages/seed/seed.go @@ -1,10 +1,10 @@ package seed import ( - "github.com/iotaledger/hive.go/crypto/ed25519" + "github.com/iotaledger/hive.go/core/crypto/ed25519" "github.com/iotaledger/goshimmer/client/wallet/packages/address" - "github.com/iotaledger/goshimmer/packages/ledger/vm/devnetvm" + "github.com/iotaledger/goshimmer/packages/core/ledger/vm/devnetvm" ) // Seed represents a seed for IOTA wallets. A seed allows us to generate a deterministic sequence of Addresses and their diff --git a/client/wallet/packages/sendoptions/options.go b/client/wallet/packages/sendoptions/options.go index 43c8fa9b02..84c672e88d 100644 --- a/client/wallet/packages/sendoptions/options.go +++ b/client/wallet/packages/sendoptions/options.go @@ -7,7 +7,7 @@ import ( "github.com/iotaledger/goshimmer/client/wallet/packages/address" "github.com/iotaledger/goshimmer/client/wallet/packages/constants" - "github.com/iotaledger/goshimmer/packages/ledger/vm/devnetvm" + "github.com/iotaledger/goshimmer/packages/core/ledger/vm/devnetvm" ) // SendFundsOption is the type for the optional parameters for the SendFunds call. diff --git a/client/wallet/packages/sweepnftownednftsoptions/options.go b/client/wallet/packages/sweepnftownednftsoptions/options.go index 63a67b249b..160e5bdb06 100644 --- a/client/wallet/packages/sweepnftownednftsoptions/options.go +++ b/client/wallet/packages/sweepnftownednftsoptions/options.go @@ -3,7 +3,7 @@ package sweepnftownednftsoptions import ( "github.com/cockroachdb/errors" - "github.com/iotaledger/goshimmer/packages/ledger/vm/devnetvm" + "github.com/iotaledger/goshimmer/packages/core/ledger/vm/devnetvm" ) // SweepNFTOwnedNFTsOption is a function that provides an option. diff --git a/client/wallet/packages/sweepnftownedoptions/options.go b/client/wallet/packages/sweepnftownedoptions/options.go index f761b17ddc..e532ff4e91 100644 --- a/client/wallet/packages/sweepnftownedoptions/options.go +++ b/client/wallet/packages/sweepnftownedoptions/options.go @@ -3,7 +3,7 @@ package sweepnftownedoptions import ( "github.com/cockroachdb/errors" - "github.com/iotaledger/goshimmer/packages/ledger/vm/devnetvm" + "github.com/iotaledger/goshimmer/packages/core/ledger/vm/devnetvm" ) // SweepNFTOwnedFundsOption is a function that provides option. diff --git a/client/wallet/packages/transfernftoptions/options.go b/client/wallet/packages/transfernftoptions/options.go index 3d19000cd2..e67cb816d4 100644 --- a/client/wallet/packages/transfernftoptions/options.go +++ b/client/wallet/packages/transfernftoptions/options.go @@ -3,7 +3,7 @@ package transfernftoptions import ( "github.com/cockroachdb/errors" - "github.com/iotaledger/goshimmer/packages/ledger/vm/devnetvm" + "github.com/iotaledger/goshimmer/packages/core/ledger/vm/devnetvm" ) // TransferNFTOption is a function that provides an option. diff --git a/client/wallet/packages/withdrawfromnftoptions/options.go b/client/wallet/packages/withdrawfromnftoptions/options.go index 1bbbc1d95e..cbb2d43bfb 100644 --- a/client/wallet/packages/withdrawfromnftoptions/options.go +++ b/client/wallet/packages/withdrawfromnftoptions/options.go @@ -3,7 +3,7 @@ package withdrawfromnftoptions import ( "github.com/cockroachdb/errors" - "github.com/iotaledger/goshimmer/packages/ledger/vm/devnetvm" + "github.com/iotaledger/goshimmer/packages/core/ledger/vm/devnetvm" ) // WithdrawFundsFromNFTOption is a function that provides an option. diff --git a/client/wallet/wallet.go b/client/wallet/wallet.go index abb01af117..a080545b8b 100644 --- a/client/wallet/wallet.go +++ b/client/wallet/wallet.go @@ -6,10 +6,10 @@ import ( "unsafe" "github.com/cockroachdb/errors" - "github.com/iotaledger/hive.go/bitmask" - "github.com/iotaledger/hive.go/generics/lo" - "github.com/iotaledger/hive.go/identity" - "github.com/iotaledger/hive.go/marshalutil" + "github.com/iotaledger/hive.go/core/bitmask" + "github.com/iotaledger/hive.go/core/generics/lo" + "github.com/iotaledger/hive.go/core/identity" + "github.com/iotaledger/hive.go/core/marshalutil" "golang.org/x/crypto/blake2b" "github.com/iotaledger/goshimmer/client/wallet/packages/address" @@ -24,9 +24,9 @@ import ( "github.com/iotaledger/goshimmer/client/wallet/packages/sweepnftownedoptions" "github.com/iotaledger/goshimmer/client/wallet/packages/transfernftoptions" "github.com/iotaledger/goshimmer/client/wallet/packages/withdrawfromnftoptions" - "github.com/iotaledger/goshimmer/packages/ledger/utxo" - "github.com/iotaledger/goshimmer/packages/ledger/vm/devnetvm" - "github.com/iotaledger/goshimmer/packages/mana" + "github.com/iotaledger/goshimmer/packages/core/ledger/utxo" + "github.com/iotaledger/goshimmer/packages/core/ledger/vm/devnetvm" + "github.com/iotaledger/goshimmer/packages/core/mana" ) // region Wallet /////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/client/wallet/webconnector.go b/client/wallet/webconnector.go index 4c648ade10..691295d2fa 100644 --- a/client/wallet/webconnector.go +++ b/client/wallet/webconnector.go @@ -2,13 +2,13 @@ package wallet import ( "github.com/cockroachdb/errors" - "github.com/iotaledger/hive.go/types/confirmation" + "github.com/iotaledger/hive.go/core/types/confirmation" "github.com/iotaledger/goshimmer/client" "github.com/iotaledger/goshimmer/client/wallet/packages/address" - "github.com/iotaledger/goshimmer/packages/ledger/utxo" - "github.com/iotaledger/goshimmer/packages/ledger/vm/devnetvm" - "github.com/iotaledger/goshimmer/packages/mana" + "github.com/iotaledger/goshimmer/packages/core/ledger/utxo" + "github.com/iotaledger/goshimmer/packages/core/ledger/vm/devnetvm" + "github.com/iotaledger/goshimmer/packages/core/mana" ) // WebConnector implements a connector that uses the web API to connect to a node to implement the required functions diff --git a/deploy/ansible/hosts/devnet.yml b/deploy/ansible/hosts/devnet.yml index 7c1ca7850a..4499288bce 100644 --- a/deploy/ansible/hosts/devnet.yml +++ b/deploy/ansible/hosts/devnet.yml @@ -7,7 +7,7 @@ supports: analysisentry-01.devnet.shimmer.iota.cafe: entryNodeSeed: "{{ ANALYSISSENTRY_01_ENTRYNODE_SEED }}" manaDashboardHost: "http://dashboards.nectar.iota.cafe:80" - logLevel: "info" + logLevel: "debug" goshimmers: children: @@ -45,7 +45,7 @@ goshimmers: bootstrapNodePubKey: "Gm7W191NDnqyF7KJycZqK7V6ENLwqxTwoKQN4SmpkB24" remoteLoggerHost: "metrics-01.devnet.shimmer.iota.cafe" communityEntryNode: "5EDH4uY78EA6wrBkHHAVBWBMDt7EcksRq6pjzipoW15B@entry-0.devnet.tanglebay.com:14646,CAB87iQZR6BjBrCgEBupQJ4gpEBgvGKKv3uuGVRBKb4n@entry-1.devnet.tanglebay.com:14646" - logLevel: "info" + logLevel: "debug" asset_registries: hosts: diff --git a/deploy/ansible/roles/goshimmer-node/templates/docker-compose-analysis-server.yml.j2 b/deploy/ansible/roles/goshimmer-node/templates/docker-compose-analysis-server.yml.j2 index 5eec897a98..21982d143c 100644 --- a/deploy/ansible/roles/goshimmer-node/templates/docker-compose-analysis-server.yml.j2 +++ b/deploy/ansible/roles/goshimmer-node/templates/docker-compose-analysis-server.yml.j2 @@ -31,3 +31,4 @@ services: --node.enablePlugins=analysisServer,analysisDashboard,prometheus --node.disablePlugins=activity,analysisClient,chat,consensus,dashboard,faucet,gossip,firewall,issuer,mana,manualpeering,blockLayer,metrics,networkdelay,portcheck,pow,syncBeaconFollower,webAPIBroadcastDataEndpoint,WebAPIDataEndpoint,WebAPIHealthzEndpoint,WebAPIFaucetRequestEndpoint,webAPIFindTransactionHashesEndpoint,webAPIGetNeighborsEndpoint,webAPIGetTransactionObjectsByHashEndpoint,webAPIGetTransactionTrytesByHashEndpoint,WebAPIInfoEndpoint,WebAPILedgerstateEndpoint,WebAPIBlockEndpoint,WebAPIToolsBlockEndpoint,WebAPIWeightProviderEndpoint,remotelog,remotelogmetrics,DAGsVisualizer,WebAPIRateSetterEndpoint,WebAPISchedulerEndpoint,ManaInitializer,Notarization,EpochStorage,WebAPIEpochEndpoint,BootstrapManager --logger.level={{ logLevel }} + --logger.outputPaths=stdout diff --git a/deploy/ansible/roles/goshimmer-node/templates/docker-compose-entrynode.yml.j2 b/deploy/ansible/roles/goshimmer-node/templates/docker-compose-entrynode.yml.j2 index 68fcbdea3a..c6bf57882e 100644 --- a/deploy/ansible/roles/goshimmer-node/templates/docker-compose-entrynode.yml.j2 +++ b/deploy/ansible/roles/goshimmer-node/templates/docker-compose-entrynode.yml.j2 @@ -28,3 +28,4 @@ services: --analysis.client.serverAddress= --node.disablePlugins=activity,analysisClient,chat,consensus,dashboard,faucet,gossip,firewall,issuer,mana,manualpeering,blockLayer,metrics,networkdelay,portcheck,pow,syncBeaconFollower,webAPIBroadcastDataEndpoint,WebAPIDataEndpoint,WebAPIHealthzEndpoint,WebAPIFaucetRequestEndpoint,webAPIFindTransactionHashesEndpoint,webAPIGetNeighborsEndpoint,webAPIGetTransactionObjectsByHashEndpoint,webAPIGetTransactionTrytesByHashEndpoint,WebAPIInfoEndpoint,WebAPILedgerstateEndpoint,WebAPIBlockEndpoint,WebAPIToolsBlockEndpoint,WebAPIWeightProviderEndpoint,remotelog,remotelogmetrics,DAGsVisualizer,WebAPIRateSetterEndpoint,WebAPISchedulerEndpoint,ManaInitializer,Notarization,EpochStorage,WebAPIEpochEndpoint,BootstrapManager --logger.level={{ logLevel }} + --logger.outputPaths=stdout diff --git a/deploy/ansible/roles/goshimmer-node/templates/docker-compose-goshimmer.yml.j2 b/deploy/ansible/roles/goshimmer-node/templates/docker-compose-goshimmer.yml.j2 index a0ed54f6fa..c77bb8fb54 100644 --- a/deploy/ansible/roles/goshimmer-node/templates/docker-compose-goshimmer.yml.j2 +++ b/deploy/ansible/roles/goshimmer-node/templates/docker-compose-goshimmer.yml.j2 @@ -64,6 +64,7 @@ services: --pow.difficulty={{ powDifficulty }} {% endif %} --logger.level={{ logLevel }} + --logger.outputPaths=stdout --logger.disableEvents=false --logger.remotelog.serverAddress={{ remoteLoggerHost }}:5213 --remotemetrics.metricsLevel=0 diff --git a/deploy/ansible/roles/goshimmer-node/templates/docker-compose-public-node.yml.j2 b/deploy/ansible/roles/goshimmer-node/templates/docker-compose-public-node.yml.j2 index 715ba4e0f5..8581dbbf1d 100644 --- a/deploy/ansible/roles/goshimmer-node/templates/docker-compose-public-node.yml.j2 +++ b/deploy/ansible/roles/goshimmer-node/templates/docker-compose-public-node.yml.j2 @@ -52,6 +52,7 @@ services: --pow.difficulty={{ powDifficulty }} {% endif %} --logger.level={{ logLevel }} + --logger.outputPaths=stdout --logger.disableEvents=false --logger.remotelog.serverAddress={{ remoteLoggerHost }}:5213 --remotemetrics.metricsLevel=0 diff --git a/go.mod b/go.mod index 995acad5da..3e87529f5a 100644 --- a/go.mod +++ b/go.mod @@ -8,34 +8,35 @@ require ( github.com/beevik/ntp v0.3.0 github.com/capossele/asset-registry v0.0.0-20210521112927-c9d6e74574e8 github.com/celestiaorg/smt v0.2.1-0.20220414134126-dba215ccb884 - github.com/cockroachdb/errors v1.8.4 - github.com/gin-gonic/gin v1.7.0 + github.com/cockroachdb/errors v1.9.0 + github.com/gin-gonic/gin v1.7.7 github.com/go-resty/resty/v2 v2.6.0 github.com/gorilla/websocket v1.5.0 - github.com/iotaledger/hive.go v0.0.0-20220714132400-7fd91bb37663 + github.com/iotaledger/hive.go/core v0.0.0-20220804174551-efbca20a83e4 + github.com/iotaledger/hive.go/serializer/v2 v2.0.0-20220804174551-efbca20a83e4 github.com/labstack/echo v3.3.10+incompatible github.com/labstack/gommon v0.3.0 github.com/libp2p/go-libp2p v0.15.0 github.com/libp2p/go-libp2p-core v0.9.0 github.com/libp2p/go-yamux/v2 v2.2.0 - github.com/magiconair/properties v1.8.1 + github.com/magiconair/properties v1.8.6 github.com/markbates/pkger v0.17.1 github.com/mr-tron/base58 v1.2.0 github.com/multiformats/go-multiaddr v0.4.1 github.com/multiformats/go-varint v0.0.6 - github.com/panjf2000/ants/v2 v2.4.8 + github.com/panjf2000/ants/v2 v2.5.0 github.com/paulbellamy/ratecounter v0.2.0 - github.com/prometheus/client_golang v1.11.0 + github.com/prometheus/client_golang v1.11.1 github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible github.com/spf13/pflag v1.0.5 - github.com/spf13/viper v1.7.0 - github.com/stretchr/testify v1.7.1 + github.com/spf13/viper v1.12.0 + github.com/stretchr/testify v1.8.0 gitlab.com/NebulousLabs/merkletree v0.0.0-20200118113624-07fbf710afc4 go.dedis.ch/kyber/v3 v3.0.13 go.uber.org/atomic v1.9.0 - go.uber.org/dig v1.14.1 - golang.org/x/crypto v0.0.0-20220214200702-86341886e292 - google.golang.org/protobuf v1.27.1 + go.uber.org/dig v1.15.0 + golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa + google.golang.org/protobuf v1.28.1 gopkg.in/src-d/go-git.v4 v4.13.1 ) @@ -44,17 +45,17 @@ require ( github.com/aws/aws-sdk-go v1.34.28 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/btcsuite/btcd v0.22.0-beta // indirect - github.com/cespare/xxhash/v2 v2.1.1 // indirect - github.com/cockroachdb/logtags v0.0.0-20190617123548-eb05cc24525f // indirect - github.com/cockroachdb/redact v1.0.8 // indirect - github.com/cockroachdb/sentry-go v0.6.1-cockroachdb.2 // indirect + github.com/cespare/xxhash/v2 v2.1.2 // indirect + github.com/cockroachdb/logtags v0.0.0-20211118104740-dabe8e521a4f // indirect + github.com/cockroachdb/redact v1.1.3 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/davidlazar/go-crypto v0.0.0-20200604182044-b73af7476f6c // indirect github.com/dgrijalva/jwt-go v3.2.0+incompatible // indirect - github.com/emirpasic/gods v1.12.0 // indirect + github.com/emirpasic/gods v1.18.1 // indirect github.com/fatih/structs v1.1.0 // indirect github.com/flynn/noise v1.0.0 // indirect - github.com/fsnotify/fsnotify v1.4.9 // indirect + github.com/fsnotify/fsnotify v1.5.4 // indirect + github.com/getsentry/sentry-go v0.13.0 // indirect github.com/gin-contrib/sse v0.1.0 // indirect github.com/go-ole/go-ole v1.2.4 // indirect github.com/go-playground/locales v0.13.0 // indirect @@ -78,15 +79,16 @@ require ( github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect github.com/jbenet/go-temp-err-catcher v0.1.0 // indirect github.com/jbenet/goprocess v0.1.4 // indirect + github.com/jellydator/ttlcache/v2 v2.11.1 // indirect github.com/jmespath/go-jmespath v0.4.0 // indirect - github.com/json-iterator/go v1.1.11 // indirect + github.com/json-iterator/go v1.1.12 // indirect github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect github.com/kevinburke/ssh_config v0.0.0-20190725054713-01f96b0aa0cd // indirect - github.com/klauspost/compress v1.12.3 // indirect + github.com/klauspost/compress v1.15.9 // indirect github.com/klauspost/cpuid/v2 v2.0.9 // indirect - github.com/knadh/koanf v1.4.0 // indirect + github.com/knadh/koanf v1.4.2 // indirect github.com/koron/go-ssdp v0.0.2 // indirect - github.com/kr/pretty v0.2.1 // indirect + github.com/kr/pretty v0.3.0 // indirect github.com/kr/text v0.2.0 // indirect github.com/leodido/go-urn v1.2.0 // indirect github.com/libp2p/go-addr-util v0.1.0 // indirect @@ -122,8 +124,8 @@ require ( github.com/libp2p/go-tcp-transport v0.2.8 // indirect github.com/libp2p/go-ws-transport v0.5.0 // indirect github.com/marten-seemann/tcp v0.0.0-20210406111302-dfbc87cc63fd // indirect - github.com/mattn/go-colorable v0.1.8 // indirect - github.com/mattn/go-isatty v0.0.13 // indirect + github.com/mattn/go-colorable v0.1.12 // indirect + github.com/mattn/go-isatty v0.0.14 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b // indirect github.com/miekg/dns v1.1.43 // indirect @@ -133,10 +135,10 @@ require ( github.com/minio/sha256-simd v1.0.0 // indirect github.com/mitchellh/copystructure v1.2.0 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect - github.com/mitchellh/mapstructure v1.4.1 // indirect + github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/mitchellh/reflectwalk v1.0.2 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect - github.com/modern-go/reflect2 v1.0.1 // indirect + github.com/modern-go/reflect2 v1.0.2 // indirect github.com/multiformats/go-base32 v0.0.3 // indirect github.com/multiformats/go-base36 v0.1.0 // indirect github.com/multiformats/go-multiaddr-dns v0.3.1 // indirect @@ -146,22 +148,24 @@ require ( github.com/multiformats/go-multistream v0.2.2 // indirect github.com/oasisprotocol/ed25519 v0.0.0-20210505154701-76d8c688d86e // indirect github.com/opentracing/opentracing-go v1.2.0 // indirect - github.com/pelletier/go-toml v1.7.0 // indirect - github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5 // indirect + github.com/pelletier/go-toml v1.9.5 // indirect + github.com/pelletier/go-toml/v2 v2.0.2 // indirect + github.com/petermattis/goid v0.0.0-20220712135657-ac599d9cba15 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/prometheus/client_model v0.2.0 // indirect github.com/prometheus/common v0.30.0 // indirect github.com/prometheus/procfs v0.7.3 // indirect + github.com/rogpeppe/go-internal v1.8.1 // indirect github.com/sasha-s/go-deadlock v0.3.1 // indirect github.com/sergi/go-diff v1.1.0 // indirect github.com/spacemonkeygo/spacelog v0.0.0-20180420211403-2296661a0572 // indirect - github.com/spf13/afero v1.3.0 // indirect - github.com/spf13/cast v1.4.1 // indirect - github.com/spf13/jwalterweatherman v1.0.0 // indirect + github.com/spf13/afero v1.8.2 // indirect + github.com/spf13/cast v1.5.0 // indirect + github.com/spf13/jwalterweatherman v1.1.0 // indirect github.com/src-d/gcfg v1.4.0 // indirect - github.com/stretchr/objx v0.3.0 // indirect - github.com/subosito/gotenv v1.2.0 // indirect + github.com/stretchr/objx v0.4.0 // indirect + github.com/subosito/gotenv v1.3.0 // indirect github.com/tklauser/go-sysconf v0.3.5 // indirect github.com/tklauser/numcpus v0.2.2 // indirect github.com/ugorji/go/codec v1.1.7 // indirect @@ -175,18 +179,18 @@ require ( github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d // indirect go.dedis.ch/fixbuf v1.0.3 // indirect go.mongodb.org/mongo-driver v1.5.1 // indirect - go.uber.org/multierr v1.7.0 // indirect + go.uber.org/multierr v1.8.0 // indirect go.uber.org/zap v1.21.0 // indirect - golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2 // indirect - golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect - golang.org/x/sys v0.0.0-20210909193231-528a39cd75f3 // indirect - golang.org/x/term v0.0.0-20210503060354-a79de5458b56 // indirect + golang.org/x/net v0.0.0-20220802222814-0bcc04d9c69b // indirect + golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4 // indirect + golang.org/x/sys v0.0.0-20220803195053-6e608f9ce704 // indirect + golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect golang.org/x/text v0.3.7 // indirect - golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect - google.golang.org/grpc v1.40.0 // indirect - gopkg.in/ini.v1 v1.51.0 // indirect + golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f // indirect + google.golang.org/grpc v1.46.2 // indirect + gopkg.in/ini.v1 v1.66.4 // indirect gopkg.in/src-d/go-billy.v4 v4.3.2 // indirect gopkg.in/warnings.v0 v0.1.2 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect - gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index dee601ae80..e31d939e59 100644 --- a/go.sum +++ b/go.sum @@ -5,6 +5,7 @@ cloud.google.com/go v0.37.0/go.mod h1:TS1dMSSfndXH133OKGwekG838Om/cQT0BUHV3HcBgo cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= +cloud.google.com/go v0.44.3/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= @@ -15,6 +16,9 @@ cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKV cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= +cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= +cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= +cloud.google.com/go v0.75.0/go.mod h1:VGuuCn7PG0dwsd5XPVm2Mm3wlh3EL55/79EKB6hlPTY= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= @@ -23,7 +27,6 @@ cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4g cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= -cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk= cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= @@ -33,6 +36,7 @@ cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0Zeo cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= +cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= dmitri.shuralyov.com/app/changes v0.0.0-20180602232624-0a106ad413e3/go.mod h1:Yl+fi1br7+Rr3LqpNJf1/uxUdtRUV+Tnj0o93V2B9MU= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= dmitri.shuralyov.com/html/belt v0.0.0-20180602232347-f7d459c86be0/go.mod h1:JLBrvjyP0v+ecvNYvCpyZgu5/xkfAUhi6wJj28eUfSU= @@ -44,11 +48,12 @@ github.com/AlecAivazis/survey/v2 v2.3.4/go.mod h1:hrV6Y/kQCLhIZXGcriDCUBtB3wnN71 github.com/AndreasBriese/bbloom v0.0.0-20180913140656-343706a395b7/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8= github.com/AndreasBriese/bbloom v0.0.0-20190306092124-e2d15f34fcf9/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8= github.com/AndreasBriese/bbloom v0.0.0-20190825152654-46b345b51c96/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8= -github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/CloudyKit/fastprinter v0.0.0-20170127035650-74b38d55f37a/go.mod h1:EFZQ978U7x8IRnstaskI3IysnWY5Ao3QgZUKOXlsAdw= +github.com/CloudyKit/fastprinter v0.0.0-20200109182630-33d98a066a53/go.mod h1:+3IMCy2vIlbG1XG/0ggNQv0SvxCAIpPM5b1nCz56Xno= github.com/CloudyKit/jet v2.1.3-0.20180809161101-62edd43e4f88+incompatible/go.mod h1:HPYO+50pSWkPoj9Q/eq0aRGByCL6ScRlUmiEX5Zgm+w= +github.com/CloudyKit/jet/v3 v3.0.0/go.mod h1:HKQPgSJmdK8hdoAbKUUWajkHyHo4RaU5rMdUywE7VMo= github.com/Joker/hpp v1.0.0/go.mod h1:8x5n+M1Hp5hC0g8okX3sR3vFQwynaX/UgSOM9MeBKzY= github.com/Joker/jade v1.0.1-0.20190614124447-d475f43051e7/go.mod h1:6E6s8o2AE4KhCrqr6GRJjdC/gNfTdxkIXvuGZZda2VM= github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= @@ -111,7 +116,6 @@ github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+Ce 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/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= -github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84= github.com/bradfitz/go-smtpd v0.0.0-20170404230938-deb6d6237625/go.mod h1:HYsPBTaaSFSlLx/70C2HPIMNZpVV8+vt/A+FMnYP11g= github.com/btcsuite/btcd v0.0.0-20190213025234-306aecffea32/go.mod h1:DrZx5ec/dmnfpw9KyYoQyYo7d0KEvTkk/5M/vbZjAr8= github.com/btcsuite/btcd v0.0.0-20190523000118-16327141da8c/go.mod h1:3J08xEfcugPacsc34/LKRU2yO7YmuT8yt28J8k2+rrI= @@ -119,7 +123,7 @@ github.com/btcsuite/btcd v0.0.0-20190824003749-130ea5bddde3/go.mod h1:3J08xEfcug github.com/btcsuite/btcd v0.20.1-beta/go.mod h1:wVuoA8VJLEcwgqHBwHmzLRazpKxTv13Px/pDuV7OomQ= github.com/btcsuite/btcd v0.22.0-beta h1:LTDpDKUM5EeOFBPM8IXpinEcmZ6FWfNZbE3lfrfdnWo= github.com/btcsuite/btcd v0.22.0-beta/go.mod h1:9n5ntfhhHQBIhUvlhDvD3Qg6fRUj4jkN0VB8L8svzOA= -github.com/btcsuite/btcd/btcec/v2 v2.1.2 h1:YoYoC9J0jwfukodSBMzZYUVQ8PTiYg4BnOWiJVzTmLs= +github.com/btcsuite/btcd/btcec/v2 v2.2.0 h1:fzn1qaOt32TuLjFlkzYSsBC35Q3KUjT1SwPxiMSCF5k= github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f/go.mod h1:TdznJufoqS23FtqVCzL0ZqgP5MqXbb4fg/WgDys70nA= github.com/btcsuite/btcutil v0.0.0-20190207003914-4c204d697803/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg= github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg= @@ -141,8 +145,9 @@ github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QH github.com/cenkalti/backoff/v4 v4.1.1/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= -github.com/cespare/xxhash/v2 v2.1.1 h1:6MnRN8NT7+YBpUIWxHtefFZOKTAPgGjpQSxqLNn0+qY= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE= +github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cheekybits/genny v1.0.0 h1:uGGa4nei+j20rOSeDeP5Of12XVm7TGUd4dJA9RDitfE= github.com/cheekybits/genny v1.0.0/go.mod h1:+tQajlRqAUrPI7DOSpB0XAqZYtQakVtB7wXkRAgjxjQ= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= @@ -151,33 +156,39 @@ github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMn github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= github.com/cockroachdb/datadriven v1.0.0/go.mod h1:5Ib8Meh+jk1RlHIXej6Pzevx/NLlNvQB9pmSBZErGA4= +github.com/cockroachdb/datadriven v1.0.1-0.20211007161720-b558070c3be0/go.mod h1:5Ib8Meh+jk1RlHIXej6Pzevx/NLlNvQB9pmSBZErGA4= +github.com/cockroachdb/datadriven v1.0.1-0.20220214170620-9913f5bc19b7/go.mod h1:hi0MtSY3AYDQNDi83kDkMH5/yqM/CsIrsOITkSoH7KI= github.com/cockroachdb/errors v1.6.1/go.mod h1:tm6FTP5G81vwJ5lC0SizQo374JNCOPrHyXGitRJoDqM= -github.com/cockroachdb/errors v1.8.4 h1:41oZ1A4Eju6LviqkGpu5R2M39gHHVAFvOYsQjot1jNc= github.com/cockroachdb/errors v1.8.4/go.mod h1:GScl7wnuvY335l6h0jbkHIKJ+8uEmUmJRVWKnenUbfI= -github.com/cockroachdb/logtags v0.0.0-20190617123548-eb05cc24525f h1:o/kfcElHqOiXqcou5a3rIlMc7oJbMQkeLk0VQJ7zgqY= +github.com/cockroachdb/errors v1.8.8/go.mod h1:z6VnEL3hZ/2ONZEvG7S5Ym0bU2AqPcEKnIiA1wbsSu0= +github.com/cockroachdb/errors v1.9.0 h1:B48dYem5SlAY7iU8AKsgedb4gH6mo+bDkbtLIvM/a88= +github.com/cockroachdb/errors v1.9.0/go.mod h1:vaNcEYYqbIqB5JhKBhFV9CneUqeuEbB2OYJBK4GBNYQ= github.com/cockroachdb/logtags v0.0.0-20190617123548-eb05cc24525f/go.mod h1:i/u985jwjWRlyHXQbwatDASoW0RMlZ/3i9yJHE2xLkI= -github.com/cockroachdb/redact v1.0.8 h1:8QG/764wK+vmEYoOlfobpe12EQcS81ukx/a4hdVMxNw= +github.com/cockroachdb/logtags v0.0.0-20211118104740-dabe8e521a4f h1:6jduT9Hfc0njg5jJ1DdKCFPdMBrp/mdZfCpa5h+WM74= +github.com/cockroachdb/logtags v0.0.0-20211118104740-dabe8e521a4f/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= github.com/cockroachdb/redact v1.0.8/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= -github.com/cockroachdb/sentry-go v0.6.1-cockroachdb.2 h1:IKgmqgMQlVJIZj19CdocBeSfSaiCbEBZGKODaixqtHM= +github.com/cockroachdb/redact v1.1.3 h1:AKZds10rFSIj7qADf0g46UixK8NNLwWTNdCIGS5wfSQ= +github.com/cockroachdb/redact v1.1.3/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= github.com/cockroachdb/sentry-go v0.6.1-cockroachdb.2/go.mod h1:8BT+cPK6xvFOcRlk0R8eg+OTkcqI6baNH4xAkpiYVvQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= github.com/codegangsta/inject v0.0.0-20150114235600-33e0aa1cb7c0/go.mod h1:4Zcjuz89kmFXt9morQgcfYZAYZ5n8WHjt81YYWIwtTM= -github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= -github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-semver v0.3.0 h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmfM= github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd v0.0.0-20181012123002-c6f51f82210d/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= -github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= @@ -203,7 +214,6 @@ github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumC github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-farm v0.0.0-20190104051053-3adb47b1fb0f/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= -github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= @@ -211,17 +221,21 @@ github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1 github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= github.com/eknkc/amber v0.0.0-20171010120322-cdade1c07385/go.mod h1:0vRUJqYpeSZifjYj7uP3BG/gKcuzL9xWVV/Y+cK33KM= -github.com/emirpasic/gods v1.12.0 h1:QAUIPSaCu4G+POclxeqb3F+WPpdKqFGlw36+yOzGlrg= github.com/emirpasic/gods v1.12.0/go.mod h1:YfzfFFoVP/catgzJb4IKIqXjX78Ha8FMSDh3ymbK86o= +github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc= +github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ= github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4safvEdbitLhGGK48rN6g= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= +github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= +github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/etcd-io/bbolt v1.3.3/go.mod h1:ZF2nL25h33cCyBtcyWeZ2/I3HQOfTP+0PIEvHjkjCrw= -github.com/ethereum/go-ethereum v1.10.17 h1:XEcumY+qSr1cZQaWsQs5Kck3FHB0V2RiMHPdTBJ+oT8= +github.com/ethereum/go-ethereum v1.10.21 h1:5lqsEx92ZaZzRyOqBEXux4/UR06m296RGzN3ol3teJY= github.com/fasthttp-contrib/websocket v0.0.0-20160511215533-1f3b11f56072/go.mod h1:duJ4Jxv5lDcvg4QuQr0oowTf7dz4/CR8NtyCooz9HL8= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/structs v1.1.0 h1:Q7juDM0QtcnhCpeyLGQKyg4TOIghuNXrkL32pHAUMxo= @@ -234,17 +248,22 @@ github.com/francoispqt/gojay v1.2.13 h1:d2m3sFjloqoIUQU3TsHBgj6qg/BVGlTBeHDUmyJn github.com/francoispqt/gojay v1.2.13/go.mod h1:ehT5mTG4ua4581f1++1WLG0vPdaA9HaiDsoyrBGkyDY= github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20= +github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= -github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= +github.com/fsnotify/fsnotify v1.5.4 h1:jRbGcIw6P2Meqdwuo0H1p6JVLbL5DHKAKlYndzMwVZI= +github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= github.com/gavv/httpexpect v2.0.0+incompatible/go.mod h1:x+9tiU1YnrOvnB725RkpoLv1M62hOWzwo5OXotisrKc= +github.com/getsentry/sentry-go v0.12.0/go.mod h1:NSap0JBYWzHND8oMbyi0+XZhUalc1TBdRL1M71JZW2c= +github.com/getsentry/sentry-go v0.13.0 h1:20dgTiUSfxRB/EhMPtxcL9ZEbM1ZdR+W/7f7NWD+xWo= +github.com/getsentry/sentry-go v0.13.0/go.mod h1:EOsfu5ZdvKPfeHYV6pTVQnsjfp30+XA7//UooKNumH0= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gin-contrib/sse v0.0.0-20190301062529-5545eab6dad3/go.mod h1:VJ0WA2NBN22VlZ2dKZQPAPnyWw5XTlK1KymzLKsr59s= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= github.com/gin-gonic/gin v1.4.0/go.mod h1:OW2EZn3DO8Ln9oIKOvM++LBO+5UPHJJDH72/q/3rZdM= -github.com/gin-gonic/gin v1.7.0 h1:jGB9xAJQ12AIGNB4HguylppmDK1Am9ppF7XnGXXJuoU= -github.com/gin-gonic/gin v1.7.0/go.mod h1:jD2toBW3GZUr5UMcdrwQA10I7RuaFOl/SGeDjXkfUtY= +github.com/gin-gonic/gin v1.7.7 h1:3DoBmSbJbZAWqXJC3SLjAPfutPJJRN1U5pALB7EeTTs= +github.com/gin-gonic/gin v1.7.7/go.mod h1:axIBovoeJpVj8S3BwE0uPMTeReE4+AfFtqpqaZ1qq1U= github.com/gliderlabs/ssh v0.1.1/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= github.com/gliderlabs/ssh v0.2.2 h1:6zsha5zo/TWhRhwqCD3+EarCAgZ2yN28ipRnGPnwkI0= github.com/gliderlabs/ssh v0.2.2/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= @@ -314,6 +333,7 @@ github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/E github.com/gogo/googleapis v0.0.0-20180223154316-0cd9801be74a/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= github.com/gogo/googleapis v1.2.0/go.mod h1:Njal3psf3qN6dwBtQfUmBZh2ybovJ0tlu3o/AC7HYjU= +github.com/gogo/googleapis v1.4.1/go.mod h1:2lpHqI5OcWCtVElxXnPt+s8oJvMpySlOyM6xDCrzib4= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= @@ -324,9 +344,9 @@ github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69 github.com/gogo/status v1.1.0/go.mod h1:BFv9nrluPLmrS0EmGVvLaPNmRosr9KapBYd5/hpY1WM= github.com/gohornet/grocksdb v1.7.1-0.20220426081058-60f50d7c59e8 h1:JBcaA1xdFtalpZsMTYZuwUSOZxPAqqYAZa1gKYpK9nw= github.com/gohornet/grocksdb v1.7.1-0.20220426081058-60f50d7c59e8/go.mod h1:RlgTltBHJ3ha/p0pWAd1g2zjw/524L1Vw6pjBTYLdIA= +github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -360,7 +380,6 @@ github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiu github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.2/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/gomodule/redigo v1.7.1-0.20190724094224-574c33c3df38/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4= @@ -376,8 +395,8 @@ github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ= github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -386,6 +405,7 @@ github.com/google/gopacket v1.1.19 h1:ves8RnFZPGiFnTS0uPQStjwru6uO6h+nlr9j6fL7kF github.com/google/gopacket v1.1.19/go.mod h1:iJ8V8n6KS+z2U1A8pUwu8bW5SyEMkXJB8Yo/Vo+TKTo= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= @@ -393,6 +413,9 @@ github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -402,7 +425,7 @@ github.com/googleapis/gax-go v2.0.0+incompatible/go.mod h1:SFVmujtThgffbyetf+mdk github.com/googleapis/gax-go/v2 v2.0.3/go.mod h1:LLvjysVCY1JZeum8Z6l8qUty8fiNwE08qbEPm1M08qg= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8= +github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= @@ -414,18 +437,14 @@ github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/ad github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= -github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= github.com/grpc-ecosystem/grpc-gateway v1.5.0/go.mod h1:RSKVYQBd5MCa4OVpNdGskqpgL2+G+NZTnrVHpWWfpdw= -github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/gxed/hashland/keccakpg v0.0.1/go.mod h1:kRzw3HkwxFU1mpmPP8v1WyQzwdGfmKFJ6tItnhQ67kU= github.com/gxed/hashland/murmur3 v0.0.1/go.mod h1:KjXop02n4/ckmZSnY2+HKcLud/tcmvhST0bie/0lS48= -github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= github.com/hashicorp/consul/api v1.3.0/go.mod h1:MmDNSzIMUjNpY/mQ398R4bk2FnqQLoPndWW5VkKPlCE= -github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= github.com/hashicorp/consul/sdk v0.3.0/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= @@ -471,12 +490,16 @@ github.com/huin/goupnp v1.0.2 h1:RfGLP+h3mvisuWEyybxNq5Eft3NWhHLPeUN72kpKZoI= github.com/huin/goupnp v1.0.2/go.mod h1:0dxJBVBHqTMjIUMkESDTNgOOx/Mw5wYIfyFmdzSamkM= github.com/huin/goutil v0.0.0-20170803182201-1ca381bf3150/go.mod h1:PpLOETDnJ0o3iZrZfqZzyLl6l7F3c6L1oWn7OICBi6o= github.com/hydrogen18/memlistener v0.0.0-20141126152155-54553eb933fb/go.mod h1:qEIFzExnS6016fRpRfxrExeVn2gbClQA99gQhnIcdhE= +github.com/hydrogen18/memlistener v0.0.0-20200120041712-dcc25e7acd91/go.mod h1:qEIFzExnS6016fRpRfxrExeVn2gbClQA99gQhnIcdhE= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/imkira/go-interpol v1.1.0/go.mod h1:z0h2/2T3XF8kyEPpRgJ3kmNv+C43p+I/CoI+jC3w2iA= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= -github.com/iotaledger/hive.go v0.0.0-20220714132400-7fd91bb37663 h1:9Iyp28UlCFLJ4inXjU7zx5WwpgvsJx8WoFiwP+SmoFQ= -github.com/iotaledger/hive.go v0.0.0-20220714132400-7fd91bb37663/go.mod h1:8f9U7qHFby0W3cxv/nKnz9LHn9BbwWU0tMsWDnfqzRI= +github.com/iotaledger/hive.go/core v0.0.0-20220804174551-efbca20a83e4 h1:LyZZsG5V5esS3iN6f42AVyUTxodo8s8KkkHYQi+CC8o= +github.com/iotaledger/hive.go/core v0.0.0-20220804174551-efbca20a83e4/go.mod h1:iiNz8/E6xPs6TWPiBKLB7QZEbaaSSNylnfWKThZNCEc= +github.com/iotaledger/hive.go/serializer/v2 v2.0.0-20220804174551-efbca20a83e4 h1:B2N7jbiIKEkLPPA5/kyDXqO6T+cPr5xhhDKS3Tjph9I= +github.com/iotaledger/hive.go/serializer/v2 v2.0.0-20220804174551-efbca20a83e4/go.mod h1:R6Q0aeFvUzt7+Mjd7fEXeCHOHasMLmXPxUGhCybTSw4= github.com/ipfs/go-cid v0.0.1/go.mod h1:GHWU/WuQdMPmIosc4Yn1bcCT7dSeX4lBafM7iqUPQvM= github.com/ipfs/go-cid v0.0.2/go.mod h1:GHWU/WuQdMPmIosc4Yn1bcCT7dSeX4lBafM7iqUPQvM= github.com/ipfs/go-cid v0.0.3/go.mod h1:GHWU/WuQdMPmIosc4Yn1bcCT7dSeX4lBafM7iqUPQvM= @@ -521,6 +544,8 @@ github.com/ipfs/go-log/v2 v2.3.0/go.mod h1:QqGoj30OTpnKaG/LKTGTxoP2mmQtjVMEnK72g github.com/iris-contrib/blackfriday v2.0.0+incompatible/go.mod h1:UzZ2bDEoaSGPbkg6SAB4att1aAwTmVIx/5gCVqeyUdI= github.com/iris-contrib/go.uuid v2.0.0+incompatible/go.mod h1:iz2lgM/1UnEf1kP0L/+fafWORmlnuysV2EMP8MW+qe0= github.com/iris-contrib/i18n v0.0.0-20171121225848-987a633949d0/go.mod h1:pMCz62A0xJL6I+umB2YTlFRwWXaDFA0jy+5HzGiJjqI= +github.com/iris-contrib/jade v1.1.3/go.mod h1:H/geBymxJhShH5kecoiOCSssPX7QWYH7UaeZTSWddIk= +github.com/iris-contrib/pongo2 v0.0.1/go.mod h1:Ssh+00+3GAZqSQb30AvBRNxBx7rf0GqwkjqxNd0u65g= github.com/iris-contrib/schema v0.0.1/go.mod h1:urYA3uvUNG1TIIjOSCzHr9/LmbQo8LrOcOqfqxa4hXw= github.com/jackpal/gateway v1.0.5/go.mod h1:lTpwd4ACLXmpyiCTRtfiNyVnUmqT9RivzCDQetPfnjA= github.com/jackpal/go-nat-pmp v1.0.1/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc= @@ -539,6 +564,8 @@ github.com/jbenet/goprocess v0.1.3/go.mod h1:5yspPrukOVuOLORacaBi858NqyClJPQxYZl github.com/jbenet/goprocess v0.1.4 h1:DRGOFReOMqqDNXwW70QkacFW0YN9QnwLV0Vqk+3oU0o= github.com/jbenet/goprocess v0.1.4/go.mod h1:5yspPrukOVuOLORacaBi858NqyClJPQxYZlqdZVfqY4= github.com/jellevandenhooff/dkim v0.0.0-20150330215556-f50fe3d243e1/go.mod h1:E0B/fFc00Y+Rasa88328GlI/XbtyysCtTHZS8h7IrBU= +github.com/jellydator/ttlcache/v2 v2.11.1 h1:AZGME43Eh2Vv3giG6GeqeLeFXxwxn1/qHItqWZl6U64= +github.com/jellydator/ttlcache/v2 v2.11.1/go.mod h1:RtE5Snf0/57e+2cLWFYWCCsLas2Hy3c5Z4n14XmSvTI= 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/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= @@ -556,11 +583,11 @@ github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/u github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.11 h1:uVUAXhF2To8cbw/3xN3pxj6kk7TYKs98NIrTqPlMWAQ= github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= +github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= -github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/juju/errors v0.0.0-20181118221551-089d3ea4e4d5/go.mod h1:W54LbzXuIE0boCoNJfwqpmkKJ1O4TCTZMetAt6jGk7Q= github.com/juju/loggo v0.0.0-20180524022052-584905176618/go.mod h1:vgyd7OREkbtVEN/8IXZe5Ooef3LQePvuBm9UWj6ZL8U= @@ -572,9 +599,14 @@ github.com/kami-zh/go-capturer v0.0.0-20171211120116-e492ea43421d/go.mod h1:P2vi github.com/karrick/godirwalk v1.8.0/go.mod h1:H5KPZjojv4lE+QYImBI8xVtrBRgYrIVsaRPx4tDPEn4= github.com/karrick/godirwalk v1.10.3/go.mod h1:RoGL9dQei4vP9ilrpETWE8CLOZ1kiN0LhBygSwrAsHA= github.com/kataras/golog v0.0.9/go.mod h1:12HJgwBIZFNGL0EJnMRhmvGA0PQGx8VFwrZtM4CqbAk= +github.com/kataras/golog v0.0.10/go.mod h1:yJ8YKCmyL+nWjERB90Qwn+bdyBZsaQwU3bTVFgkFIp8= github.com/kataras/iris/v12 v12.0.1/go.mod h1:udK4vLQKkdDqMGJJVd/msuMtN6hpYJhg/lSzuxjhO+U= +github.com/kataras/iris/v12 v12.1.8/go.mod h1:LMYy4VlP67TQ3Zgriz8RE2h2kMZV2SgMYbq3UhfoFmE= github.com/kataras/neffos v0.0.10/go.mod h1:ZYmJC07hQPW67eKuzlfY7SO3bC0mw83A3j6im82hfqw= +github.com/kataras/neffos v0.0.14/go.mod h1:8lqADm8PnbeFfL7CLXh1WHw53dG27MC3pgi2R1rmoTE= github.com/kataras/pio v0.0.0-20190103105442-ea782b38602d/go.mod h1:NV88laa9UiiDuX9AhMbDPkGYSPugBOV6yTZB1l2K9Z0= +github.com/kataras/pio v0.0.2/go.mod h1:hAoW0t9UmXi4R5Oyq5Z4irTbaTsOemSrDGUtaTl7Dro= +github.com/kataras/sitemap v0.0.5/go.mod h1:KY2eugMKiPwsJgx7+U103YZehfvNGOXURubcGyk0Bz8= github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 h1:Z9n2FFNUXsshfwJMBgNA0RU6/i7WVaAegv3PtuIHPMs= github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8= github.com/kevinburke/ssh_config v0.0.0-20190725054713-01f96b0aa0cd h1:Coekwdh0v2wtGp9Gmz1Ze3eVRAWJMLokvN3QjdzCHLY= @@ -587,15 +619,16 @@ github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6 github.com/klauspost/compress v1.8.2/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= github.com/klauspost/compress v1.9.0/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= github.com/klauspost/compress v1.9.5/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= +github.com/klauspost/compress v1.9.7/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= github.com/klauspost/compress v1.11.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= -github.com/klauspost/compress v1.12.3 h1:G5AfA94pHPysR56qqrkO2pxEexdDzrpFJ6yt/VqWxVU= -github.com/klauspost/compress v1.12.3/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= +github.com/klauspost/compress v1.15.9 h1:wKRjX6JRtDdrE9qwa4b/Cip7ACOshUI4smpCQanqjSY= +github.com/klauspost/compress v1.15.9/go.mod h1:PhcZ0MbTNciWF3rruxRgKxI5NkcHHrHUDtV4Yw2GlzU= github.com/klauspost/cpuid v1.2.1/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= github.com/klauspost/cpuid/v2 v2.0.4/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= github.com/klauspost/cpuid/v2 v2.0.9 h1:lgaqFMSdTdQYdZ04uHyN2d/eKdOMyi2YLSvlQIBFYa4= github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= -github.com/knadh/koanf v1.4.0 h1:/k0Bh49SqLyLNfte9r6cvuZWrApOQhglOmhIU3L/zDw= -github.com/knadh/koanf v1.4.0/go.mod h1:1cfH5223ZeZUOs8FU2UdTmaNfHpqgtjV0+NHjRO43gs= +github.com/knadh/koanf v1.4.2 h1:2itp+cdC6miId4pO4Jw7c/3eiYD26Z/Sz3ATJMwHxIs= +github.com/knadh/koanf v1.4.2/go.mod h1:4NCo0q4pmU398vF9vq2jStF9MWQZ8JEDcDMHlDCr4h0= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= @@ -606,8 +639,9 @@ github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= +github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/pty v1.1.3/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/pty v1.1.8/go.mod h1:O1sed60cT9XZ5uDucP5qwvh+TE3NnUj51EiZO/lmSfw= @@ -617,6 +651,7 @@ github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/labstack/echo v3.3.10+incompatible h1:pGRcYk231ExFAyoAjAfD85kQzRJCRI8bbnE7CX5OEgg= github.com/labstack/echo v3.3.10+incompatible/go.mod h1:0INS7j/VjnFxD4E2wkz67b8cVwCLbBmJyDaka6Cmk1s= github.com/labstack/echo/v4 v4.1.11/go.mod h1:i541M3Fj6f76NZtHSj7TXnyM8n2gaodfvfxNnFqi74g= +github.com/labstack/echo/v4 v4.5.0/go.mod h1:czIriw4a0C1dFun+ObrXp7ok03xON0N1awStJ6ArI7Y= github.com/labstack/gommon v0.3.0 h1:JEeO0bvc78PKdyHxloTKiF8BD5iGrH8T6MSeGvSgob0= github.com/labstack/gommon v0.3.0/go.mod h1:MULnywXg0yavhxWKc+lOruYdAhDwPK9wf0OL7NoOu+k= github.com/leodido/go-urn v1.2.0 h1:hpXL4XnriNwQ/ABnpepYM/1vCLWNDfUNts8dX3xTG6Y= @@ -821,8 +856,8 @@ github.com/lucas-clemente/quic-go v0.21.2/go.mod h1:vF5M1XqhBAHgbjKcJOXY3JZz3GP0 github.com/lunixbochs/vtclean v1.0.0/go.mod h1:pHhQNgMf3btfWnGBVipUOjRYhoOsdGqdm/+2c2E2WMI= github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= -github.com/magiconair/properties v1.8.1 h1:ZC2Vc7/ZFkGmsVC9KvOjumD+G5lXy2RtTKyzRKO2BQ4= -github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= +github.com/magiconair/properties v1.8.6 h1:5ibWZ6iY0NctNGWo87LalDlEZ6R41TqbbDamhfG/Qzo= +github.com/magiconair/properties v1.8.6/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190312143242-1de009706dbe/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/markbates/oncer v0.0.0-20181203154359-bf2de49a0be2/go.mod h1:Ld9puTsIW75CHf65OeIOkyKbteujpZVXDpWK6YGZbxE= @@ -842,8 +877,10 @@ github.com/marten-seemann/tcp v0.0.0-20210406111302-dfbc87cc63fd/go.mod h1:QuCEs github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ= github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= -github.com/mattn/go-colorable v0.1.8 h1:c1ghPdyEDarC70ftn0y+A/Ee++9zz8ljHG1b13eJ0s8= github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-colorable v0.1.11/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= +github.com/mattn/go-colorable v0.1.12 h1:jF+Du6AlPIjs2BiUiQlKOX0rt3SujHxPnksPKZbaA40= +github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= @@ -851,14 +888,16 @@ github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hd github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= -github.com/mattn/go-isatty v0.0.13 h1:qdl+GuBjcsKKDco5BsxPJlId98mSWNKqYA+Co0SC1yA= github.com/mattn/go-isatty v0.0.13/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= +github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y= +github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/goveralls v0.0.2/go.mod h1:8d1ZMHsd7fW6IRPKQh46F2WRpyib5/X4FOpevwGNQEw= github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/mediocregopher/mediocre-go-lib v0.0.0-20181029021733-cb65787f37ed/go.mod h1:dSsfyI2zABAdhcbvkXqgxOxrCsbYeHCPgrZkku60dSg= github.com/mediocregopher/radix/v3 v3.3.0/go.mod h1:EmfVyvspXz1uZEyPBMyGK+kjWiKQGvsUt6O3Pj+LDCQ= +github.com/mediocregopher/radix/v3 v3.4.2/go.mod h1:8FL3F6UQRXHXIBSPUs5h0RybMF8i4n7wVopoX3x7Bv8= github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b h1:j7+1HpAFS1zy5+Q4qx1fWh90gTKwiN4QCGoY9TWyyO4= github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE= github.com/microcosm-cc/bluemonday v1.0.1/go.mod h1:hsXNsILzKxV+sX77C5b8FSuKF00vh2OMYv+xgHpAMF4= @@ -898,8 +937,9 @@ github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS4 github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/mitchellh/mapstructure v1.4.1 h1:CpVNEelQCZBooIPDn+AR3NpivK/TIKU8bDxdASFVQag= github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= +github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= @@ -907,8 +947,9 @@ github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= +github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc= github.com/moul/http2curl v1.0.0/go.mod h1:8UbvGypXm98wA/IqH45anm5Y2Z6ep6O31QGOAZ3H0fQ= github.com/mr-tron/base58 v1.1.0/go.mod h1:xcD2VGqlgYjBdcBLw+TuYLr8afG+Hj8g2eTVqeSzSU8= @@ -993,11 +1034,11 @@ github.com/oasisprotocol/ed25519 v0.0.0-20210505154701-76d8c688d86e h1:pHDo+QVA9 github.com/oasisprotocol/ed25519 v0.0.0-20210505154701-76d8c688d86e/go.mod h1:IZbb50w3AB72BVobEF6qG93NNSrTw/V2QlboxqSu3Xw= github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= -github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= 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= github.com/onsi/ginkgo v1.8.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.0/go.mod h1:oUhWkIvk5aDxtKvDDuw8gItl8pKl42LzjC9KZE0HfGg= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.13.0/go.mod h1:+REjRxOmWfHCjfv9TTWB1jD1Frx4XydAD3zm1lskyM0= @@ -1026,8 +1067,8 @@ github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJ github.com/openzipkin/zipkin-go v0.2.1/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIwwtUjcrb0b5/5kLM= -github.com/panjf2000/ants/v2 v2.4.8 h1:JgTbolX6K6RreZ4+bfctI0Ifs+3mrE5BIHudQxUDQ9k= -github.com/panjf2000/ants/v2 v2.4.8/go.mod h1:f6F0NZVFsGCp5A7QW/Zj/m92atWwOkY0OIhFxRNFr4A= +github.com/panjf2000/ants/v2 v2.5.0 h1:1rWGWSnxCsQBga+nQbA4/iY6VMeNoOIAM0ZWh9u3q2Q= +github.com/panjf2000/ants/v2 v2.5.0/go.mod h1:cU93usDlihJZ5CfRGNDYsiBYvoilLvBF5Qp/BT2GNRE= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/paulbellamy/ratecounter v0.2.0 h1:2L/RhJq+HA8gBQImDXtLPrDXK5qAj6ozWVK/zFXVJGs= @@ -1035,35 +1076,40 @@ github.com/paulbellamy/ratecounter v0.2.0/go.mod h1:Hfx1hDpSGoqxkVVpBi/IlYD7kChl github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-buffruneio v0.2.0/go.mod h1:JkE26KsDizTr40EUHkXVtNPvgGtbSNq5BcowyYOWdKo= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/pelletier/go-toml v1.7.0 h1:7utD74fnzVc/cpcyy8sjrlFr5vYpypUixARcHIMIGuI= github.com/pelletier/go-toml v1.7.0/go.mod h1:vwGMzjaWMwyfHwgIBhI2YUM4fB6nL6lVAvS1LBMMhTE= +github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8= +github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= +github.com/pelletier/go-toml/v2 v2.0.2 h1:+jQXlF3scKIcSEKkdHzXhCTDLPFi5r1wnK6yPS+49Gw= +github.com/pelletier/go-toml/v2 v2.0.2/go.mod h1:MovirKjgVRESsAvNZlAjtFwV867yGuwRkXbG66OzopI= github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= -github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5 h1:q2e307iGHPdTGp0hoxKjt1H5pDo6utceo3dQVK3I5XQ= github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o= +github.com/petermattis/goid v0.0.0-20220712135657-ac599d9cba15 h1:4lW1DeHHRUzImL9Uz2Fa4j7IIJr+7FNfzjSJxGSZz/k= +github.com/petermattis/goid v0.0.0-20220712135657-ac599d9cba15/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4= github.com/pingcap/errors v0.11.4/go.mod h1:Oi8TUi2kEtXXLMJk9l1cGmz20kV3TaQ0usTwv5KuLY8= +github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/profile v1.2.1/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA= -github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI= +github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/prometheus/client_golang v0.8.0/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs= -github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= github.com/prometheus/client_golang v1.9.0/go.mod h1:FqZLKOZnGdFAhOK4nqGHa7D66IdsO+O441Eve7ptJDU= github.com/prometheus/client_golang v1.10.0/go.mod h1:WJM3cc3yu7XKBKa/I8WeZm+V3eltZnBwfENSU7mdogU= -github.com/prometheus/client_golang v1.11.0 h1:HNkLOAEQMIDv/K+04rukrLx6ch7msSRwf3/SASFAGtQ= github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= +github.com/prometheus/client_golang v1.11.1 h1:+4eQaD7vAZ6DsfsxB15hbE0odUjGI5ARs9yskGu1v4s= +github.com/prometheus/client_golang v1.11.1/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= @@ -1072,9 +1118,7 @@ github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6T github.com/prometheus/client_model v0.2.0 h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/common v0.0.0-20180801064454-c7de2306084e/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= -github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= @@ -1086,7 +1130,6 @@ github.com/prometheus/common v0.30.0/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+ github.com/prometheus/procfs v0.0.0-20180725123919-05ee40e3a273/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= @@ -1094,7 +1137,6 @@ github.com/prometheus/procfs v0.2.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4O github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/prometheus/procfs v0.7.3 h1:4jVXhlkAyzOScmCkXBTOLRLTz8EeU+eyjrwB/EPq0VU= github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= -github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/rhnvrm/simples3 v0.6.1/go.mod h1:Y+3vYm2V7Y4VijFoJHHTrja6OgPrJ2cBti8dPGkC3sA= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= @@ -1102,6 +1144,9 @@ github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6L github.com/rogpeppe/go-internal v1.1.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.2.2/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= +github.com/rogpeppe/go-internal v1.8.1 h1:geMPLpDpQOgVyCg5z5GoRwLHepNdb71NXb67XFkP+Eg= +github.com/rogpeppe/go-internal v1.8.1/go.mod h1:JeRgkft04UBgHMgCIwADu4Pn6Mtm5d4nPKWu0nJ5d+o= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= @@ -1110,6 +1155,7 @@ github.com/ryanuber/go-glob v1.0.0/go.mod h1:807d1WSdnB0XRJzKNil9Om6lcp/3a0v4qIH github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= github.com/sasha-s/go-deadlock v0.3.1 h1:sqv7fDNShgjcaxkO0JNcOAlr8B9+cV5Ey/OB71efZx0= github.com/sasha-s/go-deadlock v0.3.1/go.mod h1:F73l+cr82YSh10GxyRI6qZiCgK64VaZjwesgfQ1/iLM= +github.com/schollz/closestmatch v2.1.0+incompatible/go.mod h1:RtP1ddjLong6gTkbtmuhtR2uUrrJOpYzYRvbcPAid+g= github.com/sclevine/agouti v3.0.0+incompatible/go.mod h1:b4WX9W9L1sfQKXeJf1mUTLZKJ48R1S7H23Ji7oFO5Bw= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= @@ -1145,9 +1191,7 @@ github.com/sirupsen/logrus v1.4.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPx github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= -github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= -github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/smola/gocompat v0.2.0/go.mod h1:1B0MlxbmoZNo3h8guHp8HztB3BSYR5itql9qtVc0ypY= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= @@ -1160,22 +1204,23 @@ github.com/spacemonkeygo/spacelog v0.0.0-20180420211403-2296661a0572/go.mod h1:w github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= -github.com/spf13/afero v1.3.0 h1:Ysnmjh1Di8EaWaBv40CYR4IdaIsBc5996Gh1oZzCBKk= -github.com/spf13/afero v1.3.0/go.mod h1:5KUK8ByomD5Ti5Artl0RtHeI5pTF7MIDuXL3yY520V4= +github.com/spf13/afero v1.8.2 h1:xehSyVa0YnHWsJ49JFljMpg1HX19V6NDZ1fkm1Xznbo= +github.com/spf13/afero v1.8.2/go.mod h1:CtAatgMJh6bJEIs48Ay/FOnkljP3WeGUG0MC1RfAqwo= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cast v1.4.1 h1:s0hze+J0196ZfEMTs80N7UlFt0BDuQ7Q+JDnHiMWKdA= -github.com/spf13/cast v1.4.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= +github.com/spf13/cast v1.5.0 h1:rj3WzYc11XZaIZMPKmwP96zkFEnnAmV8s6XbB2aY32w= +github.com/spf13/cast v1.5.0/go.mod h1:SpXXQ5YoyJw6s3/6cMTQuxvgRl3PCJiyaX9p6b155UU= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= -github.com/spf13/jwalterweatherman v1.0.0 h1:XHEdyB+EcvlqZamSM4ZOMGlc93t6AcsBEu9Gc1vn7yk= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= +github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= +github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= -github.com/spf13/viper v1.7.0 h1:xVKxvI7ouOI5I+U9s2eeiUfMaWBVoXA3AWskkrqK0VM= -github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= +github.com/spf13/viper v1.12.0 h1:CZ7eSOd3kZoaYDLbXnmzgQI5RlciuXBMA+18HwHRfZQ= +github.com/spf13/viper v1.12.0/go.mod h1:b6COn30jlNxbm/V2IqWiNWkJ+vZNiMNksliPCiuKtSI= github.com/src-d/envconfig v1.0.0/go.mod h1:Q9YQZ7BKITldTBnoxsE5gOeB5y66RyPXeue/R4aaNBc= github.com/src-d/gcfg v1.4.0 h1:xXbNR5AlLSA315x2UO+fTSSAXCDf+Ar38/6oyGbDKQ4= github.com/src-d/gcfg v1.4.0/go.mod h1:p/UMsR43ujA89BJY9duynAwIpvqEujIH/jFlfL7jWoI= @@ -1185,18 +1230,20 @@ github.com/streadway/handy v0.0.0-20190108123426-d5acb3125c2a/go.mod h1:qNTQ5P5J github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= -github.com/stretchr/objx v0.3.0 h1:NGXK3lHquSN08v5vWalVI/L8XU9hdzE/G6xsrze47As= -github.com/stretchr/objx v0.3.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= +github.com/stretchr/objx v0.4.0 h1:M2gUjqZET1qApGOWNSnZ49BAIMX4F/1plDv3+l31EJ4= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.1 h1:5TQK59W5E3v0r2duFAb7P95B6hEeOyEnHRa8MjYSMTY= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s= -github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= +github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= +github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/subosito/gotenv v1.3.0 h1:mjC+YW8QpAdXibNi+vNWgzmgBH4+5l5dCXv8cNysBLI= +github.com/subosito/gotenv v1.3.0/go.mod h1:YzJjq/33h7nrwdY+iHMhEOEEbW0ovIz0tB6t6PwAXzs= github.com/syndtr/goleveldb v1.0.0/go.mod h1:ZVVdQEZoIme9iO1Ch2Jdy24qqXrMMOU6lpPAyBWyWuQ= github.com/tarm/serial v0.0.0-20180830185346-98f6abe2eb07/go.mod h1:kDXzergiv9cbyO7IOYJZWg1U88JhDg3PB6klq9Hg2pA= github.com/tidwall/pretty v1.0.0 h1:HsD+QiTn7sK6flMKIvNmpqz1qrpP3Ps6jOKIKMooyg4= @@ -1206,7 +1253,6 @@ github.com/tklauser/go-sysconf v0.3.5/go.mod h1:MkWzOF4RMCshBAMXuhXJs64Rte09mITn github.com/tklauser/numcpus v0.2.2 h1:oyhllyrScuYI6g+h/zUvNXNp1wy7x8qQy3t/piefldA= github.com/tklauser/numcpus v0.2.2/go.mod h1:x3qojaO3uyYt0i56EW/VUYs7uBvdl2fkfZFu0T9wgjM= github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= -github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= @@ -1273,7 +1319,6 @@ go.dedis.ch/protobuf v1.0.5/go.mod h1:eIV4wicvi6JK0q/QnfIEGeSFNG0ZeB24kzut5+HaRL go.dedis.ch/protobuf v1.0.7/go.mod h1:pv5ysfkDX/EawiPqcW3ikOxsL5t+BqnV6xHSmE79KI4= go.dedis.ch/protobuf v1.0.11 h1:FTYVIEzY/bfl37lu3pR4lIj+F9Vp1jE8oh91VmxKgLo= go.dedis.ch/protobuf v1.0.11/go.mod h1:97QR256dnkimeNdfmURz0wAMNVbd1VmLXhG1CrTYrJ4= -go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= go.mongodb.org/mongo-driver v1.5.1 h1:9nOVLGDfOaZ9R0tBumx/BcuqkbFpyTCU2r/Po7A2azI= @@ -1287,6 +1332,7 @@ go.opencensus.io v0.22.1/go.mod h1:Ap50jQcDJrx6rB6VgeeFPtuPIf3wMRvRfrfYDO6+BmA= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= @@ -1295,8 +1341,8 @@ go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/atomic v1.9.0 h1:ECmE8Bn/WFTYwEW/bpKD3M8VtR/zQVbavAoalC1PYyE= go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= -go.uber.org/dig v1.14.1 h1:fyakRgZDdi2F8FgwJJoRGangMSPTIxPSLGzR3Oh0/54= -go.uber.org/dig v1.14.1/go.mod h1:52EKx/Vjdpz9EzeNcweC4YMsTrDdFn9mS/+Uw5ZnVTI= +go.uber.org/dig v1.15.0 h1:vq3YWr8zRj1eFGC7Gvf907hE0eRjPTZ1d3xHadD6liE= +go.uber.org/dig v1.15.0/go.mod h1:pKHs0wMynzL6brANhB2hLMro+zalv1osARTviTcqHLM= go.uber.org/goleak v1.0.0/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= go.uber.org/goleak v1.1.11 h1:wy28qYRKZgnJTxGxvye5/wgWr1EKjmUDGYox5mGlRlI= @@ -1305,8 +1351,9 @@ go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/ go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= -go.uber.org/multierr v1.7.0 h1:zaiO/rmgFjbmCXdSYJWQcdvOCsthmdaHfr3Gm2Kx4Ec= go.uber.org/multierr v1.7.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95ak= +go.uber.org/multierr v1.8.0 h1:dg6GjLku4EH+249NNmoIciG9N/jURbDG+pFlTkhzIC8= +go.uber.org/multierr v1.8.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95ak= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= @@ -1337,9 +1384,9 @@ golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190618222545-ea8f1a30c443/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191119213627-4f8c1d86b1ba/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20191227163750-53104e6ec876/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200109152110-61a87790db17/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200115085410-6d4e4cb37c7d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200221231518-2aa609cf4a9d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= @@ -1349,10 +1396,13 @@ golang.org/x/crypto v0.0.0-20200602180216-279210d13fed/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= +golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210506145944-38f3c27a63bf/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8= golang.org/x/crypto v0.0.0-20210813211128-0a44fdfbc16e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20220214200702-86341886e292 h1:f+lwQ+GtmgoY+A2YaQxlSOnDjXcQ7ZRLWOHbC6HtRqE= -golang.org/x/crypto v0.0.0-20220214200702-86341886e292/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa h1:zuSxTR4o9y82ebqCUJYNGJbGPo6sKVl54f/TVDObg1c= +golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -1377,6 +1427,7 @@ golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRu golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= @@ -1386,6 +1437,8 @@ golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzB 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.3.1-0.20200828183125-ce943fd02449/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1433,6 +1486,9 @@ golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81R golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200904194848-62affa334b73/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= @@ -1441,8 +1497,9 @@ golang.org/x/net v0.0.0-20210423184538-5f58ad60dda6/go.mod h1:OJAsFXCWl8Ukc7SiCT golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2 h1:CIJ76btIcR3eFI5EgSo6k1qKw9KJexJuRLI9G7Hp5wE= -golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20211008194852-3b03d305991f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20220802222814-0bcc04d9c69b h1:3ogNYyK4oIQdIKzTu68hQrr4iuVxF3AxKl9Aj/eDrw0= +golang.org/x/net v0.0.0-20220802222814-0bcc04d9c69b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181017192945-9dcd33a902f4/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181203162652-d668ce993890/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -1450,6 +1507,10 @@ golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4Iltr golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/perf v0.0.0-20180704124530-6e6d33e29852/go.mod h1:JLpeXjPJfIyPr5TlbXLkXWLhP8nz10XfvxElABhCtcw= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -1463,8 +1524,9 @@ golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4 h1:uVc8UZUe6tr40fFVnUP5Oj+veunVezqYl9z7DYw9xzw= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1528,36 +1590,50 @@ golang.org/x/sys v0.0.0-20200602225109-6fdc65e7d980/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201214210602-f9fddec55a1e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210303074136-134d130e1a04/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210309074719-68d13333faf2/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210316164454-77fc1eacc6aa/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210317225723-c4fcb01b228e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210426080607-c94f62235c83/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210511113859-b0526f3d8744/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210816183151-1e6c022a8912/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210909193231-528a39cd75f3 h1:3Ad41xy2WCESpufXwgs7NpDSu+vjxqLt2UFqUV+20bI= -golang.org/x/sys v0.0.0-20210909193231-528a39cd75f3/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220803195053-6e608f9ce704 h1:Y7NOhdqIOU8kYI7BxsgL38d0ot0raxvcW+EMQU2QrT4= +golang.org/x/sys v0.0.0-20220803195053-6e608f9ce704/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.0.0-20210503060354-a79de5458b56 h1:b8jxX3zqjpqb2LklXPzKSGJhzyxCOZSz8ncv8Nv+y7w= golang.org/x/term v0.0.0-20210503060354-a79de5458b56/go.mod h1:tfny5GFUkzUvx4ps4ajbZsCe5lw1metzhBm9T3x7oIY= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 h1:JGgROgKl9N8DuW20oFS5gxc+lE67/N3FcwmBPMe7ArY= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20181227161524-e6919f6577db/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= 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.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= @@ -1566,6 +1642,7 @@ golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxb golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20201208040808-7e3f01d25324/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -1597,7 +1674,6 @@ golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -1626,17 +1702,26 @@ golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roY golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= +golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210112230658-8b4aab62c064/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5 h1:ouewzE6p+/VEB31YYnTbEJdi8pFqKp4P4n85vwo3DHA= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f h1:uF6paiQQebLeSXkrTqHqz0MXhXXS1KgF41eUdBNvxK0= +golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= google.golang.org/api v0.0.0-20180910000450-7ca32eb868bf/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= google.golang.org/api v0.0.0-20181030000543-1d582fd0359e/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= google.golang.org/api v0.1.0/go.mod h1:UGEZY7KEX120AnNLIHFMKIo4obdJhkp2tPbaPlQx13Y= @@ -1657,6 +1742,9 @@ google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0M google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= +google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= +google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= +google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.3.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -1665,6 +1753,7 @@ google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7 google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/genproto v0.0.0-20180518175338-11a468237815/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= @@ -1702,6 +1791,14 @@ google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7Fc google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= google.golang.org/grpc v1.12.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.16.0/go.mod h1:0JHn/cJsOMiMfNA9+DeHDlAU7KAAB5GDlYFpa9MZMio= @@ -1726,9 +1823,14 @@ google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= +google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= +google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= +google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.40.0 h1:AGJ0Ih4mHjSeibYkFGh1dD9KJ/eOtZ93I6hoHhukQ5Q= +google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= +google.golang.org/grpc v1.46.2 h1:u+MLGgVf7vRdjEYZ8wDFhAVNmhkbJ5hmrA1LMWK1CAQ= +google.golang.org/grpc v1.46.2/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -1741,8 +1843,9 @@ google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGj google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w= +google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d/go.mod h1:cuepJuh7vyXfUyUwEgHQXw849cJrilpS5NeIjOWESAw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -1757,8 +1860,9 @@ gopkg.in/gcfg.v1 v1.2.3/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE= gopkg.in/go-playground/validator.v8 v8.18.2/go.mod h1:RX2a/7Ha8BgOhfk7j780h4/u/RRjR0eouCJSH80/M2Y= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= -gopkg.in/ini.v1 v1.51.0 h1:AQvPpx3LzTDM0AjnIRlVFwFFGC+npRopjZxLJj6gdno= -gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/ini.v1 v1.51.1/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/ini.v1 v1.66.4 h1:SsAcf+mM7mRZo2nJNGt8mZCjG8ZRaNGMURJw7BsIST4= +gopkg.in/ini.v1 v1.66.4/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/mgo.v2 v2.0.0-20180705113604-9856a29383ce/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/square/go-jose.v2 v2.3.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= @@ -1785,9 +1889,12 @@ gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= +gopkg.in/yaml.v3 v3.0.0-20191120175047-4206685974f2/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= grpc.go4.org v0.0.0-20170609214715-11d0a25b4919/go.mod h1:77eQGdRu53HpSqPFJFmuJdjuHRquDANNeA4x7B8WQ9o= honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/main.go b/main.go index 7137fb141a..d0d2d4d432 100644 --- a/main.go +++ b/main.go @@ -3,7 +3,7 @@ package main import ( _ "net/http/pprof" - "github.com/iotaledger/hive.go/node" + "github.com/iotaledger/hive.go/core/node" "github.com/iotaledger/goshimmer/plugins" ) diff --git a/packages/chat/chat.go b/packages/app/chat/chat.go similarity index 91% rename from packages/chat/chat.go rename to packages/app/chat/chat.go index fb77f351fc..6b5b56e557 100644 --- a/packages/chat/chat.go +++ b/packages/app/chat/chat.go @@ -3,10 +3,10 @@ package chat import ( "fmt" - "github.com/iotaledger/hive.go/generics/model" - "github.com/iotaledger/hive.go/serix" + "github.com/iotaledger/hive.go/core/generics/model" + "github.com/iotaledger/hive.go/core/serix" - "github.com/iotaledger/goshimmer/packages/tangle/payload" + "github.com/iotaledger/goshimmer/packages/core/tangleold/payload" ) func init() { diff --git a/packages/chat/events.go b/packages/app/chat/events.go similarity index 90% rename from packages/chat/events.go rename to packages/app/chat/events.go index dc3dead36c..7015ecbf35 100644 --- a/packages/chat/events.go +++ b/packages/app/chat/events.go @@ -3,7 +3,7 @@ package chat import ( "time" - "github.com/iotaledger/hive.go/generics/event" + "github.com/iotaledger/hive.go/core/generics/event" ) // Events define events occurring within a Chat. diff --git a/packages/chat/payload_test.go b/packages/app/chat/payload_test.go similarity index 86% rename from packages/chat/payload_test.go rename to packages/app/chat/payload_test.go index ea3a4d98d0..745e9b85db 100644 --- a/packages/chat/payload_test.go +++ b/packages/app/chat/payload_test.go @@ -3,7 +3,7 @@ package chat import ( "testing" - "github.com/iotaledger/hive.go/generics/lo" + "github.com/iotaledger/hive.go/core/generics/lo" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/packages/faucet/request.go b/packages/app/faucet/request.go similarity index 89% rename from packages/faucet/request.go rename to packages/app/faucet/request.go index 7e6477bc6e..fd44b28535 100644 --- a/packages/faucet/request.go +++ b/packages/app/faucet/request.go @@ -5,13 +5,13 @@ import ( "fmt" "github.com/cockroachdb/errors" - "github.com/iotaledger/hive.go/generics/model" - "github.com/iotaledger/hive.go/identity" - "github.com/iotaledger/hive.go/serix" + "github.com/iotaledger/hive.go/core/generics/model" + "github.com/iotaledger/hive.go/core/identity" + "github.com/iotaledger/hive.go/core/serix" - "github.com/iotaledger/goshimmer/packages/ledger/vm/devnetvm" - "github.com/iotaledger/goshimmer/packages/tangle" - "github.com/iotaledger/goshimmer/packages/tangle/payload" + "github.com/iotaledger/goshimmer/packages/core/ledger/vm/devnetvm" + "github.com/iotaledger/goshimmer/packages/core/tangleold" + "github.com/iotaledger/goshimmer/packages/core/tangleold/payload" ) func init() { @@ -109,6 +109,6 @@ func (p *Payload) SetConsensusManaPledgeID(id identity.ID) { } // IsFaucetReq checks if the block is faucet payload. -func IsFaucetReq(blk *tangle.Block) bool { +func IsFaucetReq(blk *tangleold.Block) bool { return blk.Payload().Type() == RequestType } diff --git a/packages/faucet/request_test.go b/packages/app/faucet/request_test.go similarity index 67% rename from packages/faucet/request_test.go rename to packages/app/faucet/request_test.go index d796044bae..0f63907064 100644 --- a/packages/faucet/request_test.go +++ b/packages/app/faucet/request_test.go @@ -4,16 +4,16 @@ import ( "testing" "time" - "github.com/iotaledger/hive.go/crypto/ed25519" - "github.com/iotaledger/hive.go/generics/lo" - "github.com/iotaledger/hive.go/identity" - "github.com/iotaledger/hive.go/types" + "github.com/iotaledger/hive.go/core/crypto/ed25519" + "github.com/iotaledger/hive.go/core/generics/lo" + "github.com/iotaledger/hive.go/core/identity" + "github.com/iotaledger/hive.go/core/types" "github.com/stretchr/testify/assert" - "github.com/iotaledger/goshimmer/packages/epoch" - "github.com/iotaledger/goshimmer/packages/ledger/vm/devnetvm" - "github.com/iotaledger/goshimmer/packages/tangle" - "github.com/iotaledger/goshimmer/packages/tangle/payload" + "github.com/iotaledger/goshimmer/packages/core/epoch" + "github.com/iotaledger/goshimmer/packages/core/ledger/vm/devnetvm" + "github.com/iotaledger/goshimmer/packages/core/tangleold" + "github.com/iotaledger/goshimmer/packages/core/tangleold/payload" ) func TestRequest(t *testing.T) { @@ -48,10 +48,10 @@ func TestIsFaucetReq(t *testing.T) { faucetRequest := NewRequest(address, emptyID, emptyID, 0) - faucetBlk := tangle.NewBlock( - map[tangle.ParentsType]tangle.BlockIDs{ - tangle.StrongParentType: { - tangle.EmptyBlockID: types.Void, + faucetBlk := tangleold.NewBlock( + map[tangleold.ParentsType]tangleold.BlockIDs{ + tangleold.StrongParentType: { + tangleold.EmptyBlockID: types.Void, }, }, time.Now(), @@ -64,10 +64,10 @@ func TestIsFaucetReq(t *testing.T) { epoch.NewECRecord(0), ) - dataBlk := tangle.NewBlock( - map[tangle.ParentsType]tangle.BlockIDs{ - tangle.StrongParentType: { - tangle.EmptyBlockID: types.Void, + dataBlk := tangleold.NewBlock( + map[tangleold.ParentsType]tangleold.BlockIDs{ + tangleold.StrongParentType: { + tangleold.EmptyBlockID: types.Void, }, }, time.Now(), diff --git a/packages/firewall/firewall.go b/packages/app/firewall/firewall.go similarity index 92% rename from packages/firewall/firewall.go rename to packages/app/firewall/firewall.go index a57c38d82b..8d714ba1aa 100644 --- a/packages/firewall/firewall.go +++ b/packages/app/firewall/firewall.go @@ -3,11 +3,11 @@ package firewall import ( "sync" - "github.com/iotaledger/hive.go/autopeering/selection" - "github.com/iotaledger/hive.go/identity" - "github.com/iotaledger/hive.go/logger" + "github.com/iotaledger/hive.go/core/autopeering/selection" + "github.com/iotaledger/hive.go/core/identity" + "github.com/iotaledger/hive.go/core/logger" - "github.com/iotaledger/goshimmer/packages/p2p" + "github.com/iotaledger/goshimmer/packages/node/p2p" ) // Firewall is a object responsible for taking actions on faulty peers. diff --git a/packages/jsonmodels/autopeering.go b/packages/app/jsonmodels/autopeering.go similarity index 100% rename from packages/jsonmodels/autopeering.go rename to packages/app/jsonmodels/autopeering.go diff --git a/packages/jsonmodels/data.go b/packages/app/jsonmodels/data.go similarity index 100% rename from packages/jsonmodels/data.go rename to packages/app/jsonmodels/data.go diff --git a/packages/jsonmodels/epochs.go b/packages/app/jsonmodels/epochs.go similarity index 94% rename from packages/jsonmodels/epochs.go rename to packages/app/jsonmodels/epochs.go index ee31ce9523..11f3a752c9 100644 --- a/packages/jsonmodels/epochs.go +++ b/packages/app/jsonmodels/epochs.go @@ -1,7 +1,7 @@ package jsonmodels import ( - "github.com/iotaledger/goshimmer/packages/epoch" + "github.com/iotaledger/goshimmer/packages/core/epoch" ) type EpochInfo struct { diff --git a/packages/jsonmodels/faucet.go b/packages/app/jsonmodels/faucet.go similarity index 100% rename from packages/jsonmodels/faucet.go rename to packages/app/jsonmodels/faucet.go diff --git a/packages/jsonmodels/info.go b/packages/app/jsonmodels/info.go similarity index 100% rename from packages/jsonmodels/info.go rename to packages/app/jsonmodels/info.go diff --git a/packages/jsonmodels/ledgerstate.go b/packages/app/jsonmodels/ledgerstate.go similarity index 98% rename from packages/jsonmodels/ledgerstate.go rename to packages/app/jsonmodels/ledgerstate.go index 9135db5e92..16488da4de 100644 --- a/packages/jsonmodels/ledgerstate.go +++ b/packages/app/jsonmodels/ledgerstate.go @@ -5,15 +5,15 @@ import ( "time" "github.com/cockroachdb/errors" - "github.com/iotaledger/hive.go/generics/lo" - "github.com/iotaledger/hive.go/types/confirmation" - "github.com/iotaledger/hive.go/typeutils" + "github.com/iotaledger/hive.go/core/generics/lo" + "github.com/iotaledger/hive.go/core/types/confirmation" + "github.com/iotaledger/hive.go/core/typeutils" "github.com/mr-tron/base58" - "github.com/iotaledger/goshimmer/packages/conflictdag" - "github.com/iotaledger/goshimmer/packages/ledger" - "github.com/iotaledger/goshimmer/packages/ledger/utxo" - "github.com/iotaledger/goshimmer/packages/ledger/vm/devnetvm" + "github.com/iotaledger/goshimmer/packages/core/conflictdag" + "github.com/iotaledger/goshimmer/packages/core/ledger" + "github.com/iotaledger/goshimmer/packages/core/ledger/utxo" + "github.com/iotaledger/goshimmer/packages/core/ledger/vm/devnetvm" ) // region Address ////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/packages/jsonmodels/mana.go b/packages/app/jsonmodels/mana.go similarity index 98% rename from packages/jsonmodels/mana.go rename to packages/app/jsonmodels/mana.go index cdfaec080b..d30dbb497d 100644 --- a/packages/jsonmodels/mana.go +++ b/packages/app/jsonmodels/mana.go @@ -1,6 +1,6 @@ package jsonmodels -import "github.com/iotaledger/goshimmer/packages/mana" +import "github.com/iotaledger/goshimmer/packages/core/mana" // GetManaRequest is the request for get mana. type GetManaRequest struct { diff --git a/packages/jsonmodels/manualpeering.go b/packages/app/jsonmodels/manualpeering.go similarity index 80% rename from packages/jsonmodels/manualpeering.go rename to packages/app/jsonmodels/manualpeering.go index dd59a94a35..564fdcb748 100644 --- a/packages/jsonmodels/manualpeering.go +++ b/packages/app/jsonmodels/manualpeering.go @@ -1,6 +1,6 @@ package jsonmodels -import "github.com/iotaledger/hive.go/crypto/ed25519" +import "github.com/iotaledger/hive.go/core/crypto/ed25519" // PeerToRemove holds the data that uniquely identifies the peer to be removed, e.g. public key or ID. // Only public key is supported for now. diff --git a/packages/jsonmodels/markers.go b/packages/app/jsonmodels/markers.go similarity index 96% rename from packages/jsonmodels/markers.go rename to packages/app/jsonmodels/markers.go index 2410883f0c..8bf819be8a 100644 --- a/packages/jsonmodels/markers.go +++ b/packages/app/jsonmodels/markers.go @@ -1,7 +1,7 @@ package jsonmodels import ( - markersPackage "github.com/iotaledger/goshimmer/packages/markers" + markersPackage "github.com/iotaledger/goshimmer/packages/core/markers" ) // region StructureDetails ///////////////////////////////////////////////////////////////////////////////////////////// diff --git a/packages/jsonmodels/sendblock.go b/packages/app/jsonmodels/sendblock.go similarity index 81% rename from packages/jsonmodels/sendblock.go rename to packages/app/jsonmodels/sendblock.go index 1ea524efef..4d06617143 100644 --- a/packages/jsonmodels/sendblock.go +++ b/packages/app/jsonmodels/sendblock.go @@ -1,6 +1,6 @@ package jsonmodels -// ParentBlockIDs is a json representation of tangle.ParentBlockIDs. +// ParentBlockIDs is a json representation of tangleold.ParentBlockIDs. type ParentBlockIDs struct { Type uint8 `json:"type"` BlockIDs []string `json:"blockIDs"` diff --git a/packages/jsonmodels/spammer.go b/packages/app/jsonmodels/spammer.go similarity index 100% rename from packages/jsonmodels/spammer.go rename to packages/app/jsonmodels/spammer.go diff --git a/packages/jsonmodels/tangle.go b/packages/app/jsonmodels/tangle.go similarity index 93% rename from packages/jsonmodels/tangle.go rename to packages/app/jsonmodels/tangle.go index 9345aedfa9..c312a8b05c 100644 --- a/packages/jsonmodels/tangle.go +++ b/packages/app/jsonmodels/tangle.go @@ -1,10 +1,10 @@ package jsonmodels -import "github.com/iotaledger/hive.go/types/confirmation" +import "github.com/iotaledger/hive.go/core/types/confirmation" // region Block /////////////////////////////////////////////////////////////////////////////////////////////////////// -// Block represents the JSON model of a tangle.Block. +// Block represents the JSON model of a tangleold.Block. type Block struct { ID string `json:"id"` StrongParents []string `json:"strongParents"` @@ -31,7 +31,7 @@ type Block struct { // region BlockMetadata ////////////////////////////////////////////////////////////////////////////////////////////// -// BlockMetadata represents the JSON model of the tangle.BlockMetadata. +// BlockMetadata represents the JSON model of the tangleold.BlockMetadata. type BlockMetadata struct { ID string `json:"id"` ReceivedTime int64 `json:"receivedTime"` diff --git a/packages/jsonmodels/tools.go b/packages/app/jsonmodels/tools.go similarity index 100% rename from packages/jsonmodels/tools.go rename to packages/app/jsonmodels/tools.go diff --git a/packages/jsonmodels/wallet.go b/packages/app/jsonmodels/wallet.go similarity index 91% rename from packages/jsonmodels/wallet.go rename to packages/app/jsonmodels/wallet.go index 76ce4619b6..b447fd0e3e 100644 --- a/packages/jsonmodels/wallet.go +++ b/packages/app/jsonmodels/wallet.go @@ -3,7 +3,7 @@ package jsonmodels import ( "time" - "github.com/iotaledger/hive.go/types/confirmation" + "github.com/iotaledger/hive.go/core/types/confirmation" ) // WalletOutputsOnAddress represents wallet outputs on an address. diff --git a/packages/jsonmodels/webapi.go b/packages/app/jsonmodels/webapi.go similarity index 94% rename from packages/jsonmodels/webapi.go rename to packages/app/jsonmodels/webapi.go index 1be8644844..9386720039 100644 --- a/packages/jsonmodels/webapi.go +++ b/packages/app/jsonmodels/webapi.go @@ -1,11 +1,11 @@ package jsonmodels import ( - "github.com/iotaledger/goshimmer/packages/conflictdag" - "github.com/iotaledger/goshimmer/packages/ledger" - "github.com/iotaledger/goshimmer/packages/ledger/utxo" - "github.com/iotaledger/goshimmer/packages/ledger/vm/devnetvm" - "github.com/iotaledger/goshimmer/packages/tangle" + "github.com/iotaledger/goshimmer/packages/core/conflictdag" + "github.com/iotaledger/goshimmer/packages/core/ledger/utxo" + "github.com/iotaledger/goshimmer/packages/core/ledger/vm/devnetvm" + "github.com/iotaledger/goshimmer/packages/core/tangleold" + "github.com/iotaledger/goshimmer/packages/core/ledger" ) // region GetAddressResponse /////////////////////////////////////////////////////////////////////////////////////////// @@ -112,12 +112,12 @@ type GetConflictVotersResponse struct { } // NewGetConflictVotersResponse returns a GetConflictVotersResponse from the given details. -func NewGetConflictVotersResponse(conflictID utxo.TransactionID, voters *tangle.Voters) *GetConflictVotersResponse { +func NewGetConflictVotersResponse(conflictID utxo.TransactionID, voters *tangleold.Voters) *GetConflictVotersResponse { return &GetConflictVotersResponse{ ConflictID: conflictID.Base58(), Voters: func() (votersStr []string) { votersStr = make([]string, 0) - voters.ForEach(func(voter tangle.Voter) { + voters.ForEach(func(voter tangleold.Voter) { votersStr = append(votersStr, voter.String()) }) return @@ -163,7 +163,7 @@ type GetTransactionAttachmentsResponse struct { } // NewGetTransactionAttachmentsResponse returns a GetTransactionAttachmentsResponse from the given details. -func NewGetTransactionAttachmentsResponse(transactionID utxo.TransactionID, blockIDs tangle.BlockIDs) *GetTransactionAttachmentsResponse { +func NewGetTransactionAttachmentsResponse(transactionID utxo.TransactionID, blockIDs tangleold.BlockIDs) *GetTransactionAttachmentsResponse { var blockIDsBase58 []string for blockID := range blockIDs { blockIDsBase58 = append(blockIDsBase58, blockID.Base58()) @@ -193,8 +193,8 @@ type PostPayloadResponse struct { ID string `json:"id"` } -// NewPostPayloadResponse returns a PostPayloadResponse from the given tangle.Block. -func NewPostPayloadResponse(block *tangle.Block) *PostPayloadResponse { +// NewPostPayloadResponse returns a PostPayloadResponse from the given tangleold.Block. +func NewPostPayloadResponse(block *tangleold.Block) *PostPayloadResponse { return &PostPayloadResponse{ ID: block.ID().Base58(), } diff --git a/packages/metrics/events.go b/packages/app/metrics/events.go similarity index 96% rename from packages/metrics/events.go rename to packages/app/metrics/events.go index 054f2d3233..c6fafd6a89 100644 --- a/packages/metrics/events.go +++ b/packages/app/metrics/events.go @@ -1,6 +1,6 @@ package metrics -import "github.com/iotaledger/hive.go/generics/event" +import "github.com/iotaledger/hive.go/core/generics/event" // CollectionEvents defines the events fot the metrics package. type CollectionEvents struct { diff --git a/packages/graph/graph.go b/packages/app/metrics/graph/graph.go similarity index 100% rename from packages/graph/graph.go rename to packages/app/metrics/graph/graph.go diff --git a/packages/graph/list.go b/packages/app/metrics/graph/list.go similarity index 100% rename from packages/graph/list.go rename to packages/app/metrics/graph/list.go diff --git a/packages/metrics/metrics.go b/packages/app/metrics/metrics.go similarity index 100% rename from packages/metrics/metrics.go rename to packages/app/metrics/metrics.go diff --git a/packages/net/conn_metric.go b/packages/app/metrics/net/conn_metric.go similarity index 100% rename from packages/net/conn_metric.go rename to packages/app/metrics/net/conn_metric.go diff --git a/packages/ratelimiter/events.go b/packages/app/ratelimiter/events.go similarity index 69% rename from packages/ratelimiter/events.go rename to packages/app/ratelimiter/events.go index 9b2f4c64c6..2bfb5f13dd 100644 --- a/packages/ratelimiter/events.go +++ b/packages/app/ratelimiter/events.go @@ -1,8 +1,8 @@ package ratelimiter import ( - "github.com/iotaledger/hive.go/autopeering/peer" - "github.com/iotaledger/hive.go/generics/event" + "github.com/iotaledger/hive.go/core/autopeering/peer" + "github.com/iotaledger/hive.go/core/generics/event" ) type Events struct { diff --git a/packages/ratelimiter/rate_limiter.go b/packages/app/ratelimiter/rate_limiter.go similarity index 97% rename from packages/ratelimiter/rate_limiter.go rename to packages/app/ratelimiter/rate_limiter.go index 69f03f8386..25cad76e2d 100644 --- a/packages/ratelimiter/rate_limiter.go +++ b/packages/app/ratelimiter/rate_limiter.go @@ -6,8 +6,8 @@ import ( "github.com/ReneKroon/ttlcache/v2" "github.com/cockroachdb/errors" - "github.com/iotaledger/hive.go/autopeering/peer" - "github.com/iotaledger/hive.go/logger" + "github.com/iotaledger/hive.go/core/autopeering/peer" + "github.com/iotaledger/hive.go/core/logger" "github.com/paulbellamy/ratecounter" "go.uber.org/atomic" ) diff --git a/packages/ratelimiter/rate_limiter_test.go b/packages/app/ratelimiter/rate_limiter_test.go similarity index 86% rename from packages/ratelimiter/rate_limiter_test.go rename to packages/app/ratelimiter/rate_limiter_test.go index 573fb4f289..c628e1a6d5 100644 --- a/packages/ratelimiter/rate_limiter_test.go +++ b/packages/app/ratelimiter/rate_limiter_test.go @@ -5,17 +5,17 @@ import ( "testing" "time" - "github.com/iotaledger/hive.go/autopeering/peer" - "github.com/iotaledger/hive.go/autopeering/peer/service" - "github.com/iotaledger/hive.go/crypto/ed25519" - "github.com/iotaledger/hive.go/generics/event" - "github.com/iotaledger/hive.go/identity" - "github.com/iotaledger/hive.go/logger" + "github.com/iotaledger/hive.go/core/autopeering/peer" + "github.com/iotaledger/hive.go/core/autopeering/peer/service" + "github.com/iotaledger/hive.go/core/crypto/ed25519" + "github.com/iotaledger/hive.go/core/generics/event" + "github.com/iotaledger/hive.go/core/identity" + "github.com/iotaledger/hive.go/core/logger" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "go.uber.org/atomic" - "github.com/iotaledger/goshimmer/packages/ratelimiter" + "github.com/iotaledger/goshimmer/packages/app/ratelimiter" ) const ( diff --git a/packages/remotemetrics/events.go b/packages/app/remotemetrics/events.go similarity index 99% rename from packages/remotemetrics/events.go rename to packages/app/remotemetrics/events.go index 94bd5da01e..98aebbb413 100644 --- a/packages/remotemetrics/events.go +++ b/packages/app/remotemetrics/events.go @@ -3,7 +3,7 @@ package remotemetrics import ( "time" - "github.com/iotaledger/hive.go/generics/event" + "github.com/iotaledger/hive.go/core/generics/event" ) // CollectionLogEvents defines the events for the remotelogmetrics package. diff --git a/packages/remotemetrics/metrics.go b/packages/app/remotemetrics/metrics.go similarity index 100% rename from packages/remotemetrics/metrics.go rename to packages/app/remotemetrics/metrics.go diff --git a/packages/spammer/spammer.go b/packages/app/spammer/spammer.go similarity index 90% rename from packages/spammer/spammer.go rename to packages/app/spammer/spammer.go index b094078c63..e54af98d74 100644 --- a/packages/spammer/spammer.go +++ b/packages/app/spammer/spammer.go @@ -6,12 +6,12 @@ import ( "time" "github.com/cockroachdb/errors" - "github.com/iotaledger/hive.go/logger" - "github.com/iotaledger/hive.go/typeutils" + "github.com/iotaledger/hive.go/core/logger" + "github.com/iotaledger/hive.go/core/typeutils" "go.uber.org/atomic" - "github.com/iotaledger/goshimmer/packages/tangle" - "github.com/iotaledger/goshimmer/packages/tangle/payload" + "github.com/iotaledger/goshimmer/packages/core/tangleold" + "github.com/iotaledger/goshimmer/packages/core/tangleold/payload" ) const ( @@ -20,7 +20,7 @@ const ( ) // IssuePayloadFunc is a function which issues a payload. -type IssuePayloadFunc = func(payload payload.Payload, parentsCount ...int) (*tangle.Block, error) +type IssuePayloadFunc = func(payload payload.Payload, parentsCount ...int) (*tangleold.Block, error) // EstimateFunc returns the time estimate required for the block to be issued by the rate setter. type EstimateFunc = func() time.Duration @@ -96,7 +96,7 @@ func (s *Spammer) run(rate int, timeUnit time.Duration, imif string) { defer s.goroutinesCount.Add(-1) // we don't care about errors or the actual issued block _, err := s.issuePayloadFunc(payload.NewGenericDataPayload([]byte("SPAM"))) - if errors.Is(err, tangle.ErrNotBootstrapped) { + if errors.Is(err, tangleold.ErrNotBootstrapped) { s.log.Info("Stopped spamming blocks because node lost sync") s.signalShutdown() return diff --git a/packages/bootstrapmanager/manager.go b/packages/core/bootstrapmanager/manager.go similarity index 79% rename from packages/bootstrapmanager/manager.go rename to packages/core/bootstrapmanager/manager.go index 5db4f88e85..20459d6aea 100644 --- a/packages/bootstrapmanager/manager.go +++ b/packages/core/bootstrapmanager/manager.go @@ -1,10 +1,10 @@ package bootstrapmanager import ( - "github.com/iotaledger/hive.go/generics/event" + "github.com/iotaledger/hive.go/core/generics/event" - "github.com/iotaledger/goshimmer/packages/notarization" - "github.com/iotaledger/goshimmer/packages/tangle" + "github.com/iotaledger/goshimmer/packages/core/notarization" + "github.com/iotaledger/goshimmer/packages/core/tangleold" ) // region Manager ////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -18,12 +18,12 @@ type Events struct { // Manager is the bootstrap manager. type Manager struct { Events *Events - tangle *tangle.Tangle + tangle *tangleold.Tangle notarizationManager *notarization.Manager } // New creates and returns a new notarization manager. -func New(t *tangle.Tangle, notarizationManager *notarization.Manager) (new *Manager) { +func New(t *tangleold.Tangle, notarizationManager *notarization.Manager) (new *Manager) { new = &Manager{ tangle: t, notarizationManager: notarizationManager, @@ -33,7 +33,7 @@ func New(t *tangle.Tangle, notarizationManager *notarization.Manager) (new *Mana } func (m *Manager) Setup() { - m.tangle.TimeManager.Events.Bootstrapped.Attach(event.NewClosure(func(_ *tangle.BootstrappedEvent) { + m.tangle.TimeManager.Events.Bootstrapped.Attach(event.NewClosure(func(_ *tangleold.BootstrappedEvent) { if m.notarizationManager.Bootstrapped() { m.Events.Bootstrapped.Trigger(&BootstrappedEvent{}) } diff --git a/packages/conflictdag/.img/branch_dag_test.PNG b/packages/core/conflictdag/.img/branch_dag_test.PNG similarity index 100% rename from packages/conflictdag/.img/branch_dag_test.PNG rename to packages/core/conflictdag/.img/branch_dag_test.PNG diff --git a/packages/conflictdag/.img/branch_dag_test_SetBranchConfirmed.png b/packages/core/conflictdag/.img/branch_dag_test_SetBranchConfirmed.png similarity index 100% rename from packages/conflictdag/.img/branch_dag_test_SetBranchConfirmed.png rename to packages/core/conflictdag/.img/branch_dag_test_SetBranchConfirmed.png diff --git a/packages/conflictdag/conflictdag.go b/packages/core/conflictdag/conflictdag.go similarity index 97% rename from packages/conflictdag/conflictdag.go rename to packages/core/conflictdag/conflictdag.go index 6a097db363..fc9ce45b16 100644 --- a/packages/conflictdag/conflictdag.go +++ b/packages/core/conflictdag/conflictdag.go @@ -3,10 +3,10 @@ package conflictdag import ( "sync" - "github.com/iotaledger/hive.go/byteutils" - "github.com/iotaledger/hive.go/generics/set" - "github.com/iotaledger/hive.go/generics/walker" - "github.com/iotaledger/hive.go/types/confirmation" + "github.com/iotaledger/hive.go/core/byteutils" + "github.com/iotaledger/hive.go/core/generics/set" + "github.com/iotaledger/hive.go/core/generics/walker" + "github.com/iotaledger/hive.go/core/types/confirmation" ) // ConflictDAG represents a generic DAG that is able to model causal dependencies between conflicts that try to access a diff --git a/packages/conflictdag/conflictdag_test.go b/packages/core/conflictdag/conflictdag_test.go similarity index 98% rename from packages/conflictdag/conflictdag_test.go rename to packages/core/conflictdag/conflictdag_test.go index 77a64f11c1..0b7caa9015 100644 --- a/packages/conflictdag/conflictdag_test.go +++ b/packages/core/conflictdag/conflictdag_test.go @@ -4,9 +4,9 @@ import ( "strings" "testing" - "github.com/iotaledger/hive.go/generics/set" - "github.com/iotaledger/hive.go/types" - "github.com/iotaledger/hive.go/types/confirmation" + "github.com/iotaledger/hive.go/core/generics/set" + "github.com/iotaledger/hive.go/core/types" + "github.com/iotaledger/hive.go/core/types/confirmation" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/packages/conflictdag/events.go b/packages/core/conflictdag/events.go similarity index 98% rename from packages/conflictdag/events.go rename to packages/core/conflictdag/events.go index 09047120cb..deb39c9938 100644 --- a/packages/conflictdag/events.go +++ b/packages/core/conflictdag/events.go @@ -1,8 +1,8 @@ package conflictdag import ( - "github.com/iotaledger/hive.go/generics/event" - "github.com/iotaledger/hive.go/generics/set" + "github.com/iotaledger/hive.go/core/generics/event" + "github.com/iotaledger/hive.go/core/generics/set" ) // region Events /////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/packages/conflictdag/options.go b/packages/core/conflictdag/options.go similarity index 97% rename from packages/conflictdag/options.go rename to packages/core/conflictdag/options.go index 1d207e9643..fdb1f2a2a5 100644 --- a/packages/conflictdag/options.go +++ b/packages/core/conflictdag/options.go @@ -3,10 +3,10 @@ package conflictdag import ( "time" - "github.com/iotaledger/hive.go/kvstore" - "github.com/iotaledger/hive.go/kvstore/mapdb" + "github.com/iotaledger/hive.go/core/kvstore" + "github.com/iotaledger/hive.go/core/kvstore/mapdb" - "github.com/iotaledger/goshimmer/packages/database" + "github.com/iotaledger/goshimmer/packages/node/database" ) // region WithStore //////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/packages/conflictdag/storage.go b/packages/core/conflictdag/storage.go similarity index 97% rename from packages/conflictdag/storage.go rename to packages/core/conflictdag/storage.go index 884cca94bc..318995fa7d 100644 --- a/packages/conflictdag/storage.go +++ b/packages/core/conflictdag/storage.go @@ -4,11 +4,11 @@ import ( "sync" "github.com/cockroachdb/errors" - "github.com/iotaledger/hive.go/byteutils" - "github.com/iotaledger/hive.go/cerrors" - "github.com/iotaledger/hive.go/generics/objectstorage" + "github.com/iotaledger/hive.go/core/byteutils" + "github.com/iotaledger/hive.go/core/cerrors" + "github.com/iotaledger/hive.go/core/generics/objectstorage" - "github.com/iotaledger/goshimmer/packages/database" + "github.com/iotaledger/goshimmer/packages/node/database" ) // region Storage ////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/packages/conflictdag/types.go b/packages/core/conflictdag/types.go similarity index 97% rename from packages/conflictdag/types.go rename to packages/core/conflictdag/types.go index 5d5ea583de..cb463b0ea2 100644 --- a/packages/conflictdag/types.go +++ b/packages/core/conflictdag/types.go @@ -1,9 +1,9 @@ package conflictdag import ( - "github.com/iotaledger/hive.go/generics/model" - "github.com/iotaledger/hive.go/generics/set" - "github.com/iotaledger/hive.go/types/confirmation" + "github.com/iotaledger/hive.go/core/generics/model" + "github.com/iotaledger/hive.go/core/generics/set" + "github.com/iotaledger/hive.go/core/types/confirmation" ) // region Conflict ///////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/packages/conflictdag/utils.go b/packages/core/conflictdag/utils.go similarity index 93% rename from packages/conflictdag/utils.go rename to packages/core/conflictdag/utils.go index b8135742ce..e849cb18fd 100644 --- a/packages/conflictdag/utils.go +++ b/packages/core/conflictdag/utils.go @@ -3,11 +3,11 @@ package conflictdag import ( "context" - "github.com/iotaledger/hive.go/generics/lo" - "github.com/iotaledger/hive.go/generics/objectstorage" - "github.com/iotaledger/hive.go/generics/set" - "github.com/iotaledger/hive.go/generics/walker" - "github.com/iotaledger/hive.go/serix" + "github.com/iotaledger/hive.go/core/generics/lo" + "github.com/iotaledger/hive.go/core/generics/objectstorage" + "github.com/iotaledger/hive.go/core/generics/set" + "github.com/iotaledger/hive.go/core/generics/walker" + "github.com/iotaledger/hive.go/core/serix" ) // Utils is a ConflictDAG component that bundles utility related API to simplify common interactions with the ConflictDAG. diff --git a/packages/consensus/acceptance/gadget.go b/packages/core/consensus/acceptance/gadget.go similarity index 82% rename from packages/consensus/acceptance/gadget.go rename to packages/core/consensus/acceptance/gadget.go index 500a644352..20e1b7d4af 100644 --- a/packages/consensus/acceptance/gadget.go +++ b/packages/core/consensus/acceptance/gadget.go @@ -3,15 +3,15 @@ package acceptance import ( "sync" - "github.com/iotaledger/hive.go/generics/set" - "github.com/iotaledger/hive.go/generics/walker" - "github.com/iotaledger/hive.go/types/confirmation" - - "github.com/iotaledger/goshimmer/packages/ledger" - "github.com/iotaledger/goshimmer/packages/ledger/utxo" - "github.com/iotaledger/goshimmer/packages/ledger/vm/devnetvm" - "github.com/iotaledger/goshimmer/packages/markers" - "github.com/iotaledger/goshimmer/packages/tangle" + "github.com/iotaledger/hive.go/core/generics/set" + "github.com/iotaledger/hive.go/core/generics/walker" + "github.com/iotaledger/hive.go/core/types/confirmation" + + "github.com/iotaledger/goshimmer/packages/core/ledger" + "github.com/iotaledger/goshimmer/packages/core/ledger/utxo" + "github.com/iotaledger/goshimmer/packages/core/ledger/vm/devnetvm" + "github.com/iotaledger/goshimmer/packages/core/markers" + "github.com/iotaledger/goshimmer/packages/core/tangleold" ) // BlockThresholdTranslation is a function which translates approval weight to a confirmation.State. @@ -75,20 +75,20 @@ func WithConflictThresholdTranslation(f ConflictThresholdTranslation) Option { // Gadget is a GadgetInterface which simply translates approval weight down to confirmation.State // and then applies it to blocks, conflicts, transactions and outputs. type Gadget struct { - tangle *tangle.Tangle + tangle *tangleold.Tangle opts *Options lastConfirmedMarkers map[markers.SequenceID]markers.Index lastConfirmedMarkersMutex sync.RWMutex - events *tangle.ConfirmationEvents + events *tangleold.ConfirmationEvents } // NewSimpleFinalityGadget creates a new Gadget. -func NewSimpleFinalityGadget(t *tangle.Tangle, opts ...Option) *Gadget { +func NewSimpleFinalityGadget(t *tangleold.Tangle, opts ...Option) *Gadget { sfg := &Gadget{ tangle: t, opts: &Options{}, lastConfirmedMarkers: make(map[markers.SequenceID]markers.Index), - events: tangle.NewConfirmationEvents(), + events: tangleold.NewConfirmationEvents(), } for _, defOpt := range defaultOpts { @@ -102,18 +102,18 @@ func NewSimpleFinalityGadget(t *tangle.Tangle, opts ...Option) *Gadget { } // Events returns the events this gadget exposes. -func (s *Gadget) Events() *tangle.ConfirmationEvents { +func (s *Gadget) Events() *tangleold.ConfirmationEvents { return s.events } // IsMarkerConfirmed returns whether the given marker is confirmed. func (s *Gadget) IsMarkerConfirmed(marker markers.Marker) (confirmed bool) { blockID := s.tangle.Booker.MarkersManager.BlockID(marker) - if blockID == tangle.EmptyBlockID { + if blockID == tangleold.EmptyBlockID { return false } - s.tangle.Storage.BlockMetadata(blockID).Consume(func(blockMetadata *tangle.BlockMetadata) { + s.tangle.Storage.BlockMetadata(blockID).Consume(func(blockMetadata *tangleold.BlockMetadata) { if blockMetadata.ConfirmationState().IsAccepted() { confirmed = true } @@ -122,8 +122,8 @@ func (s *Gadget) IsMarkerConfirmed(marker markers.Marker) (confirmed bool) { } // IsBlockConfirmed returns whether the given block is confirmed. -func (s *Gadget) IsBlockConfirmed(blkID tangle.BlockID) (confirmed bool) { - s.tangle.Storage.BlockMetadata(blkID).Consume(func(blockMetadata *tangle.BlockMetadata) { +func (s *Gadget) IsBlockConfirmed(blkID tangleold.BlockID) (confirmed bool) { + s.tangle.Storage.BlockMetadata(blkID).Consume(func(blockMetadata *tangleold.BlockMetadata) { if blockMetadata.ConfirmationState().IsAccepted() { confirmed = true } @@ -185,7 +185,7 @@ func (s *Gadget) HandleMarker(marker markers.Marker, aw float64) (err error) { // get block ID of marker blockID := s.tangle.Booker.MarkersManager.BlockID(marker) - s.tangle.Storage.BlockMetadata(blockID).Consume(func(blockMetadata *tangle.BlockMetadata) { + s.tangle.Storage.BlockMetadata(blockID).Consume(func(blockMetadata *tangleold.BlockMetadata) { if confirmationState <= blockMetadata.ConfirmationState() { return } @@ -215,28 +215,28 @@ func (s *Gadget) setMarkerConfirmed(marker markers.Marker) (updated bool) { } // propagateConfirmationStateToBlockPastCone propagates the given ConfirmationState to the past cone of the Block. -func (s *Gadget) propagateConfirmationStateToBlockPastCone(blockID tangle.BlockID, confirmationState confirmation.State) { - strongParentWalker := walker.New[tangle.BlockID](false).Push(blockID) - weakParentsSet := set.New[tangle.BlockID]() +func (s *Gadget) propagateConfirmationStateToBlockPastCone(blockID tangleold.BlockID, confirmationState confirmation.State) { + strongParentWalker := walker.New[tangleold.BlockID](false).Push(blockID) + weakParentsSet := set.New[tangleold.BlockID]() for strongParentWalker.HasNext() { strongParentBlockID := strongParentWalker.Next() - if strongParentBlockID == tangle.EmptyBlockID { + if strongParentBlockID == tangleold.EmptyBlockID { continue } - s.tangle.Storage.BlockMetadata(strongParentBlockID).Consume(func(blockMetadata *tangle.BlockMetadata) { + s.tangle.Storage.BlockMetadata(strongParentBlockID).Consume(func(blockMetadata *tangleold.BlockMetadata) { if blockMetadata.ConfirmationState() >= confirmationState { return } - s.tangle.Storage.Block(strongParentBlockID).Consume(func(block *tangle.Block) { + s.tangle.Storage.Block(strongParentBlockID).Consume(func(block *tangleold.Block) { if !s.setBlockConfirmationState(block, blockMetadata, confirmationState) { return } - block.ForEachParent(func(parent tangle.Parent) { - if parent.Type == tangle.StrongParentType { + block.ForEachParent(func(parent tangleold.Parent) { + if parent.Type == tangleold.StrongParentType { strongParentWalker.Push(parent.ID) return } @@ -246,16 +246,16 @@ func (s *Gadget) propagateConfirmationStateToBlockPastCone(blockID tangle.BlockI }) } - weakParentsSet.ForEach(func(weakParent tangle.BlockID) { + weakParentsSet.ForEach(func(weakParent tangleold.BlockID) { if strongParentWalker.Pushed(weakParent) { return } - s.tangle.Storage.BlockMetadata(weakParent).Consume(func(blockMetadata *tangle.BlockMetadata) { + s.tangle.Storage.BlockMetadata(weakParent).Consume(func(blockMetadata *tangleold.BlockMetadata) { if blockMetadata.ConfirmationState() >= confirmationState { return } - s.tangle.Storage.Block(weakParent).Consume(func(block *tangle.Block) { + s.tangle.Storage.Block(weakParent).Consume(func(block *tangleold.Block) { s.setBlockConfirmationState(block, blockMetadata, confirmationState) }) }) @@ -272,14 +272,14 @@ func (s *Gadget) HandleConflict(conflictID utxo.TransactionID, aw float64) (err return nil } -func (s *Gadget) setBlockConfirmationState(block *tangle.Block, blockMetadata *tangle.BlockMetadata, confirmationState confirmation.State) (modified bool) { +func (s *Gadget) setBlockConfirmationState(block *tangleold.Block, blockMetadata *tangleold.BlockMetadata, confirmationState confirmation.State) (modified bool) { // abort if block has ConfirmationState already set if modified = blockMetadata.SetConfirmationState(confirmationState); !modified { return } if confirmationState.IsAccepted() { - s.Events().BlockAccepted.Trigger(&tangle.BlockAcceptedEvent{ + s.Events().BlockAccepted.Trigger(&tangleold.BlockAcceptedEvent{ Block: block, }) diff --git a/packages/consensus/acceptance/gadget_test.go b/packages/core/consensus/acceptance/gadget_test.go similarity index 71% rename from packages/consensus/acceptance/gadget_test.go rename to packages/core/consensus/acceptance/gadget_test.go index 9053c34619..58fbbf6d9f 100644 --- a/packages/consensus/acceptance/gadget_test.go +++ b/packages/core/consensus/acceptance/gadget_test.go @@ -5,17 +5,18 @@ import ( "runtime/debug" "testing" - "github.com/iotaledger/hive.go/generics/event" - "github.com/iotaledger/hive.go/types/confirmation" + "github.com/iotaledger/hive.go/core/generics/event" + "github.com/iotaledger/hive.go/core/types/confirmation" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" - "github.com/iotaledger/goshimmer/packages/conflictdag" - "github.com/iotaledger/goshimmer/packages/ledger" - "github.com/iotaledger/goshimmer/packages/ledger/utxo" - "github.com/iotaledger/goshimmer/packages/ledger/vm/devnetvm" - "github.com/iotaledger/goshimmer/packages/tangle" + "github.com/iotaledger/goshimmer/packages/core/conflictdag" + + "github.com/iotaledger/goshimmer/packages/core/ledger" + "github.com/iotaledger/goshimmer/packages/core/ledger/utxo" + "github.com/iotaledger/goshimmer/packages/core/ledger/vm/devnetvm" + "github.com/iotaledger/goshimmer/packages/core/tangleold" ) type EventHandlerMock struct { @@ -44,7 +45,7 @@ var ( } ) -func (handler *EventHandlerMock) BlockAccepted(blkID tangle.BlockID) { +func (handler *EventHandlerMock) BlockAccepted(blkID tangleold.BlockID) { handler.Called(blkID) } @@ -56,8 +57,8 @@ func (handler *EventHandlerMock) TransactionAccepted(txID utxo.TransactionID) { handler.Called(txID) } -func (handler *EventHandlerMock) WireUpFinalityGadget(ag *Gadget, tangleInstance *tangle.Tangle) { - ag.Events().BlockAccepted.Hook(event.NewClosure(func(event *tangle.BlockAcceptedEvent) { handler.BlockAccepted(event.Block.ID()) })) +func (handler *EventHandlerMock) WireUpFinalityGadget(ag *Gadget, tangleInstance *tangleold.Tangle) { + ag.Events().BlockAccepted.Hook(event.NewClosure(func(event *tangleold.BlockAcceptedEvent) { handler.BlockAccepted(event.Block.ID()) })) tangleInstance.Ledger.ConflictDAG.Events.ConflictAccepted.Hook(event.NewClosure(func(event *conflictdag.ConflictAcceptedEvent[utxo.TransactionID]) { handler.ConflictAccepted(event.ID) })) @@ -65,8 +66,8 @@ func (handler *EventHandlerMock) WireUpFinalityGadget(ag *Gadget, tangleInstance } func TestSimpleFinalityGadget(t *testing.T) { - processBlkScenario := tangle.ProcessBlockScenario(t, tangle.WithConflictDAGOptions(conflictdag.WithMergeToMaster(false))) - defer func(processBlkScenario *tangle.TestScenario, t *testing.T) { + processBlkScenario := tangleold.ProcessBlockScenario(t, tangleold.WithConflictDAGOptions(conflictdag.WithMergeToMaster(false))) + defer func(processBlkScenario *tangleold.TestScenario, t *testing.T) { if err := recover(); err != nil { t.Error(err) fmt.Println(string(debug.Stack())) @@ -89,10 +90,10 @@ func TestSimpleFinalityGadget(t *testing.T) { eventHandlerMock := &EventHandlerMock{} eventHandlerMock.WireUpFinalityGadget(sfg, processBlkScenario.Tangle) - prePostSteps := []*tangle.PrePostStepTuple{ + prePostSteps := []*tangleold.PrePostStepTuple{ // Block1 { - Post: func(t *testing.T, testFramework *tangle.BlockTestFramework, testEventMock *tangle.EventMock, nodes tangle.NodeIdentities) { + Post: func(t *testing.T, testFramework *tangleold.BlockTestFramework, testEventMock *tangleold.EventMock, nodes tangleold.NodeIdentities) { assertBlksConfirmationState(t, testFramework, map[confirmation.State][]string{ confirmation.Pending: {"Block1"}, }) @@ -101,7 +102,7 @@ func TestSimpleFinalityGadget(t *testing.T) { }, // Block2 { - Post: func(t *testing.T, testFramework *tangle.BlockTestFramework, testEventMock *tangle.EventMock, nodes tangle.NodeIdentities) { + Post: func(t *testing.T, testFramework *tangleold.BlockTestFramework, testEventMock *tangleold.EventMock, nodes tangleold.NodeIdentities) { assertBlksConfirmationState(t, testFramework, map[confirmation.State][]string{ confirmation.Pending: {"Block1", "Block2"}, }) @@ -110,10 +111,10 @@ func TestSimpleFinalityGadget(t *testing.T) { }, // Block3 { - Pre: func(t *testing.T, testFramework *tangle.BlockTestFramework, testEventMock *tangle.EventMock, nodes tangle.NodeIdentities) { + Pre: func(t *testing.T, testFramework *tangleold.BlockTestFramework, testEventMock *tangleold.EventMock, nodes tangleold.NodeIdentities) { eventHandlerMock.On("BlockAccepted", testFramework.Block("Block1").ID()) }, - Post: func(t *testing.T, testFramework *tangle.BlockTestFramework, testEventMock *tangle.EventMock, nodes tangle.NodeIdentities) { + Post: func(t *testing.T, testFramework *tangleold.BlockTestFramework, testEventMock *tangleold.EventMock, nodes tangleold.NodeIdentities) { assertBlksConfirmationState(t, testFramework, map[confirmation.State][]string{ confirmation.Accepted: {"Block1"}, confirmation.Pending: {"Block2", "Block3"}, @@ -123,10 +124,10 @@ func TestSimpleFinalityGadget(t *testing.T) { }, // Block4 { - Pre: func(t *testing.T, testFramework *tangle.BlockTestFramework, testEventMock *tangle.EventMock, nodes tangle.NodeIdentities) { + Pre: func(t *testing.T, testFramework *tangleold.BlockTestFramework, testEventMock *tangleold.EventMock, nodes tangleold.NodeIdentities) { eventHandlerMock.On("BlockAccepted", testFramework.Block("Block2").ID()) }, - Post: func(t *testing.T, testFramework *tangle.BlockTestFramework, testEventMock *tangle.EventMock, nodes tangle.NodeIdentities) { + Post: func(t *testing.T, testFramework *tangleold.BlockTestFramework, testEventMock *tangleold.EventMock, nodes tangleold.NodeIdentities) { assertBlksConfirmationState(t, testFramework, map[confirmation.State][]string{ confirmation.Accepted: {"Block1", "Block2"}, confirmation.Pending: {"Block3", "Block4"}, @@ -136,11 +137,11 @@ func TestSimpleFinalityGadget(t *testing.T) { }, // Block5 { - Pre: func(t *testing.T, testFramework *tangle.BlockTestFramework, testEventMock *tangle.EventMock, nodes tangle.NodeIdentities) { + Pre: func(t *testing.T, testFramework *tangleold.BlockTestFramework, testEventMock *tangleold.EventMock, nodes tangleold.NodeIdentities) { eventHandlerMock.On("BlockAccepted", testFramework.Block("Block3").ID()) eventHandlerMock.On("BlockAccepted", testFramework.Block("Block4").ID()) }, - Post: func(t *testing.T, testFramework *tangle.BlockTestFramework, testEventMock *tangle.EventMock, nodes tangle.NodeIdentities) { + Post: func(t *testing.T, testFramework *tangleold.BlockTestFramework, testEventMock *tangleold.EventMock, nodes tangleold.NodeIdentities) { assertBlksConfirmationState(t, testFramework, map[confirmation.State][]string{ confirmation.Accepted: {"Block1", "Block2", "Block3", "Block4"}, confirmation.Pending: {"Block5"}, @@ -150,7 +151,7 @@ func TestSimpleFinalityGadget(t *testing.T) { }, // Block6 { - Post: func(t *testing.T, testFramework *tangle.BlockTestFramework, testEventMock *tangle.EventMock, nodes tangle.NodeIdentities) { + Post: func(t *testing.T, testFramework *tangleold.BlockTestFramework, testEventMock *tangleold.EventMock, nodes tangleold.NodeIdentities) { assertBlksConfirmationState(t, testFramework, map[confirmation.State][]string{ confirmation.Accepted: {"Block1", "Block2", "Block3", "Block4"}, confirmation.Pending: {"Block5", "Block6"}, @@ -165,12 +166,12 @@ func TestSimpleFinalityGadget(t *testing.T) { }, // Block7 { - Pre: func(t *testing.T, testFramework *tangle.BlockTestFramework, testEventMock *tangle.EventMock, nodes tangle.NodeIdentities) { + Pre: func(t *testing.T, testFramework *tangleold.BlockTestFramework, testEventMock *tangleold.EventMock, nodes tangleold.NodeIdentities) { eventHandlerMock.On("BlockAccepted", testFramework.Block("Block5").ID()) eventHandlerMock.On("TransactionAccepted", testFramework.TransactionID("Block5")) eventHandlerMock.On("ConflictAccepted", testFramework.ConflictIDFromBlock("Block5")) }, - Post: func(t *testing.T, testFramework *tangle.BlockTestFramework, testEventMock *tangle.EventMock, nodes tangle.NodeIdentities) { + Post: func(t *testing.T, testFramework *tangleold.BlockTestFramework, testEventMock *tangleold.EventMock, nodes tangleold.NodeIdentities) { assertBlksConfirmationState(t, testFramework, map[confirmation.State][]string{ confirmation.Accepted: {"Block1", "Block2", "Block3", "Block4", "Block5"}, confirmation.Pending: {"Block7", "Block6"}, @@ -189,11 +190,11 @@ func TestSimpleFinalityGadget(t *testing.T) { }, // Block7.1 { - Pre: func(t *testing.T, testFramework *tangle.BlockTestFramework, testEventMock *tangle.EventMock, nodes tangle.NodeIdentities) { + Pre: func(t *testing.T, testFramework *tangleold.BlockTestFramework, testEventMock *tangleold.EventMock, nodes tangleold.NodeIdentities) { eventHandlerMock.On("BlockAccepted", testFramework.Block("Block7").ID()) eventHandlerMock.On("TransactionAccepted", testFramework.TransactionID("Block7")) }, - Post: func(t *testing.T, testFramework *tangle.BlockTestFramework, testEventMock *tangle.EventMock, nodes tangle.NodeIdentities) { + Post: func(t *testing.T, testFramework *tangleold.BlockTestFramework, testEventMock *tangleold.EventMock, nodes tangleold.NodeIdentities) { assertBlksConfirmationState(t, testFramework, map[confirmation.State][]string{ confirmation.Accepted: {"Block1", "Block2", "Block3", "Block4", "Block5", "Block7"}, confirmation.Pending: {"Block7.1", "Block6"}, @@ -211,7 +212,7 @@ func TestSimpleFinalityGadget(t *testing.T) { }, // Block8 { - Post: func(t *testing.T, testFramework *tangle.BlockTestFramework, testEventMock *tangle.EventMock, nodes tangle.NodeIdentities) { + Post: func(t *testing.T, testFramework *tangleold.BlockTestFramework, testEventMock *tangleold.EventMock, nodes tangleold.NodeIdentities) { assertBlksConfirmationState(t, testFramework, map[confirmation.State][]string{ confirmation.Accepted: {"Block1", "Block2", "Block3", "Block4", "Block5", "Block7"}, confirmation.Pending: {"Block7.1", "Block6", "Block8"}, @@ -237,8 +238,8 @@ func TestSimpleFinalityGadget(t *testing.T) { } func TestWeakVsStrongParentWalk(t *testing.T) { - processBlkScenario := tangle.ProcessBlockScenario2(t, tangle.WithConflictDAGOptions(conflictdag.WithMergeToMaster(false))) - defer func(processBlkScenario *tangle.TestScenario, t *testing.T) { + processBlkScenario := tangleold.ProcessBlockScenario2(t, tangleold.WithConflictDAGOptions(conflictdag.WithMergeToMaster(false))) + defer func(processBlkScenario *tangleold.TestScenario, t *testing.T) { if err := processBlkScenario.Cleanup(t); err != nil { require.NoError(t, err) } @@ -252,10 +253,10 @@ func TestWeakVsStrongParentWalk(t *testing.T) { sfg := NewSimpleFinalityGadget(processBlkScenario.Tangle, testOpts...) wireUpEvents(t, processBlkScenario.Tangle, sfg) - prePostSteps := []*tangle.PrePostStepTuple{ + prePostSteps := []*tangleold.PrePostStepTuple{ // Block0 { - Post: func(t *testing.T, testFramework *tangle.BlockTestFramework, testEventMock *tangle.EventMock, nodes tangle.NodeIdentities) { + Post: func(t *testing.T, testFramework *tangleold.BlockTestFramework, testEventMock *tangleold.EventMock, nodes tangleold.NodeIdentities) { assertBlksConfirmationState(t, testFramework, map[confirmation.State][]string{ confirmation.Pending: {"Block0"}, }) @@ -263,7 +264,7 @@ func TestWeakVsStrongParentWalk(t *testing.T) { }, // Block1 { - Post: func(t *testing.T, testFramework *tangle.BlockTestFramework, testEventMock *tangle.EventMock, nodes tangle.NodeIdentities) { + Post: func(t *testing.T, testFramework *tangleold.BlockTestFramework, testEventMock *tangleold.EventMock, nodes tangleold.NodeIdentities) { assertBlksConfirmationState(t, testFramework, map[confirmation.State][]string{ confirmation.Pending: {"Block1"}, }) @@ -271,7 +272,7 @@ func TestWeakVsStrongParentWalk(t *testing.T) { }, // Block2 { - Post: func(t *testing.T, testFramework *tangle.BlockTestFramework, testEventMock *tangle.EventMock, nodes tangle.NodeIdentities) { + Post: func(t *testing.T, testFramework *tangleold.BlockTestFramework, testEventMock *tangleold.EventMock, nodes tangleold.NodeIdentities) { assertBlksConfirmationState(t, testFramework, map[confirmation.State][]string{ confirmation.Pending: {"Block1", "Block2"}, }) @@ -279,7 +280,7 @@ func TestWeakVsStrongParentWalk(t *testing.T) { }, // Block3 { - Post: func(t *testing.T, testFramework *tangle.BlockTestFramework, testEventMock *tangle.EventMock, nodes tangle.NodeIdentities) { + Post: func(t *testing.T, testFramework *tangleold.BlockTestFramework, testEventMock *tangleold.EventMock, nodes tangleold.NodeIdentities) { assertBlksConfirmationState(t, testFramework, map[confirmation.State][]string{ confirmation.Accepted: {}, confirmation.Pending: {"Block1", "Block2", "Block3"}, @@ -288,7 +289,7 @@ func TestWeakVsStrongParentWalk(t *testing.T) { }, // Block4 { - Post: func(t *testing.T, testFramework *tangle.BlockTestFramework, testEventMock *tangle.EventMock, nodes tangle.NodeIdentities) { + Post: func(t *testing.T, testFramework *tangleold.BlockTestFramework, testEventMock *tangleold.EventMock, nodes tangleold.NodeIdentities) { sfg.propagateConfirmationStateToBlockPastCone(testFramework.Block("Block4").ID(), confirmation.Accepted) assertBlksConfirmationState(t, testFramework, map[confirmation.State][]string{ confirmation.Accepted: {"Block1", "Block2", "Block3", "Block4"}, @@ -306,7 +307,7 @@ func TestWeakVsStrongParentWalk(t *testing.T) { } } -func assertBlksConfirmationState(t *testing.T, testFramework *tangle.BlockTestFramework, expected map[confirmation.State][]string) { +func assertBlksConfirmationState(t *testing.T, testFramework *tangleold.BlockTestFramework, expected map[confirmation.State][]string) { for expectedConfirmationState, blkAliases := range expected { for _, blkAlias := range blkAliases { actualConfirmationState := testFramework.BlockMetadata(blkAlias).ConfirmationState() @@ -315,7 +316,7 @@ func assertBlksConfirmationState(t *testing.T, testFramework *tangle.BlockTestFr } } -func assertTxsConfirmationState(t *testing.T, testFramework *tangle.BlockTestFramework, expected map[confirmation.State][]string) { +func assertTxsConfirmationState(t *testing.T, testFramework *tangleold.BlockTestFramework, expected map[confirmation.State][]string) { for expectedConfirmationState, blkAliases := range expected { for _, blkAlias := range blkAliases { txMeta := testFramework.TransactionMetadata(blkAlias) @@ -330,7 +331,7 @@ func assertTxsConfirmationState(t *testing.T, testFramework *tangle.BlockTestFra } } -func assertConflictsConfirmationState(t *testing.T, testFramework *tangle.BlockTestFramework, expected map[confirmation.State][]string) { +func assertConflictsConfirmationState(t *testing.T, testFramework *tangleold.BlockTestFramework, expected map[confirmation.State][]string) { for expectedConfirmationState, blkAliases := range expected { for _, blkAlias := range blkAliases { conflict := testFramework.Conflict(blkAlias) @@ -340,13 +341,13 @@ func assertConflictsConfirmationState(t *testing.T, testFramework *tangle.BlockT } } -func wireUpEvents(t *testing.T, testTangle *tangle.Tangle, ag *Gadget) { - testTangle.ApprovalWeightManager.Events.MarkerWeightChanged.Hook(event.NewClosure(func(e *tangle.MarkerWeightChangedEvent) { +func wireUpEvents(t *testing.T, testTangle *tangleold.Tangle, ag *Gadget) { + testTangle.ApprovalWeightManager.Events.MarkerWeightChanged.Hook(event.NewClosure(func(e *tangleold.MarkerWeightChangedEvent) { if err := ag.HandleMarker(e.Marker, e.Weight); err != nil { t.Log(err) } })) - testTangle.ApprovalWeightManager.Events.ConflictWeightChanged.Hook(event.NewClosure(func(e *tangle.ConflictWeightChangedEvent) { + testTangle.ApprovalWeightManager.Events.ConflictWeightChanged.Hook(event.NewClosure(func(e *tangleold.ConflictWeightChangedEvent) { if err := ag.HandleConflict(e.ConflictID, e.Weight); err != nil { t.Log(err) } diff --git a/packages/consensus/consensus.go b/packages/core/consensus/consensus.go similarity index 85% rename from packages/consensus/consensus.go rename to packages/core/consensus/consensus.go index 91d9d9c2f3..890f9ff43c 100644 --- a/packages/consensus/consensus.go +++ b/packages/core/consensus/consensus.go @@ -1,9 +1,9 @@ package consensus import ( - "github.com/iotaledger/hive.go/generics/set" + "github.com/iotaledger/hive.go/core/generics/set" - "github.com/iotaledger/goshimmer/packages/ledger/utxo" + "github.com/iotaledger/goshimmer/packages/core/ledger/utxo" ) // WeightFunc returns the approval weight for the given conflict. diff --git a/packages/consensus/otv/images/otv-testcases.png b/packages/core/consensus/otv/images/otv-testcases.png similarity index 100% rename from packages/consensus/otv/images/otv-testcases.png rename to packages/core/consensus/otv/images/otv-testcases.png diff --git a/packages/consensus/otv/otv.go b/packages/core/consensus/otv/otv.go similarity index 93% rename from packages/consensus/otv/otv.go rename to packages/core/consensus/otv/otv.go index eb0d342ad3..4a3b798bb6 100644 --- a/packages/consensus/otv/otv.go +++ b/packages/core/consensus/otv/otv.go @@ -4,13 +4,14 @@ import ( "bytes" "sort" - "github.com/iotaledger/hive.go/generics/set" - "github.com/iotaledger/hive.go/generics/walker" - "github.com/iotaledger/hive.go/types/confirmation" + "github.com/iotaledger/hive.go/core/generics/set" + "github.com/iotaledger/hive.go/core/generics/walker" + "github.com/iotaledger/hive.go/core/types/confirmation" - "github.com/iotaledger/goshimmer/packages/conflictdag" - "github.com/iotaledger/goshimmer/packages/consensus" - "github.com/iotaledger/goshimmer/packages/ledger/utxo" + "github.com/iotaledger/goshimmer/packages/core/conflictdag" + + "github.com/iotaledger/goshimmer/packages/core/consensus" + "github.com/iotaledger/goshimmer/packages/core/ledger/utxo" ) // OnTangleVoting is a pluggable implementation of tangle.ConsensusMechanism2. On tangle voting is a generalized form of diff --git a/packages/consensus/otv/otv_test.go b/packages/core/consensus/otv/otv_test.go similarity index 99% rename from packages/consensus/otv/otv_test.go rename to packages/core/consensus/otv/otv_test.go index c28ad475c2..f222ea07b0 100644 --- a/packages/consensus/otv/otv_test.go +++ b/packages/core/consensus/otv/otv_test.go @@ -5,17 +5,17 @@ import ( "sort" "testing" - "github.com/iotaledger/hive.go/generics/set" - "github.com/iotaledger/hive.go/types" + "github.com/iotaledger/hive.go/core/generics/set" + "github.com/iotaledger/hive.go/core/types" "github.com/stretchr/testify/require" - "github.com/iotaledger/goshimmer/packages/conflictdag" - "github.com/iotaledger/goshimmer/packages/consensus" - "github.com/iotaledger/goshimmer/packages/ledger" - "github.com/iotaledger/goshimmer/packages/ledger/utxo" + "github.com/iotaledger/goshimmer/packages/core/conflictdag" - "github.com/iotaledger/goshimmer/packages/database" + "github.com/iotaledger/goshimmer/packages/core/consensus" + "github.com/iotaledger/goshimmer/packages/core/ledger" + "github.com/iotaledger/goshimmer/packages/core/ledger/utxo" + "github.com/iotaledger/goshimmer/packages/node/database" ) func TestOnTangleVoting_LikedInstead(t *testing.T) { diff --git a/packages/epoch/epochmanager_test.go b/packages/core/epoch/epochmanager_test.go similarity index 100% rename from packages/epoch/epochmanager_test.go rename to packages/core/epoch/epochmanager_test.go diff --git a/packages/epoch/types.go b/packages/core/epoch/types.go similarity index 89% rename from packages/epoch/types.go rename to packages/core/epoch/types.go index 53e6495792..a76b78f705 100644 --- a/packages/epoch/types.go +++ b/packages/core/epoch/types.go @@ -5,12 +5,12 @@ import ( "fmt" "time" - "github.com/iotaledger/hive.go/generics/model" - "github.com/iotaledger/hive.go/serix" + "github.com/iotaledger/hive.go/core/generics/model" + "github.com/iotaledger/hive.go/core/serix" "github.com/mr-tron/base58" "golang.org/x/crypto/blake2b" - "github.com/iotaledger/goshimmer/packages/clock" + "github.com/iotaledger/goshimmer/packages/node/clock" ) var ( @@ -167,3 +167,15 @@ func (e *ECRecord) SetPrevEC(prevEC EC) { e.M.PrevEC = NewMerkleRoot(prevEC[:]) e.SetModified() } + +func (e *ECRecord) Bytes() (bytes []byte, err error) { + bytes, err = e.Storable.Bytes() + return +} + +func (e *ECRecord) FromBytes(bytes []byte) (err error) { + err = e.Storable.FromBytes(bytes) + e.SetID(e.EI()) + + return +} diff --git a/packages/ledger/.img/ledger_test_SetBranchConfirmed.png b/packages/core/ledger/.img/ledger_test_SetBranchConfirmed.png similarity index 100% rename from packages/ledger/.img/ledger_test_SetBranchConfirmed.png rename to packages/core/ledger/.img/ledger_test_SetBranchConfirmed.png diff --git a/packages/ledger/booker.go b/packages/core/ledger/booker.go similarity index 94% rename from packages/ledger/booker.go rename to packages/core/ledger/booker.go index 53160f809a..0006569525 100644 --- a/packages/ledger/booker.go +++ b/packages/core/ledger/booker.go @@ -4,15 +4,15 @@ import ( "context" "github.com/cockroachdb/errors" - "github.com/iotaledger/hive.go/cerrors" - "github.com/iotaledger/hive.go/generics/dataflow" - "github.com/iotaledger/hive.go/generics/lo" - "github.com/iotaledger/hive.go/generics/set" - "github.com/iotaledger/hive.go/generics/walker" - "github.com/iotaledger/hive.go/identity" - - "github.com/iotaledger/goshimmer/packages/ledger/utxo" - "github.com/iotaledger/goshimmer/packages/ledger/vm/devnetvm" + "github.com/iotaledger/hive.go/core/cerrors" + "github.com/iotaledger/hive.go/core/generics/dataflow" + "github.com/iotaledger/hive.go/core/generics/lo" + "github.com/iotaledger/hive.go/core/generics/set" + "github.com/iotaledger/hive.go/core/generics/walker" + "github.com/iotaledger/hive.go/core/identity" + + "github.com/iotaledger/goshimmer/packages/core/ledger/utxo" + "github.com/iotaledger/goshimmer/packages/core/ledger/vm/devnetvm" ) // booker is a Ledger component that bundles the booking related API. diff --git a/packages/ledger/dataflow.go b/packages/core/ledger/dataflow.go similarity index 97% rename from packages/ledger/dataflow.go rename to packages/core/ledger/dataflow.go index e32b8aa87e..a2c080e698 100644 --- a/packages/ledger/dataflow.go +++ b/packages/core/ledger/dataflow.go @@ -4,9 +4,9 @@ import ( "context" "github.com/cockroachdb/errors" - "github.com/iotaledger/hive.go/generics/dataflow" + "github.com/iotaledger/hive.go/core/generics/dataflow" - "github.com/iotaledger/goshimmer/packages/ledger/utxo" + "github.com/iotaledger/goshimmer/packages/core/ledger/utxo" ) // region dataFlow ///////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/packages/ledger/errors.go b/packages/core/ledger/errors.go similarity index 100% rename from packages/ledger/errors.go rename to packages/core/ledger/errors.go diff --git a/packages/ledger/events.go b/packages/core/ledger/events.go similarity index 97% rename from packages/ledger/events.go rename to packages/core/ledger/events.go index cbf8921d8a..56d872a20d 100644 --- a/packages/ledger/events.go +++ b/packages/core/ledger/events.go @@ -4,10 +4,10 @@ import ( "context" "time" - "github.com/iotaledger/hive.go/generics/event" - "github.com/iotaledger/hive.go/generics/set" + "github.com/iotaledger/hive.go/core/generics/event" + "github.com/iotaledger/hive.go/core/generics/set" - "github.com/iotaledger/goshimmer/packages/ledger/utxo" + "github.com/iotaledger/goshimmer/packages/core/ledger/utxo" ) // region Events /////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/packages/ledger/ledger.go b/packages/core/ledger/ledger.go similarity index 85% rename from packages/ledger/ledger.go rename to packages/core/ledger/ledger.go index 474aa96c35..c7b15ded27 100644 --- a/packages/ledger/ledger.go +++ b/packages/core/ledger/ledger.go @@ -4,14 +4,14 @@ import ( "context" "time" - "github.com/iotaledger/hive.go/generics/event" - "github.com/iotaledger/hive.go/generics/objectstorage" - "github.com/iotaledger/hive.go/generics/walker" - "github.com/iotaledger/hive.go/syncutils" - "github.com/iotaledger/hive.go/types/confirmation" - - "github.com/iotaledger/goshimmer/packages/conflictdag" - "github.com/iotaledger/goshimmer/packages/ledger/utxo" + "github.com/iotaledger/hive.go/core/generics/event" + "github.com/iotaledger/hive.go/core/generics/walker" + "github.com/iotaledger/hive.go/core/syncutils" + "github.com/iotaledger/hive.go/core/types/confirmation" + + "github.com/iotaledger/goshimmer/packages/core/conflictdag" + "github.com/iotaledger/goshimmer/packages/core/epoch" + "github.com/iotaledger/goshimmer/packages/core/ledger/utxo" ) // region Ledger /////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -85,9 +85,9 @@ func New(options ...Option) (ledger *Ledger) { return ledger } -// LoadSnapshot loads a snapshot of the Ledger from the given snapshot. -func (l *Ledger) LoadSnapshot(snapshot *Snapshot) { - for _, outputWithMetadata := range snapshot.OutputsWithMetadata { +// LoadOutputWithMetadatas loads OutputWithMetadatas from a snapshot file to the storage. +func (l *Ledger) LoadOutputWithMetadatas(outputsWithMetadatas []*OutputWithMetadata) { + for _, outputWithMetadata := range outputsWithMetadatas { newOutputMetadata := NewOutputMetadata(outputWithMetadata.ID()) newOutputMetadata.SetAccessManaPledgeID(outputWithMetadata.AccessManaPledgeID()) newOutputMetadata.SetConsensusManaPledgeID(outputWithMetadata.ConsensusManaPledgeID()) @@ -96,9 +96,12 @@ func (l *Ledger) LoadSnapshot(snapshot *Snapshot) { l.Storage.outputStorage.Store(outputWithMetadata.Output()).Release() l.Storage.outputMetadataStorage.Store(newOutputMetadata).Release() } +} - for ei := snapshot.FullEpochIndex + 1; ei <= snapshot.DiffEpochIndex; ei++ { - epochdiff, exists := snapshot.EpochDiffs[ei] +// LoadEpochDiffs loads EpochDiffs from a snapshot file to the storage. +func (l *Ledger) LoadEpochDiffs(header *SnapshotHeader, epochDiffs map[epoch.Index]*EpochDiff) error { + for ei := header.FullEpochIndex + 1; ei <= header.DiffEpochIndex; ei++ { + epochdiff, exists := epochDiffs[ei] if !exists { panic("epoch diff not found for epoch") } @@ -118,27 +121,8 @@ func (l *Ledger) LoadSnapshot(snapshot *Snapshot) { l.Storage.outputMetadataStorage.Store(outputMetadata).Release() } } -} - -// TakeSnapshot returns a snapshot of the Ledger state. -func (l *Ledger) TakeSnapshot() (snapshot *Snapshot) { - snapshot = NewSnapshot([]*OutputWithMetadata{}) - l.Storage.outputMetadataStorage.ForEach(func(key []byte, cachedOutputMetadata *objectstorage.CachedObject[*OutputMetadata]) bool { - cachedOutputMetadata.Consume(func(outputMetadata *OutputMetadata) { - if outputMetadata.IsSpent() || !l.Utils.OutputConfirmationState(outputMetadata.ID()).IsAccepted() { - return - } - - l.Storage.CachedOutput(outputMetadata.ID()).Consume(func(output utxo.Output) { - outputWithMetadata := NewOutputWithMetadata(output.ID(), output, outputMetadata.CreationTime(), outputMetadata.ConsensusManaPledgeID(), outputMetadata.AccessManaPledgeID()) - snapshot.OutputsWithMetadata = append(snapshot.OutputsWithMetadata, outputWithMetadata) - }) - }) - - return true - }) - return snapshot + return nil } // SetTransactionInclusionTime sets the inclusion timestamp of a Transaction. diff --git a/packages/ledger/ledger_test.go b/packages/core/ledger/ledger_test.go similarity index 99% rename from packages/ledger/ledger_test.go rename to packages/core/ledger/ledger_test.go index 76b75410c0..3e8bac96b6 100644 --- a/packages/ledger/ledger_test.go +++ b/packages/core/ledger/ledger_test.go @@ -8,11 +8,11 @@ import ( "testing" "github.com/cockroachdb/errors" - "github.com/iotaledger/hive.go/types/confirmation" + "github.com/iotaledger/hive.go/core/types/confirmation" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/iotaledger/goshimmer/packages/ledger/utxo" + "github.com/iotaledger/goshimmer/packages/core/ledger/utxo" ) func TestLedger_BookInOrder(t *testing.T) { diff --git a/packages/ledger/models.go b/packages/core/ledger/models.go similarity index 97% rename from packages/ledger/models.go rename to packages/core/ledger/models.go index 66cfb5c559..777ab2cd94 100644 --- a/packages/ledger/models.go +++ b/packages/core/ledger/models.go @@ -3,15 +3,15 @@ package ledger import ( "time" - "github.com/iotaledger/hive.go/generics/model" - "github.com/iotaledger/hive.go/generics/orderedmap" - "github.com/iotaledger/hive.go/generics/set" - "github.com/iotaledger/hive.go/identity" - "github.com/iotaledger/hive.go/stringify" - "github.com/iotaledger/hive.go/types/confirmation" - - "github.com/iotaledger/goshimmer/packages/clock" - "github.com/iotaledger/goshimmer/packages/ledger/utxo" + "github.com/iotaledger/hive.go/core/generics/model" + "github.com/iotaledger/hive.go/core/generics/orderedmap" + "github.com/iotaledger/hive.go/core/generics/set" + "github.com/iotaledger/hive.go/core/identity" + "github.com/iotaledger/hive.go/core/stringify" + "github.com/iotaledger/hive.go/core/types/confirmation" + + "github.com/iotaledger/goshimmer/packages/core/ledger/utxo" + "github.com/iotaledger/goshimmer/packages/node/clock" ) // region TransactionMetadata ////////////////////////////////////////////////////////////////////////////////////////// @@ -575,7 +575,7 @@ func (e *EpochDiff) Spent() []*OutputWithMetadata { // Created returns the outputs created for this epoch diff. func (e *EpochDiff) Created() []*OutputWithMetadata { - return e.M.Spent + return e.M.Created } // endregion /////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/packages/ledger/options.go b/packages/core/ledger/options.go similarity index 96% rename from packages/ledger/options.go rename to packages/core/ledger/options.go index 2eaa80477f..872e31424a 100644 --- a/packages/ledger/options.go +++ b/packages/core/ledger/options.go @@ -3,12 +3,13 @@ package ledger import ( "time" - "github.com/iotaledger/hive.go/kvstore" - "github.com/iotaledger/hive.go/kvstore/mapdb" + "github.com/iotaledger/hive.go/core/kvstore" + "github.com/iotaledger/hive.go/core/kvstore/mapdb" - "github.com/iotaledger/goshimmer/packages/conflictdag" - "github.com/iotaledger/goshimmer/packages/database" - "github.com/iotaledger/goshimmer/packages/ledger/vm" + "github.com/iotaledger/goshimmer/packages/core/conflictdag" + + "github.com/iotaledger/goshimmer/packages/core/ledger/vm" + "github.com/iotaledger/goshimmer/packages/node/database" ) // region WithVM /////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/packages/core/ledger/snapshot.go b/packages/core/ledger/snapshot.go new file mode 100644 index 0000000000..8b54bfc973 --- /dev/null +++ b/packages/core/ledger/snapshot.go @@ -0,0 +1,49 @@ +package ledger + +import ( + "github.com/iotaledger/hive.go/core/stringify" + + "github.com/iotaledger/goshimmer/packages/core/epoch" +) + +// Snapshot represents a snapshot of the current ledger state. +type Snapshot struct { + Header *SnapshotHeader `serix:"0"` + OutputsWithMetadata []*OutputWithMetadata `serix:"1,lengthPrefixType=uint32"` + EpochDiffs map[epoch.Index]*EpochDiff `serix:"2,lengthPrefixType=uint32"` +} + +// SnapshotHeader represents the info of a snapshot. +type SnapshotHeader struct { + OutputWithMetadataCount uint64 `serix:"0"` + FullEpochIndex epoch.Index `serix:"1"` + DiffEpochIndex epoch.Index `serix:"2"` + LatestECRecord *epoch.ECRecord `serix:"3"` +} + +// NewSnapshot creates a new Snapshot from the given details. +func NewSnapshot(outputsWithMetadata []*OutputWithMetadata) (new *Snapshot) { + return &Snapshot{ + Header: &SnapshotHeader{OutputWithMetadataCount: uint64(len(outputsWithMetadata))}, + OutputsWithMetadata: outputsWithMetadata, + } +} + +// String returns a human-readable version of the Snapshot. +func (s *Snapshot) String() (humanReadable string) { + structBuilder := stringify.StructBuilder("Snapshot") + structBuilder.AddField(stringify.StructField("SnapshotHeader", s.Header)) + structBuilder.AddField(stringify.StructField("OutputsWithMetadata", s.OutputsWithMetadata)) + structBuilder.AddField(stringify.StructField("EpochDiffs", s.EpochDiffs)) + return structBuilder.String() +} + +// String returns a human-readable version of the Snapshot. +func (h *SnapshotHeader) String() (humanReadable string) { + return stringify.Struct("SnapshotHeader", + stringify.StructField("OutputWithMetadataCount", h.OutputWithMetadataCount), + stringify.StructField("FullEpochIndex", h.FullEpochIndex), + stringify.StructField("DiffEpochIndex", h.DiffEpochIndex), + stringify.StructField("LatestECRecord", h.LatestECRecord), + ) +} diff --git a/packages/ledger/storage.go b/packages/core/ledger/storage.go similarity index 96% rename from packages/ledger/storage.go rename to packages/core/ledger/storage.go index 33c0831617..d57d87973c 100644 --- a/packages/ledger/storage.go +++ b/packages/core/ledger/storage.go @@ -5,17 +5,17 @@ import ( "sync" "github.com/cockroachdb/errors" - "github.com/iotaledger/hive.go/serix" + "github.com/iotaledger/hive.go/core/serix" - "github.com/iotaledger/hive.go/byteutils" - "github.com/iotaledger/hive.go/cerrors" - "github.com/iotaledger/hive.go/generics/dataflow" - "github.com/iotaledger/hive.go/generics/objectstorage" - "github.com/iotaledger/hive.go/generics/walker" + "github.com/iotaledger/hive.go/core/byteutils" + "github.com/iotaledger/hive.go/core/cerrors" + "github.com/iotaledger/hive.go/core/generics/dataflow" + "github.com/iotaledger/hive.go/core/generics/objectstorage" + "github.com/iotaledger/hive.go/core/generics/walker" - "github.com/iotaledger/goshimmer/packages/database" - "github.com/iotaledger/goshimmer/packages/ledger/utxo" - "github.com/iotaledger/goshimmer/packages/ledger/vm" + "github.com/iotaledger/goshimmer/packages/core/ledger/utxo" + "github.com/iotaledger/goshimmer/packages/core/ledger/vm" + "github.com/iotaledger/goshimmer/packages/node/database" ) // region storage ////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/packages/ledger/testframework.go b/packages/core/ledger/testframework.go similarity index 97% rename from packages/ledger/testframework.go rename to packages/core/ledger/testframework.go index 01c1b8fadc..51ff8d054b 100644 --- a/packages/ledger/testframework.go +++ b/packages/core/ledger/testframework.go @@ -9,20 +9,20 @@ import ( "sync/atomic" "testing" - "github.com/iotaledger/hive.go/types/confirmation" + "github.com/iotaledger/hive.go/core/types/confirmation" "github.com/stretchr/testify/assert" - "github.com/iotaledger/hive.go/generics/event" - "github.com/iotaledger/hive.go/generics/lo" - "github.com/iotaledger/hive.go/generics/model" - "github.com/iotaledger/hive.go/generics/set" - "github.com/iotaledger/hive.go/serix" - "github.com/iotaledger/hive.go/stringify" - "github.com/iotaledger/hive.go/types" - - "github.com/iotaledger/goshimmer/packages/conflictdag" - "github.com/iotaledger/goshimmer/packages/ledger/utxo" - "github.com/iotaledger/goshimmer/packages/ledger/vm" + "github.com/iotaledger/hive.go/core/generics/event" + "github.com/iotaledger/hive.go/core/generics/lo" + "github.com/iotaledger/hive.go/core/generics/model" + "github.com/iotaledger/hive.go/core/generics/set" + "github.com/iotaledger/hive.go/core/serix" + "github.com/iotaledger/hive.go/core/stringify" + "github.com/iotaledger/hive.go/core/types" + + "github.com/iotaledger/goshimmer/packages/core/conflictdag" + "github.com/iotaledger/goshimmer/packages/core/ledger/utxo" + "github.com/iotaledger/goshimmer/packages/core/ledger/vm" ) // region TestFramework //////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/packages/ledger/utils.go b/packages/core/ledger/utils.go similarity index 94% rename from packages/ledger/utils.go rename to packages/core/ledger/utils.go index 9841353900..3266c02ef1 100644 --- a/packages/ledger/utils.go +++ b/packages/core/ledger/utils.go @@ -2,14 +2,14 @@ package ledger import ( "github.com/cockroachdb/errors" - "github.com/iotaledger/hive.go/cerrors" - "github.com/iotaledger/hive.go/generics/lo" - "github.com/iotaledger/hive.go/generics/set" - "github.com/iotaledger/hive.go/generics/walker" - "github.com/iotaledger/hive.go/types/confirmation" - - "github.com/iotaledger/goshimmer/packages/conflictdag" - "github.com/iotaledger/goshimmer/packages/ledger/utxo" + "github.com/iotaledger/hive.go/core/cerrors" + "github.com/iotaledger/hive.go/core/generics/lo" + "github.com/iotaledger/hive.go/core/generics/set" + "github.com/iotaledger/hive.go/core/generics/walker" + "github.com/iotaledger/hive.go/core/types/confirmation" + + "github.com/iotaledger/goshimmer/packages/core/conflictdag" + "github.com/iotaledger/goshimmer/packages/core/ledger/utxo" ) // Utils is a Ledger component that bundles utility related API to simplify common interactions with the Ledger. diff --git a/packages/ledger/utxo/interfaces.go b/packages/core/ledger/utxo/interfaces.go similarity index 97% rename from packages/ledger/utxo/interfaces.go rename to packages/core/ledger/utxo/interfaces.go index d59d4c4c88..d56ffd7f96 100644 --- a/packages/ledger/utxo/interfaces.go +++ b/packages/core/ledger/utxo/interfaces.go @@ -1,7 +1,7 @@ package utxo import ( - "github.com/iotaledger/hive.go/generics/objectstorage" + "github.com/iotaledger/hive.go/core/generics/objectstorage" ) // region Transaction ////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/packages/ledger/utxo/outputcommitment.go b/packages/core/ledger/utxo/outputcommitment.go similarity index 95% rename from packages/ledger/utxo/outputcommitment.go rename to packages/core/ledger/utxo/outputcommitment.go index 1ca4f54467..df6070a9a7 100644 --- a/packages/ledger/utxo/outputcommitment.go +++ b/packages/core/ledger/utxo/outputcommitment.go @@ -4,10 +4,10 @@ import ( "context" "github.com/cockroachdb/errors" - "github.com/iotaledger/hive.go/cerrors" - "github.com/iotaledger/hive.go/generics/lo" - "github.com/iotaledger/hive.go/serix" - "github.com/iotaledger/hive.go/types" + "github.com/iotaledger/hive.go/core/cerrors" + "github.com/iotaledger/hive.go/core/generics/lo" + "github.com/iotaledger/hive.go/core/serix" + "github.com/iotaledger/hive.go/core/types" "gitlab.com/NebulousLabs/merkletree/merkletree-blake" ) diff --git a/packages/ledger/utxo/outputcommitment_test.go b/packages/core/ledger/utxo/outputcommitment_test.go similarity index 96% rename from packages/ledger/utxo/outputcommitment_test.go rename to packages/core/ledger/utxo/outputcommitment_test.go index 2f04650009..5279f9b36a 100644 --- a/packages/ledger/utxo/outputcommitment_test.go +++ b/packages/core/ledger/utxo/outputcommitment_test.go @@ -4,7 +4,7 @@ import ( "sync/atomic" "testing" - "github.com/iotaledger/hive.go/generics/model" + "github.com/iotaledger/hive.go/core/generics/model" "github.com/stretchr/testify/assert" ) diff --git a/packages/ledger/utxo/outputstateproof.go b/packages/core/ledger/utxo/outputstateproof.go similarity index 93% rename from packages/ledger/utxo/outputstateproof.go rename to packages/core/ledger/utxo/outputstateproof.go index ee346ed6cf..4491066e80 100644 --- a/packages/ledger/utxo/outputstateproof.go +++ b/packages/core/ledger/utxo/outputstateproof.go @@ -2,8 +2,8 @@ package utxo import ( "github.com/cockroachdb/errors" - "github.com/iotaledger/hive.go/byteutils" - "github.com/iotaledger/hive.go/cerrors" + "github.com/iotaledger/hive.go/core/byteutils" + "github.com/iotaledger/hive.go/core/cerrors" "golang.org/x/crypto/blake2b" ) diff --git a/packages/ledger/utxo/transactioncommitment.go b/packages/core/ledger/utxo/transactioncommitment.go similarity index 90% rename from packages/ledger/utxo/transactioncommitment.go rename to packages/core/ledger/utxo/transactioncommitment.go index 57f0de1601..8737eeb069 100644 --- a/packages/ledger/utxo/transactioncommitment.go +++ b/packages/core/ledger/utxo/transactioncommitment.go @@ -1,7 +1,7 @@ package utxo import ( - "github.com/iotaledger/hive.go/types" + "github.com/iotaledger/hive.go/core/types" ) // region TransactionCommitment //////////////////////////////////////////////////////////////////////////////////////// diff --git a/packages/ledger/utxo/types.go b/packages/core/ledger/utxo/types.go similarity index 95% rename from packages/ledger/utxo/types.go rename to packages/core/ledger/utxo/types.go index 8e5fd7676c..3ea0b76449 100644 --- a/packages/ledger/utxo/types.go +++ b/packages/core/ledger/utxo/types.go @@ -7,13 +7,13 @@ import ( "sync" "github.com/cockroachdb/errors" - "github.com/iotaledger/hive.go/byteutils" - "github.com/iotaledger/hive.go/generics/orderedmap" - "github.com/iotaledger/hive.go/generics/set" - "github.com/iotaledger/hive.go/serializer" - "github.com/iotaledger/hive.go/serix" - "github.com/iotaledger/hive.go/stringify" - "github.com/iotaledger/hive.go/types" + "github.com/iotaledger/hive.go/core/byteutils" + "github.com/iotaledger/hive.go/core/generics/orderedmap" + "github.com/iotaledger/hive.go/core/generics/set" + "github.com/iotaledger/hive.go/core/serix" + "github.com/iotaledger/hive.go/core/stringify" + "github.com/iotaledger/hive.go/core/types" + "github.com/iotaledger/hive.go/serializer/v2" "github.com/mr-tron/base58" ) diff --git a/packages/ledger/validator.go b/packages/core/ledger/validator.go similarity index 93% rename from packages/ledger/validator.go rename to packages/core/ledger/validator.go index 8206805f26..2620587e44 100644 --- a/packages/ledger/validator.go +++ b/packages/core/ledger/validator.go @@ -2,11 +2,11 @@ package ledger import ( "github.com/cockroachdb/errors" - "github.com/iotaledger/hive.go/cerrors" - "github.com/iotaledger/hive.go/generics/dataflow" - "github.com/iotaledger/hive.go/generics/walker" + "github.com/iotaledger/hive.go/core/cerrors" + "github.com/iotaledger/hive.go/core/generics/dataflow" + "github.com/iotaledger/hive.go/core/generics/walker" - "github.com/iotaledger/goshimmer/packages/ledger/utxo" + "github.com/iotaledger/goshimmer/packages/core/ledger/utxo" ) // validator is a Ledger component that bundles the API that is used to check the validity of a Transaction. diff --git a/packages/ledger/vm/devnetvm/address.go b/packages/core/ledger/vm/devnetvm/address.go similarity index 98% rename from packages/ledger/vm/devnetvm/address.go rename to packages/core/ledger/vm/devnetvm/address.go index 933aec0828..81135ddab2 100644 --- a/packages/ledger/vm/devnetvm/address.go +++ b/packages/core/ledger/vm/devnetvm/address.go @@ -6,13 +6,13 @@ import ( "fmt" "github.com/cockroachdb/errors" - "github.com/iotaledger/hive.go/serix" + "github.com/iotaledger/hive.go/core/serix" "github.com/mr-tron/base58" "golang.org/x/crypto/blake2b" - "github.com/iotaledger/hive.go/cerrors" - "github.com/iotaledger/hive.go/crypto/ed25519" - "github.com/iotaledger/hive.go/stringify" + "github.com/iotaledger/hive.go/core/cerrors" + "github.com/iotaledger/hive.go/core/crypto/ed25519" + "github.com/iotaledger/hive.go/core/stringify" ) //nolint:dupl diff --git a/packages/ledger/vm/devnetvm/address_test.go b/packages/core/ledger/vm/devnetvm/address_test.go similarity index 98% rename from packages/ledger/vm/devnetvm/address_test.go rename to packages/core/ledger/vm/devnetvm/address_test.go index 9853fd2ee7..58059ba5eb 100644 --- a/packages/ledger/vm/devnetvm/address_test.go +++ b/packages/core/ledger/vm/devnetvm/address_test.go @@ -4,7 +4,7 @@ import ( "math/rand" "testing" - "github.com/iotaledger/hive.go/crypto/ed25519" + "github.com/iotaledger/hive.go/core/crypto/ed25519" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "go.dedis.ch/kyber/v3/pairing/bn256" diff --git a/packages/ledger/vm/devnetvm/color.go b/packages/core/ledger/vm/devnetvm/color.go similarity index 96% rename from packages/ledger/vm/devnetvm/color.go rename to packages/core/ledger/vm/devnetvm/color.go index ac62dee411..89ba55807c 100644 --- a/packages/ledger/vm/devnetvm/color.go +++ b/packages/core/ledger/vm/devnetvm/color.go @@ -6,10 +6,10 @@ import ( "sort" "github.com/cockroachdb/errors" - "github.com/iotaledger/hive.go/cerrors" - "github.com/iotaledger/hive.go/generics/orderedmap" - "github.com/iotaledger/hive.go/serix" - "github.com/iotaledger/hive.go/stringify" + "github.com/iotaledger/hive.go/core/cerrors" + "github.com/iotaledger/hive.go/core/generics/orderedmap" + "github.com/iotaledger/hive.go/core/serix" + "github.com/iotaledger/hive.go/core/stringify" "github.com/mr-tron/base58" ) diff --git a/packages/ledger/vm/devnetvm/color_test.go b/packages/core/ledger/vm/devnetvm/color_test.go similarity index 100% rename from packages/ledger/vm/devnetvm/color_test.go rename to packages/core/ledger/vm/devnetvm/color_test.go diff --git a/packages/ledger/vm/devnetvm/errors.go b/packages/core/ledger/vm/devnetvm/errors.go similarity index 100% rename from packages/ledger/vm/devnetvm/errors.go rename to packages/core/ledger/vm/devnetvm/errors.go diff --git a/packages/ledger/vm/devnetvm/indexer/indexer.go b/packages/core/ledger/vm/devnetvm/indexer/indexer.go similarity index 93% rename from packages/ledger/vm/devnetvm/indexer/indexer.go rename to packages/core/ledger/vm/devnetvm/indexer/indexer.go index 7c774330f5..4c003fb653 100644 --- a/packages/ledger/vm/devnetvm/indexer/indexer.go +++ b/packages/core/ledger/vm/devnetvm/indexer/indexer.go @@ -3,14 +3,14 @@ package indexer import ( "github.com/cockroachdb/errors" - "github.com/iotaledger/hive.go/cerrors" - "github.com/iotaledger/hive.go/generics/event" - "github.com/iotaledger/hive.go/generics/objectstorage" - - "github.com/iotaledger/goshimmer/packages/database" - "github.com/iotaledger/goshimmer/packages/ledger" - "github.com/iotaledger/goshimmer/packages/ledger/utxo" - "github.com/iotaledger/goshimmer/packages/ledger/vm/devnetvm" + "github.com/iotaledger/hive.go/core/cerrors" + "github.com/iotaledger/hive.go/core/generics/event" + "github.com/iotaledger/hive.go/core/generics/objectstorage" + + "github.com/iotaledger/goshimmer/packages/core/ledger" + "github.com/iotaledger/goshimmer/packages/core/ledger/utxo" + "github.com/iotaledger/goshimmer/packages/core/ledger/vm/devnetvm" + "github.com/iotaledger/goshimmer/packages/node/database" ) // region Indexer ////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/packages/ledger/vm/devnetvm/indexer/models.go b/packages/core/ledger/vm/devnetvm/indexer/models.go similarity index 85% rename from packages/ledger/vm/devnetvm/indexer/models.go rename to packages/core/ledger/vm/devnetvm/indexer/models.go index c50d7cee66..dff2d055d1 100644 --- a/packages/ledger/vm/devnetvm/indexer/models.go +++ b/packages/core/ledger/vm/devnetvm/indexer/models.go @@ -1,10 +1,10 @@ package indexer import ( - "github.com/iotaledger/hive.go/generics/model" + "github.com/iotaledger/hive.go/core/generics/model" - "github.com/iotaledger/goshimmer/packages/ledger/utxo" - "github.com/iotaledger/goshimmer/packages/ledger/vm/devnetvm" + "github.com/iotaledger/goshimmer/packages/core/ledger/utxo" + "github.com/iotaledger/goshimmer/packages/core/ledger/vm/devnetvm" ) // region AddressOutputMapping ///////////////////////////////////////////////////////////////////////////////////////// diff --git a/packages/ledger/vm/devnetvm/indexer/options.go b/packages/core/ledger/vm/devnetvm/indexer/options.go similarity index 95% rename from packages/ledger/vm/devnetvm/indexer/options.go rename to packages/core/ledger/vm/devnetvm/indexer/options.go index 809d60cd5d..bbc868b2f4 100644 --- a/packages/ledger/vm/devnetvm/indexer/options.go +++ b/packages/core/ledger/vm/devnetvm/indexer/options.go @@ -3,10 +3,10 @@ package indexer import ( "time" - "github.com/iotaledger/hive.go/kvstore" - "github.com/iotaledger/hive.go/kvstore/mapdb" + "github.com/iotaledger/hive.go/core/kvstore" + "github.com/iotaledger/hive.go/core/kvstore/mapdb" - "github.com/iotaledger/goshimmer/packages/database" + "github.com/iotaledger/goshimmer/packages/node/database" ) // region WithStore //////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/packages/ledger/vm/devnetvm/input.go b/packages/core/ledger/vm/devnetvm/input.go similarity index 94% rename from packages/ledger/vm/devnetvm/input.go rename to packages/core/ledger/vm/devnetvm/input.go index 1c8154b68e..9ef9e38c5e 100644 --- a/packages/ledger/vm/devnetvm/input.go +++ b/packages/core/ledger/vm/devnetvm/input.go @@ -6,14 +6,14 @@ import ( "sort" "strconv" - "github.com/iotaledger/hive.go/generics/lo" - "github.com/iotaledger/hive.go/generics/model" - "github.com/iotaledger/hive.go/serix" - "github.com/iotaledger/hive.go/stringify" - "github.com/iotaledger/hive.go/types" - "github.com/iotaledger/hive.go/typeutils" - - "github.com/iotaledger/goshimmer/packages/ledger/utxo" + "github.com/iotaledger/hive.go/core/generics/lo" + "github.com/iotaledger/hive.go/core/generics/model" + "github.com/iotaledger/hive.go/core/serix" + "github.com/iotaledger/hive.go/core/stringify" + "github.com/iotaledger/hive.go/core/types" + "github.com/iotaledger/hive.go/core/typeutils" + + "github.com/iotaledger/goshimmer/packages/core/ledger/utxo" ) func init() { diff --git a/packages/ledger/vm/devnetvm/output.go b/packages/core/ledger/vm/devnetvm/output.go similarity index 99% rename from packages/ledger/vm/devnetvm/output.go rename to packages/core/ledger/vm/devnetvm/output.go index 060ca8abf6..1ef588e257 100644 --- a/packages/ledger/vm/devnetvm/output.go +++ b/packages/core/ledger/vm/devnetvm/output.go @@ -10,19 +10,19 @@ import ( "time" "github.com/cockroachdb/errors" - "github.com/iotaledger/hive.go/bitmask" - "github.com/iotaledger/hive.go/cerrors" - "github.com/iotaledger/hive.go/generics/lo" - "github.com/iotaledger/hive.go/generics/model" - "github.com/iotaledger/hive.go/generics/objectstorage" - "github.com/iotaledger/hive.go/marshalutil" - "github.com/iotaledger/hive.go/serix" - "github.com/iotaledger/hive.go/stringify" - "github.com/iotaledger/hive.go/types" - "github.com/iotaledger/hive.go/typeutils" + "github.com/iotaledger/hive.go/core/bitmask" + "github.com/iotaledger/hive.go/core/cerrors" + "github.com/iotaledger/hive.go/core/generics/lo" + "github.com/iotaledger/hive.go/core/generics/model" + "github.com/iotaledger/hive.go/core/generics/objectstorage" + "github.com/iotaledger/hive.go/core/marshalutil" + "github.com/iotaledger/hive.go/core/serix" + "github.com/iotaledger/hive.go/core/stringify" + "github.com/iotaledger/hive.go/core/types" + "github.com/iotaledger/hive.go/core/typeutils" "golang.org/x/crypto/blake2b" - "github.com/iotaledger/goshimmer/packages/ledger/utxo" + "github.com/iotaledger/goshimmer/packages/core/ledger/utxo" ) func init() { diff --git a/packages/ledger/vm/devnetvm/output_test.go b/packages/core/ledger/vm/devnetvm/output_test.go similarity index 99% rename from packages/ledger/vm/devnetvm/output_test.go rename to packages/core/ledger/vm/devnetvm/output_test.go index b740b44f66..744076fcac 100644 --- a/packages/ledger/vm/devnetvm/output_test.go +++ b/packages/core/ledger/vm/devnetvm/output_test.go @@ -8,17 +8,17 @@ import ( "testing" "time" - "github.com/iotaledger/hive.go/byteutils" - "github.com/iotaledger/hive.go/crypto/ed25519" - "github.com/iotaledger/hive.go/generics/lo" - "github.com/iotaledger/hive.go/generics/model" - "github.com/iotaledger/hive.go/identity" - "github.com/iotaledger/hive.go/marshalutil" + "github.com/iotaledger/hive.go/core/byteutils" + "github.com/iotaledger/hive.go/core/crypto/ed25519" + "github.com/iotaledger/hive.go/core/generics/lo" + "github.com/iotaledger/hive.go/core/generics/model" + "github.com/iotaledger/hive.go/core/identity" + "github.com/iotaledger/hive.go/core/marshalutil" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "golang.org/x/crypto/blake2b" - "github.com/iotaledger/goshimmer/packages/ledger/utxo" + "github.com/iotaledger/goshimmer/packages/core/ledger/utxo" ) // region AliasOutput Tests diff --git a/packages/ledger/vm/devnetvm/outputfactory.go b/packages/core/ledger/vm/devnetvm/outputfactory.go similarity index 74% rename from packages/ledger/vm/devnetvm/outputfactory.go rename to packages/core/ledger/vm/devnetvm/outputfactory.go index 68fb8bca3b..2a7cbcd27b 100644 --- a/packages/ledger/vm/devnetvm/outputfactory.go +++ b/packages/core/ledger/vm/devnetvm/outputfactory.go @@ -4,10 +4,10 @@ import ( "context" "github.com/cockroachdb/errors" - "github.com/iotaledger/hive.go/cerrors" - "github.com/iotaledger/hive.go/serix" + "github.com/iotaledger/hive.go/core/cerrors" + "github.com/iotaledger/hive.go/core/serix" - "github.com/iotaledger/goshimmer/packages/ledger/utxo" + "github.com/iotaledger/goshimmer/packages/core/ledger/utxo" ) // OutputFromBytes is the factory function for Outputs. diff --git a/packages/ledger/vm/devnetvm/outputtype.go b/packages/core/ledger/vm/devnetvm/outputtype.go similarity index 100% rename from packages/ledger/vm/devnetvm/outputtype.go rename to packages/core/ledger/vm/devnetvm/outputtype.go diff --git a/packages/ledger/vm/devnetvm/signature.go b/packages/core/ledger/vm/devnetvm/signature.go similarity index 97% rename from packages/ledger/vm/devnetvm/signature.go rename to packages/core/ledger/vm/devnetvm/signature.go index 4a6f60cc34..c71b4426c1 100644 --- a/packages/ledger/vm/devnetvm/signature.go +++ b/packages/core/ledger/vm/devnetvm/signature.go @@ -6,11 +6,11 @@ import ( "fmt" "github.com/cockroachdb/errors" - "github.com/iotaledger/hive.go/cerrors" - "github.com/iotaledger/hive.go/crypto/bls" - "github.com/iotaledger/hive.go/crypto/ed25519" - "github.com/iotaledger/hive.go/serix" - "github.com/iotaledger/hive.go/stringify" + "github.com/iotaledger/hive.go/core/cerrors" + "github.com/iotaledger/hive.go/core/crypto/bls" + "github.com/iotaledger/hive.go/core/crypto/ed25519" + "github.com/iotaledger/hive.go/core/serix" + "github.com/iotaledger/hive.go/core/stringify" "github.com/mr-tron/base58" "golang.org/x/crypto/blake2b" ) diff --git a/packages/ledger/vm/devnetvm/testutils.go b/packages/core/ledger/vm/devnetvm/testutils.go similarity index 91% rename from packages/ledger/vm/devnetvm/testutils.go rename to packages/core/ledger/vm/devnetvm/testutils.go index f6ed95ae96..8bb3642757 100644 --- a/packages/ledger/vm/devnetvm/testutils.go +++ b/packages/core/ledger/vm/devnetvm/testutils.go @@ -1,8 +1,8 @@ package devnetvm import ( - "github.com/iotaledger/hive.go/crypto/ed25519" - "github.com/iotaledger/hive.go/generics/lo" + "github.com/iotaledger/hive.go/core/crypto/ed25519" + "github.com/iotaledger/hive.go/core/generics/lo" ) type wallet struct { diff --git a/packages/ledger/vm/devnetvm/transaction.go b/packages/core/ledger/vm/devnetvm/transaction.go similarity index 96% rename from packages/ledger/vm/devnetvm/transaction.go rename to packages/core/ledger/vm/devnetvm/transaction.go index a589be8bf5..2ac312d43a 100644 --- a/packages/ledger/vm/devnetvm/transaction.go +++ b/packages/core/ledger/vm/devnetvm/transaction.go @@ -8,16 +8,16 @@ import ( "time" "github.com/cockroachdb/errors" - "github.com/iotaledger/hive.go/cerrors" - "github.com/iotaledger/hive.go/generics/lo" - "github.com/iotaledger/hive.go/generics/model" - "github.com/iotaledger/hive.go/identity" - "github.com/iotaledger/hive.go/serializer" - "github.com/iotaledger/hive.go/serix" - "github.com/iotaledger/hive.go/types" - - "github.com/iotaledger/goshimmer/packages/ledger/utxo" - "github.com/iotaledger/goshimmer/packages/tangle/payload" + "github.com/iotaledger/hive.go/core/cerrors" + "github.com/iotaledger/hive.go/core/generics/lo" + "github.com/iotaledger/hive.go/core/generics/model" + "github.com/iotaledger/hive.go/core/identity" + "github.com/iotaledger/hive.go/core/serix" + "github.com/iotaledger/hive.go/core/types" + "github.com/iotaledger/hive.go/serializer/v2" + + "github.com/iotaledger/goshimmer/packages/core/ledger/utxo" + "github.com/iotaledger/goshimmer/packages/core/tangleold/payload" ) // region TransactionType ////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/packages/ledger/vm/devnetvm/transaction_test.go b/packages/core/ledger/vm/devnetvm/transaction_test.go similarity index 97% rename from packages/ledger/vm/devnetvm/transaction_test.go rename to packages/core/ledger/vm/devnetvm/transaction_test.go index 05ccc143e1..e6c7b953b7 100644 --- a/packages/ledger/vm/devnetvm/transaction_test.go +++ b/packages/core/ledger/vm/devnetvm/transaction_test.go @@ -4,13 +4,13 @@ import ( "testing" "time" - "github.com/iotaledger/hive.go/crypto/ed25519" - "github.com/iotaledger/hive.go/generics/lo" - "github.com/iotaledger/hive.go/identity" + "github.com/iotaledger/hive.go/core/crypto/ed25519" + "github.com/iotaledger/hive.go/core/generics/lo" + "github.com/iotaledger/hive.go/core/identity" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/iotaledger/goshimmer/packages/ledger/utxo" + "github.com/iotaledger/goshimmer/packages/core/ledger/utxo" ) var sampleColor = Color{2} diff --git a/packages/ledger/vm/devnetvm/unlockblock.go b/packages/core/ledger/vm/devnetvm/unlockblock.go similarity index 98% rename from packages/ledger/vm/devnetvm/unlockblock.go rename to packages/core/ledger/vm/devnetvm/unlockblock.go index 4021892c64..789f7b6567 100644 --- a/packages/ledger/vm/devnetvm/unlockblock.go +++ b/packages/core/ledger/vm/devnetvm/unlockblock.go @@ -6,9 +6,9 @@ import ( "strconv" "github.com/cockroachdb/errors" - "github.com/iotaledger/hive.go/generics/model" - "github.com/iotaledger/hive.go/serix" - "github.com/iotaledger/hive.go/stringify" + "github.com/iotaledger/hive.go/core/generics/model" + "github.com/iotaledger/hive.go/core/serix" + "github.com/iotaledger/hive.go/core/stringify" ) //nolint:dupl diff --git a/packages/ledger/vm/devnetvm/unlockblock_test.go b/packages/core/ledger/vm/devnetvm/unlockblock_test.go similarity index 95% rename from packages/ledger/vm/devnetvm/unlockblock_test.go rename to packages/core/ledger/vm/devnetvm/unlockblock_test.go index 74a1dbd1ff..a6b9ec5a24 100644 --- a/packages/ledger/vm/devnetvm/unlockblock_test.go +++ b/packages/core/ledger/vm/devnetvm/unlockblock_test.go @@ -3,7 +3,7 @@ package devnetvm import ( "testing" - "github.com/iotaledger/hive.go/crypto/ed25519" + "github.com/iotaledger/hive.go/core/crypto/ed25519" "github.com/stretchr/testify/assert" ) diff --git a/packages/ledger/vm/devnetvm/utils.go b/packages/core/ledger/vm/devnetvm/utils.go similarity index 99% rename from packages/ledger/vm/devnetvm/utils.go rename to packages/core/ledger/vm/devnetvm/utils.go index 1d36d7468f..372e17b53a 100644 --- a/packages/ledger/vm/devnetvm/utils.go +++ b/packages/core/ledger/vm/devnetvm/utils.go @@ -4,7 +4,7 @@ import ( "math" "github.com/cockroachdb/errors" - "github.com/iotaledger/hive.go/types" + "github.com/iotaledger/hive.go/core/types" ) // TransactionBalancesValid is an internal utility function that checks if the sum of the balance changes equals to 0. diff --git a/packages/ledger/vm/devnetvm/vm.go b/packages/core/ledger/vm/devnetvm/vm.go similarity index 94% rename from packages/ledger/vm/devnetvm/vm.go rename to packages/core/ledger/vm/devnetvm/vm.go index 1290004917..e2ece33552 100644 --- a/packages/ledger/vm/devnetvm/vm.go +++ b/packages/core/ledger/vm/devnetvm/vm.go @@ -3,8 +3,8 @@ package devnetvm import ( "github.com/cockroachdb/errors" - "github.com/iotaledger/goshimmer/packages/ledger/utxo" - "github.com/iotaledger/goshimmer/packages/ledger/vm" + "github.com/iotaledger/goshimmer/packages/core/ledger/utxo" + "github.com/iotaledger/goshimmer/packages/core/ledger/vm" ) type VM struct{} diff --git a/packages/ledger/vm/vm.go b/packages/core/ledger/vm/vm.go similarity index 92% rename from packages/ledger/vm/vm.go rename to packages/core/ledger/vm/vm.go index d7100ed993..f1e7f19fe8 100644 --- a/packages/ledger/vm/vm.go +++ b/packages/core/ledger/vm/vm.go @@ -1,7 +1,7 @@ package vm import ( - "github.com/iotaledger/goshimmer/packages/ledger/utxo" + "github.com/iotaledger/goshimmer/packages/core/ledger/utxo" ) // VM is a generic interface for UTXO-based VMs. diff --git a/packages/mana/base.go b/packages/core/mana/base.go similarity index 88% rename from packages/mana/base.go rename to packages/core/mana/base.go index 97bd2243ad..e17ae00107 100644 --- a/packages/mana/base.go +++ b/packages/core/mana/base.go @@ -3,7 +3,7 @@ package mana import ( "time" - "github.com/iotaledger/hive.go/identity" + "github.com/iotaledger/hive.go/core/identity" ) // BaseMana is an interface for a collection of base mana values of a single node. diff --git a/packages/mana/basevector.go b/packages/core/mana/basevector.go similarity index 92% rename from packages/mana/basevector.go rename to packages/core/mana/basevector.go index 4c3732751b..d358e03eeb 100644 --- a/packages/mana/basevector.go +++ b/packages/core/mana/basevector.go @@ -3,10 +3,10 @@ package mana import ( "time" - "github.com/iotaledger/goshimmer/packages/ledger" + "github.com/iotaledger/goshimmer/packages/core/ledger" - "github.com/iotaledger/hive.go/generics/model" - "github.com/iotaledger/hive.go/identity" + "github.com/iotaledger/hive.go/core/generics/model" + "github.com/iotaledger/hive.go/core/identity" ) // BaseManaVector is an interface for vectors that store base mana values of nodes in the network. diff --git a/packages/mana/errors.go b/packages/core/mana/errors.go similarity index 100% rename from packages/mana/errors.go rename to packages/core/mana/errors.go diff --git a/packages/mana/events.go b/packages/core/mana/events.go similarity index 97% rename from packages/mana/events.go rename to packages/core/mana/events.go index c506d25429..5c14207825 100644 --- a/packages/mana/events.go +++ b/packages/core/mana/events.go @@ -4,12 +4,12 @@ import ( "sort" "time" - "github.com/iotaledger/hive.go/generics/event" - "github.com/iotaledger/hive.go/identity" - "github.com/iotaledger/hive.go/stringify" + "github.com/iotaledger/hive.go/core/generics/event" + "github.com/iotaledger/hive.go/core/identity" + "github.com/iotaledger/hive.go/core/stringify" "github.com/mr-tron/base58" - "github.com/iotaledger/goshimmer/packages/ledger/utxo" + "github.com/iotaledger/goshimmer/packages/core/ledger/utxo" ) const ( diff --git a/packages/mana/events_test.go b/packages/core/mana/events_test.go similarity index 96% rename from packages/mana/events_test.go rename to packages/core/mana/events_test.go index 63e3920e7c..88b9f885c2 100644 --- a/packages/mana/events_test.go +++ b/packages/core/mana/events_test.go @@ -6,10 +6,10 @@ import ( "testing" "time" - "github.com/iotaledger/hive.go/identity" + "github.com/iotaledger/hive.go/core/identity" "github.com/stretchr/testify/assert" - "github.com/iotaledger/goshimmer/packages/ledger/utxo" + "github.com/iotaledger/goshimmer/packages/core/ledger/utxo" ) func TestRevokedEvent_ToPersistable(t *testing.T) { diff --git a/packages/mana/identity.go b/packages/core/mana/identity.go similarity index 90% rename from packages/mana/identity.go rename to packages/core/mana/identity.go index 9add643adf..d8702a8df0 100644 --- a/packages/mana/identity.go +++ b/packages/core/mana/identity.go @@ -3,8 +3,8 @@ package mana import ( "fmt" - "github.com/iotaledger/hive.go/identity" - "github.com/iotaledger/hive.go/marshalutil" + "github.com/iotaledger/hive.go/core/identity" + "github.com/iotaledger/hive.go/core/marshalutil" "github.com/mr-tron/base58" ) diff --git a/packages/mana/identity_test.go b/packages/core/mana/identity_test.go similarity index 91% rename from packages/mana/identity_test.go rename to packages/core/mana/identity_test.go index 1f58572945..6f638404dc 100644 --- a/packages/mana/identity_test.go +++ b/packages/core/mana/identity_test.go @@ -3,7 +3,7 @@ package mana import ( "testing" - "github.com/iotaledger/hive.go/identity" + "github.com/iotaledger/hive.go/core/identity" "github.com/mr-tron/base58" "github.com/stretchr/testify/assert" ) diff --git a/packages/mana/manabase.go b/packages/core/mana/manabase.go similarity index 94% rename from packages/mana/manabase.go rename to packages/core/mana/manabase.go index 518275d7fc..73614cb1a4 100644 --- a/packages/mana/manabase.go +++ b/packages/core/mana/manabase.go @@ -1,7 +1,7 @@ package mana import ( - "github.com/iotaledger/hive.go/generics/model" + "github.com/iotaledger/hive.go/core/generics/model" ) // ManaBase holds information about the consensus base mana values of a single node. diff --git a/packages/mana/manabase_test.go b/packages/core/mana/manabase_test.go similarity index 96% rename from packages/mana/manabase_test.go rename to packages/core/mana/manabase_test.go index e1d9580e25..3052759d38 100644 --- a/packages/mana/manabase_test.go +++ b/packages/core/mana/manabase_test.go @@ -4,7 +4,7 @@ import ( "testing" "time" - "github.com/iotaledger/hive.go/identity" + "github.com/iotaledger/hive.go/core/identity" "github.com/stretchr/testify/assert" ) diff --git a/packages/mana/manabasevector.go b/packages/core/mana/manabasevector.go similarity index 98% rename from packages/mana/manabasevector.go rename to packages/core/mana/manabasevector.go index e998076505..a79da05d76 100644 --- a/packages/mana/manabasevector.go +++ b/packages/core/mana/manabasevector.go @@ -6,12 +6,12 @@ import ( "sort" "time" - "github.com/iotaledger/goshimmer/packages/ledger" - "github.com/iotaledger/goshimmer/packages/ledger/vm/devnetvm" + "github.com/iotaledger/goshimmer/packages/core/ledger" + "github.com/iotaledger/goshimmer/packages/core/ledger/vm/devnetvm" "github.com/cockroachdb/errors" - "github.com/iotaledger/hive.go/generics/model" - "github.com/iotaledger/hive.go/identity" + "github.com/iotaledger/hive.go/core/generics/model" + "github.com/iotaledger/hive.go/core/identity" ) // ManaBaseVector represents a base mana vector. diff --git a/packages/mana/manabasevector_test.go b/packages/core/mana/manabasevector_test.go similarity index 97% rename from packages/mana/manabasevector_test.go rename to packages/core/mana/manabasevector_test.go index 0a561716af..dba721aff8 100644 --- a/packages/mana/manabasevector_test.go +++ b/packages/core/mana/manabasevector_test.go @@ -5,16 +5,18 @@ import ( "testing" "time" - "github.com/iotaledger/goshimmer/client/wallet/packages/seed" - "github.com/iotaledger/goshimmer/packages/ledger" - "github.com/iotaledger/goshimmer/packages/ledger/vm/devnetvm" - "github.com/iotaledger/hive.go/types" + "github.com/iotaledger/hive.go/core/types" "github.com/stretchr/testify/require" - "github.com/iotaledger/goshimmer/packages/ledger/utxo" - "github.com/iotaledger/hive.go/generics/event" - "github.com/iotaledger/hive.go/identity" + "github.com/iotaledger/goshimmer/client/wallet/packages/seed" + "github.com/iotaledger/goshimmer/packages/core/ledger" + "github.com/iotaledger/goshimmer/packages/core/ledger/vm/devnetvm" + + "github.com/iotaledger/hive.go/core/generics/event" + "github.com/iotaledger/hive.go/core/identity" "github.com/stretchr/testify/assert" + + "github.com/iotaledger/goshimmer/packages/core/ledger/utxo" ) var ( diff --git a/packages/mana/manabasevectormetadata.go b/packages/core/mana/manabasevectormetadata.go similarity index 94% rename from packages/mana/manabasevectormetadata.go rename to packages/core/mana/manabasevectormetadata.go index cf24e1722b..25dd8dbd27 100644 --- a/packages/mana/manabasevectormetadata.go +++ b/packages/core/mana/manabasevectormetadata.go @@ -5,9 +5,9 @@ import ( "time" "github.com/cockroachdb/errors" - "github.com/iotaledger/hive.go/generics/objectstorage" - "github.com/iotaledger/hive.go/marshalutil" - "github.com/iotaledger/hive.go/serix" + "github.com/iotaledger/hive.go/core/generics/objectstorage" + "github.com/iotaledger/hive.go/core/marshalutil" + "github.com/iotaledger/hive.go/core/serix" ) const ( diff --git a/packages/mana/manabasevectormetadata_test.go b/packages/core/mana/manabasevectormetadata_test.go similarity index 100% rename from packages/mana/manabasevectormetadata_test.go rename to packages/core/mana/manabasevectormetadata_test.go diff --git a/packages/mana/objectstorage.go b/packages/core/mana/objectstorage.go similarity index 100% rename from packages/mana/objectstorage.go rename to packages/core/mana/objectstorage.go diff --git a/packages/mana/persistablebase.go b/packages/core/mana/persistablebase.go similarity index 93% rename from packages/mana/persistablebase.go rename to packages/core/mana/persistablebase.go index d8b2e126ab..e5bfc4eb5d 100644 --- a/packages/mana/persistablebase.go +++ b/packages/core/mana/persistablebase.go @@ -3,8 +3,8 @@ package mana import ( "time" - "github.com/iotaledger/hive.go/generics/model" - "github.com/iotaledger/hive.go/identity" + "github.com/iotaledger/hive.go/core/generics/model" + "github.com/iotaledger/hive.go/core/identity" ) // PersistableBaseMana represents a base mana vector that can be persisted. diff --git a/packages/mana/persistablebase_test.go b/packages/core/mana/persistablebase_test.go similarity index 91% rename from packages/mana/persistablebase_test.go rename to packages/core/mana/persistablebase_test.go index 5bb9f0e354..96f8becc2e 100644 --- a/packages/mana/persistablebase_test.go +++ b/packages/core/mana/persistablebase_test.go @@ -5,9 +5,9 @@ import ( "testing" "time" - "github.com/iotaledger/hive.go/generics/lo" - "github.com/iotaledger/hive.go/identity" - "github.com/iotaledger/hive.go/marshalutil" + "github.com/iotaledger/hive.go/core/generics/lo" + "github.com/iotaledger/hive.go/core/identity" + "github.com/iotaledger/hive.go/core/marshalutil" "github.com/stretchr/testify/assert" ) diff --git a/packages/mana/persistableevent.go b/packages/core/mana/persistableevent.go similarity index 92% rename from packages/mana/persistableevent.go rename to packages/core/mana/persistableevent.go index cbb84bc010..2db0cae526 100644 --- a/packages/mana/persistableevent.go +++ b/packages/core/mana/persistableevent.go @@ -6,12 +6,12 @@ import ( "time" "github.com/cockroachdb/errors" - "github.com/iotaledger/hive.go/generics/objectstorage" - "github.com/iotaledger/hive.go/identity" - "github.com/iotaledger/hive.go/serix" + "github.com/iotaledger/hive.go/core/generics/objectstorage" + "github.com/iotaledger/hive.go/core/identity" + "github.com/iotaledger/hive.go/core/serix" "github.com/mr-tron/base58" - "github.com/iotaledger/goshimmer/packages/ledger/utxo" + "github.com/iotaledger/goshimmer/packages/core/ledger/utxo" ) // PersistableEvent is a persistable event. diff --git a/packages/mana/persistableevent_test.go b/packages/core/mana/persistableevent_test.go similarity index 89% rename from packages/mana/persistableevent_test.go rename to packages/core/mana/persistableevent_test.go index a644ecd365..ef0084bfcf 100644 --- a/packages/mana/persistableevent_test.go +++ b/packages/core/mana/persistableevent_test.go @@ -5,12 +5,12 @@ import ( "testing" "time" - "github.com/iotaledger/hive.go/identity" + "github.com/iotaledger/hive.go/core/identity" - "github.com/iotaledger/hive.go/marshalutil" + "github.com/iotaledger/hive.go/core/marshalutil" "github.com/stretchr/testify/assert" - "github.com/iotaledger/goshimmer/packages/ledger/utxo" + "github.com/iotaledger/goshimmer/packages/core/ledger/utxo" ) func TestPersistableEvent_Bytes(t *testing.T) { diff --git a/packages/mana/txinfo.go b/packages/core/mana/txinfo.go similarity index 96% rename from packages/mana/txinfo.go rename to packages/core/mana/txinfo.go index e0741e71f0..f40d4e79de 100644 --- a/packages/mana/txinfo.go +++ b/packages/core/mana/txinfo.go @@ -4,11 +4,11 @@ import ( "time" "github.com/cockroachdb/errors" - "github.com/iotaledger/hive.go/identity" - "github.com/iotaledger/hive.go/marshalutil" - "github.com/iotaledger/hive.go/stringify" + "github.com/iotaledger/hive.go/core/identity" + "github.com/iotaledger/hive.go/core/marshalutil" + "github.com/iotaledger/hive.go/core/stringify" - "github.com/iotaledger/goshimmer/packages/ledger/utxo" + "github.com/iotaledger/goshimmer/packages/core/ledger/utxo" ) // TxInfo holds information related to the transaction which we are processing for mana calculation. diff --git a/packages/mana/types.go b/packages/core/mana/types.go similarity index 100% rename from packages/mana/types.go rename to packages/core/mana/types.go diff --git a/packages/mana/utils.go b/packages/core/mana/utils.go similarity index 96% rename from packages/mana/utils.go rename to packages/core/mana/utils.go index 6232514988..51ff3045aa 100644 --- a/packages/mana/utils.go +++ b/packages/core/mana/utils.go @@ -1,7 +1,7 @@ package mana import ( - "github.com/iotaledger/hive.go/identity" + "github.com/iotaledger/hive.go/core/identity" "github.com/mr-tron/base58" ) diff --git a/packages/mana/utils_test.go b/packages/core/mana/utils_test.go similarity index 90% rename from packages/mana/utils_test.go rename to packages/core/mana/utils_test.go index a4dec347ab..443a22e5f1 100644 --- a/packages/mana/utils_test.go +++ b/packages/core/mana/utils_test.go @@ -3,7 +3,7 @@ package mana import ( "testing" - "github.com/iotaledger/hive.go/identity" + "github.com/iotaledger/hive.go/core/identity" "github.com/stretchr/testify/assert" ) diff --git a/packages/markers/manager.go b/packages/core/markers/manager.go similarity index 98% rename from packages/markers/manager.go rename to packages/core/markers/manager.go index 9cfd4a7b27..c547d1e705 100644 --- a/packages/markers/manager.go +++ b/packages/core/markers/manager.go @@ -8,12 +8,12 @@ import ( "github.com/cockroachdb/errors" - "github.com/iotaledger/hive.go/generics/objectstorage" - "github.com/iotaledger/hive.go/generics/walker" - "github.com/iotaledger/hive.go/kvstore" - "github.com/iotaledger/hive.go/kvstore/mapdb" + "github.com/iotaledger/hive.go/core/generics/objectstorage" + "github.com/iotaledger/hive.go/core/generics/walker" + "github.com/iotaledger/hive.go/core/kvstore" + "github.com/iotaledger/hive.go/core/kvstore/mapdb" - "github.com/iotaledger/goshimmer/packages/database" + "github.com/iotaledger/goshimmer/packages/node/database" ) // region Manager ////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/packages/markers/manager_test.go b/packages/core/markers/manager_test.go similarity index 99% rename from packages/markers/manager_test.go rename to packages/core/markers/manager_test.go index 39be6ea52f..6f9a40337f 100644 --- a/packages/markers/manager_test.go +++ b/packages/core/markers/manager_test.go @@ -3,8 +3,8 @@ package markers import ( "testing" - "github.com/iotaledger/hive.go/stringify" - "github.com/iotaledger/hive.go/types" + "github.com/iotaledger/hive.go/core/stringify" + "github.com/iotaledger/hive.go/core/types" "github.com/stretchr/testify/assert" ) diff --git a/packages/markers/models.go b/packages/core/markers/models.go similarity index 98% rename from packages/markers/models.go rename to packages/core/markers/models.go index 04ffe89b03..8dfd171ea9 100644 --- a/packages/markers/models.go +++ b/packages/core/markers/models.go @@ -6,13 +6,13 @@ import ( "strconv" "github.com/cockroachdb/errors" - "github.com/iotaledger/hive.go/generics/lo" - "github.com/iotaledger/hive.go/generics/model" - "github.com/iotaledger/hive.go/generics/thresholdmap" - "github.com/iotaledger/hive.go/marshalutil" - "github.com/iotaledger/hive.go/serix" - "github.com/iotaledger/hive.go/stringify" - "github.com/iotaledger/hive.go/types" + "github.com/iotaledger/hive.go/core/generics/lo" + "github.com/iotaledger/hive.go/core/generics/model" + "github.com/iotaledger/hive.go/core/generics/thresholdmap" + "github.com/iotaledger/hive.go/core/marshalutil" + "github.com/iotaledger/hive.go/core/serix" + "github.com/iotaledger/hive.go/core/stringify" + "github.com/iotaledger/hive.go/core/types" ) // region Index //////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/packages/markers/models_test.go b/packages/core/markers/models_test.go similarity index 99% rename from packages/markers/models_test.go rename to packages/core/markers/models_test.go index fb6106cc14..6f6e7b60b5 100644 --- a/packages/markers/models_test.go +++ b/packages/core/markers/models_test.go @@ -4,7 +4,7 @@ import ( "fmt" "testing" - "github.com/iotaledger/hive.go/generics/lo" + "github.com/iotaledger/hive.go/core/generics/lo" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/packages/notarization/commitments.go b/packages/core/notarization/commitments.go similarity index 93% rename from packages/notarization/commitments.go rename to packages/core/notarization/commitments.go index d77e7fffd0..2347942b42 100644 --- a/packages/notarization/commitments.go +++ b/packages/core/notarization/commitments.go @@ -3,22 +3,24 @@ package notarization import ( "context" - "github.com/iotaledger/hive.go/serix" + "github.com/iotaledger/hive.go/core/serix" "github.com/celestiaorg/smt" "github.com/cockroachdb/errors" - "github.com/iotaledger/goshimmer/packages/epoch" - "github.com/iotaledger/goshimmer/packages/ledger" - "github.com/iotaledger/hive.go/generics/lo" - "github.com/iotaledger/hive.go/generics/objectstorage" - "github.com/iotaledger/hive.go/kvstore" + + "github.com/iotaledger/goshimmer/packages/core/epoch" + "github.com/iotaledger/goshimmer/packages/core/ledger" + "github.com/iotaledger/goshimmer/packages/node/database" + + "github.com/iotaledger/hive.go/core/generics/lo" + "github.com/iotaledger/hive.go/core/generics/objectstorage" + "github.com/iotaledger/hive.go/core/kvstore" "golang.org/x/crypto/blake2b" - "github.com/iotaledger/goshimmer/packages/ledger/utxo" - "github.com/iotaledger/goshimmer/packages/ledger/vm/devnetvm" + "github.com/iotaledger/goshimmer/packages/core/ledger/utxo" + "github.com/iotaledger/goshimmer/packages/core/ledger/vm/devnetvm" - "github.com/iotaledger/goshimmer/packages/database" - "github.com/iotaledger/goshimmer/packages/tangle" + "github.com/iotaledger/goshimmer/packages/core/tangleold" ) // region Committment types //////////////////////////////////////////////////////////////////////////////////////////// @@ -48,7 +50,7 @@ type EpochCommitmentFactory struct { commitmentTrees map[epoch.Index]*CommitmentTrees storage *EpochCommitmentStorage - tangle *tangle.Tangle + tangle *tangleold.Tangle // stateRootTree stores the state tree at the LastCommittedEpoch. stateRootTree *smt.SparseMerkleTree @@ -60,7 +62,7 @@ type EpochCommitmentFactory struct { } // NewEpochCommitmentFactory returns a new commitment factory. -func NewEpochCommitmentFactory(store kvstore.KVStore, tangle *tangle.Tangle, snapshotDepth int) *EpochCommitmentFactory { +func NewEpochCommitmentFactory(store kvstore.KVStore, tangle *tangleold.Tangle, snapshotDepth int) *EpochCommitmentFactory { epochCommitmentStorage := newEpochCommitmentStorage(WithStore(store)) stateRootTreeNodeStore := objectstorage.NewStoreWithRealm(epochCommitmentStorage.baseStore, database.PrefixNotarization, prefixStateTreeNodes) @@ -198,7 +200,7 @@ func (f *EpochCommitmentFactory) removeStateMutationLeaf(ei epoch.Index, txID ut } // InsertTangleLeaf inserts blk to the Tangle sparse merkle tree. -func (f *EpochCommitmentFactory) insertTangleLeaf(ei epoch.Index, blkID tangle.BlockID) error { +func (f *EpochCommitmentFactory) insertTangleLeaf(ei epoch.Index, blkID tangleold.BlockID) error { commitment, err := f.getCommitmentTrees(ei) if err != nil { return errors.Wrap(err, "could not get commitment while inserting tangle leaf") @@ -211,7 +213,7 @@ func (f *EpochCommitmentFactory) insertTangleLeaf(ei epoch.Index, blkID tangle.B } // RemoveTangleLeaf removes the block ID from the Tangle sparse merkle tree. -func (f *EpochCommitmentFactory) removeTangleLeaf(ei epoch.Index, blkID tangle.BlockID) error { +func (f *EpochCommitmentFactory) removeTangleLeaf(ei epoch.Index, blkID tangleold.BlockID) error { commitment, err := f.getCommitmentTrees(ei) if err != nil { return errors.Wrap(err, "could not get commitment while deleting tangle leaf") @@ -318,6 +320,17 @@ func (f *EpochCommitmentFactory) loadDiffUTXOs(ei epoch.Index) (spent, created [ return } +func (f *EpochCommitmentFactory) loadLedgerState(consumer func(*ledger.OutputWithMetadata)) { + f.storage.ledgerstateStorage.ForEach(func(_ []byte, cachedOutputWithMetadata *objectstorage.CachedObject[*ledger.OutputWithMetadata]) bool { + cachedOutputWithMetadata.Consume(func(outputWithMetadata *ledger.OutputWithMetadata) { + consumer(outputWithMetadata) + }) + return true + }) + + return +} + // NewCommitment returns an empty commitment for the epoch. func (f *EpochCommitmentFactory) newCommitmentTrees(ei epoch.Index) *CommitmentTrees { // Volatile storage for small trees diff --git a/packages/notarization/manager.go b/packages/core/notarization/manager.go similarity index 86% rename from packages/notarization/manager.go rename to packages/core/notarization/manager.go index e42532feda..ce147b987b 100644 --- a/packages/notarization/manager.go +++ b/packages/core/notarization/manager.go @@ -6,16 +6,17 @@ import ( "github.com/cockroachdb/errors" - "github.com/iotaledger/hive.go/generics/event" - "github.com/iotaledger/hive.go/logger" - - "github.com/iotaledger/goshimmer/packages/clock" - "github.com/iotaledger/goshimmer/packages/conflictdag" - "github.com/iotaledger/goshimmer/packages/epoch" - "github.com/iotaledger/goshimmer/packages/ledger" - "github.com/iotaledger/goshimmer/packages/ledger/utxo" - "github.com/iotaledger/goshimmer/packages/ledger/vm/devnetvm" - "github.com/iotaledger/goshimmer/packages/tangle" + "github.com/iotaledger/hive.go/core/generics/event" + "github.com/iotaledger/hive.go/core/logger" + + "github.com/iotaledger/goshimmer/packages/core/conflictdag" + "github.com/iotaledger/goshimmer/packages/node/clock" + + "github.com/iotaledger/goshimmer/packages/core/epoch" + "github.com/iotaledger/goshimmer/packages/core/ledger" + "github.com/iotaledger/goshimmer/packages/core/ledger/utxo" + "github.com/iotaledger/goshimmer/packages/core/ledger/vm/devnetvm" + "github.com/iotaledger/goshimmer/packages/core/tangleold" ) const ( @@ -26,7 +27,7 @@ const ( // Manager is the notarization manager. type Manager struct { - tangle *tangle.Tangle + tangle *tangleold.Tangle epochCommitmentFactory *EpochCommitmentFactory epochCommitmentFactoryMutex sync.RWMutex bootstrapMutex sync.RWMutex @@ -38,7 +39,7 @@ type Manager struct { } // NewManager creates and returns a new notarization manager. -func NewManager(epochCommitmentFactory *EpochCommitmentFactory, t *tangle.Tangle, opts ...ManagerOption) (new *Manager) { +func NewManager(epochCommitmentFactory *EpochCommitmentFactory, t *tangleold.Tangle, opts ...ManagerOption) (new *Manager) { options := &ManagerOptions{ MinCommittableEpochAge: defaultMinEpochCommittableAge, Log: nil, @@ -67,11 +68,11 @@ func NewManager(epochCommitmentFactory *EpochCommitmentFactory, t *tangle.Tangle }, } - new.tangle.ConfirmationOracle.Events().BlockAccepted.Attach(onlyIfBootstrapped(t.TimeManager, func(event *tangle.BlockAcceptedEvent) { + new.tangle.ConfirmationOracle.Events().BlockAccepted.Attach(onlyIfBootstrapped(t.TimeManager, func(event *tangleold.BlockAcceptedEvent) { new.OnBlockAccepted(event.Block) })) - new.tangle.ConfirmationOracle.Events().BlockOrphaned.Attach(onlyIfBootstrapped(t.TimeManager, func(event *tangle.BlockAcceptedEvent) { + new.tangle.ConfirmationOracle.Events().BlockOrphaned.Attach(onlyIfBootstrapped(t.TimeManager, func(event *tangleold.BlockAcceptedEvent) { new.OnBlockOrphaned(event.Block) })) @@ -95,14 +96,30 @@ func NewManager(epochCommitmentFactory *EpochCommitmentFactory, t *tangle.Tangle new.OnConflictRejected(event.ID) })) - new.tangle.TimeManager.Events.AcceptanceTimeUpdated.Attach(onlyIfBootstrapped(t.TimeManager, func(event *tangle.TimeUpdate) { + new.tangle.TimeManager.Events.AcceptanceTimeUpdated.Attach(onlyIfBootstrapped(t.TimeManager, func(event *tangleold.TimeUpdate) { new.OnAcceptanceTimeUpdated(event.ATT) })) return new } -func onlyIfBootstrapped[E any](timeManager *tangle.TimeManager, handler func(event E)) *event.Closure[E] { +func (m *Manager) ReadLockLedger() { + m.epochCommitmentFactoryMutex.RLock() +} + +func (m *Manager) ReadUnlockLedger() { + m.epochCommitmentFactoryMutex.RUnlock() +} + +func (m *Manager) WriteLockLedger() { + m.epochCommitmentFactoryMutex.Lock() +} + +func (m *Manager) WriteUnlockLedger() { + m.epochCommitmentFactoryMutex.Unlock() +} + +func onlyIfBootstrapped[E any](timeManager *tangleold.TimeManager, handler func(event E)) *event.Closure[E] { return event.NewClosure(func(event E) { if !timeManager.Bootstrapped() { return @@ -111,12 +128,12 @@ func onlyIfBootstrapped[E any](timeManager *tangle.TimeManager, handler func(eve }) } -// LoadSnapshot initiates the state and mana trees from a given snapshot. -func (m *Manager) LoadSnapshot(snapshot *ledger.Snapshot) { - m.epochCommitmentFactoryMutex.Lock() - defer m.epochCommitmentFactoryMutex.Unlock() +// LoadOutputsWithMetadata initiates the state and mana trees from a given snapshot. +func (m *Manager) LoadOutputsWithMetadata(outputsWithMetadatas []*ledger.OutputWithMetadata) { + m.WriteLockLedger() + defer m.WriteUnlockLedger() - for _, outputWithMetadata := range snapshot.OutputsWithMetadata { + for _, outputWithMetadata := range outputsWithMetadatas { m.epochCommitmentFactory.storage.ledgerstateStorage.Store(outputWithMetadata).Release() err := m.epochCommitmentFactory.insertStateLeaf(outputWithMetadata.ID()) if err != nil { @@ -127,8 +144,15 @@ func (m *Manager) LoadSnapshot(snapshot *ledger.Snapshot) { m.log.Error(err) } } - for ei := snapshot.FullEpochIndex + 1; ei <= snapshot.DiffEpochIndex; ei++ { - epochDiff := snapshot.EpochDiffs[ei] +} + +// LoadEpochDiffs updates the state tree from a given snapshot. +func (m *Manager) LoadEpochDiffs(header *ledger.SnapshotHeader, epochDiffs map[epoch.Index]*ledger.EpochDiff) { + m.WriteLockLedger() + defer m.WriteUnlockLedger() + + for ei := header.FullEpochIndex + 1; ei <= header.DiffEpochIndex; ei++ { + epochDiff := epochDiffs[ei] for _, spentOutputWithMetadata := range epochDiff.Spent() { spentOutputIDBytes := spentOutputWithMetadata.ID().Bytes() m.epochCommitmentFactory.storage.ledgerstateStorage.Delete(spentOutputIDBytes) @@ -140,7 +164,6 @@ func (m *Manager) LoadSnapshot(snapshot *ledger.Snapshot) { panic("could not delete leaf from state root tree") } } - for _, createdOutputWithMetadata := range epochDiff.Created() { createdOutputIDBytes := createdOutputWithMetadata.ID().Bytes() m.epochCommitmentFactory.storage.ledgerstateStorage.Store(createdOutputWithMetadata).Release() @@ -150,29 +173,62 @@ func (m *Manager) LoadSnapshot(snapshot *ledger.Snapshot) { } } } + return +} + +// LoadECandEIs initiates the ECRecord, latest committable EI, last confirmed EI and acceptance EI from a given snapshot. +func (m *Manager) LoadECandEIs(header *ledger.SnapshotHeader) { + m.WriteLockLedger() + defer m.WriteUnlockLedger() // The last committed epoch index corresponds to the last epoch diff stored in the snapshot. - if err := m.epochCommitmentFactory.storage.setLatestCommittableEpochIndex(snapshot.DiffEpochIndex); err != nil { + if err := m.epochCommitmentFactory.storage.setLatestCommittableEpochIndex(header.DiffEpochIndex); err != nil { panic("could not set last committed epoch index") } // We assume as our earliest forking point the last epoch diff stored in the snapshot. - if err := m.epochCommitmentFactory.storage.setLastConfirmedEpochIndex(snapshot.DiffEpochIndex); err != nil { + if err := m.epochCommitmentFactory.storage.setLastConfirmedEpochIndex(header.DiffEpochIndex); err != nil { panic("could not set last confirmed epoch index") } // We set it to the next epoch after snapshotted one. It will be updated upon first confirmed block will arrive. - if err := m.epochCommitmentFactory.storage.setAcceptanceEpochIndex(snapshot.DiffEpochIndex + 1); err != nil { + if err := m.epochCommitmentFactory.storage.setAcceptanceEpochIndex(header.DiffEpochIndex + 1); err != nil { panic("could not set current epoch index") } - m.epochCommitmentFactory.storage.ecRecordStorage.Store(snapshot.LatestECRecord).Release() + m.epochCommitmentFactory.storage.ecRecordStorage.Store(header.LatestECRecord).Release() +} + +// SnapshotEpochDiffs returns the EpochDiffs when a snapshot is created. +func (m *Manager) SnapshotEpochDiffs(lastConfirmedEpoch, latestCommittableEpoch epoch.Index) (map[epoch.Index]*ledger.EpochDiff, error) { + epochDiffsMap := make(map[epoch.Index]*ledger.EpochDiff) + for ei := lastConfirmedEpoch + 1; ei <= latestCommittableEpoch; ei++ { + spent, created := m.epochCommitmentFactory.loadDiffUTXOs(ei) + epochDiffsMap[ei] = ledger.NewEpochDiff(spent, created) + } + + return epochDiffsMap, nil +} + +// SnapshotLedgerState returns the all confirmed OutputsWithMetadata when a snapshot is created. +func (m *Manager) SnapshotLedgerState(lastConfirmedEpoch epoch.Index, prodChan chan *ledger.OutputWithMetadata) { + go func() { + m.epochCommitmentFactory.loadLedgerState(func(o *ledger.OutputWithMetadata) { + index := epoch.IndexFromTime(o.CreationTime()) + if index <= lastConfirmedEpoch { + prodChan <- o + } + }) + close(prodChan) + }() + + return } // GetLatestEC returns the latest commitment that a new block should commit to. func (m *Manager) GetLatestEC() (ecRecord *epoch.ECRecord, err error) { - m.epochCommitmentFactoryMutex.RLock() - defer m.epochCommitmentFactoryMutex.RUnlock() + m.ReadLockLedger() + defer m.ReadUnlockLedger() latestCommittableEpoch, err := m.epochCommitmentFactory.storage.latestCommittableEpochIndex() ecRecord = m.epochCommitmentFactory.loadECRecord(latestCommittableEpoch) @@ -184,16 +240,16 @@ func (m *Manager) GetLatestEC() (ecRecord *epoch.ECRecord, err error) { // LatestConfirmedEpochIndex returns the latest epoch index that has been confirmed. func (m *Manager) LatestConfirmedEpochIndex() (epoch.Index, error) { - m.epochCommitmentFactoryMutex.RLock() - defer m.epochCommitmentFactoryMutex.RUnlock() + m.ReadLockLedger() + defer m.ReadUnlockLedger() return m.epochCommitmentFactory.storage.lastConfirmedEpochIndex() } // OnBlockAccepted is the handler for block confirmed event. -func (m *Manager) OnBlockAccepted(block *tangle.Block) { - m.epochCommitmentFactoryMutex.Lock() - defer m.epochCommitmentFactoryMutex.Unlock() +func (m *Manager) OnBlockAccepted(block *tangleold.Block) { + m.WriteLockLedger() + defer m.WriteUnlockLedger() ei := epoch.IndexFromTime(block.IssuingTime()) @@ -206,13 +262,15 @@ func (m *Manager) OnBlockAccepted(block *tangle.Block) { m.log.Error(err) return } + m.updateEpochsBootstrapped(ei) + m.Events.TangleTreeInserted.Trigger(&TangleTreeUpdatedEvent{EI: ei, BlockID: block.ID()}) } // OnBlockOrphaned is the handler for block orphaned event. -func (m *Manager) OnBlockOrphaned(block *tangle.Block) { - m.epochCommitmentFactoryMutex.Lock() - defer m.epochCommitmentFactoryMutex.Unlock() +func (m *Manager) OnBlockOrphaned(block *tangleold.Block) { + m.WriteLockLedger() + defer m.WriteUnlockLedger() ei := epoch.IndexFromTime(block.IssuingTime()) if m.isEpochAlreadyCommitted(ei) { @@ -235,8 +293,8 @@ func (m *Manager) OnBlockOrphaned(block *tangle.Block) { // OnTransactionAccepted is the handler for transaction accepted event. func (m *Manager) OnTransactionAccepted(event *ledger.TransactionAcceptedEvent) { - m.epochCommitmentFactoryMutex.Lock() - defer m.epochCommitmentFactoryMutex.Unlock() + m.WriteLockLedger() + defer m.WriteUnlockLedger() txID := event.TransactionID @@ -262,8 +320,8 @@ func (m *Manager) OnTransactionAccepted(event *ledger.TransactionAcceptedEvent) // OnTransactionInclusionUpdated is the handler for transaction inclusion updated event. func (m *Manager) OnTransactionInclusionUpdated(event *ledger.TransactionInclusionUpdatedEvent) { - m.epochCommitmentFactoryMutex.Lock() - defer m.epochCommitmentFactoryMutex.Unlock() + m.WriteLockLedger() + defer m.WriteUnlockLedger() oldEpoch := epoch.IndexFromTime(event.PreviousInclusionTime) newEpoch := epoch.IndexFromTime(event.InclusionTime) @@ -301,8 +359,8 @@ func (m *Manager) OnConflictAccepted(conflictID utxo.TransactionID) { // OnConflictConfirmed is the handler for conflict confirmed event. func (m *Manager) onConflictAccepted(conflictID utxo.TransactionID) ([]*EpochCommittableEvent, []*ManaVectorUpdateEvent) { - m.epochCommitmentFactoryMutex.Lock() - defer m.epochCommitmentFactoryMutex.Unlock() + m.WriteLockLedger() + defer m.WriteUnlockLedger() ei := m.getConflictEI(conflictID) @@ -315,8 +373,8 @@ func (m *Manager) onConflictAccepted(conflictID utxo.TransactionID) ([]*EpochCom // OnConflictCreated is the handler for conflict created event. func (m *Manager) OnConflictCreated(conflictID utxo.TransactionID) { - m.epochCommitmentFactoryMutex.Lock() - defer m.epochCommitmentFactoryMutex.Unlock() + m.WriteLockLedger() + defer m.WriteUnlockLedger() ei := m.getConflictEI(conflictID) @@ -335,8 +393,8 @@ func (m *Manager) OnConflictRejected(conflictID utxo.TransactionID) { // OnConflictRejected is the handler for conflict created event. func (m *Manager) onConflictRejected(conflictID utxo.TransactionID) ([]*EpochCommittableEvent, []*ManaVectorUpdateEvent) { - m.epochCommitmentFactoryMutex.Lock() - defer m.epochCommitmentFactoryMutex.Unlock() + m.WriteLockLedger() + defer m.WriteUnlockLedger() ei := m.getConflictEI(conflictID) @@ -355,8 +413,8 @@ func (m *Manager) OnAcceptanceTimeUpdated(newTime time.Time) { // OnAcceptanceTimeUpdated is the handler for time updated event and returns events to be triggered. func (m *Manager) onAcceptanceTimeUpdated(newTime time.Time) ([]*EpochCommittableEvent, []*ManaVectorUpdateEvent) { - m.epochCommitmentFactoryMutex.Lock() - defer m.epochCommitmentFactoryMutex.Unlock() + m.WriteLockLedger() + defer m.WriteUnlockLedger() ei := epoch.IndexFromTime(newTime) currentEpochIndex, err := m.epochCommitmentFactory.storage.acceptanceEpochIndex() @@ -398,8 +456,8 @@ func (m *Manager) Bootstrapped() bool { // Shutdown shuts down the manager's permanent storagee. func (m *Manager) Shutdown() { - m.epochCommitmentFactoryMutex.Lock() - defer m.epochCommitmentFactoryMutex.Unlock() + m.WriteLockLedger() + defer m.WriteUnlockLedger() m.epochCommitmentFactory.storage.shutdown() } @@ -566,7 +624,6 @@ func (m *Manager) moveLatestCommittableEpoch(currentEpoch epoch.Index) ([]*Epoch func (m *Manager) triggerEpochEvents(epochCommittableEvents []*EpochCommittableEvent, manaVectorUpdateEvents []*ManaVectorUpdateEvent) { for _, epochCommittableEvent := range epochCommittableEvents { - m.updateEpochsBootstrapped(epochCommittableEvent.EI) m.Events.EpochCommittable.Trigger(epochCommittableEvent) } for _, manaVectorUpdateEvent := range manaVectorUpdateEvents { @@ -656,7 +713,7 @@ type TangleTreeUpdatedEvent struct { // EI is the index of the block. EI epoch.Index // BlockID is the blockID that inserted/removed to/from the tangle smt. - BlockID tangle.BlockID + BlockID tangleold.BlockID } // BootstrappedEvent is an event that gets triggered when a notarization manager has the last committable epoch relatively close to current epoch. diff --git a/packages/notarization/manager_test.go b/packages/core/notarization/manager_test.go similarity index 69% rename from packages/notarization/manager_test.go rename to packages/core/notarization/manager_test.go index 6911a5910c..dc14096402 100644 --- a/packages/notarization/manager_test.go +++ b/packages/core/notarization/manager_test.go @@ -5,22 +5,23 @@ import ( "testing" "time" - "github.com/iotaledger/goshimmer/packages/conflictdag" - "github.com/iotaledger/goshimmer/packages/consensus/acceptance" - epoch "github.com/iotaledger/goshimmer/packages/epoch" - "github.com/iotaledger/goshimmer/packages/ledger" - "github.com/iotaledger/goshimmer/packages/ledger/utxo" - "github.com/iotaledger/goshimmer/packages/tangle" - - "github.com/iotaledger/hive.go/generics/event" - "github.com/iotaledger/hive.go/identity" - "github.com/iotaledger/hive.go/logger" + "github.com/iotaledger/goshimmer/packages/core/conflictdag" + + "github.com/iotaledger/goshimmer/packages/core/consensus/acceptance" + "github.com/iotaledger/goshimmer/packages/core/epoch" + "github.com/iotaledger/goshimmer/packages/core/ledger" + "github.com/iotaledger/goshimmer/packages/core/ledger/utxo" + "github.com/iotaledger/goshimmer/packages/core/tangleold" + + "github.com/iotaledger/hive.go/core/generics/event" + "github.com/iotaledger/hive.go/core/identity" + "github.com/iotaledger/hive.go/core/logger" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) func TestNewManager(t *testing.T) { - testTangle := tangle.NewTestTangle() + testTangle := tangleold.NewTestTangle() m := NewManager(NewEpochCommitmentFactory(testTangle.Options.Store, testTangle, 1), testTangle) assert.NotNil(t, m) } @@ -74,19 +75,19 @@ func TestManager_GetLatestEC(t *testing.T) { nodes := map[string]*identity.Identity{ "A": identity.GenerateIdentity(), } - var weightProvider *tangle.CManaWeightProvider + var weightProvider *tangleold.CManaWeightProvider manaRetrieverMock := func() map[identity.ID]float64 { weightProvider.Update(time.Now(), nodes["A"].ID()) return map[identity.ID]float64{ nodes["A"].ID(): 100, } } - weightProvider = tangle.NewCManaWeightProvider(manaRetrieverMock, time.Now) + weightProvider = tangleold.NewCManaWeightProvider(manaRetrieverMock, time.Now) genesisTime := time.Now().Add(-25 * time.Minute) epochDuration := 5 * time.Minute - testFramework, eventHandlerMock, m := setupFramework(t, genesisTime, epochDuration, epochDuration*2, tangle.ApprovalWeights(weightProvider), tangle.WithConflictDAGOptions(conflictdag.WithMergeToMaster(false))) + testFramework, eventHandlerMock, m := setupFramework(t, genesisTime, epochDuration, epochDuration*2, tangleold.ApprovalWeights(weightProvider), tangleold.WithConflictDAGOptions(conflictdag.WithMergeToMaster(false))) ecRecord, _, err := testFramework.LatestCommitment() require.NoError(t, err) @@ -96,7 +97,7 @@ func TestManager_GetLatestEC(t *testing.T) { m.increasePendingConflictCounter(epoch.Index(i)) } // Make all epochs committable by advancing ATT - testFramework.CreateBlock("Block7", tangle.WithIssuingTime(genesisTime.Add(epochDuration*6)), tangle.WithStrongParents("Genesis"), tangle.WithIssuer(nodes["A"].PublicKey()), tangle.WithECRecord(ecRecord)) + testFramework.CreateBlock("Block7", tangleold.WithIssuingTime(genesisTime.Add(epochDuration*6)), tangleold.WithStrongParents("Genesis"), tangleold.WithIssuer(nodes["A"].PublicKey()), tangleold.WithECRecord(ecRecord)) testFramework.IssueBlocks("Block7").WaitUntilAllTasksProcessed() commitment, err := m.GetLatestEC() @@ -137,7 +138,7 @@ func TestManager_UpdateTangleTree(t *testing.T) { nodes[node] = identity.GenerateIdentity() } - var weightProvider *tangle.CManaWeightProvider + var weightProvider *tangleold.CManaWeightProvider manaRetrieverMock := func() map[identity.ID]float64 { for _, node := range nodes { weightProvider.Update(time.Now(), node.ID()) @@ -149,14 +150,14 @@ func TestManager_UpdateTangleTree(t *testing.T) { nodes["D"].ID(): 25, } } - weightProvider = tangle.NewCManaWeightProvider(manaRetrieverMock, time.Now) + weightProvider = tangleold.NewCManaWeightProvider(manaRetrieverMock, time.Now) epochInterval := 1 * time.Second // Make Current Epoch be epoch 5 genesisTime := time.Now().Add(-epochInterval * 5) - testFramework, eventHandlerMock, notarizationMgr := setupFramework(t, genesisTime, epochInterval, epochInterval*2, tangle.ApprovalWeights(weightProvider), tangle.WithConflictDAGOptions(conflictdag.WithMergeToMaster(false))) + testFramework, eventHandlerMock, notarizationMgr := setupFramework(t, genesisTime, epochInterval, epochInterval*2, tangleold.ApprovalWeights(weightProvider), tangleold.WithConflictDAGOptions(conflictdag.WithMergeToMaster(false))) var EC0 epoch.EC @@ -171,7 +172,7 @@ func TestManager_UpdateTangleTree(t *testing.T) { EC0 = EC(ecRecord) // PrevEC of Epoch0 is the empty Merkle Root assert.Equal(t, epoch.MerkleRoot{}, ecRecord.PrevEC()) - testFramework.CreateBlock("Block1", tangle.WithIssuingTime(issuingTime), tangle.WithStrongParents("Genesis"), tangle.WithIssuer(nodes["A"].PublicKey()), tangle.WithECRecord(ecRecord)) + testFramework.CreateBlock("Block1", tangleold.WithIssuingTime(issuingTime), tangleold.WithStrongParents("Genesis"), tangleold.WithIssuer(nodes["A"].PublicKey()), tangleold.WithECRecord(ecRecord)) testFramework.IssueBlocks("Block1").WaitUntilAllTasksProcessed() blk := testFramework.Block("Block1") @@ -189,7 +190,7 @@ func TestManager_UpdateTangleTree(t *testing.T) { assert.Equal(t, EC0, EC(ecRecord)) // PrevEC of Epoch0 is the empty Merkle Root assert.Equal(t, epoch.MerkleRoot{}, ecRecord.PrevEC()) - testFramework.CreateBlock("Block2", tangle.WithIssuingTime(issuingTime), tangle.WithStrongParents("Block1"), tangle.WithIssuer(nodes["B"].PublicKey()), tangle.WithECRecord(ecRecord)) + testFramework.CreateBlock("Block2", tangleold.WithIssuingTime(issuingTime), tangleold.WithStrongParents("Block1"), tangleold.WithIssuer(nodes["B"].PublicKey()), tangleold.WithECRecord(ecRecord)) testFramework.IssueBlocks("Block2").WaitUntilAllTasksProcessed() blk := testFramework.Block("Block2") @@ -211,7 +212,7 @@ func TestManager_UpdateTangleTree(t *testing.T) { assert.Equal(t, EC0, EC(ecRecord)) // PrevEC of Epoch0 is the empty Merkle Root assert.Equal(t, epoch.MerkleRoot{}, ecRecord.PrevEC()) - testFramework.CreateBlock("Block3", tangle.WithIssuingTime(issuingTime), tangle.WithStrongParents("Block2"), tangle.WithIssuer(nodes["C"].PublicKey()), tangle.WithECRecord(ecRecord)) + testFramework.CreateBlock("Block3", tangleold.WithIssuingTime(issuingTime), tangleold.WithStrongParents("Block2"), tangleold.WithIssuer(nodes["C"].PublicKey()), tangleold.WithECRecord(ecRecord)) testFramework.IssueBlocks("Block3").WaitUntilAllTasksProcessed() blk := testFramework.Block("Block3") @@ -235,7 +236,7 @@ func TestManager_UpdateTangleTree(t *testing.T) { assert.Equal(t, epoch.MerkleRoot{}, ecRecord.PrevEC()) event.Loop.WaitUntilAllTasksProcessed() eventHandlerMock.Expect("EpochCommittable", epoch.Index(1)) - testFramework.CreateBlock("Block4", tangle.WithIssuingTime(issuingTime), tangle.WithStrongParents("Block3", "Block2"), tangle.WithIssuer(nodes["D"].PublicKey()), tangle.WithECRecord(ecRecord)) + testFramework.CreateBlock("Block4", tangleold.WithIssuingTime(issuingTime), tangleold.WithStrongParents("Block3", "Block2"), tangleold.WithIssuer(nodes["D"].PublicKey()), tangleold.WithECRecord(ecRecord)) testFramework.IssueBlocks("Block4").WaitUntilAllTasksProcessed() blk := testFramework.Block("Block4") @@ -255,7 +256,7 @@ func TestManager_UpdateTangleTree(t *testing.T) { ecRecord, _, err := testFramework.LatestCommitment() require.NoError(t, err) fmt.Println(ecRecord) - testFramework.CreateBlock("Block5", tangle.WithIssuingTime(issuingTime), tangle.WithStrongParents("Block4"), tangle.WithIssuer(nodes["D"].PublicKey()), tangle.WithECRecord(ecRecord)) + testFramework.CreateBlock("Block5", tangleold.WithIssuingTime(issuingTime), tangleold.WithStrongParents("Block4"), tangleold.WithIssuer(nodes["D"].PublicKey()), tangleold.WithECRecord(ecRecord)) testFramework.IssueBlocks("Block5").WaitUntilAllTasksProcessed() blk := testFramework.Block("Block5") @@ -272,7 +273,7 @@ func TestManager_UpdateStateMutationTree(t *testing.T) { nodes[node] = identity.GenerateIdentity() } - var weightProvider *tangle.CManaWeightProvider + var weightProvider *tangleold.CManaWeightProvider manaRetrieverMock := func() map[identity.ID]float64 { for _, node := range nodes { weightProvider.Update(time.Now(), node.ID()) @@ -285,14 +286,14 @@ func TestManager_UpdateStateMutationTree(t *testing.T) { nodes["E"].ID(): 10, } } - weightProvider = tangle.NewCManaWeightProvider(manaRetrieverMock, time.Now) + weightProvider = tangleold.NewCManaWeightProvider(manaRetrieverMock, time.Now) epochInterval := 1 * time.Second // Make Current Epoch be epoch 5 genesisTime := time.Now().Add(-epochInterval * 5) - testFramework, eventHandlerMock, notarizationMgr := setupFramework(t, genesisTime, epochInterval, epochInterval*2, tangle.ApprovalWeights(weightProvider), tangle.WithConflictDAGOptions(conflictdag.WithMergeToMaster(false))) + testFramework, eventHandlerMock, notarizationMgr := setupFramework(t, genesisTime, epochInterval, epochInterval*2, tangleold.ApprovalWeights(weightProvider), tangleold.WithConflictDAGOptions(conflictdag.WithMergeToMaster(false))) var EC0, EC1, EC2 epoch.EC issuingTime := genesisTime @@ -303,7 +304,7 @@ func TestManager_UpdateStateMutationTree(t *testing.T) { ecRecord, _, err := testFramework.LatestCommitment() require.NoError(t, err) EC0 = EC(ecRecord) - testFramework.CreateBlock("Block1", tangle.WithIssuingTime(issuingTime), tangle.WithStrongParents("Genesis"), tangle.WithIssuer(nodes["A"].PublicKey()), tangle.WithECRecord(ecRecord)) + testFramework.CreateBlock("Block1", tangleold.WithIssuingTime(issuingTime), tangleold.WithStrongParents("Genesis"), tangleold.WithIssuer(nodes["A"].PublicKey()), tangleold.WithECRecord(ecRecord)) testFramework.IssueBlocks("Block1").WaitUntilAllTasksProcessed() blk := testFramework.Block("Block1") @@ -318,7 +319,7 @@ func TestManager_UpdateStateMutationTree(t *testing.T) { ecRecord, _, err := testFramework.LatestCommitment() require.NoError(t, err) - testFramework.CreateBlock("Block2", tangle.WithIssuingTime(issuingTime), tangle.WithStrongParents("Block1"), tangle.WithIssuer(nodes["B"].PublicKey()), tangle.WithECRecord(ecRecord)) + testFramework.CreateBlock("Block2", tangleold.WithIssuingTime(issuingTime), tangleold.WithStrongParents("Block1"), tangleold.WithIssuer(nodes["B"].PublicKey()), tangleold.WithECRecord(ecRecord)) testFramework.IssueBlocks("Block2").WaitUntilAllTasksProcessed() blk := testFramework.Block("Block2") @@ -333,7 +334,7 @@ func TestManager_UpdateStateMutationTree(t *testing.T) { ecRecord, _, err := testFramework.LatestCommitment() require.NoError(t, err) - testFramework.CreateBlock("Block3", tangle.WithIssuingTime(issuingTime), tangle.WithStrongParents("Block2"), tangle.WithIssuer(nodes["C"].PublicKey()), tangle.WithECRecord(ecRecord)) + testFramework.CreateBlock("Block3", tangleold.WithIssuingTime(issuingTime), tangleold.WithStrongParents("Block2"), tangleold.WithIssuer(nodes["C"].PublicKey()), tangleold.WithECRecord(ecRecord)) testFramework.IssueBlocks("Block3").WaitUntilAllTasksProcessed() blk := testFramework.Block("Block3") @@ -350,7 +351,7 @@ func TestManager_UpdateStateMutationTree(t *testing.T) { require.NoError(t, err) eventHandlerMock.Expect("EpochCommittable", epoch.Index(1)) - testFramework.CreateBlock("Block4", tangle.WithIssuingTime(issuingTime), tangle.WithStrongParents("Block3"), tangle.WithIssuer(nodes["D"].PublicKey()), tangle.WithECRecord(ecRecord)) + testFramework.CreateBlock("Block4", tangleold.WithIssuingTime(issuingTime), tangleold.WithStrongParents("Block3"), tangleold.WithIssuer(nodes["D"].PublicKey()), tangleold.WithECRecord(ecRecord)) testFramework.IssueBlocks("Block4").WaitUntilAllTasksProcessed() blk := testFramework.Block("Block4") @@ -368,7 +369,7 @@ func TestManager_UpdateStateMutationTree(t *testing.T) { EC1 = EC(ecRecord) eventHandlerMock.Expect("EpochCommittable", epoch.Index(2)) - testFramework.CreateBlock("Block5", tangle.WithIssuingTime(issuingTime), tangle.WithStrongParents("Block4"), tangle.WithIssuer(nodes["A"].PublicKey()), tangle.WithInputs("A"), tangle.WithOutput("C", 500), tangle.WithECRecord(ecRecord)) + testFramework.CreateBlock("Block5", tangleold.WithIssuingTime(issuingTime), tangleold.WithStrongParents("Block4"), tangleold.WithIssuer(nodes["A"].PublicKey()), tangleold.WithInputs("A"), tangleold.WithOutput("C", 500), tangleold.WithECRecord(ecRecord)) testFramework.IssueBlocks("Block5").WaitUntilAllTasksProcessed() blk := testFramework.Block("Block5") @@ -385,7 +386,7 @@ func TestManager_UpdateStateMutationTree(t *testing.T) { EC2 = EC(ecRecord) eventHandlerMock.Expect("EpochCommittable", epoch.Index(3)) eventHandlerMock.Expect("ManaVectorUpdate", epoch.Index(3), []*ledger.OutputWithMetadata{}, []*ledger.OutputWithMetadata{}) - testFramework.CreateBlock("Block6", tangle.WithIssuingTime(issuingTime), tangle.WithStrongParents("Block5"), tangle.WithIssuer(nodes["E"].PublicKey()), tangle.WithInputs("B"), tangle.WithOutput("D", 500), tangle.WithECRecord(ecRecord)) + testFramework.CreateBlock("Block6", tangleold.WithIssuingTime(issuingTime), tangleold.WithStrongParents("Block5"), tangleold.WithIssuer(nodes["E"].PublicKey()), tangleold.WithInputs("B"), tangleold.WithOutput("D", 500), tangleold.WithECRecord(ecRecord)) testFramework.IssueBlocks("Block6").WaitUntilAllTasksProcessed() blk := testFramework.Block("Block6") @@ -405,7 +406,7 @@ func TestManager_UpdateStateMutationTree(t *testing.T) { eventHandlerMock.Expect("EpochCommittable", epoch.Index(4)) eventHandlerMock.Expect("ManaVectorUpdate", epoch.Index(4), []*ledger.OutputWithMetadata{}, []*ledger.OutputWithMetadata{}) - testFramework.CreateBlock("Block7", tangle.WithIssuingTime(issuingTime), tangle.WithStrongParents("Block6"), tangle.WithIssuer(nodes["C"].PublicKey()), tangle.WithInputs("C"), tangle.WithOutput("E", 500), tangle.WithECRecord(ecRecord)) + testFramework.CreateBlock("Block7", tangleold.WithIssuingTime(issuingTime), tangleold.WithStrongParents("Block6"), tangleold.WithIssuer(nodes["C"].PublicKey()), tangleold.WithInputs("C"), tangleold.WithOutput("E", 500), tangleold.WithECRecord(ecRecord)) testFramework.IssueBlocks("Block7").WaitUntilAllTasksProcessed() blk := testFramework.Block("Block7") @@ -419,7 +420,7 @@ func TestManager_UpdateStateMutationTree(t *testing.T) { ecRecord, _, err := testFramework.LatestCommitment() require.NoError(t, err) - testFramework.CreateBlock("Block8", tangle.WithIssuingTime(issuingTime), tangle.WithStrongParents("Block7"), tangle.WithIssuer(nodes["D"].PublicKey()), tangle.WithECRecord(ecRecord)) + testFramework.CreateBlock("Block8", tangleold.WithIssuingTime(issuingTime), tangleold.WithStrongParents("Block7"), tangleold.WithIssuer(nodes["D"].PublicKey()), tangleold.WithECRecord(ecRecord)) testFramework.IssueBlocks("Block8").WaitUntilAllTasksProcessed() blk := testFramework.Block("Block8") @@ -439,7 +440,7 @@ func TestManager_UpdateStateMutationTreeWithConflict(t *testing.T) { nodes[node] = identity.GenerateIdentity() } - var weightProvider *tangle.CManaWeightProvider + var weightProvider *tangleold.CManaWeightProvider manaRetrieverMock := func() map[identity.ID]float64 { for _, node := range nodes { weightProvider.Update(time.Now(), node.ID()) @@ -458,8 +459,8 @@ func TestManager_UpdateStateMutationTreeWithConflict(t *testing.T) { // Make Current Epoch be epoch 5 genesisTime := time.Now().Add(-epochInterval * 5) - weightProvider = tangle.NewCManaWeightProvider(manaRetrieverMock, time.Now) - testFramework, eventHandlerMock, notarizationMgr := setupFramework(t, genesisTime, epochInterval, epochInterval*2, tangle.ApprovalWeights(weightProvider), tangle.WithConflictDAGOptions(conflictdag.WithMergeToMaster(false))) + weightProvider = tangleold.NewCManaWeightProvider(manaRetrieverMock, time.Now) + testFramework, eventHandlerMock, notarizationMgr := setupFramework(t, genesisTime, epochInterval, epochInterval*2, tangleold.ApprovalWeights(weightProvider), tangleold.WithConflictDAGOptions(conflictdag.WithMergeToMaster(false))) issuingTime := genesisTime @@ -469,7 +470,7 @@ func TestManager_UpdateStateMutationTreeWithConflict(t *testing.T) { ecRecord, _, err := testFramework.LatestCommitment() require.NoError(t, err) - testFramework.CreateBlock("Block1", tangle.WithIssuingTime(issuingTime), tangle.WithStrongParents("Genesis"), tangle.WithIssuer(nodes["A"].PublicKey()), tangle.WithECRecord(ecRecord)) + testFramework.CreateBlock("Block1", tangleold.WithIssuingTime(issuingTime), tangleold.WithStrongParents("Genesis"), tangleold.WithIssuer(nodes["A"].PublicKey()), tangleold.WithECRecord(ecRecord)) testFramework.IssueBlocks("Block1").WaitUntilAllTasksProcessed() blk := testFramework.Block("Block1") @@ -481,7 +482,7 @@ func TestManager_UpdateStateMutationTreeWithConflict(t *testing.T) { ecRecord, _, err := testFramework.LatestCommitment() require.NoError(t, err) - testFramework.CreateBlock("Block2", tangle.WithIssuingTime(issuingTime), tangle.WithStrongParents("Block1"), tangle.WithIssuer(nodes["B"].PublicKey()), tangle.WithECRecord(ecRecord)) + testFramework.CreateBlock("Block2", tangleold.WithIssuingTime(issuingTime), tangleold.WithStrongParents("Block1"), tangleold.WithIssuer(nodes["B"].PublicKey()), tangleold.WithECRecord(ecRecord)) testFramework.IssueBlocks("Block2").WaitUntilAllTasksProcessed() blk := testFramework.Block("Block2") @@ -493,7 +494,7 @@ func TestManager_UpdateStateMutationTreeWithConflict(t *testing.T) { ecRecord, _, err := testFramework.LatestCommitment() require.NoError(t, err) - testFramework.CreateBlock("Block3", tangle.WithIssuingTime(issuingTime), tangle.WithStrongParents("Block2"), tangle.WithIssuer(nodes["C"].PublicKey()), tangle.WithECRecord(ecRecord)) + testFramework.CreateBlock("Block3", tangleold.WithIssuingTime(issuingTime), tangleold.WithStrongParents("Block2"), tangleold.WithIssuer(nodes["C"].PublicKey()), tangleold.WithECRecord(ecRecord)) testFramework.IssueBlocks("Block3").WaitUntilAllTasksProcessed() blk := testFramework.Block("Block3") @@ -505,7 +506,7 @@ func TestManager_UpdateStateMutationTreeWithConflict(t *testing.T) { ecRecord, _, err := testFramework.LatestCommitment() require.NoError(t, err) - testFramework.CreateBlock("Block4", tangle.WithIssuingTime(issuingTime), tangle.WithStrongParents("Block3"), tangle.WithIssuer(nodes["D"].PublicKey()), tangle.WithECRecord(ecRecord)) + testFramework.CreateBlock("Block4", tangleold.WithIssuingTime(issuingTime), tangleold.WithStrongParents("Block3"), tangleold.WithIssuer(nodes["D"].PublicKey()), tangleold.WithECRecord(ecRecord)) testFramework.IssueBlocks("Block4").WaitUntilAllTasksProcessed() blk := testFramework.Block("Block4") @@ -520,7 +521,7 @@ func TestManager_UpdateStateMutationTreeWithConflict(t *testing.T) { ecRecord, _, err := testFramework.LatestCommitment() require.NoError(t, err) - testFramework.CreateBlock("Block5", tangle.WithIssuingTime(issuingTime), tangle.WithStrongParents("Block4"), tangle.WithIssuer(nodes["A"].PublicKey()), tangle.WithInputs("A"), tangle.WithOutput("B", 500), tangle.WithECRecord(ecRecord)) + testFramework.CreateBlock("Block5", tangleold.WithIssuingTime(issuingTime), tangleold.WithStrongParents("Block4"), tangleold.WithIssuer(nodes["A"].PublicKey()), tangleold.WithInputs("A"), tangleold.WithOutput("B", 500), tangleold.WithECRecord(ecRecord)) testFramework.IssueBlocks("Block5").WaitUntilAllTasksProcessed() blk := testFramework.Block("Block5") @@ -532,7 +533,7 @@ func TestManager_UpdateStateMutationTreeWithConflict(t *testing.T) { ecRecord, _, err := testFramework.LatestCommitment() require.NoError(t, err) - testFramework.CreateBlock("Block6", tangle.WithIssuingTime(issuingTime), tangle.WithStrongParents("Block4"), tangle.WithIssuer(nodes["D"].PublicKey()), tangle.WithInputs("A"), tangle.WithOutput("C", 500), tangle.WithECRecord(ecRecord)) + testFramework.CreateBlock("Block6", tangleold.WithIssuingTime(issuingTime), tangleold.WithStrongParents("Block4"), tangleold.WithIssuer(nodes["D"].PublicKey()), tangleold.WithInputs("A"), tangleold.WithOutput("C", 500), tangleold.WithECRecord(ecRecord)) testFramework.IssueBlocks("Block6").WaitUntilAllTasksProcessed() blk := testFramework.Block("Block6") @@ -554,7 +555,7 @@ func TestManager_UpdateStateMutationTreeWithConflict(t *testing.T) { ecRecord, _, err := testFramework.LatestCommitment() require.NoError(t, err) - testFramework.CreateBlock("Block7", tangle.WithIssuingTime(issuingTime), tangle.WithStrongParents("Block5"), tangle.WithIssuer(nodes["C"].PublicKey()), tangle.WithInputs("B"), tangle.WithOutput("E", 500), tangle.WithECRecord(ecRecord)) + testFramework.CreateBlock("Block7", tangleold.WithIssuingTime(issuingTime), tangleold.WithStrongParents("Block5"), tangleold.WithIssuer(nodes["C"].PublicKey()), tangleold.WithInputs("B"), tangleold.WithOutput("E", 500), tangleold.WithECRecord(ecRecord)) testFramework.IssueBlocks("Block7").WaitUntilAllTasksProcessed() blk := testFramework.Block("Block7") @@ -580,7 +581,7 @@ func TestManager_UpdateStateMutationTreeWithConflict(t *testing.T) { require.NoError(t, err) eventHandlerMock.Expect("EpochCommittable", epoch.Index(1)) - testFramework.CreateBlock("Block8", tangle.WithIssuingTime(issuingTime), tangle.WithStrongParents("Block7"), tangle.WithIssuer(nodes["D"].PublicKey()), tangle.WithECRecord(ecRecord)) + testFramework.CreateBlock("Block8", tangleold.WithIssuingTime(issuingTime), tangleold.WithStrongParents("Block7"), tangleold.WithIssuer(nodes["D"].PublicKey()), tangleold.WithECRecord(ecRecord)) testFramework.IssueBlocks("Block8").WaitUntilAllTasksProcessed() blk := testFramework.Block("Block8") @@ -603,7 +604,7 @@ func TestManager_TransactionInclusionUpdate(t *testing.T) { nodes[node] = identity.GenerateIdentity() } - var weightProvider *tangle.CManaWeightProvider + var weightProvider *tangleold.CManaWeightProvider manaRetrieverMock := func() map[identity.ID]float64 { for _, node := range nodes { weightProvider.Update(time.Now(), node.ID()) @@ -622,8 +623,8 @@ func TestManager_TransactionInclusionUpdate(t *testing.T) { // Make Current Epoch be epoch 5 genesisTime := time.Now().Add(-epochInterval * 5) - weightProvider = tangle.NewCManaWeightProvider(manaRetrieverMock, time.Now) - testFramework, eventHandlerMock, notarizationMgr := setupFramework(t, genesisTime, epochInterval, epochInterval*2, tangle.ApprovalWeights(weightProvider), tangle.WithConflictDAGOptions(conflictdag.WithMergeToMaster(false))) + weightProvider = tangleold.NewCManaWeightProvider(manaRetrieverMock, time.Now) + testFramework, eventHandlerMock, notarizationMgr := setupFramework(t, genesisTime, epochInterval, epochInterval*2, tangleold.ApprovalWeights(weightProvider), tangleold.WithConflictDAGOptions(conflictdag.WithMergeToMaster(false))) issuingTime := genesisTime @@ -633,7 +634,7 @@ func TestManager_TransactionInclusionUpdate(t *testing.T) { ecRecord, _, err := testFramework.LatestCommitment() require.NoError(t, err) - testFramework.CreateBlock("Block1", tangle.WithIssuingTime(issuingTime), tangle.WithStrongParents("Genesis"), tangle.WithIssuer(nodes["A"].PublicKey()), tangle.WithECRecord(ecRecord)) + testFramework.CreateBlock("Block1", tangleold.WithIssuingTime(issuingTime), tangleold.WithStrongParents("Genesis"), tangleold.WithIssuer(nodes["A"].PublicKey()), tangleold.WithECRecord(ecRecord)) testFramework.IssueBlocks("Block1").WaitUntilAllTasksProcessed() blk := testFramework.Block("Block1") @@ -645,7 +646,7 @@ func TestManager_TransactionInclusionUpdate(t *testing.T) { ecRecord, _, err := testFramework.LatestCommitment() require.NoError(t, err) - testFramework.CreateBlock("Block2", tangle.WithIssuingTime(issuingTime), tangle.WithStrongParents("Block1"), tangle.WithIssuer(nodes["B"].PublicKey()), tangle.WithECRecord(ecRecord)) + testFramework.CreateBlock("Block2", tangleold.WithIssuingTime(issuingTime), tangleold.WithStrongParents("Block1"), tangleold.WithIssuer(nodes["B"].PublicKey()), tangleold.WithECRecord(ecRecord)) testFramework.IssueBlocks("Block2").WaitUntilAllTasksProcessed() blk := testFramework.Block("Block2") @@ -657,7 +658,7 @@ func TestManager_TransactionInclusionUpdate(t *testing.T) { ecRecord, _, err := testFramework.LatestCommitment() require.NoError(t, err) - testFramework.CreateBlock("Block3", tangle.WithIssuingTime(issuingTime), tangle.WithStrongParents("Block2"), tangle.WithIssuer(nodes["C"].PublicKey()), tangle.WithInputs("A"), tangle.WithOutput("C", 500), tangle.WithECRecord(ecRecord)) + testFramework.CreateBlock("Block3", tangleold.WithIssuingTime(issuingTime), tangleold.WithStrongParents("Block2"), tangleold.WithIssuer(nodes["C"].PublicKey()), tangleold.WithInputs("A"), tangleold.WithOutput("C", 500), tangleold.WithECRecord(ecRecord)) testFramework.IssueBlocks("Block3").WaitUntilAllTasksProcessed() blk := testFramework.Block("Block3") @@ -669,14 +670,14 @@ func TestManager_TransactionInclusionUpdate(t *testing.T) { ecRecord, _, err := testFramework.LatestCommitment() require.NoError(t, err) - testFramework.CreateBlock("Block4", tangle.WithIssuingTime(issuingTime), tangle.WithStrongParents("Block2"), tangle.WithIssuer(nodes["D"].PublicKey()), tangle.WithInputs("B"), tangle.WithOutput("D", 500), tangle.WithECRecord(ecRecord)) + testFramework.CreateBlock("Block4", tangleold.WithIssuingTime(issuingTime), tangleold.WithStrongParents("Block2"), tangleold.WithIssuer(nodes["D"].PublicKey()), tangleold.WithInputs("B"), tangleold.WithOutput("D", 500), tangleold.WithECRecord(ecRecord)) testFramework.IssueBlocks("Block4").WaitUntilAllTasksProcessed() blk := testFramework.Block("Block4") assert.Equal(t, epoch.Index(0), blk.EI()) // pre-create block 8 - testFramework.CreateBlock("Block8", tangle.WithIssuingTime(issuingTime), tangle.WithStrongParents("Block4"), tangle.WithIssuer(nodes["B"].PublicKey()), tangle.WithInputs("C"), tangle.WithOutput("E", 500), tangle.WithECRecord(ecRecord)) + testFramework.CreateBlock("Block8", tangleold.WithIssuingTime(issuingTime), tangleold.WithStrongParents("Block4"), tangleold.WithIssuer(nodes["B"].PublicKey()), tangleold.WithInputs("C"), tangleold.WithOutput("E", 500), tangleold.WithECRecord(ecRecord)) } issuingTime = issuingTime.Add(epochInterval) @@ -687,7 +688,7 @@ func TestManager_TransactionInclusionUpdate(t *testing.T) { ecRecord, _, err := testFramework.LatestCommitment() require.NoError(t, err) - testFramework.CreateBlock("Block5", tangle.WithIssuingTime(issuingTime), tangle.WithStrongParents("Block3"), tangle.WithIssuer(nodes["A"].PublicKey()), tangle.WithECRecord(ecRecord)) + testFramework.CreateBlock("Block5", tangleold.WithIssuingTime(issuingTime), tangleold.WithStrongParents("Block3"), tangleold.WithIssuer(nodes["A"].PublicKey()), tangleold.WithECRecord(ecRecord)) testFramework.IssueBlocks("Block5").WaitUntilAllTasksProcessed() blk := testFramework.Block("Block5") @@ -699,7 +700,7 @@ func TestManager_TransactionInclusionUpdate(t *testing.T) { ecRecord, _, err := testFramework.LatestCommitment() require.NoError(t, err) - testFramework.CreateBlock("Block6", tangle.WithIssuingTime(issuingTime), tangle.WithStrongParents("Block5"), tangle.WithIssuer(nodes["B"].PublicKey()), tangle.WithReattachment("Block8"), tangle.WithECRecord(ecRecord)) + testFramework.CreateBlock("Block6", tangleold.WithIssuingTime(issuingTime), tangleold.WithStrongParents("Block5"), tangleold.WithIssuer(nodes["B"].PublicKey()), tangleold.WithReattachment("Block8"), tangleold.WithECRecord(ecRecord)) testFramework.IssueBlocks("Block6").WaitUntilAllTasksProcessed() blk := testFramework.Block("Block6") @@ -711,7 +712,7 @@ func TestManager_TransactionInclusionUpdate(t *testing.T) { ecRecord, _, err := testFramework.LatestCommitment() require.NoError(t, err) - testFramework.CreateBlock("Block7", tangle.WithIssuingTime(issuingTime), tangle.WithStrongParents("Block6"), tangle.WithIssuer(nodes["D"].PublicKey()), tangle.WithECRecord(ecRecord)) + testFramework.CreateBlock("Block7", tangleold.WithIssuingTime(issuingTime), tangleold.WithStrongParents("Block6"), tangleold.WithIssuer(nodes["D"].PublicKey()), tangleold.WithECRecord(ecRecord)) testFramework.IssueBlocks("Block7").WaitUntilAllTasksProcessed() blk := testFramework.Block("Block7") @@ -730,7 +731,7 @@ func TestManager_TransactionInclusionUpdate(t *testing.T) { ecRecord, _, err := testFramework.LatestCommitment() require.NoError(t, err) - testFramework.CreateBlock("Block9", tangle.WithIssuingTime(issuingTime), tangle.WithStrongParents("Block8", "Block7"), tangle.WithIssuer(nodes["A"].PublicKey()), tangle.WithECRecord(ecRecord)) + testFramework.CreateBlock("Block9", tangleold.WithIssuingTime(issuingTime), tangleold.WithStrongParents("Block8", "Block7"), tangleold.WithIssuer(nodes["A"].PublicKey()), tangleold.WithECRecord(ecRecord)) testFramework.IssueBlocks("Block9").WaitUntilAllTasksProcessed() blk := testFramework.Block("Block9") @@ -742,7 +743,7 @@ func TestManager_TransactionInclusionUpdate(t *testing.T) { ecRecord, _, err := testFramework.LatestCommitment() require.NoError(t, err) - testFramework.CreateBlock("Block10", tangle.WithIssuingTime(issuingTime), tangle.WithStrongParents("Block9"), tangle.WithIssuer(nodes["C"].PublicKey()), tangle.WithECRecord(ecRecord)) + testFramework.CreateBlock("Block10", tangleold.WithIssuingTime(issuingTime), tangleold.WithStrongParents("Block9"), tangleold.WithIssuer(nodes["C"].PublicKey()), tangleold.WithECRecord(ecRecord)) testFramework.IssueBlocks("Block10").WaitUntilAllTasksProcessed() blk := testFramework.Block("Block10") @@ -772,7 +773,7 @@ func TestManager_DiffUTXOs(t *testing.T) { nodes[node] = identity.GenerateIdentity() } - var weightProvider *tangle.CManaWeightProvider + var weightProvider *tangleold.CManaWeightProvider manaRetrieverMock := func() map[identity.ID]float64 { for _, node := range nodes { weightProvider.Update(time.Now(), node.ID()) @@ -791,8 +792,8 @@ func TestManager_DiffUTXOs(t *testing.T) { // Make Current Epoch be epoch 5 genesisTime := time.Now().Add(-epochInterval * 5) - weightProvider = tangle.NewCManaWeightProvider(manaRetrieverMock, time.Now) - testFramework, eventHandlerMock, notarizationMgr := setupFramework(t, genesisTime, epochInterval, epochInterval*2, tangle.ApprovalWeights(weightProvider), tangle.WithConflictDAGOptions(conflictdag.WithMergeToMaster(false))) + weightProvider = tangleold.NewCManaWeightProvider(manaRetrieverMock, time.Now) + testFramework, eventHandlerMock, notarizationMgr := setupFramework(t, genesisTime, epochInterval, epochInterval*2, tangleold.ApprovalWeights(weightProvider), tangleold.WithConflictDAGOptions(conflictdag.WithMergeToMaster(false))) issuingTime := genesisTime @@ -803,7 +804,7 @@ func TestManager_DiffUTXOs(t *testing.T) { ecRecord, _, err := testFramework.LatestCommitment() require.NoError(t, err) require.Equal(t, epoch.Index(0), ecRecord.EI()) - testFramework.CreateBlock("Block1", tangle.WithIssuingTime(issuingTime), tangle.WithStrongParents("Genesis"), tangle.WithIssuer(nodes["A"].PublicKey()), tangle.WithInputs("A"), tangle.WithOutput("C1", 400), tangle.WithOutput("C1+", 100), tangle.WithECRecord(ecRecord)) + testFramework.CreateBlock("Block1", tangleold.WithIssuingTime(issuingTime), tangleold.WithStrongParents("Genesis"), tangleold.WithIssuer(nodes["A"].PublicKey()), tangleold.WithInputs("A"), tangleold.WithOutput("C1", 400), tangleold.WithOutput("C1+", 100), tangleold.WithECRecord(ecRecord)) testFramework.IssueBlocks("Block1").WaitUntilAllTasksProcessed() blk := testFramework.Block("Block1") @@ -817,7 +818,7 @@ func TestManager_DiffUTXOs(t *testing.T) { ecRecord, _, err := testFramework.LatestCommitment() require.NoError(t, err) require.Equal(t, epoch.Index(0), ecRecord.EI()) - testFramework.CreateBlock("Block2", tangle.WithIssuingTime(issuingTime), tangle.WithStrongParents("Block1"), tangle.WithIssuer(nodes["B"].PublicKey()), tangle.WithInputs("B"), tangle.WithOutput("D2", 500), tangle.WithECRecord(ecRecord)) + testFramework.CreateBlock("Block2", tangleold.WithIssuingTime(issuingTime), tangleold.WithStrongParents("Block1"), tangleold.WithIssuer(nodes["B"].PublicKey()), tangleold.WithInputs("B"), tangleold.WithOutput("D2", 500), tangleold.WithECRecord(ecRecord)) testFramework.IssueBlocks("Block2").WaitUntilAllTasksProcessed() blk := testFramework.Block("Block2") @@ -835,7 +836,7 @@ func TestManager_DiffUTXOs(t *testing.T) { ecRecord, _, err := testFramework.LatestCommitment() require.NoError(t, err) require.Equal(t, epoch.Index(0), ecRecord.EI()) - testFramework.CreateBlock("Block3", tangle.WithIssuingTime(issuingTime), tangle.WithStrongParents("Block2"), tangle.WithIssuer(nodes["C"].PublicKey()), tangle.WithInputs("D2"), tangle.WithOutput("E3", 500), tangle.WithECRecord(ecRecord)) + testFramework.CreateBlock("Block3", tangleold.WithIssuingTime(issuingTime), tangleold.WithStrongParents("Block2"), tangleold.WithIssuer(nodes["C"].PublicKey()), tangleold.WithInputs("D2"), tangleold.WithOutput("E3", 500), tangleold.WithECRecord(ecRecord)) testFramework.IssueBlocks("Block3").WaitUntilAllTasksProcessed() blk := testFramework.Block("Block3") @@ -849,7 +850,7 @@ func TestManager_DiffUTXOs(t *testing.T) { ecRecord, _, err := testFramework.LatestCommitment() require.NoError(t, err) require.Equal(t, epoch.Index(0), ecRecord.EI()) - testFramework.CreateBlock("Block4", tangle.WithIssuingTime(issuingTime), tangle.WithStrongParents("Block3"), tangle.WithIssuer(nodes["D"].PublicKey()), tangle.WithInputs("E3"), tangle.WithOutput("F4", 500), tangle.WithECRecord(ecRecord)) + testFramework.CreateBlock("Block4", tangleold.WithIssuingTime(issuingTime), tangleold.WithStrongParents("Block3"), tangleold.WithIssuer(nodes["D"].PublicKey()), tangleold.WithInputs("E3"), tangleold.WithOutput("F4", 500), tangleold.WithECRecord(ecRecord)) testFramework.IssueBlocks("Block4").WaitUntilAllTasksProcessed() blk := testFramework.Block("Block4") @@ -868,7 +869,7 @@ func TestManager_DiffUTXOs(t *testing.T) { require.NoError(t, err) require.Equal(t, epoch.Index(0), ecRecord.EI()) - testFramework.CreateBlock("Block5", tangle.WithIssuingTime(issuingTime), tangle.WithStrongParents("Block4"), tangle.WithIssuer(nodes["A"].PublicKey()), tangle.WithInputs("F4"), tangle.WithOutput("G5", 500), tangle.WithECRecord(ecRecord)) + testFramework.CreateBlock("Block5", tangleold.WithIssuingTime(issuingTime), tangleold.WithStrongParents("Block4"), tangleold.WithIssuer(nodes["A"].PublicKey()), tangleold.WithInputs("F4"), tangleold.WithOutput("G5", 500), tangleold.WithECRecord(ecRecord)) testFramework.IssueBlocks("Block5").WaitUntilAllTasksProcessed() blk := testFramework.Block("Block5") @@ -887,7 +888,7 @@ func TestManager_DiffUTXOs(t *testing.T) { require.Equal(t, epoch.Index(0), ecRecord.EI()) eventHandlerMock.Expect("EpochCommittable", epoch.Index(1)) - testFramework.CreateBlock("Block6", tangle.WithIssuingTime(issuingTime), tangle.WithStrongParents("Block5"), tangle.WithIssuer(nodes["E"].PublicKey()), tangle.WithInputs("G5"), tangle.WithOutput("H6", 500), tangle.WithECRecord(ecRecord)) + testFramework.CreateBlock("Block6", tangleold.WithIssuingTime(issuingTime), tangleold.WithStrongParents("Block5"), tangleold.WithIssuer(nodes["E"].PublicKey()), tangleold.WithInputs("G5"), tangleold.WithOutput("H6", 500), tangleold.WithECRecord(ecRecord)) testFramework.IssueBlocks("Block6").WaitUntilAllTasksProcessed() blk := testFramework.Block("Block6") @@ -902,7 +903,7 @@ func TestManager_DiffUTXOs(t *testing.T) { require.NoError(t, err) require.Equal(t, epoch.Index(1), ecRecord.EI()) - testFramework.CreateBlock("Block7", tangle.WithIssuingTime(issuingTime), tangle.WithStrongParents("Block6"), tangle.WithIssuer(nodes["A"].PublicKey()), tangle.WithECRecord(ecRecord)) + testFramework.CreateBlock("Block7", tangleold.WithIssuingTime(issuingTime), tangleold.WithStrongParents("Block6"), tangleold.WithIssuer(nodes["A"].PublicKey()), tangleold.WithECRecord(ecRecord)) testFramework.IssueBlocks("Block7").WaitUntilAllTasksProcessed() blk := testFramework.Block("Block7") @@ -917,7 +918,7 @@ func TestManager_DiffUTXOs(t *testing.T) { require.NoError(t, err) require.Equal(t, epoch.Index(1), ecRecord.EI()) - testFramework.CreateBlock("Block8", tangle.WithIssuingTime(issuingTime.Add(-epochInterval)), tangle.WithStrongParents("Block4"), tangle.WithIssuer(nodes["B"].PublicKey()), tangle.WithReattachment("Block6"), tangle.WithECRecord(ecRecord)) + testFramework.CreateBlock("Block8", tangleold.WithIssuingTime(issuingTime.Add(-epochInterval)), tangleold.WithStrongParents("Block4"), tangleold.WithIssuer(nodes["B"].PublicKey()), tangleold.WithReattachment("Block6"), tangleold.WithECRecord(ecRecord)) testFramework.IssueBlocks("Block8").WaitUntilAllTasksProcessed() blk := testFramework.Block("Block8") @@ -932,7 +933,7 @@ func TestManager_DiffUTXOs(t *testing.T) { require.NoError(t, err) require.Equal(t, epoch.Index(1), ecRecord.EI()) - testFramework.CreateBlock("Block9", tangle.WithIssuingTime(issuingTime), tangle.WithStrongParents("Block8"), tangle.WithIssuer(nodes["A"].PublicKey()), tangle.WithECRecord(ecRecord)) + testFramework.CreateBlock("Block9", tangleold.WithIssuingTime(issuingTime), tangleold.WithStrongParents("Block8"), tangleold.WithIssuer(nodes["A"].PublicKey()), tangleold.WithECRecord(ecRecord)) testFramework.IssueBlocks("Block9").WaitUntilAllTasksProcessed() blk := testFramework.Block("Block9") @@ -947,7 +948,7 @@ func TestManager_DiffUTXOs(t *testing.T) { require.NoError(t, err) require.Equal(t, epoch.Index(1), ecRecord.EI()) - testFramework.CreateBlock("Block10", tangle.WithIssuingTime(issuingTime), tangle.WithStrongParents("Block9"), tangle.WithIssuer(nodes["C"].PublicKey()), tangle.WithECRecord(ecRecord)) + testFramework.CreateBlock("Block10", tangleold.WithIssuingTime(issuingTime), tangleold.WithStrongParents("Block9"), tangleold.WithIssuer(nodes["C"].PublicKey()), tangleold.WithECRecord(ecRecord)) testFramework.IssueBlocks("Block10").WaitUntilAllTasksProcessed() blk := testFramework.Block("Block10") @@ -960,13 +961,13 @@ func TestManager_DiffUTXOs(t *testing.T) { eventHandlerMock.AssertExpectations(t) } -func setupFramework(t *testing.T, genesisTime time.Time, epochInterval time.Duration, minCommittable time.Duration, options ...tangle.Option) (testFramework *tangle.BlockTestFramework, eventMock *EventMock, m *Manager) { +func setupFramework(t *testing.T, genesisTime time.Time, epochInterval time.Duration, minCommittable time.Duration, options ...tangleold.Option) (testFramework *tangleold.BlockTestFramework, eventMock *EventMock, m *Manager) { epoch.Duration = int64(epochInterval.Seconds()) - testTangle := tangle.NewTestTangle(append([]tangle.Option{tangle.StartSynced(true), tangle.GenesisTime(genesisTime)}, options...)...) + testTangle := tangleold.NewTestTangle(append([]tangleold.Option{tangleold.StartSynced(true), tangleold.GenesisTime(genesisTime)}, options...)...) testTangle.Booker.MarkersManager.Options.MaxPastMarkerDistance = 0 - testFramework = tangle.NewBlockTestFramework(testTangle, tangle.WithGenesisOutput("A", 500), tangle.WithGenesisOutput("B", 500)) + testFramework = tangleold.NewBlockTestFramework(testTangle, tangleold.WithGenesisOutput("A", 500), tangleold.WithGenesisOutput("B", 500)) // set up finality gadget testOpts := []acceptance.Option{ @@ -998,7 +999,7 @@ func setupFramework(t *testing.T, genesisTime time.Time, epochInterval time.Dura return testFramework, eventMock, m } -func assertExistenceOfBlock(t *testing.T, testFramework *tangle.BlockTestFramework, m *Manager, results map[string]bool) { +func assertExistenceOfBlock(t *testing.T, testFramework *tangleold.BlockTestFramework, m *Manager, results map[string]bool) { event.Loop.WaitUntilAllTasksProcessed() for alias, result := range results { @@ -1006,7 +1007,7 @@ func assertExistenceOfBlock(t *testing.T, testFramework *tangle.BlockTestFramewo p, err := m.GetBlockInclusionProof(blkID) require.NoError(t, err) var ei epoch.Index - m.tangle.Storage.Block(blkID).Consume(func(block *tangle.Block) { + m.tangle.Storage.Block(blkID).Consume(func(block *tangleold.Block) { t := block.IssuingTime() ei = epoch.IndexFromTime(t) }) @@ -1015,7 +1016,7 @@ func assertExistenceOfBlock(t *testing.T, testFramework *tangle.BlockTestFramewo } } -func assertExistenceOfTransaction(t *testing.T, testFramework *tangle.BlockTestFramework, m *Manager, results map[string]bool) { +func assertExistenceOfTransaction(t *testing.T, testFramework *tangleold.BlockTestFramework, m *Manager, results map[string]bool) { event.Loop.WaitUntilAllTasksProcessed() for alias, result := range results { @@ -1045,7 +1046,7 @@ func assertExistenceOfTransaction(t *testing.T, testFramework *tangle.BlockTestF } } -func assertEpochDiff(t *testing.T, testFramework *tangle.BlockTestFramework, m *Manager, ei epoch.Index, expectedSpentAliases, expectedCreatedAliases []string) { +func assertEpochDiff(t *testing.T, testFramework *tangleold.BlockTestFramework, m *Manager, ei epoch.Index, expectedSpentAliases, expectedCreatedAliases []string) { event.Loop.WaitUntilAllTasksProcessed() spent, created := m.epochCommitmentFactory.loadDiffUTXOs(ei) @@ -1074,31 +1075,36 @@ func assertEpochDiff(t *testing.T, testFramework *tangle.BlockTestFramework, m * assert.True(t, expectedCreatedIDs.Equal(actualCreatedIDs), "created outputs for epoch %d do not match:\nExpected: %s\nActual: %s", ei, expectedCreatedIDs, actualCreatedIDs) } -func loadSnapshot(m *Manager, testFramework *tangle.BlockTestFramework) { +func loadSnapshot(m *Manager, testFramework *tangleold.BlockTestFramework) { snapshot := testFramework.Snapshot() - snapshot.DiffEpochIndex = epoch.Index(0) - snapshot.FullEpochIndex = epoch.Index(0) + header := &ledger.SnapshotHeader{} + header.DiffEpochIndex = epoch.Index(0) + header.FullEpochIndex = epoch.Index(0) var createMetadata []*ledger.OutputWithMetadata for _, metadata := range snapshot.OutputsWithMetadata { createMetadata = append(createMetadata, metadata) } + header.OutputWithMetadataCount = uint64(len(snapshot.OutputsWithMetadata)) snapshot.EpochDiffs = make(map[epoch.Index]*ledger.EpochDiff) snapshot.EpochDiffs[epoch.Index(0)] = ledger.NewEpochDiff([]*ledger.OutputWithMetadata{}, createMetadata) - ecRecord := epoch.NewECRecord(snapshot.FullEpochIndex) + ecRecord := epoch.NewECRecord(header.FullEpochIndex) ecRecord.SetECR(epoch.MerkleRoot{}) ecRecord.SetPrevEC(epoch.MerkleRoot{}) - snapshot.LatestECRecord = ecRecord + header.LatestECRecord = ecRecord + snapshot.Header = header - m.LoadSnapshot(snapshot) + m.LoadOutputsWithMetadata(snapshot.OutputsWithMetadata) + m.LoadEpochDiffs(snapshot.Header, snapshot.EpochDiffs) + m.LoadECandEIs(snapshot.Header) } -func registerToTangleEvents(sfg *acceptance.Gadget, testTangle *tangle.Tangle) { - testTangle.ApprovalWeightManager.Events.MarkerWeightChanged.Hook(event.NewClosure(func(e *tangle.MarkerWeightChangedEvent) { +func registerToTangleEvents(sfg *acceptance.Gadget, testTangle *tangleold.Tangle) { + testTangle.ApprovalWeightManager.Events.MarkerWeightChanged.Hook(event.NewClosure(func(e *tangleold.MarkerWeightChangedEvent) { sfg.HandleMarker(e.Marker, e.Weight) })) - testTangle.ApprovalWeightManager.Events.ConflictWeightChanged.Hook(event.NewClosure(func(e *tangle.ConflictWeightChangedEvent) { + testTangle.ApprovalWeightManager.Events.ConflictWeightChanged.Hook(event.NewClosure(func(e *tangleold.ConflictWeightChangedEvent) { sfg.HandleConflict(e.ConflictID, e.Weight) })) } diff --git a/packages/notarization/proofs.go b/packages/core/notarization/proofs.go similarity index 87% rename from packages/notarization/proofs.go rename to packages/core/notarization/proofs.go index a296f24ad5..2f99403f87 100644 --- a/packages/notarization/proofs.go +++ b/packages/core/notarization/proofs.go @@ -3,12 +3,13 @@ package notarization import ( "github.com/celestiaorg/smt" "github.com/cockroachdb/errors" - "github.com/iotaledger/goshimmer/packages/epoch" - "github.com/iotaledger/goshimmer/packages/ledger" - "github.com/iotaledger/goshimmer/packages/ledger/utxo" - "github.com/iotaledger/goshimmer/packages/tangle" - "github.com/iotaledger/hive.go/generics/lo" + "github.com/iotaledger/hive.go/core/generics/lo" "golang.org/x/crypto/blake2b" + + "github.com/iotaledger/goshimmer/packages/core/epoch" + "github.com/iotaledger/goshimmer/packages/core/ledger" + "github.com/iotaledger/goshimmer/packages/core/ledger/utxo" + "github.com/iotaledger/goshimmer/packages/core/tangleold" ) // region proofs helpers /////////////////////////////////////////////////////////////////////////////////////////////// @@ -21,9 +22,9 @@ type CommitmentProof struct { } // GetBlockInclusionProof gets the proof of the inclusion (acceptance) of a block. -func (m *Manager) GetBlockInclusionProof(blockID tangle.BlockID) (*CommitmentProof, error) { +func (m *Manager) GetBlockInclusionProof(blockID tangleold.BlockID) (*CommitmentProof, error) { var ei epoch.Index - m.tangle.Storage.Block(blockID).Consume(func(block *tangle.Block) { + m.tangle.Storage.Block(blockID).Consume(func(block *tangleold.Block) { t := block.IssuingTime() ei = epoch.IndexFromTime(t) }) @@ -79,7 +80,7 @@ func (f *EpochCommitmentFactory) ProofStateMutationRoot(ei epoch.Index, txID utx } // ProofTangleRoot returns the merkle proof for the blockID against the tangle root. -func (f *EpochCommitmentFactory) ProofTangleRoot(ei epoch.Index, blockID tangle.BlockID) (*CommitmentProof, error) { +func (f *EpochCommitmentFactory) ProofTangleRoot(ei epoch.Index, blockID tangleold.BlockID) (*CommitmentProof, error) { committmentTrees, err := f.getCommitmentTrees(ei) if err != nil { return nil, errors.Wrapf(err, "cannot get commitment trees for epoch %d", ei) @@ -95,7 +96,7 @@ func (f *EpochCommitmentFactory) ProofTangleRoot(ei epoch.Index, blockID tangle. } // VerifyTangleRoot verify the provided merkle proof against the tangle root. -func (f *EpochCommitmentFactory) VerifyTangleRoot(proof CommitmentProof, blockID tangle.BlockID) bool { +func (f *EpochCommitmentFactory) VerifyTangleRoot(proof CommitmentProof, blockID tangleold.BlockID) bool { key := blockID.Bytes() return f.verifyRoot(proof, key, key) } diff --git a/packages/notarization/storage.go b/packages/core/notarization/storage.go similarity index 96% rename from packages/notarization/storage.go rename to packages/core/notarization/storage.go index 4ee85c7cb8..9fb5082cc0 100644 --- a/packages/notarization/storage.go +++ b/packages/core/notarization/storage.go @@ -5,13 +5,13 @@ import ( "time" "github.com/cockroachdb/errors" - "github.com/iotaledger/hive.go/generics/objectstorage" - "github.com/iotaledger/hive.go/kvstore" - "github.com/iotaledger/hive.go/kvstore/mapdb" + "github.com/iotaledger/hive.go/core/generics/objectstorage" + "github.com/iotaledger/hive.go/core/kvstore" + "github.com/iotaledger/hive.go/core/kvstore/mapdb" - "github.com/iotaledger/goshimmer/packages/database" - "github.com/iotaledger/goshimmer/packages/epoch" - "github.com/iotaledger/goshimmer/packages/ledger" + "github.com/iotaledger/goshimmer/packages/core/epoch" + "github.com/iotaledger/goshimmer/packages/core/ledger" + "github.com/iotaledger/goshimmer/packages/node/database" ) // region storage ////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/packages/notarization/testutils.go b/packages/core/notarization/testutils.go similarity index 92% rename from packages/notarization/testutils.go rename to packages/core/notarization/testutils.go index ec36c53675..2d4f11b685 100644 --- a/packages/notarization/testutils.go +++ b/packages/core/notarization/testutils.go @@ -5,13 +5,13 @@ import ( "testing" "time" - "github.com/iotaledger/hive.go/generics/event" - "github.com/iotaledger/hive.go/types/confirmation" + "github.com/iotaledger/hive.go/core/generics/event" + "github.com/iotaledger/hive.go/core/types/confirmation" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" - "github.com/iotaledger/goshimmer/packages/consensus/acceptance" - "github.com/iotaledger/goshimmer/packages/ledger/utxo" + "github.com/iotaledger/goshimmer/packages/core/consensus/acceptance" + "github.com/iotaledger/goshimmer/packages/core/ledger/utxo" ) const ( diff --git a/packages/pow/pow.go b/packages/core/pow/pow.go similarity index 100% rename from packages/pow/pow.go rename to packages/core/pow/pow.go diff --git a/packages/pow/pow_test.go b/packages/core/pow/pow_test.go similarity index 100% rename from packages/pow/pow_test.go rename to packages/core/pow/pow_test.go diff --git a/packages/core/snapshot/read.go b/packages/core/snapshot/read.go new file mode 100644 index 0000000000..cbaf30988c --- /dev/null +++ b/packages/core/snapshot/read.go @@ -0,0 +1,156 @@ +package snapshot + +import ( + "bufio" + "bytes" + "context" + "encoding/binary" + "fmt" + "io" + + "github.com/cockroachdb/errors" + "github.com/iotaledger/hive.go/core/serix" + + "github.com/iotaledger/goshimmer/packages/core/epoch" + "github.com/iotaledger/goshimmer/packages/core/ledger" +) + +// streamSnapshotDataFrom consumes a snapshot from the given reader. +func streamSnapshotDataFrom( + reader io.ReadSeeker, + headerConsumer HeaderConsumerFunc, + outputConsumer UTXOStatesConsumerFunc, + epochDiffsConsumer EpochDiffsConsumerFunc) error { + + header, err := readSnapshotHeader(reader) + if err != nil { + return err + } + + scanner := bufio.NewScanner(reader) + scanner.Split(scanDelimiter) + + // read latest ECRecord + ecRecord, err := readECRecord(scanner) + if err != nil { + return err + } + header.LatestECRecord = ecRecord + headerConsumer(header) + + // read outputWithMetadata + for i := 0; uint64(i) < header.OutputWithMetadataCount; { + outputs, err := readOutputWithMetadata(scanner) + if err != nil { + return err + } + i += len(outputs) + + outputConsumer(outputs) + } + + epochDiffs, err := readEpochDiffs(scanner) + if err != nil { + return errors.Errorf("failed to parse epochDiffs from bytes: %w", err) + } + epochDiffsConsumer(header, epochDiffs) + + return nil +} + +func readSnapshotHeader(reader io.ReadSeeker) (*ledger.SnapshotHeader, error) { + header := &ledger.SnapshotHeader{} + + if err := binary.Read(reader, binary.LittleEndian, &header.OutputWithMetadataCount); err != nil { + return nil, fmt.Errorf("unable to read outputWithMetadata length: %w", err) + } + + var index int64 + if err := binary.Read(reader, binary.LittleEndian, &index); err != nil { + return nil, fmt.Errorf("unable to read fullEpochIndex: %w", err) + } + header.FullEpochIndex = epoch.Index(index) + + if err := binary.Read(reader, binary.LittleEndian, &index); err != nil { + return nil, fmt.Errorf("unable to read diffEpochIndex: %w", err) + } + header.DiffEpochIndex = epoch.Index(index) + + return header, nil +} + +// readOutputWithMetadata consumes a slice of OutputWithMetadata from the given reader. +func readOutputWithMetadata(scanner *bufio.Scanner) (outputMetadatas []*ledger.OutputWithMetadata, err error) { + scanner.Scan() + data := scanner.Bytes() + + if len(data) > 0 { + outputMetadatas = make([]*ledger.OutputWithMetadata, 0) + _, err = serix.DefaultAPI.Decode(context.Background(), data, &outputMetadatas, serix.WithValidation()) + if err != nil { + return nil, err + } + + for _, o := range outputMetadatas { + o.SetID(o.M.OutputID) + o.Output().SetID(o.M.OutputID) + } + } + + return +} + +// readEpochDiffs consumes a map of EpochDiff from the given reader. +func readEpochDiffs(scanner *bufio.Scanner) (epochDiffs map[epoch.Index]*ledger.EpochDiff, err error) { + epochDiffs = make(map[epoch.Index]*ledger.EpochDiff) + + scanner.Scan() + data := scanner.Bytes() + if len(data) > 0 { + _, err = serix.DefaultAPI.Decode(context.Background(), data, &epochDiffs, serix.WithValidation()) + if err != nil { + return nil, errors.Errorf("failed to parse epochDiffs from bytes: %w", err) + } + + for _, epochdiff := range epochDiffs { + for _, spentOutput := range epochdiff.Spent() { + spentOutput.SetID(spentOutput.M.OutputID) + spentOutput.Output().SetID(spentOutput.M.OutputID) + } + for _, createdOutput := range epochdiff.Created() { + createdOutput.SetID(createdOutput.M.OutputID) + createdOutput.Output().SetID(createdOutput.M.OutputID) + } + } + } + + return +} + +// readECRecord consumes the latest ECRecord from the given reader. +func readECRecord(scanner *bufio.Scanner) (ecRecord *epoch.ECRecord, err error) { + scanner.Scan() + + ecRecord = &epoch.ECRecord{} + err = ecRecord.FromBytes(scanner.Bytes()) + if err != nil { + return nil, errors.Errorf("failed to parse epochDiffs from bytes: %w", err) + } + + return +} + +func scanDelimiter(data []byte, atEOF bool) (advance int, token []byte, err error) { + if atEOF && len(data) == 0 { + return 0, nil, nil + } + if i := bytes.Index(data, delimiter); i >= 0 { + return i + len(delimiter), data[0:i], nil + } + // at EOF, return rest of data. + if atEOF { + return len(data), data, nil + } + + return 0, nil, nil +} diff --git a/packages/core/snapshot/snapshot.go b/packages/core/snapshot/snapshot.go new file mode 100644 index 0000000000..0ba1a242eb --- /dev/null +++ b/packages/core/snapshot/snapshot.go @@ -0,0 +1,87 @@ +package snapshot + +import ( + "fmt" + "os" + + "github.com/iotaledger/hive.go/core/serix" + + "github.com/iotaledger/goshimmer/packages/core/epoch" + "github.com/iotaledger/goshimmer/packages/core/ledger" +) + +// Snapshot contains the data to be put in a snapshot file. +type Snapshot struct { + LedgerSnapshot *ledger.Snapshot +} + +func init() { + typeSet := new(serix.TypeSettings) + ts := typeSet.WithLengthPrefixType(serix.LengthPrefixTypeAsUint32) + + err := serix.DefaultAPI.RegisterTypeSettings([]*ledger.OutputWithMetadata{}, ts) + if err != nil { + panic(fmt.Errorf("error registering OutputWithMetadata slice type settings: %w", err)) + } + + err = serix.DefaultAPI.RegisterTypeSettings(map[epoch.Index]*ledger.EpochDiff{}, ts) + if err != nil { + panic(fmt.Errorf("error registering EpochDiff map type settings: %w", err)) + } +} + +// CreateSnapshot creates a snapshot file to the given file path. +func CreateSnapshot(filePath string, + headerProd HeaderProducerFunc, + utxoStatesProd UTXOStatesProducerFunc, + epochDiffsProd EpochDiffProducerFunc) (*ledger.SnapshotHeader, error) { + f, err := os.Create(filePath) + if err != nil { + return nil, fmt.Errorf("fail to create snapshot file: %s", err) + } + + header, err := streamSnapshotDataTo(f, headerProd, utxoStatesProd, epochDiffsProd) + if err != nil { + return nil, err + } + f.Close() + + return header, err +} + +// LoadSnapshot loads a snapshot file from the given file path. Contents in a snapshot file +// will not be written to a snapshot struct in case blowing up the memory, they should be proccessed in +// consumer functions. +func LoadSnapshot(filePath string, + headerConsumer HeaderConsumerFunc, + outputWithMetadataConsumer UTXOStatesConsumerFunc, + epochDiffsConsumer EpochDiffsConsumerFunc) (err error) { + + f, err := os.Open(filePath) + defer f.Close() + if err != nil { + return fmt.Errorf("fail to open the snapshot file") + } + + err = streamSnapshotDataFrom(f, headerConsumer, outputWithMetadataConsumer, epochDiffsConsumer) + + return +} + +// UTXOStatesProducerFunc is the type of function that produces OutputWithMetadatas when taking a snapshot. +type UTXOStatesProducerFunc func() (outputWithMetadata *ledger.OutputWithMetadata) + +// UTXOStatesConsumerFunc is the type of function that consumes OutputWithMetadatas when loading a snapshot. +type UTXOStatesConsumerFunc func(outputWithMetadatas []*ledger.OutputWithMetadata) + +// EpochDiffProducerFunc is the type of function that produces EpochDiff when taking a snapshot. +type EpochDiffProducerFunc func() (epochDiffs map[epoch.Index]*ledger.EpochDiff, err error) + +// EpochDiffsConsumerFunc is the type of function that consumes EpochDiff when loading a snapshot. +type EpochDiffsConsumerFunc func(header *ledger.SnapshotHeader, epochDiffs map[epoch.Index]*ledger.EpochDiff) + +// HeaderProducerFunc is the type of function that produces snapshot header when taking a snapshot. +type HeaderProducerFunc func() (header *ledger.SnapshotHeader, err error) + +// HeaderConsumerFunc is the type of function that consumes snapshot header when loading a snapshot. +type HeaderConsumerFunc func(header *ledger.SnapshotHeader) diff --git a/packages/core/snapshot/snapshot_test.go b/packages/core/snapshot/snapshot_test.go new file mode 100644 index 0000000000..e5afa4e28f --- /dev/null +++ b/packages/core/snapshot/snapshot_test.go @@ -0,0 +1,196 @@ +package snapshot + +import ( + "os" + "testing" + "time" + + "github.com/iotaledger/hive.go/core/crypto/ed25519" + "github.com/iotaledger/hive.go/core/identity" + "github.com/iotaledger/hive.go/core/types/confirmation" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + "github.com/iotaledger/goshimmer/packages/core/epoch" + "github.com/iotaledger/goshimmer/packages/core/ledger" + "github.com/iotaledger/goshimmer/packages/core/ledger/utxo" + "github.com/iotaledger/goshimmer/packages/core/ledger/vm/devnetvm" +) + +const ( + cfgPledgeTokenAmount = 1000000000000000 + snapshotFileName = "tmp.snapshot" +) + +var nodesToPledge = []string{ + "2GtxMQD94KvDH1SJPJV7icxofkyV1njuUZKtsqKmtux5", // peer_master + "AXSoTPcN6SNwH64tywpz4k2XfAc24NR7ckKX8wPjeUZD", // peer_master2 + "FZ6xmPZXRs2M8z9m9ETTQok4PCga4X8FRHwQE6uYm4rV", // faucet +} + +var ( + outputsWithMetadata = make([]*ledger.OutputWithMetadata, 0) + epochDiffs = make(map[epoch.Index]*ledger.EpochDiff) + manaDistribution = createManaDistribution(cfgPledgeTokenAmount) +) + +func Test_CreateAndReadSnapshot(t *testing.T) { + header := createSnapshot(t) + + rheader, rstates, repochDiffs := readSnapshot(t) + compareSnapshotHeader(t, header, rheader) + compareOutputWithMetadataSlice(t, outputsWithMetadata, rstates) + compareEpochDiffs(t, epochDiffs, repochDiffs) + + err := os.Remove(snapshotFileName) + require.NoError(t, err) +} + +func createSnapshot(t *testing.T) (header *ledger.SnapshotHeader) { + fullEpochIndex := 1 + diffEpochIndex := 3 + + headerProd := func() (header *ledger.SnapshotHeader, err error) { + ecRecord := epoch.NewECRecord(epoch.Index(diffEpochIndex)) + ecRecord.SetECR(epoch.MerkleRoot{}) + ecRecord.SetPrevEC(epoch.MerkleRoot{}) + + header = &ledger.SnapshotHeader{ + FullEpochIndex: epoch.Index(fullEpochIndex), + DiffEpochIndex: epoch.Index(diffEpochIndex), + LatestECRecord: ecRecord, + } + + return + } + + // prepare outputsWithMetadata + createsOutputsWithMetadatas(t, 110) + i := 0 + utxoStatesProd := func() *ledger.OutputWithMetadata { + if i == len(outputsWithMetadata) { + return nil + } + + o := outputsWithMetadata[i] + i++ + return o + } + + epochDiffsProd := func() (diffs map[epoch.Index]*ledger.EpochDiff, err error) { + l, size := 0, 10 + + for i := fullEpochIndex + 1; i <= diffEpochIndex; i++ { + spent, created := make([]*ledger.OutputWithMetadata, 0), make([]*ledger.OutputWithMetadata, 0) + spent = append(spent, outputsWithMetadata[l*size:(l+1)*size]...) + created = append(created, outputsWithMetadata[(l+1)*size:(l+2)*size]...) + + epochDiffs[epoch.Index(i)] = ledger.NewEpochDiff(spent, created) + l += 2 + } + return epochDiffs, nil + } + + header, err := CreateSnapshot(snapshotFileName, headerProd, utxoStatesProd, epochDiffsProd) + require.NoError(t, err) + + return header +} + +func readSnapshot(t *testing.T) (header *ledger.SnapshotHeader, states []*ledger.OutputWithMetadata, epochDiffs map[epoch.Index]*ledger.EpochDiff) { + outputWithMetadataConsumer := func(outputWithMetadatas []*ledger.OutputWithMetadata) { + states = append(states, outputWithMetadatas...) + } + epochDiffsConsumer := func(_ *ledger.SnapshotHeader, diffs map[epoch.Index]*ledger.EpochDiff) { + epochDiffs = diffs + } + headerConsumer := func(h *ledger.SnapshotHeader) { + header = h + } + + err := LoadSnapshot(snapshotFileName, headerConsumer, outputWithMetadataConsumer, epochDiffsConsumer) + require.NoError(t, err) + + return +} + +func createManaDistribution(totalTokensToPledge uint64) (manaDistribution map[identity.ID]uint64) { + manaDistribution = make(map[identity.ID]uint64) + for _, node := range nodesToPledge { + nodeID, err := identity.DecodeIDBase58(node) + if err != nil { + panic("failed to decode node id: " + err.Error()) + } + + manaDistribution[nodeID] = totalTokensToPledge / uint64(len(nodesToPledge)) + } + + return manaDistribution +} + +var outputCounter uint16 = 1 + +func createsOutputsWithMetadatas(t *testing.T, total int) { + now := time.Now() + for i := 0; i < total; { + for nodeID, value := range manaDistribution { + if i >= total { + break + } + // pledge to ID but send funds to random address + output, outputMetadata := createOutput(devnetvm.NewED25519Address(ed25519.GenerateKeyPair().PublicKey), value, nodeID, now) + outputsWithMetadata = append(outputsWithMetadata, ledger.NewOutputWithMetadata(output.ID(), output, outputMetadata.CreationTime(), outputMetadata.ConsensusManaPledgeID(), outputMetadata.AccessManaPledgeID())) + i++ + } + } + +} + +func createOutput(address devnetvm.Address, tokenAmount uint64, pledgeID identity.ID, creationTime time.Time) (output devnetvm.Output, outputMetadata *ledger.OutputMetadata) { + output = devnetvm.NewSigLockedColoredOutput(devnetvm.NewColoredBalances(map[devnetvm.Color]uint64{ + devnetvm.ColorIOTA: tokenAmount, + }), address) + output.SetID(utxo.NewOutputID(utxo.EmptyTransactionID, outputCounter)) + outputCounter++ + + outputMetadata = ledger.NewOutputMetadata(output.ID()) + outputMetadata.SetConfirmationState(confirmation.Confirmed) + outputMetadata.SetAccessManaPledgeID(pledgeID) + outputMetadata.SetConsensusManaPledgeID(pledgeID) + outputMetadata.SetCreationTime(creationTime) + + return output, outputMetadata +} + +func compareSnapshotHeader(t *testing.T, created, unmarshal *ledger.SnapshotHeader) { + assert.Equal(t, created.FullEpochIndex, unmarshal.FullEpochIndex) + assert.Equal(t, created.DiffEpochIndex, unmarshal.DiffEpochIndex) + assert.Equal(t, created.OutputWithMetadataCount, unmarshal.OutputWithMetadataCount) + oLatestECRecordBytes, err := created.LatestECRecord.Bytes() + require.NoError(t, err) + nLatestECRecordBytes, err := unmarshal.LatestECRecord.Bytes() + require.NoError(t, err) + assert.ElementsMatch(t, oLatestECRecordBytes, nLatestECRecordBytes) +} + +func compareOutputWithMetadataSlice(t *testing.T, created, unmarshal []*ledger.OutputWithMetadata) { + assert.Equal(t, len(created), len(unmarshal)) + for i := 0; i < len(created); i++ { + ob, err := created[i].Bytes() + require.NoError(t, err) + rb, err := unmarshal[i].Bytes() + require.NoError(t, err) + assert.ElementsMatch(t, ob, rb) + } +} + +func compareEpochDiffs(t *testing.T, created, unmarshal map[epoch.Index]*ledger.EpochDiff) { + assert.Equal(t, len(created), len(unmarshal)) + for ei, diffs := range created { + uDiffs, ok := unmarshal[ei] + require.True(t, ok) + + compareOutputWithMetadataSlice(t, diffs.Spent(), uDiffs.Spent()) + compareOutputWithMetadataSlice(t, diffs.Created(), uDiffs.Created()) + } +} diff --git a/packages/core/snapshot/write.go b/packages/core/snapshot/write.go new file mode 100644 index 0000000000..ffa0a16bd8 --- /dev/null +++ b/packages/core/snapshot/write.go @@ -0,0 +1,175 @@ +package snapshot + +import ( + "context" + "encoding/binary" + "fmt" + "io" + + "github.com/iotaledger/hive.go/core/serix" + + "github.com/iotaledger/goshimmer/packages/core/epoch" + "github.com/iotaledger/goshimmer/packages/core/ledger" + "github.com/iotaledger/goshimmer/packages/core/notarization" +) + +const utxoStatesChunkSize = 100 + +var delimiter = []byte{';', ';', ';'} + +// streamSnapshotDataTo writes snapshot to a given writer. +func streamSnapshotDataTo( + writeSeeker io.WriteSeeker, + headerProd HeaderProducerFunc, + outputProd UTXOStatesProducerFunc, + epochDiffsProd EpochDiffProducerFunc) (*ledger.SnapshotHeader, error) { + + writeFunc := func(name string, value any) error { + return writeFunc(writeSeeker, name, value) + } + + writeOutputWithMetadatasFunc := func(chunks []*ledger.OutputWithMetadata) error { + if len(chunks) == 0 { + return nil + } + + data, err := serix.DefaultAPI.Encode(context.Background(), chunks, serix.WithValidation()) + if err != nil { + return err + } + if err := writeFunc("outputs", append(data, delimiter...)); err != nil { + return err + } + return nil + } + + header, err := headerProd() + if err != nil { + return nil, err + } + + err = writeSnapshotHeader(writeSeeker, header) + if err != nil { + return nil, err + } + + // write outputWithMetadata + var outputWithMetadataCounter uint64 + var outputChunkCounter int + chunksOutputWithMetadata := make([]*ledger.OutputWithMetadata, 0) + for { + output := outputProd() + if output == nil { + // write rests of outputWithMetadatas + err = writeOutputWithMetadatasFunc(chunksOutputWithMetadata) + if err != nil { + return nil, err + } + break + } + + outputWithMetadataCounter++ + outputChunkCounter++ + chunksOutputWithMetadata = append(chunksOutputWithMetadata, output) + + // put a delimeter every utxoStatesChunkSize outputs + if outputChunkCounter == utxoStatesChunkSize { + err = writeOutputWithMetadatasFunc(chunksOutputWithMetadata) + if err != nil { + return nil, err + } + chunksOutputWithMetadata = make([]*ledger.OutputWithMetadata, 0) + outputChunkCounter = 0 + } + } + + // write epochDiffs + epochDiffs, err := epochDiffsProd() + if err != nil { + return nil, err + } + + bytes, err := serix.DefaultAPI.Encode(context.Background(), epochDiffs, serix.WithValidation()) + if err != nil { + return nil, err + } + if err := writeFunc(fmt.Sprintf("diffEpoch"), append(bytes, delimiter...)); err != nil { + return nil, err + } + + // seek back to the file position of the outputWithMetadata counter + if _, err := writeSeeker.Seek(0, io.SeekStart); err != nil { + return nil, fmt.Errorf("unable to seek to LS counter placeholders: %w", err) + } + if err := writeFunc(fmt.Sprintf("outputWithMetadata counter %d", outputWithMetadataCounter), outputWithMetadataCounter); err != nil { + return nil, err + } + header.OutputWithMetadataCount = outputWithMetadataCounter + + return header, nil +} + +// NewLedgerUTXOStatesProducer returns a OutputWithMetadataProducerFunc that provide OutputWithMetadatas from the ledger. +func NewLedgerUTXOStatesProducer(lastConfirmedEpoch epoch.Index, nmgr *notarization.Manager) UTXOStatesProducerFunc { + prodChan := make(chan *ledger.OutputWithMetadata) + nmgr.SnapshotLedgerState(lastConfirmedEpoch, prodChan) + + return func() *ledger.OutputWithMetadata { + obj, ok := <-prodChan + if !ok { + return nil + } + return obj + } +} + +// NewEpochDiffsProducer returns a OutputWithMetadataProducerFunc that provide OutputWithMetadatas from the ledger. +func NewEpochDiffsProducer(lastConfirmedEpoch, latestCommitableEpoch epoch.Index, nmgr *notarization.Manager) EpochDiffProducerFunc { + epochDiffs, err := nmgr.SnapshotEpochDiffs(lastConfirmedEpoch, latestCommitableEpoch) + + return func() (map[epoch.Index]*ledger.EpochDiff, error) { + return epochDiffs, err + } +} + +func writeSnapshotHeader(writeSeeker io.WriteSeeker, header *ledger.SnapshotHeader) error { + writeFunc := func(name string, value any) error { + return writeFunc(writeSeeker, name, value) + } + + if err := writeFunc(fmt.Sprintf("outputWithMetadata counter %d", header.OutputWithMetadataCount), header.OutputWithMetadataCount); err != nil { + return err + } + + if err := writeFunc(fmt.Sprintf("fullEpochIndex %d", header.FullEpochIndex), header.FullEpochIndex); err != nil { + return err + } + + if err := writeFunc(fmt.Sprintf("diffEpochIndex %d", header.DiffEpochIndex), header.DiffEpochIndex); err != nil { + return err + } + + data, err := header.LatestECRecord.Bytes() + if err != nil { + return err + } + + if err := writeFunc("latestECRecord", append(data, delimiter...)); err != nil { + return err + } + + return nil +} + +func writeFunc(writeSeeker io.WriteSeeker, variableName string, value any) error { + length := binary.Size(value) + if length == -1 { + return fmt.Errorf("unable to determine length of %s", variableName) + } + + if err := binary.Write(writeSeeker, binary.LittleEndian, value); err != nil { + return fmt.Errorf("unable to write LS %s: %w", variableName, err) + } + + return nil +} diff --git a/packages/tangle/approvalweightmanager.go b/packages/core/tangleold/approvalweightmanager.go similarity index 97% rename from packages/tangle/approvalweightmanager.go rename to packages/core/tangleold/approvalweightmanager.go index a3746faa64..657e140054 100644 --- a/packages/tangle/approvalweightmanager.go +++ b/packages/core/tangleold/approvalweightmanager.go @@ -1,16 +1,16 @@ -package tangle +package tangleold import ( "time" - "github.com/iotaledger/hive.go/generics/event" - "github.com/iotaledger/hive.go/generics/set" - "github.com/iotaledger/hive.go/generics/walker" - "github.com/iotaledger/hive.go/identity" + "github.com/iotaledger/hive.go/core/generics/event" + "github.com/iotaledger/hive.go/core/generics/set" + "github.com/iotaledger/hive.go/core/generics/walker" + "github.com/iotaledger/hive.go/core/identity" - "github.com/iotaledger/goshimmer/packages/conflictdag" - "github.com/iotaledger/goshimmer/packages/ledger/utxo" - "github.com/iotaledger/goshimmer/packages/markers" + "github.com/iotaledger/goshimmer/packages/core/conflictdag" + "github.com/iotaledger/goshimmer/packages/core/ledger/utxo" + "github.com/iotaledger/goshimmer/packages/core/markers" ) const ( diff --git a/packages/tangle/approvalweightmanager.models.go b/packages/core/tangleold/approvalweightmanager.models.go similarity index 96% rename from packages/tangle/approvalweightmanager.models.go rename to packages/core/tangleold/approvalweightmanager.models.go index dbb457a92a..f70d2053f1 100644 --- a/packages/tangle/approvalweightmanager.models.go +++ b/packages/core/tangleold/approvalweightmanager.models.go @@ -1,19 +1,19 @@ -package tangle +package tangleold import ( "context" "github.com/cockroachdb/errors" - "github.com/iotaledger/hive.go/generics/model" - "github.com/iotaledger/hive.go/generics/objectstorage" - "github.com/iotaledger/hive.go/generics/set" - "github.com/iotaledger/hive.go/generics/thresholdmap" - "github.com/iotaledger/hive.go/identity" - "github.com/iotaledger/hive.go/serix" - "github.com/iotaledger/hive.go/stringify" - - "github.com/iotaledger/goshimmer/packages/ledger/utxo" - "github.com/iotaledger/goshimmer/packages/markers" + "github.com/iotaledger/hive.go/core/generics/model" + "github.com/iotaledger/hive.go/core/generics/objectstorage" + "github.com/iotaledger/hive.go/core/generics/set" + "github.com/iotaledger/hive.go/core/generics/thresholdmap" + "github.com/iotaledger/hive.go/core/identity" + "github.com/iotaledger/hive.go/core/serix" + "github.com/iotaledger/hive.go/core/stringify" + + "github.com/iotaledger/goshimmer/packages/core/ledger/utxo" + "github.com/iotaledger/goshimmer/packages/core/markers" ) // region ApprovalWeightManager Models ///////////////////////////////////////////////////////////////////////////////// diff --git a/packages/tangle/approvalweightmanager_test.go b/packages/core/tangleold/approvalweightmanager_test.go similarity index 98% rename from packages/tangle/approvalweightmanager_test.go rename to packages/core/tangleold/approvalweightmanager_test.go index 142adf3a12..6f51308a8b 100644 --- a/packages/tangle/approvalweightmanager_test.go +++ b/packages/core/tangleold/approvalweightmanager_test.go @@ -1,23 +1,23 @@ //nolint:dupl -package tangle +package tangleold import ( "fmt" "testing" "time" - "github.com/iotaledger/hive.go/crypto/ed25519" - "github.com/iotaledger/hive.go/debug" - "github.com/iotaledger/hive.go/generics/lo" - "github.com/iotaledger/hive.go/generics/set" - "github.com/iotaledger/hive.go/generics/thresholdmap" - "github.com/iotaledger/hive.go/identity" + "github.com/iotaledger/hive.go/core/crypto/ed25519" + "github.com/iotaledger/hive.go/core/debug" + "github.com/iotaledger/hive.go/core/generics/lo" + "github.com/iotaledger/hive.go/core/generics/set" + "github.com/iotaledger/hive.go/core/generics/thresholdmap" + "github.com/iotaledger/hive.go/core/identity" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/iotaledger/goshimmer/packages/conflictdag" - "github.com/iotaledger/goshimmer/packages/ledger/utxo" - "github.com/iotaledger/goshimmer/packages/markers" + "github.com/iotaledger/goshimmer/packages/core/conflictdag" + "github.com/iotaledger/goshimmer/packages/core/ledger/utxo" + "github.com/iotaledger/goshimmer/packages/core/markers" ) func BenchmarkApprovalWeightManager_ProcessBlock_Conflicts(b *testing.B) { diff --git a/packages/tangle/block.go b/packages/core/tangleold/block.go similarity index 97% rename from packages/tangle/block.go rename to packages/core/tangleold/block.go index 80572ec505..087e253456 100644 --- a/packages/tangle/block.go +++ b/packages/core/tangleold/block.go @@ -1,4 +1,4 @@ -package tangle +package tangleold import ( "bytes" @@ -11,23 +11,24 @@ import ( "time" "github.com/cockroachdb/errors" - "github.com/iotaledger/hive.go/crypto/ed25519" - "github.com/iotaledger/hive.go/generics/lo" - "github.com/iotaledger/hive.go/generics/model" - "github.com/iotaledger/hive.go/serializer" - "github.com/iotaledger/hive.go/serix" - "github.com/iotaledger/hive.go/stringify" - "github.com/iotaledger/hive.go/types" - "github.com/iotaledger/hive.go/types/confirmation" + "github.com/iotaledger/hive.go/core/crypto/ed25519" + "github.com/iotaledger/hive.go/core/generics/lo" + "github.com/iotaledger/hive.go/core/generics/model" + "github.com/iotaledger/hive.go/core/serix" + "github.com/iotaledger/hive.go/core/stringify" + "github.com/iotaledger/hive.go/core/types" + "github.com/iotaledger/hive.go/core/types/confirmation" + "github.com/iotaledger/hive.go/serializer/v2" "github.com/mr-tron/base58" "golang.org/x/crypto/blake2b" - "github.com/iotaledger/goshimmer/packages/clock" - "github.com/iotaledger/goshimmer/packages/epoch" - "github.com/iotaledger/goshimmer/packages/ledger/utxo" - "github.com/iotaledger/goshimmer/packages/ledger/vm/devnetvm" - "github.com/iotaledger/goshimmer/packages/markers" - "github.com/iotaledger/goshimmer/packages/tangle/payload" + "github.com/iotaledger/goshimmer/packages/core/tangleold/payload" + + "github.com/iotaledger/goshimmer/packages/core/epoch" + "github.com/iotaledger/goshimmer/packages/core/ledger/utxo" + "github.com/iotaledger/goshimmer/packages/core/ledger/vm/devnetvm" + "github.com/iotaledger/goshimmer/packages/core/markers" + "github.com/iotaledger/goshimmer/packages/node/clock" ) func init() { diff --git a/packages/tangle/block_test.go b/packages/core/tangleold/block_test.go similarity index 97% rename from packages/tangle/block_test.go rename to packages/core/tangleold/block_test.go index 34337dbb14..d6cd2a3902 100644 --- a/packages/tangle/block_test.go +++ b/packages/core/tangleold/block_test.go @@ -1,4 +1,4 @@ -package tangle +package tangleold import ( "bytes" @@ -11,19 +11,19 @@ import ( "time" "github.com/cockroachdb/errors" - "github.com/iotaledger/hive.go/cerrors" - "github.com/iotaledger/hive.go/crypto/ed25519" - "github.com/iotaledger/hive.go/generics/lo" - "github.com/iotaledger/hive.go/identity" - "github.com/iotaledger/hive.go/types" + "github.com/iotaledger/hive.go/core/cerrors" + "github.com/iotaledger/hive.go/core/crypto/ed25519" + "github.com/iotaledger/hive.go/core/generics/lo" + "github.com/iotaledger/hive.go/core/identity" + "github.com/iotaledger/hive.go/core/types" "github.com/mr-tron/base58" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/iotaledger/goshimmer/packages/epoch" - "github.com/iotaledger/goshimmer/packages/ledger/utxo" - "github.com/iotaledger/goshimmer/packages/ledger/vm/devnetvm" - "github.com/iotaledger/goshimmer/packages/tangle/payload" + "github.com/iotaledger/goshimmer/packages/core/epoch" + "github.com/iotaledger/goshimmer/packages/core/ledger/utxo" + "github.com/iotaledger/goshimmer/packages/core/ledger/vm/devnetvm" + "github.com/iotaledger/goshimmer/packages/core/tangleold/payload" ) func randomBytes(size uint) []byte { diff --git a/packages/tangle/blockfactory.go b/packages/core/tangleold/blockfactory.go similarity index 97% rename from packages/tangle/blockfactory.go rename to packages/core/tangleold/blockfactory.go index 1239031abc..63f2731b45 100644 --- a/packages/tangle/blockfactory.go +++ b/packages/core/tangleold/blockfactory.go @@ -1,4 +1,4 @@ -package tangle +package tangleold import ( "fmt" @@ -6,14 +6,14 @@ import ( "time" "github.com/cockroachdb/errors" - "github.com/iotaledger/hive.go/crypto/ed25519" - "github.com/iotaledger/hive.go/identity" - "github.com/iotaledger/hive.go/kvstore" - - "github.com/iotaledger/goshimmer/packages/clock" - "github.com/iotaledger/goshimmer/packages/epoch" - "github.com/iotaledger/goshimmer/packages/ledger/utxo" - "github.com/iotaledger/goshimmer/packages/tangle/payload" + "github.com/iotaledger/hive.go/core/crypto/ed25519" + "github.com/iotaledger/hive.go/core/identity" + "github.com/iotaledger/hive.go/core/kvstore" + + "github.com/iotaledger/goshimmer/packages/core/epoch" + "github.com/iotaledger/goshimmer/packages/core/ledger/utxo" + "github.com/iotaledger/goshimmer/packages/core/tangleold/payload" + "github.com/iotaledger/goshimmer/packages/node/clock" ) const storeSequenceInterval = 100 diff --git a/packages/tangle/blockfactory_test.go b/packages/core/tangleold/blockfactory_test.go similarity index 97% rename from packages/tangle/blockfactory_test.go rename to packages/core/tangleold/blockfactory_test.go index 7b1e4a11d7..054b2dbba5 100644 --- a/packages/tangle/blockfactory_test.go +++ b/packages/core/tangleold/blockfactory_test.go @@ -1,4 +1,4 @@ -package tangle +package tangleold import ( "context" @@ -9,18 +9,18 @@ import ( "testing" "time" - "github.com/iotaledger/hive.go/generics/event" - "github.com/iotaledger/hive.go/generics/set" - "github.com/iotaledger/hive.go/identity" - "github.com/iotaledger/hive.go/types" + "github.com/iotaledger/hive.go/core/generics/event" + "github.com/iotaledger/hive.go/core/generics/set" + "github.com/iotaledger/hive.go/core/identity" + "github.com/iotaledger/hive.go/core/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" _ "golang.org/x/crypto/blake2b" - "github.com/iotaledger/goshimmer/packages/clock" - "github.com/iotaledger/goshimmer/packages/ledger/utxo" - "github.com/iotaledger/goshimmer/packages/pow" - "github.com/iotaledger/goshimmer/packages/tangle/payload" + "github.com/iotaledger/goshimmer/packages/core/ledger/utxo" + "github.com/iotaledger/goshimmer/packages/core/pow" + "github.com/iotaledger/goshimmer/packages/core/tangleold/payload" + "github.com/iotaledger/goshimmer/packages/node/clock" ) const ( diff --git a/packages/tangle/booker.go b/packages/core/tangleold/booker.go similarity index 98% rename from packages/tangle/booker.go rename to packages/core/tangleold/booker.go index 39f8f24278..415884efc2 100644 --- a/packages/tangle/booker.go +++ b/packages/core/tangleold/booker.go @@ -1,18 +1,18 @@ -package tangle +package tangleold import ( "context" "github.com/cockroachdb/errors" - "github.com/iotaledger/hive.go/cerrors" - "github.com/iotaledger/hive.go/generics/event" - "github.com/iotaledger/hive.go/generics/set" - "github.com/iotaledger/hive.go/generics/walker" - "github.com/iotaledger/hive.go/syncutils" - - "github.com/iotaledger/goshimmer/packages/ledger" - "github.com/iotaledger/goshimmer/packages/ledger/utxo" - "github.com/iotaledger/goshimmer/packages/markers" + "github.com/iotaledger/hive.go/core/cerrors" + "github.com/iotaledger/hive.go/core/generics/event" + "github.com/iotaledger/hive.go/core/generics/set" + "github.com/iotaledger/hive.go/core/generics/walker" + "github.com/iotaledger/hive.go/core/syncutils" + + "github.com/iotaledger/goshimmer/packages/core/ledger" + "github.com/iotaledger/goshimmer/packages/core/ledger/utxo" + "github.com/iotaledger/goshimmer/packages/core/markers" ) // region booker /////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/packages/tangle/booker_test.go b/packages/core/tangleold/booker_test.go similarity index 99% rename from packages/tangle/booker_test.go rename to packages/core/tangleold/booker_test.go index 01c85dd308..4699129a68 100644 --- a/packages/tangle/booker_test.go +++ b/packages/core/tangleold/booker_test.go @@ -1,5 +1,5 @@ //nolint:dupl,whitespace -package tangle +package tangleold import ( "fmt" @@ -8,14 +8,14 @@ import ( "testing" "time" - "github.com/iotaledger/hive.go/debug" - "github.com/iotaledger/hive.go/generics/lo" - "github.com/iotaledger/hive.go/generics/set" + "github.com/iotaledger/hive.go/core/debug" + "github.com/iotaledger/hive.go/core/generics/lo" + "github.com/iotaledger/hive.go/core/generics/set" "github.com/stretchr/testify/assert" - "github.com/iotaledger/goshimmer/packages/conflictdag" - "github.com/iotaledger/goshimmer/packages/ledger/utxo" - "github.com/iotaledger/goshimmer/packages/markers" + "github.com/iotaledger/goshimmer/packages/core/conflictdag" + "github.com/iotaledger/goshimmer/packages/core/ledger/utxo" + "github.com/iotaledger/goshimmer/packages/core/markers" ) func TestScenario_1(t *testing.T) { diff --git a/packages/tangle/cmanaweightprovider.go b/packages/core/tangleold/cmanaweightprovider.go similarity index 98% rename from packages/tangle/cmanaweightprovider.go rename to packages/core/tangleold/cmanaweightprovider.go index b105aed215..97f62efa26 100644 --- a/packages/tangle/cmanaweightprovider.go +++ b/packages/core/tangleold/cmanaweightprovider.go @@ -1,4 +1,4 @@ -package tangle +package tangleold import ( "container/heap" @@ -9,10 +9,10 @@ import ( "time" "github.com/cockroachdb/errors" - "github.com/iotaledger/hive.go/generics/set" - "github.com/iotaledger/hive.go/identity" - "github.com/iotaledger/hive.go/kvstore" - "github.com/iotaledger/hive.go/serix" + "github.com/iotaledger/hive.go/core/generics/set" + "github.com/iotaledger/hive.go/core/identity" + "github.com/iotaledger/hive.go/core/kvstore" + "github.com/iotaledger/hive.go/core/serix" ) func init() { diff --git a/packages/tangle/cmanaweightprovider_test.go b/packages/core/tangleold/cmanaweightprovider_test.go similarity index 94% rename from packages/tangle/cmanaweightprovider_test.go rename to packages/core/tangleold/cmanaweightprovider_test.go index 14f6bd28d9..90a9076d42 100644 --- a/packages/tangle/cmanaweightprovider_test.go +++ b/packages/core/tangleold/cmanaweightprovider_test.go @@ -1,14 +1,15 @@ -package tangle +package tangleold import ( "testing" "time" - "github.com/iotaledger/goshimmer/packages/epoch" - "github.com/iotaledger/hive.go/crypto" - "github.com/iotaledger/hive.go/identity" + "github.com/iotaledger/hive.go/core/crypto" + "github.com/iotaledger/hive.go/core/identity" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + + "github.com/iotaledger/goshimmer/packages/core/epoch" ) func TestActiveNodesMarshalling(t *testing.T) { diff --git a/packages/tangle/consensusmanager.go b/packages/core/tangleold/consensusmanager.go similarity index 88% rename from packages/tangle/consensusmanager.go rename to packages/core/tangleold/consensusmanager.go index e5d27e2ef0..7292e25e8d 100644 --- a/packages/tangle/consensusmanager.go +++ b/packages/core/tangleold/consensusmanager.go @@ -1,7 +1,7 @@ -package tangle +package tangleold import ( - "github.com/iotaledger/goshimmer/packages/consensus" + "github.com/iotaledger/goshimmer/packages/core/consensus" ) // region OTVConsensusManager ///////////////////////////////////////////////////////////////////////////////////////////// diff --git a/packages/tangle/errors.go b/packages/core/tangleold/errors.go similarity index 95% rename from packages/tangle/errors.go rename to packages/core/tangleold/errors.go index 7b4f4f2e8e..e9eff1082d 100644 --- a/packages/tangle/errors.go +++ b/packages/core/tangleold/errors.go @@ -1,4 +1,4 @@ -package tangle +package tangleold import "github.com/cockroachdb/errors" diff --git a/packages/tangle/events.go b/packages/core/tangleold/events.go similarity index 98% rename from packages/tangle/events.go rename to packages/core/tangleold/events.go index 578e186eb0..aa0f992995 100644 --- a/packages/tangle/events.go +++ b/packages/core/tangleold/events.go @@ -1,14 +1,14 @@ -package tangle +package tangleold import ( "time" - "github.com/iotaledger/hive.go/autopeering/peer" - "github.com/iotaledger/hive.go/generics/event" - "github.com/iotaledger/hive.go/identity" + "github.com/iotaledger/hive.go/core/autopeering/peer" + "github.com/iotaledger/hive.go/core/generics/event" + "github.com/iotaledger/hive.go/core/identity" - "github.com/iotaledger/goshimmer/packages/ledger/utxo" - "github.com/iotaledger/goshimmer/packages/markers" + "github.com/iotaledger/goshimmer/packages/core/ledger/utxo" + "github.com/iotaledger/goshimmer/packages/core/markers" ) // region Events /////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/packages/tangle/images/MessageFactory_LikeSwitchTest-Scenario-1.png b/packages/core/tangleold/images/MessageFactory_LikeSwitchTest-Scenario-1.png similarity index 100% rename from packages/tangle/images/MessageFactory_LikeSwitchTest-Scenario-1.png rename to packages/core/tangleold/images/MessageFactory_LikeSwitchTest-Scenario-1.png diff --git a/packages/tangle/images/MessageFactory_LikeSwitchTest-Scenario-2.png b/packages/core/tangleold/images/MessageFactory_LikeSwitchTest-Scenario-2.png similarity index 100% rename from packages/tangle/images/MessageFactory_LikeSwitchTest-Scenario-2.png rename to packages/core/tangleold/images/MessageFactory_LikeSwitchTest-Scenario-2.png diff --git a/packages/tangle/images/OpinionFormer Scenario 2.png b/packages/core/tangleold/images/OpinionFormer Scenario 2.png similarity index 100% rename from packages/tangle/images/OpinionFormer Scenario 2.png rename to packages/core/tangleold/images/OpinionFormer Scenario 2.png diff --git a/packages/tangle/images/Scenario 1.png b/packages/core/tangleold/images/Scenario 1.png similarity index 100% rename from packages/tangle/images/Scenario 1.png rename to packages/core/tangleold/images/Scenario 1.png diff --git a/packages/tangle/images/Scenario 2.png b/packages/core/tangleold/images/Scenario 2.png similarity index 100% rename from packages/tangle/images/Scenario 2.png rename to packages/core/tangleold/images/Scenario 2.png diff --git a/packages/tangle/images/Scenario 3.png b/packages/core/tangleold/images/Scenario 3.png similarity index 100% rename from packages/tangle/images/Scenario 3.png rename to packages/core/tangleold/images/Scenario 3.png diff --git a/packages/tangle/images/TSC_test_scenario.drawio.png b/packages/core/tangleold/images/TSC_test_scenario.drawio.png similarity index 100% rename from packages/tangle/images/TSC_test_scenario.drawio.png rename to packages/core/tangleold/images/TSC_test_scenario.drawio.png diff --git a/packages/tangle/images/approvalweight-processMessage.png b/packages/core/tangleold/images/approvalweight-processMessage.png similarity index 100% rename from packages/tangle/images/approvalweight-processMessage.png rename to packages/core/tangleold/images/approvalweight-processMessage.png diff --git a/packages/tangle/images/approvalweight-updateBranchSupporters.png b/packages/core/tangleold/images/approvalweight-updateBranchSupporters.png similarity index 100% rename from packages/tangle/images/approvalweight-updateBranchSupporters.png rename to packages/core/tangleold/images/approvalweight-updateBranchSupporters.png diff --git a/packages/tangle/images/approvalweight-updateSequenceSupporters.png b/packages/core/tangleold/images/approvalweight-updateSequenceSupporters.png similarity index 100% rename from packages/tangle/images/approvalweight-updateSequenceSupporters.png rename to packages/core/tangleold/images/approvalweight-updateSequenceSupporters.png diff --git a/packages/tangle/images/tipmanager-DataMessageTips-test.png b/packages/core/tangleold/images/tipmanager-DataMessageTips-test.png similarity index 100% rename from packages/tangle/images/tipmanager-DataMessageTips-test.png rename to packages/core/tangleold/images/tipmanager-DataMessageTips-test.png diff --git a/packages/tangle/images/tipmanager-TransactionTips-test.png b/packages/core/tangleold/images/tipmanager-TransactionTips-test.png similarity index 100% rename from packages/tangle/images/tipmanager-TransactionTips-test.png rename to packages/core/tangleold/images/tipmanager-TransactionTips-test.png diff --git a/packages/tangle/images/tipmanager-add-tips.png b/packages/core/tangleold/images/tipmanager-add-tips.png similarity index 100% rename from packages/tangle/images/tipmanager-add-tips.png rename to packages/core/tangleold/images/tipmanager-add-tips.png diff --git a/packages/tangle/images/util-AllTransactionsApprovedByMessages-parallel-markers.png b/packages/core/tangleold/images/util-AllTransactionsApprovedByMessages-parallel-markers.png similarity index 100% rename from packages/tangle/images/util-AllTransactionsApprovedByMessages-parallel-markers.png rename to packages/core/tangleold/images/util-AllTransactionsApprovedByMessages-parallel-markers.png diff --git a/packages/tangle/markersmanager.go b/packages/core/tangleold/markersmanager.go similarity index 97% rename from packages/tangle/markersmanager.go rename to packages/core/tangleold/markersmanager.go index 407e75ffb4..2ad9007444 100644 --- a/packages/tangle/markersmanager.go +++ b/packages/core/tangleold/markersmanager.go @@ -1,10 +1,10 @@ -package tangle +package tangleold import ( - "github.com/iotaledger/hive.go/generics/set" + "github.com/iotaledger/hive.go/core/generics/set" - "github.com/iotaledger/goshimmer/packages/ledger/utxo" - "github.com/iotaledger/goshimmer/packages/markers" + "github.com/iotaledger/goshimmer/packages/core/ledger/utxo" + "github.com/iotaledger/goshimmer/packages/core/markers" ) // region MarkersManager /////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/packages/tangle/markersmanager.models.go b/packages/core/tangleold/markersmanager.models.go similarity index 94% rename from packages/tangle/markersmanager.models.go rename to packages/core/tangleold/markersmanager.models.go index 108e438ff6..83b82dd2a9 100644 --- a/packages/tangle/markersmanager.models.go +++ b/packages/core/tangleold/markersmanager.models.go @@ -1,14 +1,14 @@ -package tangle +package tangleold import ( "fmt" - "github.com/iotaledger/hive.go/generics/model" - "github.com/iotaledger/hive.go/generics/objectstorage" - "github.com/iotaledger/hive.go/generics/thresholdmap" + "github.com/iotaledger/hive.go/core/generics/model" + "github.com/iotaledger/hive.go/core/generics/objectstorage" + "github.com/iotaledger/hive.go/core/generics/thresholdmap" - "github.com/iotaledger/goshimmer/packages/ledger/utxo" - "github.com/iotaledger/goshimmer/packages/markers" + "github.com/iotaledger/goshimmer/packages/core/ledger/utxo" + "github.com/iotaledger/goshimmer/packages/core/markers" ) // region markerIndexConflictIDMap ///////////////////////////////////////////////////////////////////////////////////////// diff --git a/packages/tangle/orphanagemanager.go b/packages/core/tangleold/orphanagemanager.go similarity index 97% rename from packages/tangle/orphanagemanager.go rename to packages/core/tangleold/orphanagemanager.go index 6d0a5b3201..a4309bcb90 100644 --- a/packages/tangle/orphanagemanager.go +++ b/packages/core/tangleold/orphanagemanager.go @@ -1,9 +1,9 @@ -package tangle +package tangleold import ( "sync" - "github.com/iotaledger/hive.go/generics/event" + "github.com/iotaledger/hive.go/core/generics/event" ) // region OrphanageManager ///////////////////////////////////////////////////////////////////////////////////////////// diff --git a/packages/tangle/parser.go b/packages/core/tangleold/parser.go similarity index 97% rename from packages/tangle/parser.go rename to packages/core/tangleold/parser.go index e09e1b1c89..a901230aff 100644 --- a/packages/tangle/parser.go +++ b/packages/core/tangleold/parser.go @@ -1,4 +1,4 @@ -package tangle +package tangleold import ( "context" @@ -8,14 +8,14 @@ import ( "time" "github.com/cockroachdb/errors" - "github.com/iotaledger/hive.go/autopeering/peer" - "github.com/iotaledger/hive.go/bytesfilter" - "github.com/iotaledger/hive.go/crypto/ed25519" - "github.com/iotaledger/hive.go/serix" - "github.com/iotaledger/hive.go/typeutils" - - "github.com/iotaledger/goshimmer/packages/ledger/vm/devnetvm" - "github.com/iotaledger/goshimmer/packages/pow" + "github.com/iotaledger/hive.go/core/autopeering/peer" + "github.com/iotaledger/hive.go/core/bytesfilter" + "github.com/iotaledger/hive.go/core/crypto/ed25519" + "github.com/iotaledger/hive.go/core/serix" + "github.com/iotaledger/hive.go/core/typeutils" + + "github.com/iotaledger/goshimmer/packages/core/ledger/vm/devnetvm" + "github.com/iotaledger/goshimmer/packages/core/pow" ) const ( diff --git a/packages/tangle/parser_test.go b/packages/core/tangleold/parser_test.go similarity index 90% rename from packages/tangle/parser_test.go rename to packages/core/tangleold/parser_test.go index 1c2b4cd583..80a318f960 100644 --- a/packages/tangle/parser_test.go +++ b/packages/core/tangleold/parser_test.go @@ -1,4 +1,4 @@ -package tangle +package tangleold import ( "context" @@ -7,21 +7,21 @@ import ( "time" "github.com/cockroachdb/errors" - "github.com/iotaledger/hive.go/autopeering/peer" - "github.com/iotaledger/hive.go/crypto/ed25519" - "github.com/iotaledger/hive.go/generics/event" - "github.com/iotaledger/hive.go/generics/lo" - "github.com/iotaledger/hive.go/identity" - "github.com/iotaledger/hive.go/marshalutil" + "github.com/iotaledger/hive.go/core/autopeering/peer" + "github.com/iotaledger/hive.go/core/crypto/ed25519" + "github.com/iotaledger/hive.go/core/generics/event" + "github.com/iotaledger/hive.go/core/generics/lo" + "github.com/iotaledger/hive.go/core/identity" + "github.com/iotaledger/hive.go/core/marshalutil" "github.com/labstack/gommon/log" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" - "github.com/iotaledger/goshimmer/packages/ledger/utxo" - "github.com/iotaledger/goshimmer/packages/ledger/vm/devnetvm" - "github.com/iotaledger/goshimmer/packages/pow" - "github.com/iotaledger/goshimmer/packages/tangle/payload" + "github.com/iotaledger/goshimmer/packages/core/ledger/utxo" + "github.com/iotaledger/goshimmer/packages/core/ledger/vm/devnetvm" + "github.com/iotaledger/goshimmer/packages/core/pow" + "github.com/iotaledger/goshimmer/packages/core/tangleold/payload" ) func BenchmarkBlockParser_ParseBytesSame(b *testing.B) { diff --git a/packages/tangle/payload/data.go b/packages/core/tangleold/payload/data.go similarity index 93% rename from packages/tangle/payload/data.go rename to packages/core/tangleold/payload/data.go index 77f5a5d699..e3a2e04fa9 100644 --- a/packages/tangle/payload/data.go +++ b/packages/core/tangleold/payload/data.go @@ -3,8 +3,8 @@ package payload import ( "fmt" - "github.com/iotaledger/hive.go/generics/model" - "github.com/iotaledger/hive.go/serix" + "github.com/iotaledger/hive.go/core/generics/model" + "github.com/iotaledger/hive.go/core/serix" ) func init() { diff --git a/packages/tangle/payload/payload.go b/packages/core/tangleold/payload/payload.go similarity index 96% rename from packages/tangle/payload/payload.go rename to packages/core/tangleold/payload/payload.go index a349798769..7e5809ae51 100644 --- a/packages/tangle/payload/payload.go +++ b/packages/core/tangleold/payload/payload.go @@ -4,7 +4,7 @@ import ( "context" "github.com/cockroachdb/errors" - "github.com/iotaledger/hive.go/serix" + "github.com/iotaledger/hive.go/core/serix" ) // MaxSize = MaxBlockSize - diff --git a/packages/tangle/payload/type.go b/packages/core/tangleold/payload/type.go similarity index 100% rename from packages/tangle/payload/type.go rename to packages/core/tangleold/payload/type.go diff --git a/packages/tangle/ratesetter.go b/packages/core/tangleold/ratesetter.go similarity index 97% rename from packages/tangle/ratesetter.go rename to packages/core/tangleold/ratesetter.go index e95782ed84..cc05b288e9 100644 --- a/packages/tangle/ratesetter.go +++ b/packages/core/tangleold/ratesetter.go @@ -1,4 +1,4 @@ -package tangle +package tangleold import ( "math" @@ -6,12 +6,12 @@ import ( "time" "github.com/cockroachdb/errors" - "github.com/iotaledger/hive.go/generics/event" - "github.com/iotaledger/hive.go/generics/lo" - "github.com/iotaledger/hive.go/identity" + "github.com/iotaledger/hive.go/core/generics/event" + "github.com/iotaledger/hive.go/core/generics/lo" + "github.com/iotaledger/hive.go/core/identity" "go.uber.org/atomic" - "github.com/iotaledger/goshimmer/packages/tangle/schedulerutils" + "github.com/iotaledger/goshimmer/packages/core/tangleold/schedulerutils" ) const ( diff --git a/packages/tangle/ratesetter_test.go b/packages/core/tangleold/ratesetter_test.go similarity index 88% rename from packages/tangle/ratesetter_test.go rename to packages/core/tangleold/ratesetter_test.go index 5f28e81e5f..f89b6f0f1d 100644 --- a/packages/tangle/ratesetter_test.go +++ b/packages/core/tangleold/ratesetter_test.go @@ -1,16 +1,16 @@ -package tangle +package tangleold import ( "testing" "time" - "github.com/iotaledger/goshimmer/packages/epoch" + "github.com/iotaledger/goshimmer/packages/core/epoch" - "github.com/iotaledger/goshimmer/packages/tangle/payload" + "github.com/iotaledger/goshimmer/packages/core/tangleold/payload" - "github.com/iotaledger/hive.go/crypto/ed25519" - "github.com/iotaledger/hive.go/generics/event" - "github.com/iotaledger/hive.go/identity" + "github.com/iotaledger/hive.go/core/crypto/ed25519" + "github.com/iotaledger/hive.go/core/generics/event" + "github.com/iotaledger/hive.go/core/identity" "github.com/stretchr/testify/assert" ) diff --git a/packages/tangle/referenceprovider.go b/packages/core/tangleold/referenceprovider.go similarity index 96% rename from packages/tangle/referenceprovider.go rename to packages/core/tangleold/referenceprovider.go index 353f57c31e..33e959cdc3 100644 --- a/packages/tangle/referenceprovider.go +++ b/packages/core/tangleold/referenceprovider.go @@ -1,15 +1,15 @@ -package tangle +package tangleold import ( "time" "github.com/cockroachdb/errors" - "github.com/iotaledger/hive.go/generics/walker" + "github.com/iotaledger/hive.go/core/generics/walker" - "github.com/iotaledger/goshimmer/packages/clock" - "github.com/iotaledger/goshimmer/packages/conflictdag" - "github.com/iotaledger/goshimmer/packages/ledger/utxo" - "github.com/iotaledger/goshimmer/packages/tangle/payload" + "github.com/iotaledger/goshimmer/packages/core/conflictdag" + "github.com/iotaledger/goshimmer/packages/core/ledger/utxo" + "github.com/iotaledger/goshimmer/packages/core/tangleold/payload" + "github.com/iotaledger/goshimmer/packages/node/clock" ) // region ReferenceProvider //////////////////////////////////////////////////////////////////////////////////////////// diff --git a/packages/tangle/requester.go b/packages/core/tangleold/requester.go similarity index 97% rename from packages/tangle/requester.go rename to packages/core/tangleold/requester.go index a7a82e17d9..0dc5deabb0 100644 --- a/packages/tangle/requester.go +++ b/packages/core/tangleold/requester.go @@ -1,12 +1,12 @@ -package tangle +package tangleold import ( "sync" "time" - "github.com/iotaledger/hive.go/crypto" - "github.com/iotaledger/hive.go/generics/event" - "github.com/iotaledger/hive.go/timedexecutor" + "github.com/iotaledger/hive.go/core/crypto" + "github.com/iotaledger/hive.go/core/generics/event" + "github.com/iotaledger/hive.go/core/timedexecutor" ) // region Requester //////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/packages/tangle/scenarios.go b/packages/core/tangleold/scenarios.go similarity index 99% rename from packages/tangle/scenarios.go rename to packages/core/tangleold/scenarios.go index 955afcc866..2f02efba46 100644 --- a/packages/tangle/scenarios.go +++ b/packages/core/tangleold/scenarios.go @@ -1,14 +1,14 @@ -package tangle +package tangleold import ( "math" "testing" "time" - "github.com/iotaledger/hive.go/identity" + "github.com/iotaledger/hive.go/core/identity" "github.com/stretchr/testify/require" - "github.com/iotaledger/goshimmer/packages/markers" + "github.com/iotaledger/goshimmer/packages/core/markers" ) // TestStep defines a test scenario step. diff --git a/packages/tangle/scheduler.go b/packages/core/tangleold/scheduler.go similarity index 98% rename from packages/tangle/scheduler.go rename to packages/core/tangleold/scheduler.go index 6009e4b428..1d141baf3b 100644 --- a/packages/tangle/scheduler.go +++ b/packages/core/tangleold/scheduler.go @@ -1,4 +1,4 @@ -package tangle +package tangleold import ( "math" @@ -7,13 +7,13 @@ import ( "time" "github.com/cockroachdb/errors" - "github.com/iotaledger/hive.go/generics/event" - "github.com/iotaledger/hive.go/identity" - "github.com/iotaledger/hive.go/typeutils" + "github.com/iotaledger/hive.go/core/generics/event" + "github.com/iotaledger/hive.go/core/identity" + "github.com/iotaledger/hive.go/core/typeutils" "go.uber.org/atomic" - "github.com/iotaledger/goshimmer/packages/clock" - "github.com/iotaledger/goshimmer/packages/tangle/schedulerutils" + "github.com/iotaledger/goshimmer/packages/core/tangleold/schedulerutils" + "github.com/iotaledger/goshimmer/packages/node/clock" ) const ( diff --git a/packages/tangle/scheduler_test.go b/packages/core/tangleold/scheduler_test.go similarity index 97% rename from packages/tangle/scheduler_test.go rename to packages/core/tangleold/scheduler_test.go index 67c26071ce..fb69468d5f 100644 --- a/packages/tangle/scheduler_test.go +++ b/packages/core/tangleold/scheduler_test.go @@ -1,22 +1,22 @@ -package tangle +package tangleold import ( "sync" "testing" "time" - "github.com/iotaledger/hive.go/generics/event" - "github.com/iotaledger/hive.go/types" + "github.com/iotaledger/hive.go/core/generics/event" + "github.com/iotaledger/hive.go/core/types" "github.com/cockroachdb/errors" - "github.com/iotaledger/hive.go/crypto/ed25519" - "github.com/iotaledger/hive.go/identity" + "github.com/iotaledger/hive.go/core/crypto/ed25519" + "github.com/iotaledger/hive.go/core/identity" "github.com/stretchr/testify/assert" "go.uber.org/atomic" - "github.com/iotaledger/goshimmer/packages/epoch" - "github.com/iotaledger/goshimmer/packages/tangle/payload" - "github.com/iotaledger/goshimmer/packages/tangle/schedulerutils" + "github.com/iotaledger/goshimmer/packages/core/epoch" + "github.com/iotaledger/goshimmer/packages/core/tangleold/payload" + "github.com/iotaledger/goshimmer/packages/core/tangleold/schedulerutils" ) // region Scheduler_test ///////////////////////////////////////////////////////////////////////////////////////////// diff --git a/packages/tangle/schedulerutils/accessmanacache.go b/packages/core/tangleold/schedulerutils/accessmanacache.go similarity index 98% rename from packages/tangle/schedulerutils/accessmanacache.go rename to packages/core/tangleold/schedulerutils/accessmanacache.go index b374ff9934..ce0b637777 100644 --- a/packages/tangle/schedulerutils/accessmanacache.go +++ b/packages/core/tangleold/schedulerutils/accessmanacache.go @@ -5,7 +5,7 @@ import ( "sync" "time" - "github.com/iotaledger/hive.go/identity" + "github.com/iotaledger/hive.go/core/identity" ) const ( diff --git a/packages/tangle/schedulerutils/bufferqueue.go b/packages/core/tangleold/schedulerutils/bufferqueue.go similarity index 99% rename from packages/tangle/schedulerutils/bufferqueue.go rename to packages/core/tangleold/schedulerutils/bufferqueue.go index d9c8d1a7cd..ce627df9fd 100644 --- a/packages/tangle/schedulerutils/bufferqueue.go +++ b/packages/core/tangleold/schedulerutils/bufferqueue.go @@ -5,7 +5,7 @@ import ( "math" "github.com/cockroachdb/errors" - "github.com/iotaledger/hive.go/identity" + "github.com/iotaledger/hive.go/core/identity" ) // ErrInsufficientMana is returned when the mana is insufficient. diff --git a/packages/tangle/schedulerutils/bufferqueue_test.go b/packages/core/tangleold/schedulerutils/bufferqueue_test.go similarity index 97% rename from packages/tangle/schedulerutils/bufferqueue_test.go rename to packages/core/tangleold/schedulerutils/bufferqueue_test.go index 95ee689288..1723a59972 100644 --- a/packages/tangle/schedulerutils/bufferqueue_test.go +++ b/packages/core/tangleold/schedulerutils/bufferqueue_test.go @@ -4,13 +4,13 @@ import ( "testing" "time" - "github.com/iotaledger/hive.go/byteutils" + "github.com/iotaledger/hive.go/core/byteutils" - "github.com/iotaledger/goshimmer/packages/tangle/schedulerutils" + "github.com/iotaledger/goshimmer/packages/core/tangleold/schedulerutils" - "github.com/iotaledger/hive.go/crypto/ed25519" - "github.com/iotaledger/hive.go/identity" - "github.com/iotaledger/hive.go/marshalutil" + "github.com/iotaledger/hive.go/core/crypto/ed25519" + "github.com/iotaledger/hive.go/core/identity" + "github.com/iotaledger/hive.go/core/marshalutil" "github.com/stretchr/testify/assert" "golang.org/x/crypto/blake2b" ) diff --git a/packages/tangle/schedulerutils/nodequeue.go b/packages/core/tangleold/schedulerutils/nodequeue.go similarity index 97% rename from packages/tangle/schedulerutils/nodequeue.go rename to packages/core/tangleold/schedulerutils/nodequeue.go index f61378e5de..83bd7e5d6b 100644 --- a/packages/tangle/schedulerutils/nodequeue.go +++ b/packages/core/tangleold/schedulerutils/nodequeue.go @@ -5,8 +5,8 @@ import ( "fmt" "time" - "github.com/iotaledger/hive.go/crypto/ed25519" - "github.com/iotaledger/hive.go/identity" + "github.com/iotaledger/hive.go/core/crypto/ed25519" + "github.com/iotaledger/hive.go/core/identity" "go.uber.org/atomic" ) diff --git a/packages/tangle/solidifier.go b/packages/core/tangleold/solidifier.go similarity index 97% rename from packages/tangle/solidifier.go rename to packages/core/tangleold/solidifier.go index 5719346a59..77b1ac7f0e 100644 --- a/packages/tangle/solidifier.go +++ b/packages/core/tangleold/solidifier.go @@ -1,12 +1,12 @@ -package tangle +package tangleold import ( "time" - "github.com/iotaledger/hive.go/generics/event" - "github.com/iotaledger/hive.go/syncutils" + "github.com/iotaledger/hive.go/core/generics/event" + "github.com/iotaledger/hive.go/core/syncutils" - "github.com/iotaledger/goshimmer/packages/ledger/utxo" + "github.com/iotaledger/goshimmer/packages/core/ledger/utxo" ) // maxParentsTimeDifference defines the smallest allowed time difference between a child Block and its parents. diff --git a/packages/tangle/storage.go b/packages/core/tangleold/storage.go similarity index 98% rename from packages/tangle/storage.go rename to packages/core/tangleold/storage.go index a9d057743d..7e9809649a 100644 --- a/packages/tangle/storage.go +++ b/packages/core/tangleold/storage.go @@ -1,18 +1,19 @@ -package tangle +package tangleold import ( "fmt" "time" - "github.com/iotaledger/hive.go/byteutils" - "github.com/iotaledger/hive.go/generics/event" - "github.com/iotaledger/hive.go/generics/model" - "github.com/iotaledger/hive.go/generics/objectstorage" + "github.com/iotaledger/hive.go/core/byteutils" + "github.com/iotaledger/hive.go/core/generics/event" + "github.com/iotaledger/hive.go/core/generics/model" + "github.com/iotaledger/hive.go/core/generics/objectstorage" - "github.com/iotaledger/goshimmer/packages/clock" - "github.com/iotaledger/goshimmer/packages/database" - "github.com/iotaledger/goshimmer/packages/ledger/utxo" - "github.com/iotaledger/goshimmer/packages/markers" + "github.com/iotaledger/goshimmer/packages/node/clock" + + "github.com/iotaledger/goshimmer/packages/core/ledger/utxo" + "github.com/iotaledger/goshimmer/packages/core/markers" + "github.com/iotaledger/goshimmer/packages/node/database" ) const ( diff --git a/packages/tangle/storage_test.go b/packages/core/tangleold/storage_test.go similarity index 93% rename from packages/tangle/storage_test.go rename to packages/core/tangleold/storage_test.go index 544cb9c198..d98e87aba2 100644 --- a/packages/tangle/storage_test.go +++ b/packages/core/tangleold/storage_test.go @@ -1,13 +1,13 @@ -package tangle +package tangleold import ( "math/rand" "testing" - "github.com/iotaledger/hive.go/generics/lo" + "github.com/iotaledger/hive.go/core/generics/lo" "github.com/stretchr/testify/assert" - "github.com/iotaledger/goshimmer/packages/ledger/utxo" + "github.com/iotaledger/goshimmer/packages/core/ledger/utxo" ) func TestMarkerIndexConflictIDMapping_Serialization(t *testing.T) { diff --git a/packages/tangle/tangle.go b/packages/core/tangleold/tangle.go similarity index 93% rename from packages/tangle/tangle.go rename to packages/core/tangleold/tangle.go index 6134239d54..ac917a4f1e 100644 --- a/packages/tangle/tangle.go +++ b/packages/core/tangleold/tangle.go @@ -1,26 +1,26 @@ -package tangle +package tangleold import ( "time" "github.com/cockroachdb/errors" - "github.com/iotaledger/hive.go/autopeering/peer" - "github.com/iotaledger/hive.go/crypto/ed25519" - "github.com/iotaledger/hive.go/generics/event" - "github.com/iotaledger/hive.go/identity" - "github.com/iotaledger/hive.go/kvstore" - "github.com/iotaledger/hive.go/kvstore/mapdb" - "github.com/iotaledger/hive.go/syncutils" + "github.com/iotaledger/hive.go/core/autopeering/peer" + "github.com/iotaledger/hive.go/core/crypto/ed25519" + "github.com/iotaledger/hive.go/core/generics/event" + "github.com/iotaledger/hive.go/core/identity" + "github.com/iotaledger/hive.go/core/kvstore" + "github.com/iotaledger/hive.go/core/kvstore/mapdb" + "github.com/iotaledger/hive.go/core/syncutils" "github.com/mr-tron/base58" - "github.com/iotaledger/goshimmer/packages/conflictdag" - "github.com/iotaledger/goshimmer/packages/database" - "github.com/iotaledger/goshimmer/packages/epoch" - "github.com/iotaledger/goshimmer/packages/ledger" - "github.com/iotaledger/goshimmer/packages/ledger/utxo" - "github.com/iotaledger/goshimmer/packages/ledger/vm/devnetvm" - "github.com/iotaledger/goshimmer/packages/markers" - "github.com/iotaledger/goshimmer/packages/tangle/payload" + "github.com/iotaledger/goshimmer/packages/core/conflictdag" + "github.com/iotaledger/goshimmer/packages/core/epoch" + "github.com/iotaledger/goshimmer/packages/core/ledger" + "github.com/iotaledger/goshimmer/packages/core/ledger/utxo" + "github.com/iotaledger/goshimmer/packages/core/ledger/vm/devnetvm" + "github.com/iotaledger/goshimmer/packages/core/markers" + "github.com/iotaledger/goshimmer/packages/core/tangleold/payload" + "github.com/iotaledger/goshimmer/packages/node/database" ) const ( diff --git a/packages/tangle/tangle_test.go b/packages/core/tangleold/tangle_test.go similarity index 96% rename from packages/tangle/tangle_test.go rename to packages/core/tangleold/tangle_test.go index 9e312d7262..767033a4b2 100644 --- a/packages/tangle/tangle_test.go +++ b/packages/core/tangleold/tangle_test.go @@ -1,4 +1,4 @@ -package tangle +package tangleold import ( "context" @@ -10,22 +10,22 @@ import ( "testing" "time" - "github.com/iotaledger/hive.go/autopeering/peer" - "github.com/iotaledger/hive.go/autopeering/peer/service" - "github.com/iotaledger/hive.go/crypto/ed25519" - "github.com/iotaledger/hive.go/generics/event" - "github.com/iotaledger/hive.go/generics/lo" - "github.com/iotaledger/hive.go/generics/randommap" + "github.com/iotaledger/hive.go/core/autopeering/peer" + "github.com/iotaledger/hive.go/core/autopeering/peer/service" + "github.com/iotaledger/hive.go/core/crypto/ed25519" + "github.com/iotaledger/hive.go/core/generics/event" + "github.com/iotaledger/hive.go/core/generics/lo" + "github.com/iotaledger/hive.go/core/generics/randommap" - "github.com/iotaledger/hive.go/workerpool" + "github.com/iotaledger/hive.go/core/workerpool" "github.com/panjf2000/ants/v2" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/iotaledger/goshimmer/packages/consensus/otv" - "github.com/iotaledger/goshimmer/packages/epoch" - "github.com/iotaledger/goshimmer/packages/pow" - "github.com/iotaledger/goshimmer/packages/tangle/payload" + "github.com/iotaledger/goshimmer/packages/core/consensus/otv" + "github.com/iotaledger/goshimmer/packages/core/epoch" + "github.com/iotaledger/goshimmer/packages/core/pow" + "github.com/iotaledger/goshimmer/packages/core/tangleold/payload" ) func BenchmarkVerifyDataBlocks(b *testing.B) { diff --git a/packages/tangle/testutils.go b/packages/core/tangleold/testutils.go similarity index 96% rename from packages/tangle/testutils.go rename to packages/core/tangleold/testutils.go index b4da20cb1d..0be6af86ec 100644 --- a/packages/tangle/testutils.go +++ b/packages/core/tangleold/testutils.go @@ -1,4 +1,4 @@ -package tangle +package tangleold import ( "fmt" @@ -8,23 +8,25 @@ import ( "testing" "time" - "github.com/iotaledger/hive.go/crypto/ed25519" - "github.com/iotaledger/hive.go/generics/event" - "github.com/iotaledger/hive.go/generics/lo" - "github.com/iotaledger/hive.go/generics/set" - "github.com/iotaledger/hive.go/identity" - "github.com/iotaledger/hive.go/types" + "github.com/iotaledger/hive.go/core/crypto/ed25519" + "github.com/iotaledger/hive.go/core/generics/event" + "github.com/iotaledger/hive.go/core/generics/lo" + "github.com/iotaledger/hive.go/core/generics/set" + "github.com/iotaledger/hive.go/core/identity" + "github.com/iotaledger/hive.go/core/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" - "github.com/iotaledger/goshimmer/packages/conflictdag" - "github.com/iotaledger/goshimmer/packages/database" - "github.com/iotaledger/goshimmer/packages/epoch" - "github.com/iotaledger/goshimmer/packages/ledger" - "github.com/iotaledger/goshimmer/packages/ledger/utxo" - "github.com/iotaledger/goshimmer/packages/ledger/vm/devnetvm" - "github.com/iotaledger/goshimmer/packages/markers" - "github.com/iotaledger/goshimmer/packages/tangle/payload" + "github.com/iotaledger/goshimmer/packages/core/conflictdag" + + "github.com/iotaledger/goshimmer/packages/core/tangleold/payload" + + "github.com/iotaledger/goshimmer/packages/core/epoch" + "github.com/iotaledger/goshimmer/packages/core/ledger" + "github.com/iotaledger/goshimmer/packages/core/ledger/utxo" + "github.com/iotaledger/goshimmer/packages/core/ledger/vm/devnetvm" + "github.com/iotaledger/goshimmer/packages/core/markers" + "github.com/iotaledger/goshimmer/packages/node/database" ) // region BlockTestFramework ///////////////////////////////////////////////////////////////////////////////////////// @@ -310,7 +312,7 @@ func (m *BlockTestFramework) createGenesisOutputs() { } m.snapshot = ledger.NewSnapshot(outputsWithMetadata) - m.tangle.Ledger.LoadSnapshot(m.snapshot) + loadSnapshotToLedger(m.tangle.Ledger, m.snapshot) } func (m *BlockTestFramework) createOutput(alias string, coloredBalances *devnetvm.ColoredBalances, manaPledgeID identity.ID, manaPledgeTime time.Time) (outputWithMetadata *ledger.OutputWithMetadata) { @@ -1066,3 +1068,12 @@ func (e *EventMock) BlockProcessed(event *BlockProcessedEvent) { atomic.AddUint64(&e.calledEvents, 1) } + +// loadSnapshotToLedger loads a snapshot of the Ledger from the given snapshot. +func loadSnapshotToLedger(l *ledger.Ledger, s *ledger.Snapshot) { + l.LoadOutputWithMetadatas(s.OutputsWithMetadata) + err := l.LoadEpochDiffs(s.Header, s.EpochDiffs) + if err != nil { + panic("Failed to load epochDiffs from snapshot") + } +} diff --git a/packages/tangle/timemanager.go b/packages/core/tangleold/timemanager.go similarity index 95% rename from packages/tangle/timemanager.go rename to packages/core/tangleold/timemanager.go index 5054f03031..eb1fefba68 100644 --- a/packages/tangle/timemanager.go +++ b/packages/core/tangleold/timemanager.go @@ -1,4 +1,4 @@ -package tangle +package tangleold import ( "context" @@ -6,15 +6,15 @@ import ( "time" "github.com/cockroachdb/errors" - "github.com/iotaledger/hive.go/cerrors" - "github.com/iotaledger/hive.go/generics/event" - "github.com/iotaledger/hive.go/kvstore" - "github.com/iotaledger/hive.go/serix" - "github.com/iotaledger/hive.go/stringify" - "github.com/iotaledger/hive.go/timeutil" - - "github.com/iotaledger/goshimmer/packages/clock" - "github.com/iotaledger/goshimmer/packages/epoch" + "github.com/iotaledger/hive.go/core/cerrors" + "github.com/iotaledger/hive.go/core/generics/event" + "github.com/iotaledger/hive.go/core/kvstore" + "github.com/iotaledger/hive.go/core/serix" + "github.com/iotaledger/hive.go/core/stringify" + "github.com/iotaledger/hive.go/core/timeutil" + + "github.com/iotaledger/goshimmer/packages/core/epoch" + "github.com/iotaledger/goshimmer/packages/node/clock" ) const ( diff --git a/packages/tangle/tipmanager.go b/packages/core/tangleold/tipmanager.go similarity index 97% rename from packages/tangle/tipmanager.go rename to packages/core/tangleold/tipmanager.go index a876f0586d..ac45299b90 100644 --- a/packages/tangle/tipmanager.go +++ b/packages/core/tangleold/tipmanager.go @@ -1,4 +1,4 @@ -package tangle +package tangleold import ( "container/heap" @@ -6,14 +6,15 @@ import ( "sync" "time" - "github.com/iotaledger/hive.go/generics/event" - "github.com/iotaledger/hive.go/generics/randommap" - "github.com/iotaledger/hive.go/generics/walker" + "github.com/iotaledger/hive.go/core/generics/event" + "github.com/iotaledger/hive.go/core/generics/randommap" + "github.com/iotaledger/hive.go/core/generics/walker" - "github.com/iotaledger/goshimmer/packages/clock" - "github.com/iotaledger/goshimmer/packages/epoch" - "github.com/iotaledger/goshimmer/packages/markers" - "github.com/iotaledger/goshimmer/packages/tangle/payload" + "github.com/iotaledger/goshimmer/packages/core/tangleold/payload" + + "github.com/iotaledger/goshimmer/packages/core/epoch" + "github.com/iotaledger/goshimmer/packages/core/markers" + "github.com/iotaledger/goshimmer/packages/node/clock" ) // region TipManager /////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/packages/tangle/tipmanager_test.go b/packages/core/tangleold/tipmanager_test.go similarity index 99% rename from packages/tangle/tipmanager_test.go rename to packages/core/tangleold/tipmanager_test.go index 1669b8235a..fdd72b1105 100644 --- a/packages/tangle/tipmanager_test.go +++ b/packages/core/tangleold/tipmanager_test.go @@ -1,4 +1,4 @@ -package tangle +package tangleold import ( "fmt" @@ -6,11 +6,11 @@ import ( "testing" "time" - "github.com/iotaledger/hive.go/generics/event" - "github.com/iotaledger/hive.go/identity" + "github.com/iotaledger/hive.go/core/generics/event" + "github.com/iotaledger/hive.go/core/identity" "github.com/stretchr/testify/assert" - "github.com/iotaledger/goshimmer/packages/markers" + "github.com/iotaledger/goshimmer/packages/core/markers" ) func TestTipManager_DataBlockTips(t *testing.T) { diff --git a/packages/tangle/tipsconflicttracker.go b/packages/core/tangleold/tipsconflicttracker.go similarity index 92% rename from packages/tangle/tipsconflicttracker.go rename to packages/core/tangleold/tipsconflicttracker.go index 8331010a21..e97e685ab5 100644 --- a/packages/tangle/tipsconflicttracker.go +++ b/packages/core/tangleold/tipsconflicttracker.go @@ -1,14 +1,14 @@ -package tangle +package tangleold import ( "sync" "github.com/cockroachdb/errors" - "github.com/iotaledger/hive.go/generics/event" - "github.com/iotaledger/hive.go/generics/set" + "github.com/iotaledger/hive.go/core/generics/event" + "github.com/iotaledger/hive.go/core/generics/set" - "github.com/iotaledger/goshimmer/packages/conflictdag" - "github.com/iotaledger/goshimmer/packages/ledger/utxo" + "github.com/iotaledger/goshimmer/packages/core/conflictdag" + "github.com/iotaledger/goshimmer/packages/core/ledger/utxo" ) type TipsConflictTracker struct { diff --git a/packages/tangle/utils.go b/packages/core/tangleold/utils.go similarity index 97% rename from packages/tangle/utils.go rename to packages/core/tangleold/utils.go index b102d4eba1..c574825726 100644 --- a/packages/tangle/utils.go +++ b/packages/core/tangleold/utils.go @@ -1,14 +1,14 @@ -package tangle +package tangleold import ( "time" "github.com/cockroachdb/errors" - "github.com/iotaledger/hive.go/generics/set" - "github.com/iotaledger/hive.go/generics/walker" + "github.com/iotaledger/hive.go/core/generics/set" + "github.com/iotaledger/hive.go/core/generics/walker" - "github.com/iotaledger/goshimmer/packages/ledger" - "github.com/iotaledger/goshimmer/packages/ledger/utxo" + "github.com/iotaledger/goshimmer/packages/core/ledger" + "github.com/iotaledger/goshimmer/packages/core/ledger/utxo" ) // region utils //////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/packages/ledger/snapshot.go b/packages/ledger/snapshot.go deleted file mode 100644 index ae40444ebd..0000000000 --- a/packages/ledger/snapshot.go +++ /dev/null @@ -1,34 +0,0 @@ -package ledger - -import ( - "github.com/iotaledger/hive.go/stringify" - - "github.com/iotaledger/goshimmer/packages/epoch" -) - -// Snapshot represents a snapshot of the current ledger state. -type Snapshot struct { - OutputsWithMetadata []*OutputWithMetadata `serix:"0,lengthPrefixType=uint32"` - FullEpochIndex epoch.Index `serix:"1"` - DiffEpochIndex epoch.Index `serix:"2"` - EpochDiffs map[epoch.Index]*EpochDiff `serix:"3,lengthPrefixType=uint32"` - LatestECRecord *epoch.ECRecord `serix:"4"` -} - -// NewSnapshot creates a new Snapshot from the given details. -func NewSnapshot(outputsWithMetadata []*OutputWithMetadata) (new *Snapshot) { - return &Snapshot{ - OutputsWithMetadata: outputsWithMetadata, - } -} - -// String returns a human-readable version of the Snapshot. -func (s *Snapshot) String() (humanReadable string) { - return stringify.Struct("Snapshot", - stringify.StructField("OutputsWithMetadata", s.OutputsWithMetadata), - stringify.StructField("FullEpochIndex", s.FullEpochIndex), - stringify.StructField("DiffEpochIndex", s.DiffEpochIndex), - stringify.StructField("EpochDiffs", s.EpochDiffs), - stringify.StructField("LatestECRecord", s.LatestECRecord), - ) -} diff --git a/packages/clock/synchronization.go b/packages/node/clock/synchronization.go similarity index 100% rename from packages/clock/synchronization.go rename to packages/node/clock/synchronization.go diff --git a/packages/database/cache_time_provider.go b/packages/node/database/cache_time_provider.go similarity index 93% rename from packages/database/cache_time_provider.go rename to packages/node/database/cache_time_provider.go index 12cf543397..a08148ec06 100644 --- a/packages/database/cache_time_provider.go +++ b/packages/node/database/cache_time_provider.go @@ -3,7 +3,7 @@ package database import ( "time" - "github.com/iotaledger/hive.go/generics/objectstorage" + "github.com/iotaledger/hive.go/core/generics/objectstorage" ) // CacheTimeProvider should be always used to get the CacheTime option for storage diff --git a/packages/database/database.go b/packages/node/database/database.go similarity index 89% rename from packages/database/database.go rename to packages/node/database/database.go index 200cc67cfb..e8c7fe890f 100644 --- a/packages/database/database.go +++ b/packages/node/database/database.go @@ -1,7 +1,7 @@ package database import ( - "github.com/iotaledger/hive.go/kvstore" + "github.com/iotaledger/hive.go/core/kvstore" ) // DB represents a database abstraction. diff --git a/packages/database/memdb.go b/packages/node/database/memdb.go similarity index 81% rename from packages/database/memdb.go rename to packages/node/database/memdb.go index 570264d354..9e6a3e6868 100644 --- a/packages/database/memdb.go +++ b/packages/node/database/memdb.go @@ -1,8 +1,8 @@ package database import ( - "github.com/iotaledger/hive.go/kvstore" - "github.com/iotaledger/hive.go/kvstore/mapdb" + "github.com/iotaledger/hive.go/core/kvstore" + "github.com/iotaledger/hive.go/core/kvstore/mapdb" ) type memDB struct { diff --git a/packages/database/prefix.go b/packages/node/database/prefix.go similarity index 100% rename from packages/database/prefix.go rename to packages/node/database/prefix.go diff --git a/packages/database/rocksdb.go b/packages/node/database/rocksdb.go similarity index 87% rename from packages/database/rocksdb.go rename to packages/node/database/rocksdb.go index 01f23e7cd7..fe1862597c 100644 --- a/packages/database/rocksdb.go +++ b/packages/node/database/rocksdb.go @@ -3,8 +3,8 @@ package database import ( "runtime" - "github.com/iotaledger/hive.go/kvstore" - "github.com/iotaledger/hive.go/kvstore/rocksdb" + "github.com/iotaledger/hive.go/core/kvstore" + "github.com/iotaledger/hive.go/core/kvstore/rocksdb" ) // const valueLogGCDiscardRatio = 0.1 diff --git a/packages/gossip/errors.go b/packages/node/gossip/errors.go similarity index 100% rename from packages/gossip/errors.go rename to packages/node/gossip/errors.go diff --git a/packages/gossip/events.go b/packages/node/gossip/events.go similarity index 83% rename from packages/gossip/events.go rename to packages/node/gossip/events.go index 68a39abea7..5c7d520386 100644 --- a/packages/gossip/events.go +++ b/packages/node/gossip/events.go @@ -1,8 +1,8 @@ package gossip import ( - "github.com/iotaledger/hive.go/autopeering/peer" - "github.com/iotaledger/hive.go/generics/event" + "github.com/iotaledger/hive.go/core/autopeering/peer" + "github.com/iotaledger/hive.go/core/generics/event" ) // Events defines all the events related to the gossip protocol. diff --git a/packages/gossip/gossipproto/message.pb.go b/packages/node/gossip/gossipproto/message.pb.go similarity index 98% rename from packages/gossip/gossipproto/message.pb.go rename to packages/node/gossip/gossipproto/message.pb.go index 37320237dc..fcd0fe1459 100644 --- a/packages/gossip/gossipproto/message.pb.go +++ b/packages/node/gossip/gossipproto/message.pb.go @@ -7,11 +7,11 @@ package gossipproto import ( - reflect "reflect" - sync "sync" + "reflect" + "sync" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" + "google.golang.org/protobuf/reflect/protoreflect" + "google.golang.org/protobuf/runtime/protoimpl" ) const ( diff --git a/packages/gossip/gossipproto/message.proto b/packages/node/gossip/gossipproto/message.proto similarity index 100% rename from packages/gossip/gossipproto/message.proto rename to packages/node/gossip/gossipproto/message.proto diff --git a/packages/gossip/manager.go b/packages/node/gossip/manager.go similarity index 93% rename from packages/gossip/manager.go rename to packages/node/gossip/manager.go index a3c0716c32..99cf16bbdb 100644 --- a/packages/gossip/manager.go +++ b/packages/node/gossip/manager.go @@ -5,15 +5,17 @@ import ( "sync" "github.com/cockroachdb/errors" - gp "github.com/iotaledger/goshimmer/packages/gossip/gossipproto" - "github.com/iotaledger/goshimmer/packages/p2p" - "github.com/iotaledger/goshimmer/packages/ratelimiter" - "github.com/iotaledger/goshimmer/packages/tangle" - "github.com/iotaledger/hive.go/generics/event" - "github.com/iotaledger/hive.go/identity" - "github.com/iotaledger/hive.go/logger" + "github.com/iotaledger/hive.go/core/generics/event" + "github.com/iotaledger/hive.go/core/identity" + "github.com/iotaledger/hive.go/core/logger" "go.uber.org/atomic" "google.golang.org/protobuf/proto" + + "github.com/iotaledger/goshimmer/packages/core/tangleold" + + "github.com/iotaledger/goshimmer/packages/app/ratelimiter" + gp "github.com/iotaledger/goshimmer/packages/node/gossip/gossipproto" + "github.com/iotaledger/goshimmer/packages/node/p2p" ) const ( @@ -21,7 +23,7 @@ const ( ) // LoadBlockFunc defines a function that returns the block for the given id. -type LoadBlockFunc func(blockId tangle.BlockID) ([]byte, error) +type LoadBlockFunc func(blockId tangleold.BlockID) ([]byte, error) // The Manager handles the connected neighbors. type Manager struct { @@ -184,7 +186,7 @@ func (m *Manager) processBlockRequestPacket(packetBlkReq *gp.Packet_BlockRequest if m.blockRequestsRateLimiter != nil { m.blockRequestsRateLimiter.Count(nbr.Peer) } - var blkID tangle.BlockID + var blkID tangleold.BlockID _, err := blkID.FromBytes(packetBlkReq.BlockRequest.GetId()) if err != nil { m.log.Debugw("invalid block id:", "err", err) diff --git a/packages/gossip/manager_test.go b/packages/node/gossip/manager_test.go similarity index 96% rename from packages/gossip/manager_test.go rename to packages/node/gossip/manager_test.go index cef9a4e651..8c09dc69b0 100644 --- a/packages/gossip/manager_test.go +++ b/packages/node/gossip/manager_test.go @@ -9,11 +9,11 @@ import ( "testing" "time" - "github.com/iotaledger/hive.go/autopeering/peer" - "github.com/iotaledger/hive.go/autopeering/peer/service" - "github.com/iotaledger/hive.go/generics/event" - "github.com/iotaledger/hive.go/kvstore/mapdb" - "github.com/iotaledger/hive.go/logger" + "github.com/iotaledger/hive.go/core/autopeering/peer" + "github.com/iotaledger/hive.go/core/autopeering/peer/service" + "github.com/iotaledger/hive.go/core/generics/event" + "github.com/iotaledger/hive.go/core/kvstore/mapdb" + "github.com/iotaledger/hive.go/core/logger" libp2ppeer "github.com/libp2p/go-libp2p-core/peer" mocknet "github.com/libp2p/go-libp2p/p2p/net/mock" "github.com/multiformats/go-multiaddr" @@ -22,10 +22,11 @@ import ( "github.com/stretchr/testify/require" "google.golang.org/protobuf/proto" - gp "github.com/iotaledger/goshimmer/packages/gossip/gossipproto" - "github.com/iotaledger/goshimmer/packages/libp2putil" - "github.com/iotaledger/goshimmer/packages/p2p" - "github.com/iotaledger/goshimmer/packages/tangle" + gp "github.com/iotaledger/goshimmer/packages/node/gossip/gossipproto" + "github.com/iotaledger/goshimmer/packages/node/libp2putil" + "github.com/iotaledger/goshimmer/packages/node/p2p" + + "github.com/iotaledger/goshimmer/packages/core/tangleold" ) const graceTime = 10 * time.Millisecond @@ -35,7 +36,7 @@ var ( testBlockData = []byte("testBlk") ) -func loadTestBlock(tangle.BlockID) ([]byte, error) { return testBlockData, nil } +func loadTestBlock(tangleold.BlockID) ([]byte, error) { return testBlockData, nil } func TestClose(t *testing.T) { testMgrs := newTestManagers(t, true /* doMock */, "A") @@ -353,7 +354,7 @@ func TestBlockRequest(t *testing.T) { // wait for the connections to establish wg.Wait() - id := tangle.BlockID{} + id := tangleold.BlockID{} // mgrA should eventually receive the block mgrA.On("blockReceived", &BlockReceivedEvent{Data: testBlockData, Peer: peerB}).Once() diff --git a/packages/libp2putil/io.go b/packages/node/libp2putil/io.go similarity index 93% rename from packages/libp2putil/io.go rename to packages/node/libp2putil/io.go index 8d4a027666..28e84b908e 100644 --- a/packages/libp2putil/io.go +++ b/packages/node/libp2putil/io.go @@ -8,7 +8,7 @@ import ( "github.com/multiformats/go-varint" "google.golang.org/protobuf/proto" - "github.com/iotaledger/goshimmer/packages/tangle" + "github.com/iotaledger/goshimmer/packages/core/tangleold" ) // UvarintWriter writes protobuf blocks. @@ -55,7 +55,7 @@ func (ur *UvarintReader) ReadBlk(blk proto.Message) error { if err != nil { return err } - if length64 > tangle.MaxBlockSize { + if length64 > tangleold.MaxBlockSize { return fmt.Errorf("max block size exceeded: %d", length64) } buf := make([]byte, length64) diff --git a/packages/libp2putil/libp2ptesting/libp2ptesting.go b/packages/node/libp2putil/libp2ptesting/libp2ptesting.go similarity index 100% rename from packages/libp2putil/libp2ptesting/libp2ptesting.go rename to packages/node/libp2putil/libp2ptesting/libp2ptesting.go diff --git a/packages/libp2putil/libp2putil.go b/packages/node/libp2putil/libp2putil.go similarity index 92% rename from packages/libp2putil/libp2putil.go rename to packages/node/libp2putil/libp2putil.go index 155e308649..9163d649bb 100644 --- a/packages/libp2putil/libp2putil.go +++ b/packages/node/libp2putil/libp2putil.go @@ -2,8 +2,8 @@ package libp2putil import ( "github.com/cockroachdb/errors" - "github.com/iotaledger/hive.go/autopeering/peer" - "github.com/iotaledger/hive.go/crypto/ed25519" + "github.com/iotaledger/hive.go/core/autopeering/peer" + "github.com/iotaledger/hive.go/core/crypto/ed25519" "github.com/libp2p/go-libp2p" libp2pcrypto "github.com/libp2p/go-libp2p-core/crypto" libp2ppeer "github.com/libp2p/go-libp2p-core/peer" diff --git a/packages/manualpeering/manualpeering.go b/packages/node/manualpeering/manualpeering.go similarity index 96% rename from packages/manualpeering/manualpeering.go rename to packages/node/manualpeering/manualpeering.go index 892375929f..58da8ce0d4 100644 --- a/packages/manualpeering/manualpeering.go +++ b/packages/node/manualpeering/manualpeering.go @@ -8,17 +8,17 @@ import ( "sync/atomic" "time" - "github.com/iotaledger/hive.go/autopeering/peer/service" - "github.com/iotaledger/hive.go/generics/event" - "github.com/iotaledger/hive.go/typeutils" + "github.com/iotaledger/hive.go/core/autopeering/peer/service" + "github.com/iotaledger/hive.go/core/generics/event" + "github.com/iotaledger/hive.go/core/typeutils" "github.com/cockroachdb/errors" - "github.com/iotaledger/hive.go/autopeering/peer" - "github.com/iotaledger/hive.go/crypto/ed25519" - "github.com/iotaledger/hive.go/identity" - "github.com/iotaledger/hive.go/logger" + "github.com/iotaledger/hive.go/core/autopeering/peer" + "github.com/iotaledger/hive.go/core/crypto/ed25519" + "github.com/iotaledger/hive.go/core/identity" + "github.com/iotaledger/hive.go/core/logger" - "github.com/iotaledger/goshimmer/packages/p2p" + "github.com/iotaledger/goshimmer/packages/node/p2p" ) const defaultReconnectInterval = 5 * time.Second diff --git a/packages/p2p/common.go b/packages/node/p2p/common.go similarity index 74% rename from packages/p2p/common.go rename to packages/node/p2p/common.go index 22b1a42bdb..0c92df0105 100644 --- a/packages/p2p/common.go +++ b/packages/node/p2p/common.go @@ -4,8 +4,8 @@ import ( "net" "strconv" - "github.com/iotaledger/hive.go/autopeering/peer" - "github.com/iotaledger/hive.go/autopeering/peer/service" + "github.com/iotaledger/hive.go/core/autopeering/peer" + "github.com/iotaledger/hive.go/core/autopeering/peer/service" ) // GetAddress returns the address of the p2p service. diff --git a/packages/p2p/errors.go b/packages/node/p2p/errors.go similarity index 100% rename from packages/p2p/errors.go rename to packages/node/p2p/errors.go diff --git a/packages/p2p/events.go b/packages/node/p2p/events.go similarity index 97% rename from packages/p2p/events.go rename to packages/node/p2p/events.go index 19937c1e5d..88910d179d 100644 --- a/packages/p2p/events.go +++ b/packages/node/p2p/events.go @@ -1,7 +1,7 @@ package p2p import ( - "github.com/iotaledger/hive.go/generics/event" + "github.com/iotaledger/hive.go/core/generics/event" "github.com/libp2p/go-libp2p-core/protocol" "google.golang.org/protobuf/proto" ) diff --git a/packages/p2p/manager.go b/packages/node/p2p/manager.go similarity index 97% rename from packages/p2p/manager.go rename to packages/node/p2p/manager.go index e86f920507..5786787ef0 100644 --- a/packages/p2p/manager.go +++ b/packages/node/p2p/manager.go @@ -5,10 +5,10 @@ import ( "sync" "github.com/cockroachdb/errors" - "github.com/iotaledger/hive.go/autopeering/peer" - "github.com/iotaledger/hive.go/generics/event" - "github.com/iotaledger/hive.go/identity" - "github.com/iotaledger/hive.go/logger" + "github.com/iotaledger/hive.go/core/autopeering/peer" + "github.com/iotaledger/hive.go/core/generics/event" + "github.com/iotaledger/hive.go/core/identity" + "github.com/iotaledger/hive.go/core/logger" "github.com/libp2p/go-libp2p-core/host" libp2ppeer "github.com/libp2p/go-libp2p-core/peer" "github.com/libp2p/go-libp2p-core/protocol" diff --git a/packages/p2p/neighbor.go b/packages/node/p2p/neighbor.go similarity index 83% rename from packages/p2p/neighbor.go rename to packages/node/p2p/neighbor.go index 294641c250..23320e3fe1 100644 --- a/packages/p2p/neighbor.go +++ b/packages/node/p2p/neighbor.go @@ -1,17 +1,13 @@ package p2p import ( - "io" - "strings" "sync" "time" "github.com/cockroachdb/errors" - "github.com/iotaledger/hive.go/autopeering/peer" - "github.com/iotaledger/hive.go/logger" - "github.com/libp2p/go-libp2p-core/mux" + "github.com/iotaledger/hive.go/core/autopeering/peer" + "github.com/iotaledger/hive.go/core/logger" "github.com/libp2p/go-libp2p-core/protocol" - "github.com/libp2p/go-yamux/v2" ) // NeighborsGroup is an enum type for various neighbors groups like auto/manual. @@ -110,16 +106,14 @@ func (n *Neighbor) readLoop() { packet := stream.packetFactory() err := stream.ReadPacket(packet) if err != nil { - if isPermanentError(err) { - if disconnectErr := n.disconnect(); disconnectErr != nil { - n.Log.Warnw("Failed to disconnect", "err", disconnectErr) - } - return + if isTimeoutError(err) { + continue } - if !isTimeoutError(err) { - n.Log.Debugw("Read error", "err", err) + n.Log.Infow("Stream read packet error", "err", err) + if disconnectErr := n.disconnect(); disconnectErr != nil { + n.Log.Warnw("Failed to disconnect", "err", disconnectErr) } - continue + return } n.Events.PacketReceived.Trigger(&NeighborPacketReceivedEvent{ Neighbor: n, @@ -151,9 +145,3 @@ func (n *Neighbor) disconnect() (err error) { }) return err } - -func isPermanentError(err error) bool { - return strings.Contains(err.Error(), "use of closed network connection") || - errors.Is(err, io.ErrClosedPipe) || errors.Is(err, mux.ErrReset) || errors.Is(err, yamux.ErrStreamClosed) || - errors.Is(err, io.EOF) || errors.Is(err, io.ErrUnexpectedEOF) -} diff --git a/packages/p2p/neighbor_test.go b/packages/node/p2p/neighbor_test.go similarity index 85% rename from packages/p2p/neighbor_test.go rename to packages/node/p2p/neighbor_test.go index 885c36d130..f61fa872a8 100644 --- a/packages/p2p/neighbor_test.go +++ b/packages/node/p2p/neighbor_test.go @@ -6,20 +6,20 @@ import ( "testing" "time" - "github.com/iotaledger/hive.go/autopeering/peer" - "github.com/iotaledger/hive.go/autopeering/peer/service" - "github.com/iotaledger/hive.go/crypto/ed25519" - "github.com/iotaledger/hive.go/generics/event" - "github.com/iotaledger/hive.go/identity" - "github.com/iotaledger/hive.go/logger" + "github.com/iotaledger/hive.go/core/autopeering/peer" + "github.com/iotaledger/hive.go/core/autopeering/peer/service" + "github.com/iotaledger/hive.go/core/crypto/ed25519" + "github.com/iotaledger/hive.go/core/generics/event" + "github.com/iotaledger/hive.go/core/identity" + "github.com/iotaledger/hive.go/core/logger" "github.com/libp2p/go-libp2p-core/network" "github.com/libp2p/go-libp2p-core/protocol" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "google.golang.org/protobuf/proto" - gp "github.com/iotaledger/goshimmer/packages/gossip/gossipproto" - "github.com/iotaledger/goshimmer/packages/libp2putil/libp2ptesting" + gp "github.com/iotaledger/goshimmer/packages/node/gossip/gossipproto" + "github.com/iotaledger/goshimmer/packages/node/libp2putil/libp2ptesting" ) var ( diff --git a/packages/p2p/stream.go b/packages/node/p2p/stream.go similarity index 98% rename from packages/p2p/stream.go rename to packages/node/p2p/stream.go index edc3add7c4..86b007f26e 100644 --- a/packages/p2p/stream.go +++ b/packages/node/p2p/stream.go @@ -11,8 +11,8 @@ import ( "time" "github.com/cockroachdb/errors" - "github.com/iotaledger/hive.go/autopeering/peer" - "github.com/iotaledger/hive.go/autopeering/peer/service" + "github.com/iotaledger/hive.go/core/autopeering/peer" + "github.com/iotaledger/hive.go/core/autopeering/peer/service" "github.com/libp2p/go-libp2p-core/network" libp2ppeer "github.com/libp2p/go-libp2p-core/peer" "github.com/libp2p/go-libp2p-core/peerstore" @@ -21,7 +21,7 @@ import ( "go.uber.org/atomic" "google.golang.org/protobuf/proto" - "github.com/iotaledger/goshimmer/packages/libp2putil" + "github.com/iotaledger/goshimmer/packages/node/libp2putil" ) const ( diff --git a/packages/shutdown/order.go b/packages/node/shutdown/order.go similarity index 100% rename from packages/shutdown/order.go rename to packages/node/shutdown/order.go diff --git a/packages/snapshot/snapshot.go b/packages/snapshot/snapshot.go deleted file mode 100644 index 3804b415d9..0000000000 --- a/packages/snapshot/snapshot.go +++ /dev/null @@ -1,98 +0,0 @@ -package snapshot - -import ( - "context" - "os" - - "github.com/cockroachdb/errors" - "github.com/iotaledger/hive.go/generics/lo" - "github.com/iotaledger/hive.go/marshalutil" - "github.com/iotaledger/hive.go/serix" - "github.com/iotaledger/hive.go/stringify" - - "github.com/iotaledger/goshimmer/packages/ledger" - "github.com/iotaledger/goshimmer/packages/ledger/vm/devnetvm" - "github.com/iotaledger/goshimmer/packages/mana" -) - -type Snapshot struct { - LedgerSnapshot *ledger.Snapshot -} - -func (s *Snapshot) FromNode(ledger *ledger.Ledger) { - s.LedgerSnapshot = ledger.TakeSnapshot() -} - -func (s *Snapshot) FromFile(fileName string) (err error) { - bytes, err := os.ReadFile(fileName) - if err != nil { - return errors.Errorf("failed to read file %s: %w", fileName, err) - } - - if err = s.FromBytes(bytes); err != nil { - return errors.Errorf("failed to unmarshal Snapshot: %w", err) - } - - return nil -} - -func (s *Snapshot) FromBytes(bytes []byte) (err error) { - s.LedgerSnapshot = new(ledger.Snapshot) - _, err = serix.DefaultAPI.Decode(context.Background(), bytes, s.LedgerSnapshot) - if err != nil { - return errors.Errorf("failed to read LedgerSnapshot: %w", err) - } - - for _, output := range s.LedgerSnapshot.OutputsWithMetadata { - output.SetID(output.M.OutputID) - output.Output().SetID(output.M.OutputID) - } - - for _, epochdiff := range s.LedgerSnapshot.EpochDiffs { - for _, spentOutput := range epochdiff.Spent() { - spentOutput.SetID(spentOutput.M.OutputID) - spentOutput.Output().SetID(spentOutput.M.OutputID) - } - for _, createdOutput := range epochdiff.Created() { - createdOutput.SetID(createdOutput.M.OutputID) - createdOutput.Output().SetID(createdOutput.M.OutputID) - } - } - - return nil -} - -func (s *Snapshot) WriteFile(fileName string) (err error) { - if err = os.WriteFile(fileName, s.Bytes(), 0o644); err != nil { - return errors.Errorf("failed to write snapshot file %s: %w", fileName, err) - } - - return nil -} - -// Bytes returns a serialized version of the Snapshot. -func (s *Snapshot) Bytes() (serialized []byte) { - return marshalutil.New(). - WriteBytes(lo.PanicOnErr(serix.DefaultAPI.Encode(context.Background(), s.LedgerSnapshot))). - Bytes() -} - -func (s *Snapshot) String() (humanReadable string) { - return stringify.Struct("Snapshot", - stringify.StructField("LedgerSnapshot", s.LedgerSnapshot), - ) -} - -func (s *Snapshot) updateConsensusManaDetails(nodeSnapshot *mana.SnapshotNode, output devnetvm.Output, outputMetadata *ledger.OutputMetadata) { - pledgedValue := float64(0) - output.Balances().ForEach(func(color devnetvm.Color, balance uint64) bool { - pledgedValue += float64(balance) - return true - }) - - nodeSnapshot.SortedTxSnapshot = append(nodeSnapshot.SortedTxSnapshot, &mana.TxSnapshot{ - Value: pledgedValue, - TxID: output.ID().TransactionID, - Timestamp: outputMetadata.CreationTime(), - }) -} diff --git a/plugins/activity/parameters.go b/plugins/activity/parameters.go index f2492de7d1..a0c6dea0c4 100644 --- a/plugins/activity/parameters.go +++ b/plugins/activity/parameters.go @@ -3,7 +3,7 @@ package activity import ( "time" - "github.com/iotaledger/hive.go/configuration" + "github.com/iotaledger/goshimmer/plugins/config" ) // ParametersDefinition contains the definition of configuration parameters used by the activity plugin. @@ -20,5 +20,5 @@ type ParametersDefinition struct { var Parameters = &ParametersDefinition{} func init() { - configuration.BindParameters(Parameters, "activity") + config.BindParameters(Parameters, "activity") } diff --git a/plugins/activity/plugin.go b/plugins/activity/plugin.go index 16ac04380a..06a083a9e4 100644 --- a/plugins/activity/plugin.go +++ b/plugins/activity/plugin.go @@ -5,14 +5,15 @@ import ( "math/rand" "time" - "github.com/iotaledger/hive.go/daemon" - "github.com/iotaledger/hive.go/node" - "github.com/iotaledger/hive.go/timeutil" + "github.com/iotaledger/hive.go/core/daemon" + "github.com/iotaledger/hive.go/core/node" + "github.com/iotaledger/hive.go/core/timeutil" "go.uber.org/dig" - "github.com/iotaledger/goshimmer/packages/shutdown" - "github.com/iotaledger/goshimmer/packages/tangle" - "github.com/iotaledger/goshimmer/packages/tangle/payload" + "github.com/iotaledger/goshimmer/packages/core/tangleold" + "github.com/iotaledger/goshimmer/packages/core/tangleold/payload" + + "github.com/iotaledger/goshimmer/packages/node/shutdown" ) var ( @@ -23,7 +24,7 @@ var ( type dependencies struct { dig.In - Tangle *tangle.Tangle + Tangle *tangleold.Tangle } func init() { diff --git a/plugins/analysis/client/connector.go b/plugins/analysis/client/connector.go index 5a00902ab2..64036d16d7 100644 --- a/plugins/analysis/client/connector.go +++ b/plugins/analysis/client/connector.go @@ -6,9 +6,9 @@ import ( "time" "github.com/cockroachdb/errors" - "github.com/iotaledger/hive.go/generics/event" - "github.com/iotaledger/hive.go/netutil" - "github.com/iotaledger/hive.go/network" + "github.com/iotaledger/hive.go/core/generics/event" + "github.com/iotaledger/hive.go/core/netutil" + "github.com/iotaledger/hive.go/core/network" ) // errors returned by the Connector diff --git a/plugins/analysis/client/heartbeat.go b/plugins/analysis/client/heartbeat.go index d21e616ad8..7995051ab9 100644 --- a/plugins/analysis/client/heartbeat.go +++ b/plugins/analysis/client/heartbeat.go @@ -4,10 +4,10 @@ import ( "io" "strings" - "github.com/iotaledger/hive.go/identity" + "github.com/iotaledger/hive.go/core/identity" "github.com/mr-tron/base58" - "github.com/iotaledger/goshimmer/packages/metrics" + "github.com/iotaledger/goshimmer/packages/app/metrics" "github.com/iotaledger/goshimmer/plugins/analysis/packet" "github.com/iotaledger/goshimmer/plugins/banner" ) diff --git a/plugins/analysis/client/metric_heartbeat.go b/plugins/analysis/client/metric_heartbeat.go index 056777c46b..6eae04f3a8 100644 --- a/plugins/analysis/client/metric_heartbeat.go +++ b/plugins/analysis/client/metric_heartbeat.go @@ -5,10 +5,10 @@ import ( "runtime" "time" - "github.com/iotaledger/hive.go/identity" + "github.com/iotaledger/hive.go/core/identity" "github.com/shirou/gopsutil/cpu" - "github.com/iotaledger/goshimmer/packages/metrics" + "github.com/iotaledger/goshimmer/packages/app/metrics" "github.com/iotaledger/goshimmer/plugins/analysis/packet" "github.com/iotaledger/goshimmer/plugins/banner" ) diff --git a/plugins/analysis/client/plugin.go b/plugins/analysis/client/plugin.go index 6668db5b7f..dd4a046fbb 100644 --- a/plugins/analysis/client/plugin.go +++ b/plugins/analysis/client/plugin.go @@ -4,16 +4,16 @@ import ( "context" "time" - "github.com/iotaledger/hive.go/autopeering/peer" - "github.com/iotaledger/hive.go/autopeering/selection" - "github.com/iotaledger/hive.go/configuration" - "github.com/iotaledger/hive.go/daemon" - "github.com/iotaledger/hive.go/logger" - "github.com/iotaledger/hive.go/node" + "github.com/iotaledger/hive.go/core/autopeering/peer" + "github.com/iotaledger/hive.go/core/autopeering/selection" + "github.com/iotaledger/hive.go/core/configuration" + "github.com/iotaledger/hive.go/core/daemon" + "github.com/iotaledger/hive.go/core/logger" + "github.com/iotaledger/hive.go/core/node" flag "github.com/spf13/pflag" "go.uber.org/dig" - "github.com/iotaledger/goshimmer/packages/shutdown" + "github.com/iotaledger/goshimmer/packages/node/shutdown" ) const ( diff --git a/plugins/analysis/dashboard/autopeering_feed.go b/plugins/analysis/dashboard/autopeering_feed.go index c04f27b1d8..daa9a2ff12 100644 --- a/plugins/analysis/dashboard/autopeering_feed.go +++ b/plugins/analysis/dashboard/autopeering_feed.go @@ -5,11 +5,11 @@ import ( "fmt" "github.com/gorilla/websocket" - "github.com/iotaledger/hive.go/daemon" - "github.com/iotaledger/hive.go/generics/event" - "github.com/iotaledger/hive.go/workerpool" + "github.com/iotaledger/hive.go/core/daemon" + "github.com/iotaledger/hive.go/core/generics/event" + "github.com/iotaledger/hive.go/core/workerpool" - "github.com/iotaledger/goshimmer/packages/shutdown" + "github.com/iotaledger/goshimmer/packages/node/shutdown" analysisserver "github.com/iotaledger/goshimmer/plugins/analysis/server" ) diff --git a/plugins/analysis/dashboard/frontend/src/app/App.tsx b/plugins/analysis/dashboard/frontend/src/app/App.tsx index e6466e2fb1..aea6bc08bc 100644 --- a/plugins/analysis/dashboard/frontend/src/app/App.tsx +++ b/plugins/analysis/dashboard/frontend/src/app/App.tsx @@ -1,10 +1,10 @@ -import { inject, observer } from "mobx-react"; -import React, { ReactNode } from "react"; -import { hot } from "react-hot-loader/root"; -import { withRouter } from "react-router"; -import { Link, Redirect, Route, Switch } from "react-router-dom"; +import {inject, observer} from "mobx-react"; +import React, {ReactNode} from "react"; +import {hot} from "react-hot-loader/root"; +import {withRouter} from "react-router"; +import {Link, Redirect, Route, Switch} from "react-router-dom"; import "./App.scss"; -import { AppProps } from "./AppProps"; +import {AppProps} from "./AppProps"; import Autopeering from "./components/Autopeering/Autopeering"; import Mana from "./components/Mana/Mana"; diff --git a/plugins/analysis/dashboard/frontend/src/app/AppProps.tsx b/plugins/analysis/dashboard/frontend/src/app/AppProps.tsx index 9310d3da54..a4e582e7a4 100644 --- a/plugins/analysis/dashboard/frontend/src/app/AppProps.tsx +++ b/plugins/analysis/dashboard/frontend/src/app/AppProps.tsx @@ -1,5 +1,5 @@ -import { AutopeeringStore } from "./stores/AutopeeringStore"; -import { RouteComponentProps } from "react-router"; +import {AutopeeringStore} from "./stores/AutopeeringStore"; +import {RouteComponentProps} from "react-router"; export interface AppProps extends RouteComponentProps { autopeeringStore: AutopeeringStore; diff --git a/plugins/analysis/dashboard/frontend/src/app/components/Autopeering/Autopeering.tsx b/plugins/analysis/dashboard/frontend/src/app/components/Autopeering/Autopeering.tsx index 03278e116d..ea1bb9b93f 100644 --- a/plugins/analysis/dashboard/frontend/src/app/components/Autopeering/Autopeering.tsx +++ b/plugins/analysis/dashboard/frontend/src/app/components/Autopeering/Autopeering.tsx @@ -1,10 +1,10 @@ -import { shortenedIDCharCount } from "../../stores/AutopeeringStore"; +import {shortenedIDCharCount} from "../../stores/AutopeeringStore"; import classNames from "classnames"; -import { inject, observer } from "mobx-react"; -import React, { ReactNode } from "react"; +import {inject, observer} from "mobx-react"; +import React, {ReactNode} from "react"; import "./Autopeering.scss"; -import { AutopeeringProps } from "./AutopeeringProps"; -import { NodeView } from "./NodeView"; +import {AutopeeringProps} from "./AutopeeringProps"; +import {NodeView} from "./NodeView"; import BootstrapSwitchButton from 'bootstrap-switch-button-react' import ManaLegend from "../Mana/ManaLegend"; diff --git a/plugins/analysis/dashboard/frontend/src/app/components/Autopeering/AutopeeringProps.ts b/plugins/analysis/dashboard/frontend/src/app/components/Autopeering/AutopeeringProps.ts index 2542186b7a..ebf03eab5a 100644 --- a/plugins/analysis/dashboard/frontend/src/app/components/Autopeering/AutopeeringProps.ts +++ b/plugins/analysis/dashboard/frontend/src/app/components/Autopeering/AutopeeringProps.ts @@ -1,5 +1,5 @@ -import { AutopeeringStore } from "../../stores/AutopeeringStore"; -import { ManaStore } from "../../stores/ManaStore"; +import {AutopeeringStore} from "../../stores/AutopeeringStore"; +import {ManaStore} from "../../stores/ManaStore"; export interface AutopeeringProps { autopeeringStore: AutopeeringStore; diff --git a/plugins/analysis/dashboard/frontend/src/app/components/Autopeering/NodeView.tsx b/plugins/analysis/dashboard/frontend/src/app/components/Autopeering/NodeView.tsx index 44a574e728..c8383bb04a 100644 --- a/plugins/analysis/dashboard/frontend/src/app/components/Autopeering/NodeView.tsx +++ b/plugins/analysis/dashboard/frontend/src/app/components/Autopeering/NodeView.tsx @@ -1,9 +1,9 @@ import classNames from "classnames"; -import { shortenedIDCharCount } from "../../stores/AutopeeringStore"; -import { inject, observer } from "mobx-react"; -import React, { ReactNode } from "react"; +import {shortenedIDCharCount} from "../../stores/AutopeeringStore"; +import {inject, observer} from "mobx-react"; +import React, {ReactNode} from "react"; import "./NodeView.scss"; -import { AutopeeringProps } from "./AutopeeringProps"; +import {AutopeeringProps} from "./AutopeeringProps"; @inject("autopeeringStore") @inject("manaStore") diff --git a/plugins/analysis/dashboard/frontend/src/app/models/blocks/IConflict.ts b/plugins/analysis/dashboard/frontend/src/app/models/blocks/IConflict.ts index 288cc4dfd0..df1ead5777 100644 --- a/plugins/analysis/dashboard/frontend/src/app/models/blocks/IConflict.ts +++ b/plugins/analysis/dashboard/frontend/src/app/models/blocks/IConflict.ts @@ -1,4 +1,4 @@ -import { IVoteContext } from "./IVoteContext"; +import {IVoteContext} from "./IVoteContext"; export interface IConflict { nodesview: { [id: string]: IVoteContext }; diff --git a/plugins/analysis/dashboard/frontend/src/app/models/ws/IWSBlk.ts b/plugins/analysis/dashboard/frontend/src/app/models/ws/IWSBlk.ts index 8d6165a13a..8826a27f0f 100644 --- a/plugins/analysis/dashboard/frontend/src/app/models/ws/IWSBlk.ts +++ b/plugins/analysis/dashboard/frontend/src/app/models/ws/IWSBlk.ts @@ -1,4 +1,4 @@ -import { WSBlkType } from "./wsBlkType"; +import {WSBlkType} from "./wsBlkType"; export interface WSBlock { type: WSBlkType; diff --git a/plugins/analysis/dashboard/frontend/src/app/services/WS.ts b/plugins/analysis/dashboard/frontend/src/app/services/WS.ts index 2564dd717e..988f3ede0c 100644 --- a/plugins/analysis/dashboard/frontend/src/app/services/WS.ts +++ b/plugins/analysis/dashboard/frontend/src/app/services/WS.ts @@ -1,9 +1,9 @@ -import { IAddNodeBlock } from "../models/blocks/IAddNodeBlock"; -import { IRemoveNodeBlock } from "../models/blocks/IRemoveNodeBlock"; -import { IConnectNodesBlock } from "../models/blocks/IConnectNodesBlock"; -import { IDisconnectNodesBlock } from "../models/blocks/IDisconnectNodesBlock"; -import { WSBlkType } from "../models/ws/wsBlkType"; -import { WSBlock } from "../models/ws/IWSBlk"; +import {IAddNodeBlock} from "../models/blocks/IAddNodeBlock"; +import {IRemoveNodeBlock} from "../models/blocks/IRemoveNodeBlock"; +import {IConnectNodesBlock} from "../models/blocks/IConnectNodesBlock"; +import {IDisconnectNodesBlock} from "../models/blocks/IDisconnectNodesBlock"; +import {WSBlkType} from "../models/ws/wsBlkType"; +import {WSBlock} from "../models/ws/IWSBlk"; type DataHandler = (data: T) => void; diff --git a/plugins/analysis/dashboard/frontend/src/app/services/WSmana.ts b/plugins/analysis/dashboard/frontend/src/app/services/WSmana.ts index 2d1a8178fd..75886f4e5e 100644 --- a/plugins/analysis/dashboard/frontend/src/app/services/WSmana.ts +++ b/plugins/analysis/dashboard/frontend/src/app/services/WSmana.ts @@ -1,9 +1,9 @@ -import { WSBlkTypeDashboard } from "../models/ws/WSBlkTypeDashboard"; -import { WSBlock } from "../models/ws/IWSBlk"; -import { IManaBlock } from "../models/mana/IManaBlock"; -import { INetworkManaBlock } from "../models/mana/INetworkManaBlock"; -import { IPledgeBlock } from "../models/mana/IPledgeBlock"; -import { IRevokeBlock } from "../models/mana/IRevokeBlock"; +import {WSBlkTypeDashboard} from "../models/ws/WSBlkTypeDashboard"; +import {WSBlock} from "../models/ws/IWSBlk"; +import {IManaBlock} from "../models/mana/IManaBlock"; +import {INetworkManaBlock} from "../models/mana/INetworkManaBlock"; +import {IPledgeBlock} from "../models/mana/IPledgeBlock"; +import {IRevokeBlock} from "../models/mana/IRevokeBlock"; type DataHandler = (data: T) => void; diff --git a/plugins/analysis/dashboard/frontend/src/app/stores/AutopeeringStore.tsx b/plugins/analysis/dashboard/frontend/src/app/stores/AutopeeringStore.tsx index 6da7fb2985..cce022b33a 100644 --- a/plugins/analysis/dashboard/frontend/src/app/stores/AutopeeringStore.tsx +++ b/plugins/analysis/dashboard/frontend/src/app/stores/AutopeeringStore.tsx @@ -1,16 +1,16 @@ -import { action, computed, observable, ObservableMap, ObservableSet } from "mobx"; +import {action, computed, observable, ObservableMap, ObservableSet} from "mobx"; import Viva from "vivagraphjs"; -import { INeighbors } from "../models/INeigbours"; -import { IAddNodeBlock } from "../models/blocks/IAddNodeBlock"; -import { IConnectNodesBlock } from "../models/blocks/IConnectNodesBlock"; -import { IDisconnectNodesBlock } from "../models/blocks/IDisconnectNodesBlock"; -import { IRemoveNodeBlock } from "../models/blocks/IRemoveNodeBlock"; -import { WSBlkType } from "../models/ws/wsBlkType"; -import { connectWebSocket, registerHandler } from "../services/WS"; -import { buildCircleNodeShader } from "../utils/circleNodeShader"; -import { parseColor } from "../utils/colorHelper"; -import { Neighbors } from "../models/Neighbors"; -import { manaStore } from "../../main"; +import {INeighbors} from "../models/INeigbours"; +import {IAddNodeBlock} from "../models/blocks/IAddNodeBlock"; +import {IConnectNodesBlock} from "../models/blocks/IConnectNodesBlock"; +import {IDisconnectNodesBlock} from "../models/blocks/IDisconnectNodesBlock"; +import {IRemoveNodeBlock} from "../models/blocks/IRemoveNodeBlock"; +import {WSBlkType} from "../models/ws/wsBlkType"; +import {connectWebSocket, registerHandler} from "../services/WS"; +import {buildCircleNodeShader} from "../utils/circleNodeShader"; +import {parseColor} from "../utils/colorHelper"; +import {Neighbors} from "../models/Neighbors"; +import {manaStore} from "../../main"; import tinycolor from "tinycolor2"; const EDGE_COLOR_DEFAULT = "#ff7d6cff"; diff --git a/plugins/analysis/dashboard/frontend/src/app/utils/circleNodeShader.ts b/plugins/analysis/dashboard/frontend/src/app/utils/circleNodeShader.ts index 2368320cca..ab6af96122 100644 --- a/plugins/analysis/dashboard/frontend/src/app/utils/circleNodeShader.ts +++ b/plugins/analysis/dashboard/frontend/src/app/utils/circleNodeShader.ts @@ -1,4 +1,3 @@ - import Viva from "vivagraphjs"; // Next comes the hard part - implementation of API for custom shader diff --git a/plugins/analysis/dashboard/frontend/src/assets/logo-header.svg b/plugins/analysis/dashboard/frontend/src/assets/logo-header.svg index e698bd5f4e..55fdff43cb 100644 --- a/plugins/analysis/dashboard/frontend/src/assets/logo-header.svg +++ b/plugins/analysis/dashboard/frontend/src/assets/logo-header.svg @@ -1 +1,3 @@ - \ No newline at end of file + + \ No newline at end of file diff --git a/plugins/analysis/dashboard/frontend/src/main.tsx b/plugins/analysis/dashboard/frontend/src/main.tsx index c62a25eaee..66dff13d73 100644 --- a/plugins/analysis/dashboard/frontend/src/main.tsx +++ b/plugins/analysis/dashboard/frontend/src/main.tsx @@ -1,10 +1,10 @@ import App from "./app/App"; -import { AutopeeringStore } from "./app/stores/AutopeeringStore"; -import { Provider } from "mobx-react"; +import {AutopeeringStore} from "./app/stores/AutopeeringStore"; +import {Provider} from "mobx-react"; import React from "react"; import ReactDOM from "react-dom"; -import { Route } from "react-router"; -import { BrowserRouter as Router } from "react-router-dom"; +import {Route} from "react-router"; +import {BrowserRouter as Router} from "react-router-dom"; import "./main.scss"; import ManaStore from "./app/stores/ManaStore"; diff --git a/plugins/analysis/dashboard/frontend/yarn.lock b/plugins/analysis/dashboard/frontend/yarn.lock index bd87343d7f..003c31648b 100644 --- a/plugins/analysis/dashboard/frontend/yarn.lock +++ b/plugins/analysis/dashboard/frontend/yarn.lock @@ -1085,9 +1085,9 @@ browserify-zlib@^0.2.0: pako "~1.0.5" buffer-from@^1.0.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" - integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A== + version "1.1.2" + resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.2.tgz#2b146a6fd72e80b4f55d255f35ed59a3a9a41bd5" + integrity sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ== buffer-indexof@^1.0.0: version "1.1.1" @@ -5604,9 +5604,9 @@ source-map-resolve@^0.5.0: urix "^0.1.0" source-map-support@~0.5.12: - version "0.5.19" - resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.19.tgz#a98b62f86dcaf4f67399648c085291ab9e8fed61" - integrity sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw== + version "0.5.21" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.21.tgz#04fe7c7f9e1ed2d662233c28cb2b35b9f63f6e4f" + integrity sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w== dependencies: buffer-from "^1.0.0" source-map "^0.6.0" @@ -5906,9 +5906,9 @@ terser-webpack-plugin@^1.4.3: worker-farm "^1.7.0" terser@^4.1.2, terser@^4.6.3: - version "4.8.0" - resolved "https://registry.yarnpkg.com/terser/-/terser-4.8.0.tgz#63056343d7c70bb29f3af665865a46fe03a0df17" - integrity sha512-EAPipTNeWsb/3wLPeup1tVPaXfIaU68xMnVdPafIL1TV05OhASArYyIfFvnvJCNrR2NIOvDVNNTFRa+Re2MWyw== + version "4.8.1" + resolved "https://registry.yarnpkg.com/terser/-/terser-4.8.1.tgz#a00e5634562de2239fd404c649051bf6fc21144f" + integrity sha512-4GnLC0x667eJG0ewJTa6z/yXrbLGv80D9Ru6HIpCQmO+Q4PfEtBFi0ObSckqwL6VyQv/7ENJieXHo2ANmdQwgw== dependencies: commander "^2.20.0" source-map "~0.6.1" diff --git a/plugins/analysis/dashboard/parameters.go b/plugins/analysis/dashboard/parameters.go index 1fb67d320e..9babada56a 100644 --- a/plugins/analysis/dashboard/parameters.go +++ b/plugins/analysis/dashboard/parameters.go @@ -1,6 +1,6 @@ package dashboard -import "github.com/iotaledger/hive.go/configuration" +import "github.com/iotaledger/goshimmer/plugins/config" // ParametersDefinition contains the definition of the parameters used by the dasbhoard plugin. type ParametersDefinition struct { @@ -22,5 +22,5 @@ type ParametersDefinition struct { var Parameters = &ParametersDefinition{} func init() { - configuration.BindParameters(Parameters, "analysis.dashboard") + config.BindParameters(Parameters, "analysis.dashboard") } diff --git a/plugins/analysis/dashboard/plugin.go b/plugins/analysis/dashboard/plugin.go index cb6591da71..a70f0ff8ac 100644 --- a/plugins/analysis/dashboard/plugin.go +++ b/plugins/analysis/dashboard/plugin.go @@ -6,15 +6,15 @@ import ( "time" "github.com/cockroachdb/errors" - "github.com/iotaledger/hive.go/configuration" - "github.com/iotaledger/hive.go/daemon" - "github.com/iotaledger/hive.go/logger" - "github.com/iotaledger/hive.go/node" + "github.com/iotaledger/hive.go/core/configuration" + "github.com/iotaledger/hive.go/core/daemon" + "github.com/iotaledger/hive.go/core/logger" + "github.com/iotaledger/hive.go/core/node" "github.com/labstack/echo" "github.com/labstack/echo/middleware" "go.uber.org/dig" - "github.com/iotaledger/goshimmer/packages/shutdown" + "github.com/iotaledger/goshimmer/packages/node/shutdown" ) // PluginName is the name of the dashboard plugin. diff --git a/plugins/analysis/packet/heartbeat.go b/plugins/analysis/packet/heartbeat.go index 9ffd080d8a..5b4d051cf2 100644 --- a/plugins/analysis/packet/heartbeat.go +++ b/plugins/analysis/packet/heartbeat.go @@ -8,8 +8,8 @@ import ( "strings" "github.com/cockroachdb/errors" - "github.com/iotaledger/hive.go/protocol/message" - "github.com/iotaledger/hive.go/protocol/tlv" + "github.com/iotaledger/hive.go/core/protocol/message" + "github.com/iotaledger/hive.go/core/protocol/tlv" ) var ( diff --git a/plugins/analysis/packet/heartbeat_test.go b/plugins/analysis/packet/heartbeat_test.go index 5f61fb868f..932491a118 100644 --- a/plugins/analysis/packet/heartbeat_test.go +++ b/plugins/analysis/packet/heartbeat_test.go @@ -5,7 +5,7 @@ import ( "testing" "github.com/cockroachdb/errors" - "github.com/iotaledger/hive.go/protocol/tlv" + "github.com/iotaledger/hive.go/core/protocol/tlv" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/plugins/analysis/packet/metric_heartbeat.go b/plugins/analysis/packet/metric_heartbeat.go index 2f2205b9de..573aac79ee 100644 --- a/plugins/analysis/packet/metric_heartbeat.go +++ b/plugins/analysis/packet/metric_heartbeat.go @@ -7,8 +7,8 @@ import ( "github.com/cockroachdb/errors" - "github.com/iotaledger/hive.go/protocol/message" - "github.com/iotaledger/hive.go/protocol/tlv" + "github.com/iotaledger/hive.go/core/protocol/message" + "github.com/iotaledger/hive.go/core/protocol/tlv" "github.com/iotaledger/goshimmer/plugins/banner" ) diff --git a/plugins/analysis/packet/metric_heartbeat_test.go b/plugins/analysis/packet/metric_heartbeat_test.go index 6874d732ef..3d747ee1cc 100644 --- a/plugins/analysis/packet/metric_heartbeat_test.go +++ b/plugins/analysis/packet/metric_heartbeat_test.go @@ -6,8 +6,8 @@ import ( "testing" "time" - "github.com/iotaledger/hive.go/protocol/message" - "github.com/iotaledger/hive.go/protocol/tlv" + "github.com/iotaledger/hive.go/core/protocol/message" + "github.com/iotaledger/hive.go/core/protocol/tlv" "github.com/shirou/gopsutil/cpu" "github.com/stretchr/testify/require" diff --git a/plugins/analysis/packet/packet.go b/plugins/analysis/packet/packet.go index 5b60802737..ef6f0ded71 100644 --- a/plugins/analysis/packet/packet.go +++ b/plugins/analysis/packet/packet.go @@ -4,8 +4,8 @@ import ( "sync" "github.com/cockroachdb/errors" - "github.com/iotaledger/hive.go/protocol/message" - "github.com/iotaledger/hive.go/protocol/tlv" + "github.com/iotaledger/hive.go/core/protocol/message" + "github.com/iotaledger/hive.go/core/protocol/tlv" ) // ErrMalformedPacket is returned when malformed packets are tried to be parsed. diff --git a/plugins/analysis/packet/types.go b/plugins/analysis/packet/types.go index 1d7139582a..e02498c007 100644 --- a/plugins/analysis/packet/types.go +++ b/plugins/analysis/packet/types.go @@ -1,6 +1,6 @@ package packet -import "github.com/iotaledger/hive.go/protocol/message" +import "github.com/iotaledger/hive.go/core/protocol/message" const ( // MessageTypeHeartbeat defines the Heartbeat blk type. diff --git a/plugins/analysis/server/autopeering.go b/plugins/analysis/server/autopeering.go index e7bdc8293c..6dcf0c991e 100644 --- a/plugins/analysis/server/autopeering.go +++ b/plugins/analysis/server/autopeering.go @@ -6,11 +6,11 @@ import ( "sync" "time" - "github.com/iotaledger/hive.go/daemon" - "github.com/iotaledger/hive.go/identity" + "github.com/iotaledger/hive.go/core/daemon" + "github.com/iotaledger/hive.go/core/identity" - "github.com/iotaledger/goshimmer/packages/graph" - "github.com/iotaledger/goshimmer/packages/shutdown" + "github.com/iotaledger/goshimmer/packages/app/metrics/graph" + "github.com/iotaledger/goshimmer/packages/node/shutdown" "github.com/iotaledger/goshimmer/plugins/analysis/packet" ) diff --git a/plugins/analysis/server/events.go b/plugins/analysis/server/events.go index b31f7a377f..3468c4ae07 100644 --- a/plugins/analysis/server/events.go +++ b/plugins/analysis/server/events.go @@ -1,7 +1,7 @@ package server import ( - "github.com/iotaledger/hive.go/generics/event" + "github.com/iotaledger/hive.go/core/generics/event" "github.com/iotaledger/goshimmer/plugins/analysis/packet" ) diff --git a/plugins/analysis/server/plugin.go b/plugins/analysis/server/plugin.go index d99560885e..2bdae60039 100644 --- a/plugins/analysis/server/plugin.go +++ b/plugins/analysis/server/plugin.go @@ -9,18 +9,18 @@ import ( "time" "github.com/cockroachdb/errors" - "github.com/iotaledger/hive.go/configuration" - "github.com/iotaledger/hive.go/daemon" - "github.com/iotaledger/hive.go/generics/event" - "github.com/iotaledger/hive.go/logger" - "github.com/iotaledger/hive.go/network" - "github.com/iotaledger/hive.go/network/tcp" - "github.com/iotaledger/hive.go/node" - "github.com/iotaledger/hive.go/protocol" + "github.com/iotaledger/hive.go/core/configuration" + "github.com/iotaledger/hive.go/core/daemon" + "github.com/iotaledger/hive.go/core/generics/event" + "github.com/iotaledger/hive.go/core/logger" + "github.com/iotaledger/hive.go/core/network" + "github.com/iotaledger/hive.go/core/network/tcp" + "github.com/iotaledger/hive.go/core/node" + "github.com/iotaledger/hive.go/core/protocol" flag "github.com/spf13/pflag" "go.uber.org/dig" - "github.com/iotaledger/goshimmer/packages/shutdown" + "github.com/iotaledger/goshimmer/packages/node/shutdown" "github.com/iotaledger/goshimmer/plugins/analysis/packet" ) diff --git a/plugins/autopeering/discovery/discovery.go b/plugins/autopeering/discovery/discovery.go index 4f7b449351..fa8fc1b0dc 100644 --- a/plugins/autopeering/discovery/discovery.go +++ b/plugins/autopeering/discovery/discovery.go @@ -6,12 +6,12 @@ import ( "strings" "github.com/cockroachdb/errors" - "github.com/iotaledger/hive.go/autopeering/discover" - "github.com/iotaledger/hive.go/autopeering/peer" - "github.com/iotaledger/hive.go/autopeering/peer/service" - "github.com/iotaledger/hive.go/crypto/ed25519" - "github.com/iotaledger/hive.go/identity" - "github.com/iotaledger/hive.go/logger" + "github.com/iotaledger/hive.go/core/autopeering/discover" + "github.com/iotaledger/hive.go/core/autopeering/peer" + "github.com/iotaledger/hive.go/core/autopeering/peer/service" + "github.com/iotaledger/hive.go/core/crypto/ed25519" + "github.com/iotaledger/hive.go/core/identity" + "github.com/iotaledger/hive.go/core/logger" "github.com/mr-tron/base58" ) diff --git a/plugins/autopeering/discovery/parameters.go b/plugins/autopeering/discovery/parameters.go index 5b8a52cfc3..2e08146383 100644 --- a/plugins/autopeering/discovery/parameters.go +++ b/plugins/autopeering/discovery/parameters.go @@ -1,11 +1,11 @@ package discovery -import "github.com/iotaledger/hive.go/configuration" +import "github.com/iotaledger/goshimmer/plugins/config" // ParametersDefinitionDiscovery contains the definition of configuration parameters used by the autopeering peer discovery. type ParametersDefinitionDiscovery struct { // NetworkVersion defines the config flag of the network version. - NetworkVersion uint32 `default:"61" usage:"autopeering network version"` + NetworkVersion uint32 `default:"62" usage:"autopeering network version"` // EntryNodes defines the config flag of the entry nodes. EntryNodes []string `default:"2PV5487xMw5rasGBXXWeqSi4hLz7r19YBt8Y1TGAsQbj@analysisentry-01.devnet.shimmer.iota.cafe:15626,5EDH4uY78EA6wrBkHHAVBWBMDt7EcksRq6pjzipoW15B@entry-0.devnet.tanglebay.com:14646,CAB87iQZR6BjBrCgEBupQJ4gpEBgvGKKv3uuGVRBKb4n@entry-1.devnet.tanglebay.com:14646" usage:"list of trusted entry nodes for auto peering"` @@ -15,5 +15,5 @@ type ParametersDefinitionDiscovery struct { var Parameters = &ParametersDefinitionDiscovery{} func init() { - configuration.BindParameters(Parameters, "autoPeering") + config.BindParameters(Parameters, "autoPeering") } diff --git a/plugins/autopeering/parameters.go b/plugins/autopeering/parameters.go index 53f1c64af4..95a3d6cd8d 100644 --- a/plugins/autopeering/parameters.go +++ b/plugins/autopeering/parameters.go @@ -1,6 +1,6 @@ package autopeering -import "github.com/iotaledger/hive.go/configuration" +import "github.com/iotaledger/goshimmer/plugins/config" // ParametersDefinition contains the definition of configuration parameters used by the autopeering plugin. type ParametersDefinition struct { @@ -21,5 +21,5 @@ type ParametersDefinition struct { var Parameters = &ParametersDefinition{} func init() { - configuration.BindParameters(Parameters, "autoPeering") + config.BindParameters(Parameters, "autoPeering") } diff --git a/plugins/autopeering/plugin.go b/plugins/autopeering/plugin.go index 1f8faf9724..7da7fd3427 100644 --- a/plugins/autopeering/plugin.go +++ b/plugins/autopeering/plugin.go @@ -7,19 +7,20 @@ import ( "go.uber.org/dig" - "github.com/iotaledger/hive.go/autopeering/discover" - "github.com/iotaledger/hive.go/autopeering/peer" - "github.com/iotaledger/hive.go/autopeering/peer/service" - "github.com/iotaledger/hive.go/autopeering/selection" - "github.com/iotaledger/hive.go/autopeering/server" - "github.com/iotaledger/hive.go/daemon" - "github.com/iotaledger/hive.go/generics/event" - "github.com/iotaledger/hive.go/node" - - "github.com/iotaledger/goshimmer/packages/mana" - net2 "github.com/iotaledger/goshimmer/packages/net" - "github.com/iotaledger/goshimmer/packages/p2p" - "github.com/iotaledger/goshimmer/packages/shutdown" + "github.com/iotaledger/hive.go/core/autopeering/discover" + "github.com/iotaledger/hive.go/core/autopeering/peer" + "github.com/iotaledger/hive.go/core/autopeering/peer/service" + "github.com/iotaledger/hive.go/core/autopeering/selection" + "github.com/iotaledger/hive.go/core/autopeering/server" + "github.com/iotaledger/hive.go/core/daemon" + "github.com/iotaledger/hive.go/core/generics/event" + "github.com/iotaledger/hive.go/core/node" + + "github.com/iotaledger/goshimmer/packages/core/mana" + + netPkg "github.com/iotaledger/goshimmer/packages/app/metrics/net" + "github.com/iotaledger/goshimmer/packages/node/p2p" + "github.com/iotaledger/goshimmer/packages/node/shutdown" "github.com/iotaledger/goshimmer/plugins/autopeering/discovery" ) @@ -42,7 +43,7 @@ type dependencies struct { Local *peer.Local P2PMgr *p2p.Manager `optional:"true"` ManaFunc mana.ManaRetrievalFunc `optional:"true" name:"manaFunc"` - AutoPeeringConnMetric *net2.ConnMetric + AutoPeeringConnMetric *netPkg.ConnMetric } func init() { @@ -63,8 +64,8 @@ func init() { Plugin.Panic(err) } - if err := event.Container.Provide(func() *net2.ConnMetric { - return &net2.ConnMetric{} + if err := event.Container.Provide(func() *netPkg.ConnMetric { + return &netPkg.ConnMetric{} }); err != nil { Plugin.Panic(err) } @@ -77,12 +78,12 @@ func configure(_ *node.Plugin) { // resolve the bind address localAddr, err = net.ResolveUDPAddr("udp", Parameters.BindAddress) if err != nil { - Plugin.LogFatalf("bind address '%s' is invalid: %s", Parameters.BindAddress, err) + Plugin.LogFatalfAndExit("bind address '%s' is invalid: %s", Parameters.BindAddress, err) } // announce the peering service if err := deps.Local.UpdateService(service.PeeringKey, localAddr.Network(), localAddr.Port); err != nil { - Plugin.LogFatalf("could not update services: %s", err) + Plugin.LogFatalfAndExit("could not update services: %s", err) } if deps.P2PMgr != nil { diff --git a/plugins/autopeering/selection.go b/plugins/autopeering/selection.go index afdc8055aa..fb7cfabb06 100644 --- a/plugins/autopeering/selection.go +++ b/plugins/autopeering/selection.go @@ -1,12 +1,12 @@ package autopeering import ( - "github.com/iotaledger/hive.go/autopeering/discover" - "github.com/iotaledger/hive.go/autopeering/peer" - "github.com/iotaledger/hive.go/autopeering/peer/service" - "github.com/iotaledger/hive.go/autopeering/selection" - "github.com/iotaledger/hive.go/identity" - "github.com/iotaledger/hive.go/logger" + "github.com/iotaledger/hive.go/core/autopeering/discover" + "github.com/iotaledger/hive.go/core/autopeering/peer" + "github.com/iotaledger/hive.go/core/autopeering/peer/service" + "github.com/iotaledger/hive.go/core/autopeering/selection" + "github.com/iotaledger/hive.go/core/identity" + "github.com/iotaledger/hive.go/core/logger" ) func createPeerSel(localID *peer.Local, nbrDiscover *discover.Protocol) *selection.Protocol { diff --git a/plugins/banner/plugin.go b/plugins/banner/plugin.go index 6663594a75..803e817470 100644 --- a/plugins/banner/plugin.go +++ b/plugins/banner/plugin.go @@ -4,7 +4,7 @@ import ( "fmt" "strings" - "github.com/iotaledger/hive.go/node" + "github.com/iotaledger/hive.go/core/node" ) // PluginName is the name of the banner plugin. @@ -15,7 +15,7 @@ var ( Plugin = node.NewPlugin(PluginName, nil, node.Enabled, configure, run) // AppVersion version number - AppVersion = "v0.9.3" + AppVersion = "v0.9.4" // SimplifiedAppVersion is the version number without commit hash SimplifiedAppVersion = simplifiedVersion(AppVersion) ) diff --git a/plugins/blocklayer/acceptance_gadget.go b/plugins/blocklayer/acceptance_gadget.go index db44c15029..eacb518233 100644 --- a/plugins/blocklayer/acceptance_gadget.go +++ b/plugins/blocklayer/acceptance_gadget.go @@ -1,11 +1,11 @@ package blocklayer import ( - "github.com/iotaledger/hive.go/generics/event" - "github.com/iotaledger/hive.go/identity" + "github.com/iotaledger/hive.go/core/generics/event" + "github.com/iotaledger/hive.go/core/identity" - "github.com/iotaledger/goshimmer/packages/consensus/acceptance" - "github.com/iotaledger/goshimmer/packages/tangle" + "github.com/iotaledger/goshimmer/packages/core/consensus/acceptance" + "github.com/iotaledger/goshimmer/packages/core/tangleold" ) var acceptanceGadget *acceptance.Gadget @@ -16,19 +16,19 @@ func AcceptanceGadget() *acceptance.Gadget { } func configureFinality() { - deps.Tangle.ApprovalWeightManager.Events.MarkerWeightChanged.Attach(event.NewClosure(func(e *tangle.MarkerWeightChangedEvent) { + deps.Tangle.ApprovalWeightManager.Events.MarkerWeightChanged.Attach(event.NewClosure(func(e *tangleold.MarkerWeightChangedEvent) { if err := acceptanceGadget.HandleMarker(e.Marker, e.Weight); err != nil { Plugin.LogError(err) } })) - deps.Tangle.ApprovalWeightManager.Events.ConflictWeightChanged.Attach(event.NewClosure(func(e *tangle.ConflictWeightChangedEvent) { + deps.Tangle.ApprovalWeightManager.Events.ConflictWeightChanged.Attach(event.NewClosure(func(e *tangleold.ConflictWeightChangedEvent) { if err := acceptanceGadget.HandleConflict(e.ConflictID, e.Weight); err != nil { Plugin.LogError(err) } })) // we need to update the WeightProvider on confirmation - acceptanceGadget.Events().BlockAccepted.Attach(event.NewClosure(func(event *tangle.BlockAcceptedEvent) { + acceptanceGadget.Events().BlockAccepted.Attach(event.NewClosure(func(event *tangleold.BlockAcceptedEvent) { deps.Tangle.WeightProvider.Update(event.Block.IssuingTime(), identity.NewID(event.Block.IssuerPublicKey())) })) } diff --git a/plugins/blocklayer/mana_plugin.go b/plugins/blocklayer/mana_plugin.go index b87f65ac37..84743ac4df 100644 --- a/plugins/blocklayer/mana_plugin.go +++ b/plugins/blocklayer/mana_plugin.go @@ -6,28 +6,28 @@ import ( "sort" "time" - "github.com/iotaledger/goshimmer/packages/notarization" - "github.com/iotaledger/goshimmer/packages/p2p" + "github.com/iotaledger/goshimmer/packages/core/notarization" + db_pkg "github.com/iotaledger/goshimmer/packages/node/database" + "github.com/iotaledger/goshimmer/packages/node/p2p" + "github.com/iotaledger/goshimmer/packages/node/shutdown" - "github.com/cockroachdb/errors" "go.uber.org/dig" - "github.com/iotaledger/hive.go/daemon" - "github.com/iotaledger/hive.go/generics/event" - "github.com/iotaledger/hive.go/generics/objectstorage" - "github.com/iotaledger/hive.go/generics/set" - "github.com/iotaledger/hive.go/identity" - "github.com/iotaledger/hive.go/logger" - "github.com/iotaledger/hive.go/node" - - db_pkg "github.com/iotaledger/goshimmer/packages/database" - "github.com/iotaledger/goshimmer/packages/epoch" - "github.com/iotaledger/goshimmer/packages/ledger" - "github.com/iotaledger/goshimmer/packages/ledger/utxo" - "github.com/iotaledger/goshimmer/packages/ledger/vm/devnetvm" - "github.com/iotaledger/goshimmer/packages/mana" - "github.com/iotaledger/goshimmer/packages/shutdown" - "github.com/iotaledger/goshimmer/packages/snapshot" + "github.com/iotaledger/hive.go/core/daemon" + "github.com/iotaledger/hive.go/core/generics/event" + "github.com/iotaledger/hive.go/core/generics/objectstorage" + "github.com/iotaledger/hive.go/core/generics/set" + "github.com/iotaledger/hive.go/core/identity" + "github.com/iotaledger/hive.go/core/logger" + "github.com/iotaledger/hive.go/core/node" + + "github.com/iotaledger/goshimmer/packages/core/epoch" + "github.com/iotaledger/goshimmer/packages/core/ledger" + "github.com/iotaledger/goshimmer/packages/core/ledger/utxo" + "github.com/iotaledger/goshimmer/packages/core/ledger/vm/devnetvm" + "github.com/iotaledger/goshimmer/packages/core/mana" + + "github.com/iotaledger/goshimmer/packages/core/snapshot" ) const ( @@ -191,15 +191,71 @@ func runManaPlugin(_ *node.Plugin) { if !readStoredManaVectors() { // read snapshot file if Parameters.Snapshot.File != "" { - nodeSnapshot := new(snapshot.Snapshot) - if err := nodeSnapshot.FromFile(Parameters.Snapshot.File); err != nil { - Plugin.Panic("could not load snapshot from file", Parameters.Snapshot.File, err) + var cManaTargetEpoch epoch.Index + consensusManaByNode := map[identity.ID]float64{} + accessManaByNode := map[identity.ID]float64{} + processOutputs := func(outputsWithMetadata []*ledger.OutputWithMetadata, baseVector map[identity.ID]float64, areCreated bool) { + for _, outputWithMetadata := range outputsWithMetadata { + devnetOutput := outputWithMetadata.Output().(devnetvm.Output) + balance, exists := devnetOutput.Balances().Get(devnetvm.ColorIOTA) + if !exists { + continue + } + consensusManaPledgeID := outputWithMetadata.ConsensusManaPledgeID() + if areCreated { + baseVector[consensusManaPledgeID] += float64(balance) + } else { + baseVector[consensusManaPledgeID] -= float64(balance) + } + } + + return + } + + utxoStatesConsumer := func(outputsWithMetadatas []*ledger.OutputWithMetadata) { + processOutputs(outputsWithMetadatas, consensusManaByNode, true /* areCreated */) + processOutputs(outputsWithMetadatas, accessManaByNode, true /* areCreated */) + + } + + epochDiffsConsumer := func(header *ledger.SnapshotHeader, epochDiffs map[epoch.Index]*ledger.EpochDiff) { + // We fix the cMana vector a few epochs in the past with respect of the latest epoch in the snapshot. + for ei := header.FullEpochIndex + 1; ei <= cManaTargetEpoch; ei++ { + diff, exists := epochDiffs[ei] + if !exists { + panic(fmt.Sprintf("diff with index %d missing from snapshot", ei)) + } + processOutputs(diff.Created(), consensusManaByNode, true /* areCreated */) + processOutputs(diff.Created(), accessManaByNode, true /* areCreated */) + processOutputs(diff.Spent(), consensusManaByNode, false /* areCreated */) + processOutputs(diff.Spent(), accessManaByNode, false /* areCreated */) + } + + // Only the aMana will be loaded until the latest snapshot's epoch + for ei := cManaTargetEpoch + 1; ei <= header.DiffEpochIndex; ei++ { + diff, exists := epochDiffs[ei] + if !exists { + panic(fmt.Sprintf("diff with index %d missing from snapshot", ei)) + } + processOutputs(diff.Created(), accessManaByNode, true /* areCreated */) + processOutputs(diff.Spent(), accessManaByNode, false /* areCreated */) + } } - if err := loadSnapshot(nodeSnapshot.LedgerSnapshot); err != nil { - Plugin.Panicf("Couldn't load snapshot: %s", err) + headerConsumer := func(header *ledger.SnapshotHeader) { + cManaTargetEpoch = header.DiffEpochIndex - epoch.Index(ManaParameters.EpochDelay) + if cManaTargetEpoch < 0 { + cManaTargetEpoch = 0 + } + } + if err := snapshot.LoadSnapshot(Parameters.Snapshot.File, headerConsumer, utxoStatesConsumer, epochDiffsConsumer); err != nil { + Plugin.Panic("could not load snapshot from file", Parameters.Snapshot.File, err) + } + baseManaVectors[mana.ConsensusMana].InitializeWithData(consensusManaByNode) + baseManaVectors[mana.AccessMana].InitializeWithData(accessManaByNode) + // initialize cMana WeightProvider with snapshot // TODO: consume the activity record from the snapshot to determine which nodes were active at the time of the snapshot t := deps.Tangle.Options.GenesisTime @@ -754,61 +810,3 @@ func QueryAllowed() (allowed bool) { // query allowed only when base mana vectors have been initialized return len(baseManaVectors) > 0 } - -// loadSnapshot loads the tx snapshot and the access mana snapshot, sorts it and loads it into the various mana versions. -func loadSnapshot(snapshot *ledger.Snapshot) error { - consensusManaByNode := map[identity.ID]float64{} - accessManaByNode := map[identity.ID]float64{} - processOutputs := func(outputsWithMetadata []*ledger.OutputWithMetadata, baseVector map[identity.ID]float64, areCreated bool) { - for _, outputWithMetadata := range outputsWithMetadata { - devnetOutput := outputWithMetadata.Output().(devnetvm.Output) - balance, exists := devnetOutput.Balances().Get(devnetvm.ColorIOTA) - if !exists { - continue - } - consensusManaPledgeID := outputWithMetadata.ConsensusManaPledgeID() - if areCreated { - baseVector[consensusManaPledgeID] += float64(balance) - } else { - baseVector[consensusManaPledgeID] -= float64(balance) - } - } - - return - } - - processOutputs(snapshot.OutputsWithMetadata, consensusManaByNode, true /* areCreated */) - processOutputs(snapshot.OutputsWithMetadata, accessManaByNode, true /* areCreated */) - - cManaTargetEpoch := snapshot.DiffEpochIndex - epoch.Index(ManaParameters.EpochDelay) - if cManaTargetEpoch < 0 { - cManaTargetEpoch = 0 - } - - // We fix the cMana vector a few epochs in the past with respect of the latest epoch in the snapshot. - for ei := snapshot.FullEpochIndex + 1; ei <= cManaTargetEpoch; ei++ { - diff, exists := snapshot.EpochDiffs[ei] - if !exists { - return errors.Errorf("diff with index %d missing from snapshot", ei) - } - processOutputs(diff.Created(), consensusManaByNode, true /* areCreated */) - processOutputs(diff.Created(), accessManaByNode, true /* areCreated */) - processOutputs(diff.Spent(), consensusManaByNode, false /* areCreated */) - processOutputs(diff.Spent(), accessManaByNode, false /* areCreated */) - } - - // Only the aMana will be loaded until the latest snapshot's epoch - for ei := cManaTargetEpoch + 1; ei <= snapshot.DiffEpochIndex; ei++ { - diff, exists := snapshot.EpochDiffs[ei] - if !exists { - return errors.Errorf("diff with index %d missing from snapshot", ei) - } - processOutputs(diff.Created(), accessManaByNode, true /* areCreated */) - processOutputs(diff.Spent(), accessManaByNode, false /* areCreated */) - } - - baseManaVectors[mana.ConsensusMana].InitializeWithData(consensusManaByNode) - baseManaVectors[mana.AccessMana].InitializeWithData(accessManaByNode) - - return nil -} diff --git a/plugins/blocklayer/notarization_plugin.go b/plugins/blocklayer/notarization_plugin.go index 1b89a5b3d3..ff208e957b 100644 --- a/plugins/blocklayer/notarization_plugin.go +++ b/plugins/blocklayer/notarization_plugin.go @@ -3,16 +3,18 @@ package blocklayer import ( "context" - "github.com/iotaledger/hive.go/daemon" - "github.com/iotaledger/hive.go/generics/event" - "github.com/iotaledger/hive.go/kvstore" - "github.com/iotaledger/hive.go/node" + "github.com/iotaledger/hive.go/core/daemon" + "github.com/iotaledger/hive.go/core/generics/event" + "github.com/iotaledger/hive.go/core/kvstore" + "github.com/iotaledger/hive.go/core/node" "go.uber.org/dig" - "github.com/iotaledger/goshimmer/packages/epoch" - "github.com/iotaledger/goshimmer/packages/notarization" - "github.com/iotaledger/goshimmer/packages/shutdown" - "github.com/iotaledger/goshimmer/packages/tangle" + "github.com/iotaledger/goshimmer/packages/core/notarization" + "github.com/iotaledger/goshimmer/packages/core/snapshot" + "github.com/iotaledger/goshimmer/packages/node/shutdown" + + "github.com/iotaledger/goshimmer/packages/core/epoch" + "github.com/iotaledger/goshimmer/packages/core/tangleold" ) const ( @@ -23,14 +25,14 @@ const ( type notarizationPluginDependencies struct { dig.In - Tangle *tangle.Tangle + Tangle *tangleold.Tangle Manager *notarization.Manager } type notarizationManagerDependencies struct { dig.In - Tangle *tangle.Tangle + Tangle *tangleold.Tangle Storage kvstore.KVStore } @@ -50,8 +52,14 @@ func init() { } func configureNotarizationPlugin(plugin *node.Plugin) { - if nodeSnapshot != nil { - notarizationDeps.Manager.LoadSnapshot(nodeSnapshot.LedgerSnapshot) + if Parameters.Snapshot.File != "" { + err := snapshot.LoadSnapshot(Parameters.Snapshot.File, + notarizationDeps.Manager.LoadECandEIs, + notarizationDeps.Manager.LoadOutputsWithMetadata, + notarizationDeps.Manager.LoadEpochDiffs) + if err != nil { + plugin.Panic("could not load snapshot file:", err) + } } // attach mana plugin event after notarization manager has been initialized notarizationDeps.Manager.Events.ManaVectorUpdate.Hook(onManaVectorToUpdateClosure) diff --git a/plugins/blocklayer/parameters.go b/plugins/blocklayer/parameters.go index 67924598c5..2bfdd9279b 100644 --- a/plugins/blocklayer/parameters.go +++ b/plugins/blocklayer/parameters.go @@ -3,7 +3,7 @@ package blocklayer import ( "time" - "github.com/iotaledger/hive.go/configuration" + "github.com/iotaledger/goshimmer/plugins/config" ) // ParametersDefinition contains the definition of the parameters used by the blocklayer plugin. @@ -21,7 +21,7 @@ type ParametersDefinition struct { } // TangleTimeWindow defines the time window in which the node considers itself as synced according to TangleTime. - TangleTimeWindow time.Duration `default:"20m" usage:"the time window in which the node considers itself as synced according to TangleTime"` + TangleTimeWindow time.Duration `default:"20s" usage:"the time window in which the node considers itself as synced according to TangleTime"` // StartSynced defines if the node should start as synced. StartSynced bool `default:"false" usage:"start as synced"` @@ -99,9 +99,9 @@ var SchedulerParameters = &SchedulerParametersDefinition{} var NotarizationParameters = &NotarizationParametersDefinition{} func init() { - configuration.BindParameters(Parameters, "blockLayer") - configuration.BindParameters(ManaParameters, "mana") - configuration.BindParameters(RateSetterParameters, "rateSetter") - configuration.BindParameters(SchedulerParameters, "scheduler") - configuration.BindParameters(NotarizationParameters, "notarization") + config.BindParameters(Parameters, "blockLayer") + config.BindParameters(ManaParameters, "mana") + config.BindParameters(RateSetterParameters, "rateSetter") + config.BindParameters(SchedulerParameters, "scheduler") + config.BindParameters(NotarizationParameters, "notarization") } diff --git a/plugins/blocklayer/plugin.go b/plugins/blocklayer/plugin.go index a1ea7ccaea..2281e87526 100644 --- a/plugins/blocklayer/plugin.go +++ b/plugins/blocklayer/plugin.go @@ -5,29 +5,32 @@ import ( "time" "github.com/cockroachdb/errors" - "github.com/iotaledger/hive.go/generics/lo" + "github.com/iotaledger/hive.go/core/generics/lo" "go.uber.org/dig" - "github.com/iotaledger/hive.go/autopeering/discover" - "github.com/iotaledger/hive.go/autopeering/peer" - "github.com/iotaledger/hive.go/crypto/ed25519" - "github.com/iotaledger/hive.go/daemon" - "github.com/iotaledger/hive.go/generics/event" - "github.com/iotaledger/hive.go/identity" - "github.com/iotaledger/hive.go/kvstore" - "github.com/iotaledger/hive.go/node" - - "github.com/iotaledger/goshimmer/packages/consensus/acceptance" - "github.com/iotaledger/goshimmer/packages/consensus/otv" - "github.com/iotaledger/goshimmer/packages/epoch" - "github.com/iotaledger/goshimmer/packages/ledger/utxo" - "github.com/iotaledger/goshimmer/packages/ledger/vm/devnetvm" - "github.com/iotaledger/goshimmer/packages/ledger/vm/devnetvm/indexer" - "github.com/iotaledger/goshimmer/packages/mana" - "github.com/iotaledger/goshimmer/packages/notarization" - "github.com/iotaledger/goshimmer/packages/shutdown" - "github.com/iotaledger/goshimmer/packages/snapshot" - "github.com/iotaledger/goshimmer/packages/tangle" + "github.com/iotaledger/hive.go/core/autopeering/discover" + "github.com/iotaledger/hive.go/core/autopeering/peer" + "github.com/iotaledger/hive.go/core/crypto/ed25519" + "github.com/iotaledger/hive.go/core/daemon" + "github.com/iotaledger/hive.go/core/generics/event" + "github.com/iotaledger/hive.go/core/identity" + "github.com/iotaledger/hive.go/core/kvstore" + "github.com/iotaledger/hive.go/core/node" + + "github.com/iotaledger/goshimmer/packages/core/epoch" + "github.com/iotaledger/goshimmer/packages/core/ledger" + "github.com/iotaledger/goshimmer/packages/core/ledger/utxo" + "github.com/iotaledger/goshimmer/packages/core/ledger/vm/devnetvm" + "github.com/iotaledger/goshimmer/packages/core/ledger/vm/devnetvm/indexer" + "github.com/iotaledger/goshimmer/packages/core/mana" + "github.com/iotaledger/goshimmer/packages/core/tangleold" + + "github.com/iotaledger/goshimmer/packages/core/snapshot" + + "github.com/iotaledger/goshimmer/packages/core/consensus/acceptance" + "github.com/iotaledger/goshimmer/packages/core/consensus/otv" + "github.com/iotaledger/goshimmer/packages/core/notarization" + "github.com/iotaledger/goshimmer/packages/node/shutdown" "github.com/iotaledger/goshimmer/plugins/database" "github.com/iotaledger/goshimmer/plugins/remotelog" ) @@ -46,15 +49,14 @@ var ( var ( // Plugin is the plugin instance of the blocklayer plugin. - Plugin *node.Plugin - deps = new(dependencies) - nodeSnapshot *snapshot.Snapshot + Plugin *node.Plugin + deps = new(dependencies) ) type dependencies struct { dig.In - Tangle *tangle.Tangle + Tangle *tangleold.Tangle Indexer *indexer.Indexer Local *peer.Local Discover *discover.Protocol `optional:"true"` @@ -73,7 +75,7 @@ type tangledeps struct { type indexerdeps struct { dig.In - Tangle *tangle.Tangle + Tangle *tangleold.Tangle } func init() { @@ -106,37 +108,37 @@ func configure(plugin *node.Plugin) { })) // Blocks created by the node need to pass through the normal flow. - deps.Tangle.RateSetter.Events.BlockIssued.Attach(event.NewClosure(func(event *tangle.BlockConstructedEvent) { + deps.Tangle.RateSetter.Events.BlockIssued.Attach(event.NewClosure(func(event *tangleold.BlockConstructedEvent) { deps.Tangle.ProcessGossipBlock(lo.PanicOnErr(event.Block.Bytes()), deps.Local.Peer) })) - deps.Tangle.Booker.Events.BlockBooked.Attach(event.NewClosure(func(event *tangle.BlockBookedEvent) { - deps.Tangle.Storage.Block(event.BlockID).Consume(func(block *tangle.Block) { + deps.Tangle.Booker.Events.BlockBooked.Attach(event.NewClosure(func(event *tangleold.BlockBookedEvent) { + deps.Tangle.Storage.Block(event.BlockID).Consume(func(block *tangleold.Block) { deps.Tangle.WeightProvider.Update(block.IssuingTime(), identity.NewID(block.IssuerPublicKey())) }) })) - deps.Tangle.Parser.Events.BlockRejected.Attach(event.NewClosure(func(event *tangle.BlockRejectedEvent) { + deps.Tangle.Parser.Events.BlockRejected.Attach(event.NewClosure(func(event *tangleold.BlockRejectedEvent) { plugin.LogInfof("block with %s rejected in Parser: %v", event.Block.ID().Base58(), event.Error) })) - deps.Tangle.Parser.Events.BytesRejected.Attach(event.NewClosure(func(event *tangle.BytesRejectedEvent) { - if errors.Is(event.Error, tangle.ErrReceivedDuplicateBytes) { + deps.Tangle.Parser.Events.BytesRejected.Attach(event.NewClosure(func(event *tangleold.BytesRejectedEvent) { + if errors.Is(event.Error, tangleold.ErrReceivedDuplicateBytes) { return } plugin.LogWarnf("bytes rejected from peer %s: %v", event.Peer.ID(), event.Error) })) - deps.Tangle.Scheduler.Events.BlockDiscarded.Attach(event.NewClosure(func(event *tangle.BlockDiscardedEvent) { + deps.Tangle.Scheduler.Events.BlockDiscarded.Attach(event.NewClosure(func(event *tangleold.BlockDiscardedEvent) { plugin.LogInfof("block rejected in Scheduler: %s", event.BlockID.Base58()) })) - deps.Tangle.Scheduler.Events.NodeBlacklisted.Attach(event.NewClosure(func(event *tangle.NodeBlacklistedEvent) { + deps.Tangle.Scheduler.Events.NodeBlacklisted.Attach(event.NewClosure(func(event *tangleold.NodeBlacklistedEvent) { plugin.LogInfof("node %s is blacklisted in Scheduler", event.NodeID.String()) })) - deps.Tangle.TimeManager.Events.SyncChanged.Attach(event.NewClosure(func(event *tangle.SyncChangedEvent) { + deps.Tangle.TimeManager.Events.SyncChanged.Attach(event.NewClosure(func(event *tangleold.SyncChangedEvent) { plugin.LogInfo("Sync changed: ", event.Synced) })) @@ -144,23 +146,30 @@ func configure(plugin *node.Plugin) { if loaded, _ := deps.Storage.Has(snapshotLoadedKey); !loaded && Parameters.Snapshot.File != "" { plugin.LogInfof("reading snapshot from %s ...", Parameters.Snapshot.File) - nodeSnapshot = new(snapshot.Snapshot) - err := nodeSnapshot.FromFile(Parameters.Snapshot.File) - if err != nil { - plugin.Panic("could not load snapshot file:", err) + utxoStatesConsumer := func(outputsWithMetadatas []*ledger.OutputWithMetadata) { + deps.Tangle.Ledger.LoadOutputWithMetadatas(outputsWithMetadatas) + for _, outputWithMetadata := range outputsWithMetadatas { + deps.Indexer.IndexOutput(outputWithMetadata.Output().(devnetvm.Output)) + } } - deps.Tangle.Ledger.LoadSnapshot(nodeSnapshot.LedgerSnapshot) - - // Add outputs to Indexer. - for _, outputWithMetadata := range nodeSnapshot.LedgerSnapshot.OutputsWithMetadata { - deps.Indexer.IndexOutput(outputWithMetadata.Output().(devnetvm.Output)) + epochDiffsConsumer := func(header *ledger.SnapshotHeader, epochDiffs map[epoch.Index]*ledger.EpochDiff) { + err := deps.Tangle.Ledger.LoadEpochDiffs(header, epochDiffs) + if err != nil { + panic(err) + } + for _, epochDiff := range epochDiffs { + for _, outputWithMetadata := range epochDiff.Created() { + deps.Indexer.IndexOutput(outputWithMetadata.Output().(devnetvm.Output)) + } + } } - for _, epochDiff := range nodeSnapshot.LedgerSnapshot.EpochDiffs { - for _, outputWithMetadata := range epochDiff.Created() { - deps.Indexer.IndexOutput(outputWithMetadata.Output().(devnetvm.Output)) - } + headerConsumer := func(*ledger.SnapshotHeader) {} + + err := snapshot.LoadSnapshot(Parameters.Snapshot.File, headerConsumer, utxoStatesConsumer, epochDiffsConsumer) + if err != nil { + plugin.Panic("could not load snapshot file:", err) } plugin.LogInfof("reading snapshot from %s ... done", Parameters.Snapshot.File) @@ -188,23 +197,23 @@ func run(*node.Plugin) { // region Tangle /////////////////////////////////////////////////////////////////////////////////////////////////////// -var tangleInstance *tangle.Tangle +var tangleInstance *tangleold.Tangle // newTangle gets the tangle instance. -func newTangle(tangleDeps tangledeps) *tangle.Tangle { +func newTangle(tangleDeps tangledeps) *tangleold.Tangle { // TODO: this should use the time from the snapshot instead of epoch.GenesisTime genesisTime := time.Unix(epoch.GenesisTime, 0) if Parameters.GenesisTime > 0 { genesisTime = time.Unix(Parameters.GenesisTime, 0) } - tangleInstance = tangle.New( - tangle.Store(tangleDeps.Storage), - tangle.Identity(tangleDeps.Local.LocalIdentity()), - tangle.Width(Parameters.TangleWidth), - tangle.TimeSinceConfirmationThreshold(Parameters.TimeSinceConfirmationThreshold), - tangle.GenesisNode(Parameters.Snapshot.GenesisNode), - tangle.SchedulerConfig(tangle.SchedulerParams{ + tangleInstance = tangleold.New( + tangleold.Store(tangleDeps.Storage), + tangleold.Identity(tangleDeps.Local.LocalIdentity()), + tangleold.Width(Parameters.TangleWidth), + tangleold.TimeSinceConfirmationThreshold(Parameters.TimeSinceConfirmationThreshold), + tangleold.GenesisNode(Parameters.Snapshot.GenesisNode), + tangleold.SchedulerConfig(tangleold.SchedulerParams{ MaxBufferSize: SchedulerParameters.MaxBufferSize, TotalSupply: 2779530283277761, ConfirmedBlockScheduleThreshold: parseDuration(SchedulerParameters.ConfirmedBlockThreshold), @@ -212,21 +221,21 @@ func newTangle(tangleDeps tangledeps) *tangle.Tangle { AccessManaMapRetrieverFunc: accessManaMapRetriever, TotalAccessManaRetrieveFunc: totalAccessManaRetriever, }), - tangle.RateSetterConfig(tangle.RateSetterParams{ + tangleold.RateSetterConfig(tangleold.RateSetterParams{ Initial: RateSetterParameters.Initial, RateSettingPause: RateSetterParameters.RateSettingPause, Enabled: RateSetterParameters.Enable, }), - tangle.GenesisTime(genesisTime), - tangle.SyncTimeWindow(Parameters.TangleTimeWindow), - tangle.StartSynced(Parameters.StartSynced), - tangle.CacheTimeProvider(database.CacheTimeProvider()), - tangle.CommitmentFunc(GetLatestEC), + tangleold.GenesisTime(genesisTime), + tangleold.SyncTimeWindow(Parameters.TangleTimeWindow), + tangleold.StartSynced(Parameters.StartSynced), + tangleold.CacheTimeProvider(database.CacheTimeProvider()), + tangleold.CommitmentFunc(GetLatestEC), ) - tangleInstance.Scheduler = tangle.NewScheduler(tangleInstance) - tangleInstance.WeightProvider = tangle.NewCManaWeightProvider(GetCMana, tangleInstance.TimeManager.ActivityTime, tangleDeps.Storage) - tangleInstance.OTVConsensusManager = tangle.NewOTVConsensusManager(otv.NewOnTangleVoting(tangleInstance.Ledger.ConflictDAG, tangleInstance.ApprovalWeightManager.WeightOfConflict)) + tangleInstance.Scheduler = tangleold.NewScheduler(tangleInstance) + tangleInstance.WeightProvider = tangleold.NewCManaWeightProvider(GetCMana, tangleInstance.TimeManager.ActivityTime, tangleDeps.Storage) + tangleInstance.OTVConsensusManager = tangleold.NewOTVConsensusManager(otv.NewOnTangleVoting(tangleInstance.Ledger.ConflictDAG, tangleInstance.ApprovalWeightManager.WeightOfConflict)) acceptanceGadget = acceptance.NewSimpleFinalityGadget(tangleInstance) tangleInstance.ConfirmationOracle = acceptanceGadget @@ -271,7 +280,7 @@ func totalAccessManaRetriever() float64 { // endregion /////////////////////////////////////////////////////////////////////////////////////////////////////////// // AwaitBlockToBeBooked awaits maxAwait for the given block to get booked. -func AwaitBlockToBeBooked(f func() (*tangle.Block, error), txID utxo.TransactionID, maxAwait time.Duration) (*tangle.Block, error) { +func AwaitBlockToBeBooked(f func() (*tangleold.Block, error), txID utxo.TransactionID, maxAwait time.Duration) (*tangleold.Block, error) { // first subscribe to the transaction booked event booked := make(chan struct{}, 1) // exit is used to let the caller exit if for whatever @@ -279,9 +288,9 @@ func AwaitBlockToBeBooked(f func() (*tangle.Block, error), txID utxo.Transaction exit := make(chan struct{}) defer close(exit) - closure := event.NewClosure(func(event *tangle.BlockBookedEvent) { + closure := event.NewClosure(func(event *tangleold.BlockBookedEvent) { match := false - deps.Tangle.Storage.Block(event.BlockID).Consume(func(block *tangle.Block) { + deps.Tangle.Storage.Block(event.BlockID).Consume(func(block *tangleold.Block) { if block.Payload().Type() == devnetvm.TransactionType { tx := block.Payload().(*devnetvm.Transaction) if tx.ID() == txID { @@ -317,13 +326,13 @@ func AwaitBlockToBeBooked(f func() (*tangle.Block, error), txID utxo.Transaction } // AwaitBlockToBeIssued awaits maxAwait for the given block to get issued. -func AwaitBlockToBeIssued(f func() (*tangle.Block, error), issuer ed25519.PublicKey, maxAwait time.Duration) (*tangle.Block, error) { - issued := make(chan *tangle.Block, 1) +func AwaitBlockToBeIssued(f func() (*tangleold.Block, error), issuer ed25519.PublicKey, maxAwait time.Duration) (*tangleold.Block, error) { + issued := make(chan *tangleold.Block, 1) exit := make(chan struct{}) defer close(exit) - closure := event.NewClosure(func(event *tangle.BlockScheduledEvent) { - deps.Tangle.Storage.Block(event.BlockID).Consume(func(block *tangle.Block) { + closure := event.NewClosure(func(event *tangleold.BlockScheduledEvent) { + deps.Tangle.Storage.Block(event.BlockID).Consume(func(block *tangleold.Block) { if block.IssuerPublicKey() != issuer { return } @@ -338,14 +347,14 @@ func AwaitBlockToBeIssued(f func() (*tangle.Block, error), issuer ed25519.Public // channel to receive the result of issuance issueResult := make(chan struct { - blk *tangle.Block + blk *tangleold.Block err error }, 1) go func() { blk, err := f() issueResult <- struct { - blk *tangle.Block + blk *tangleold.Block err error }{blk: blk, err: err} }() diff --git a/plugins/bootstrapmanager/plugin.go b/plugins/bootstrapmanager/plugin.go index c0e44b0137..51b8b05b76 100644 --- a/plugins/bootstrapmanager/plugin.go +++ b/plugins/bootstrapmanager/plugin.go @@ -3,12 +3,12 @@ package bootstrapmanager import ( "go.uber.org/dig" - "github.com/iotaledger/hive.go/generics/event" - "github.com/iotaledger/hive.go/node" + "github.com/iotaledger/hive.go/core/generics/event" + "github.com/iotaledger/hive.go/core/node" - "github.com/iotaledger/goshimmer/packages/bootstrapmanager" - "github.com/iotaledger/goshimmer/packages/notarization" - "github.com/iotaledger/goshimmer/packages/tangle" + "github.com/iotaledger/goshimmer/packages/core/bootstrapmanager" + "github.com/iotaledger/goshimmer/packages/core/notarization" + "github.com/iotaledger/goshimmer/packages/core/tangleold" ) // region Plugin /////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -23,14 +23,14 @@ var ( type dependencies struct { dig.In - Tangle *tangle.Tangle + Tangle *tangleold.Tangle NotarizationMgr *notarization.Manager } type pluginDependencies struct { dig.In - Tangle *tangle.Tangle + Tangle *tangleold.Tangle NotarizationMgr *notarization.Manager BootstrapManager *bootstrapmanager.Manager } diff --git a/plugins/broadcast/plugin.go b/plugins/broadcast/plugin.go index 1eec2b5302..06f81e49ab 100644 --- a/plugins/broadcast/plugin.go +++ b/plugins/broadcast/plugin.go @@ -3,13 +3,14 @@ package broadcast import ( "context" - "github.com/iotaledger/hive.go/configuration" - "github.com/iotaledger/hive.go/daemon" - "github.com/iotaledger/hive.go/generics/event" - "github.com/iotaledger/hive.go/node" + "github.com/iotaledger/hive.go/core/daemon" + "github.com/iotaledger/hive.go/core/generics/event" + "github.com/iotaledger/hive.go/core/node" - "github.com/iotaledger/goshimmer/packages/shutdown" - "github.com/iotaledger/goshimmer/packages/tangle" + "github.com/iotaledger/goshimmer/packages/core/tangleold" + "github.com/iotaledger/goshimmer/plugins/config" + + "github.com/iotaledger/goshimmer/packages/node/shutdown" "github.com/iotaledger/goshimmer/plugins/broadcast/server" ) @@ -24,12 +25,12 @@ var ( ) type dependencies struct { - Tangle *tangle.Tangle + Tangle *tangleold.Tangle } func init() { Plugin = node.NewPlugin(pluginName, deps, node.Disabled, run) - configuration.BindParameters(Parameters, "Broadcast") + config.BindParameters(Parameters, "Broadcast") } // ParametersDefinition contains the configuration parameters used by the plugin. @@ -50,11 +51,11 @@ func run(_ *node.Plugin) { } <-ctx.Done() }); err != nil { - Plugin.LogFatalf("Failed to start Broadcast daemon: %v", err) + Plugin.LogFatalfAndExit("Failed to start Broadcast daemon: %v", err) } // Get Blocks from node. - notifyNewBlk := event.NewClosure(func(event *tangle.BlockStoredEvent) { + notifyNewBlk := event.NewClosure(func(event *tangleold.BlockStoredEvent) { server.Broadcast([]byte(event.Block.String())) }) diff --git a/plugins/broadcast/server/server.go b/plugins/broadcast/server/server.go index 50ea08f1b2..b764f2fe4e 100644 --- a/plugins/broadcast/server/server.go +++ b/plugins/broadcast/server/server.go @@ -7,12 +7,12 @@ import ( "sync" "github.com/cockroachdb/errors" - "github.com/iotaledger/hive.go/generics/event" - "github.com/iotaledger/hive.go/netutil/buffconn" - "github.com/iotaledger/hive.go/node" + "github.com/iotaledger/hive.go/core/generics/event" + "github.com/iotaledger/hive.go/core/netutil/buffconn" + "github.com/iotaledger/hive.go/core/node" "go.uber.org/atomic" - "github.com/iotaledger/goshimmer/packages/tangle" + "github.com/iotaledger/goshimmer/packages/core/tangleold" ) type connection struct { @@ -74,7 +74,7 @@ func handleConnection(conn net.Conn, log *node.Plugin, shutdownSignal <-chan str idx := int(index.Load()) connectionList[idx] = connection{ - bufferedConn: buffconn.NewBufferedConnection(conn, tangle.MaxBlockSize), + bufferedConn: buffconn.NewBufferedConnection(conn, tangleold.MaxBlockSize), log: log, active: true, } diff --git a/plugins/chat/plugin.go b/plugins/chat/plugin.go index b433e41e23..65b92dc722 100644 --- a/plugins/chat/plugin.go +++ b/plugins/chat/plugin.go @@ -4,11 +4,11 @@ import ( "github.com/labstack/echo" "go.uber.org/dig" - "github.com/iotaledger/hive.go/generics/event" - "github.com/iotaledger/hive.go/node" + "github.com/iotaledger/hive.go/core/generics/event" + "github.com/iotaledger/hive.go/core/node" - "github.com/iotaledger/goshimmer/packages/chat" - "github.com/iotaledger/goshimmer/packages/tangle" + "github.com/iotaledger/goshimmer/packages/app/chat" + "github.com/iotaledger/goshimmer/packages/core/tangleold" ) const ( @@ -33,21 +33,21 @@ func init() { type dependencies struct { dig.In - Tangle *tangle.Tangle + Tangle *tangleold.Tangle Server *echo.Echo Chat *chat.Chat } func configure(_ *node.Plugin) { - deps.Tangle.Booker.Events.BlockBooked.Attach(event.NewClosure(func(event *tangle.BlockBookedEvent) { + deps.Tangle.Booker.Events.BlockBooked.Attach(event.NewClosure(func(event *tangleold.BlockBookedEvent) { onReceiveBlockFromBlockLayer(event.BlockID) })) configureWebAPI() } -func onReceiveBlockFromBlockLayer(blockID tangle.BlockID) { +func onReceiveBlockFromBlockLayer(blockID tangleold.BlockID) { var chatEvent *chat.BlockReceivedEvent - deps.Tangle.Storage.Block(blockID).Consume(func(block *tangle.Block) { + deps.Tangle.Storage.Block(blockID).Consume(func(block *tangleold.Block) { if block.Payload().Type() != chat.Type { return } diff --git a/plugins/chat/webapi.go b/plugins/chat/webapi.go index f1625d6385..9a233968ba 100644 --- a/plugins/chat/webapi.go +++ b/plugins/chat/webapi.go @@ -5,8 +5,8 @@ import ( "github.com/labstack/echo" - "github.com/iotaledger/goshimmer/packages/chat" - "github.com/iotaledger/goshimmer/packages/jsonmodels" + "github.com/iotaledger/goshimmer/packages/app/chat" + "github.com/iotaledger/goshimmer/packages/app/jsonmodels" ) const ( diff --git a/plugins/cli/cli.go b/plugins/cli/cli.go index 2708d3a677..2e35a63b89 100644 --- a/plugins/cli/cli.go +++ b/plugins/cli/cli.go @@ -7,7 +7,7 @@ import ( "sort" "strings" - "github.com/iotaledger/hive.go/node" + "github.com/iotaledger/hive.go/core/node" flag "github.com/spf13/pflag" "github.com/iotaledger/goshimmer/plugins/config" diff --git a/plugins/cli/plugin.go b/plugins/cli/plugin.go index d3da3ac05f..3116a5e5ad 100644 --- a/plugins/cli/plugin.go +++ b/plugins/cli/plugin.go @@ -6,8 +6,8 @@ import ( flag "github.com/spf13/pflag" - "github.com/iotaledger/hive.go/generics/event" - "github.com/iotaledger/hive.go/node" + "github.com/iotaledger/hive.go/core/generics/event" + "github.com/iotaledger/hive.go/core/node" "github.com/iotaledger/goshimmer/plugins/banner" ) diff --git a/plugins/clock/parameters.go b/plugins/clock/parameters.go index 50a72504b0..02d26621ba 100644 --- a/plugins/clock/parameters.go +++ b/plugins/clock/parameters.go @@ -1,8 +1,6 @@ package clock -import ( - "github.com/iotaledger/hive.go/configuration" -) +import "github.com/iotaledger/goshimmer/plugins/config" // ParametersDefinition contains the definition of configuration parameters used by the clock plugin. type ParametersDefinition struct { @@ -14,5 +12,5 @@ type ParametersDefinition struct { var Parameters = &ParametersDefinition{} func init() { - configuration.BindParameters(Parameters, "clock") + config.BindParameters(Parameters, "clock") } diff --git a/plugins/clock/plugin.go b/plugins/clock/plugin.go index 06199776b4..05940f328e 100644 --- a/plugins/clock/plugin.go +++ b/plugins/clock/plugin.go @@ -7,13 +7,14 @@ import ( "go.uber.org/dig" - "github.com/iotaledger/hive.go/daemon" - "github.com/iotaledger/hive.go/generics/event" - "github.com/iotaledger/hive.go/node" - "github.com/iotaledger/hive.go/timeutil" + "github.com/iotaledger/hive.go/core/daemon" + "github.com/iotaledger/hive.go/core/generics/event" + "github.com/iotaledger/hive.go/core/node" + "github.com/iotaledger/hive.go/core/timeutil" - "github.com/iotaledger/goshimmer/packages/clock" - "github.com/iotaledger/goshimmer/packages/shutdown" + "github.com/iotaledger/goshimmer/packages/node/clock" + + "github.com/iotaledger/goshimmer/packages/node/shutdown" ) const ( @@ -38,7 +39,7 @@ func init() { func configure(plugin *node.Plugin) { if len(Parameters.NTPPools) == 0 { - plugin.LogFatalf("at least 1 NTP pool needs to be provided to synchronize the local clock.") + plugin.LogFatalfAndExit("at least 1 NTP pool needs to be provided to synchronize the local clock.") } } diff --git a/plugins/config/parameters.go b/plugins/config/parameters.go index c4cb36e364..8e374accf4 100644 --- a/plugins/config/parameters.go +++ b/plugins/config/parameters.go @@ -1,9 +1,5 @@ package config -import ( - "github.com/iotaledger/hive.go/configuration" -) - // The following flags are only for text support. const ( CfgDisablePlugins = "node.disablePlugins" @@ -24,5 +20,5 @@ var Parameters = &ParametersDefinition{} // do not change "node" to "config" since this name is used already. func init() { - configuration.BindParameters(Parameters, "node") + BindParameters(Parameters, "node") } diff --git a/plugins/config/plugin.go b/plugins/config/plugin.go index 10cb5183b3..53e004002d 100644 --- a/plugins/config/plugin.go +++ b/plugins/config/plugin.go @@ -7,9 +7,9 @@ import ( flag "github.com/spf13/pflag" "go.uber.org/dig" - "github.com/iotaledger/hive.go/configuration" - "github.com/iotaledger/hive.go/generics/event" - "github.com/iotaledger/hive.go/node" + "github.com/iotaledger/hive.go/core/configuration" + "github.com/iotaledger/hive.go/core/generics/event" + "github.com/iotaledger/hive.go/core/node" ) // PluginName is the name of the config plugin. @@ -24,7 +24,6 @@ var ( configFilePath = flag.StringP("config", "c", defaultConfigName, "file path of the config file") skipConfigAvailable = flag.Bool("skip-config", false, "Skip config file availability check") - // Node is viper _node = configuration.New() ) @@ -87,7 +86,7 @@ func fetch(printConfig bool, ignoreSettingsAtPrint ...[]string) error { } // propagate values in the config back to bound parameters - configuration.UpdateBoundParameters(_node) + _node.UpdateBoundParameters() if printConfig { PrintConfig(ignoreSettingsAtPrint...) @@ -108,6 +107,10 @@ func PrintConfig(ignoreSettingsAtPrint ...[]string) { _node.Print(ignoreSettingsAtPrint...) } +func BindParameters(p any, namespace string) { + _node.BindParameters(flag.CommandLine, namespace, p) +} + func hasFlag(name string) bool { has := false flag.Visit(func(f *flag.Flag) { diff --git a/plugins/core.go b/plugins/core.go index cf7bcf6e2c..3625af30f8 100644 --- a/plugins/core.go +++ b/plugins/core.go @@ -1,7 +1,7 @@ package plugins import ( - "github.com/iotaledger/hive.go/node" + "github.com/iotaledger/hive.go/core/node" "github.com/iotaledger/goshimmer/plugins/autopeering" "github.com/iotaledger/goshimmer/plugins/banner" diff --git a/plugins/dagsvisualizer/frontend/yarn.lock b/plugins/dagsvisualizer/frontend/yarn.lock index 22b06152cd..bb10706481 100644 --- a/plugins/dagsvisualizer/frontend/yarn.lock +++ b/plugins/dagsvisualizer/frontend/yarn.lock @@ -4424,7 +4424,7 @@ bser@2.1.1: buffer-from@^1.0.0: version "1.1.2" - resolved "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz" + resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.2.tgz#2b146a6fd72e80b4f55d255f35ed59a3a9a41bd5" integrity sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ== buffer-indexof@^1.0.0: @@ -12090,9 +12090,9 @@ source-map-resolve@^0.6.0: decode-uri-component "^0.2.0" source-map-support@^0.5.6, source-map-support@~0.5.12, source-map-support@~0.5.19: - version "0.5.19" - resolved "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz" - integrity sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw== + version "0.5.21" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.21.tgz#04fe7c7f9e1ed2d662233c28cb2b35b9f63f6e4f" + integrity sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w== dependencies: buffer-from "^1.0.0" source-map "^0.6.0" @@ -12594,9 +12594,9 @@ terser-webpack-plugin@^1.4.3: worker-farm "^1.7.0" terser@^4.1.2, terser@^4.6.2, terser@^4.6.3: - version "4.8.0" - resolved "https://registry.npmjs.org/terser/-/terser-4.8.0.tgz" - integrity sha512-EAPipTNeWsb/3wLPeup1tVPaXfIaU68xMnVdPafIL1TV05OhASArYyIfFvnvJCNrR2NIOvDVNNTFRa+Re2MWyw== + version "4.8.1" + resolved "https://registry.yarnpkg.com/terser/-/terser-4.8.1.tgz#a00e5634562de2239fd404c649051bf6fc21144f" + integrity sha512-4GnLC0x667eJG0ewJTa6z/yXrbLGv80D9Ru6HIpCQmO+Q4PfEtBFi0ObSckqwL6VyQv/7ENJieXHo2ANmdQwgw== dependencies: commander "^2.20.0" source-map "~0.6.1" diff --git a/plugins/dagsvisualizer/parameters.go b/plugins/dagsvisualizer/parameters.go index 5a74a08d81..1de59c3885 100644 --- a/plugins/dagsvisualizer/parameters.go +++ b/plugins/dagsvisualizer/parameters.go @@ -1,8 +1,6 @@ package dagsvisualizer -import ( - "github.com/iotaledger/hive.go/configuration" -) +import "github.com/iotaledger/goshimmer/plugins/config" // ParametersDefinition contains the definition of configuration parameters used by the dags visualizer plugin. type ParametersDefinition struct { @@ -20,5 +18,5 @@ type ParametersDefinition struct { var Parameters = &ParametersDefinition{} func init() { - configuration.BindParameters(Parameters, "dagsvisualizer") + config.BindParameters(Parameters, "dagsvisualizer") } diff --git a/plugins/dagsvisualizer/plugin.go b/plugins/dagsvisualizer/plugin.go index f1a56bd2ee..aff8dfb1c7 100644 --- a/plugins/dagsvisualizer/plugin.go +++ b/plugins/dagsvisualizer/plugin.go @@ -6,16 +6,17 @@ import ( "time" "github.com/cockroachdb/errors" - "github.com/iotaledger/hive.go/daemon" - "github.com/iotaledger/hive.go/logger" - "github.com/iotaledger/hive.go/node" + "github.com/iotaledger/hive.go/core/daemon" + "github.com/iotaledger/hive.go/core/logger" + "github.com/iotaledger/hive.go/core/node" "github.com/labstack/echo" "github.com/labstack/echo/middleware" "go.uber.org/dig" - "github.com/iotaledger/goshimmer/packages/consensus/acceptance" - "github.com/iotaledger/goshimmer/packages/shutdown" - "github.com/iotaledger/goshimmer/packages/tangle" + "github.com/iotaledger/goshimmer/packages/core/consensus/acceptance" + "github.com/iotaledger/goshimmer/packages/node/shutdown" + + "github.com/iotaledger/goshimmer/packages/core/tangleold" ) // PluginName is the name of the dags visualizer plugin. @@ -32,7 +33,7 @@ var ( type dependencies struct { dig.In - Tangle *tangle.Tangle + Tangle *tangleold.Tangle AcceptanceGadget *acceptance.Gadget } diff --git a/plugins/dagsvisualizer/type.go b/plugins/dagsvisualizer/type.go index 2597a99be6..0c326e9343 100644 --- a/plugins/dagsvisualizer/type.go +++ b/plugins/dagsvisualizer/type.go @@ -1,6 +1,8 @@ package dagsvisualizer -import "github.com/iotaledger/goshimmer/packages/jsonmodels" +import ( + "github.com/iotaledger/goshimmer/packages/app/jsonmodels" +) const ( // BlkTypeTangleVertex is the type of the Tangle DAG vertex. diff --git a/plugins/dagsvisualizer/visualizer.go b/plugins/dagsvisualizer/visualizer.go index ff6ec58e0e..21dd774f8c 100644 --- a/plugins/dagsvisualizer/visualizer.go +++ b/plugins/dagsvisualizer/visualizer.go @@ -7,22 +7,23 @@ import ( "sync" "time" - "github.com/iotaledger/hive.go/daemon" - "github.com/iotaledger/hive.go/generics/event" - "github.com/iotaledger/hive.go/generics/lo" - "github.com/iotaledger/hive.go/generics/set" - "github.com/iotaledger/hive.go/generics/walker" - "github.com/iotaledger/hive.go/types/confirmation" - "github.com/iotaledger/hive.go/workerpool" + "github.com/iotaledger/hive.go/core/daemon" + "github.com/iotaledger/hive.go/core/generics/event" + "github.com/iotaledger/hive.go/core/generics/lo" + "github.com/iotaledger/hive.go/core/generics/set" + "github.com/iotaledger/hive.go/core/generics/walker" + "github.com/iotaledger/hive.go/core/types/confirmation" + "github.com/iotaledger/hive.go/core/workerpool" "github.com/labstack/echo" - "github.com/iotaledger/goshimmer/packages/conflictdag" - "github.com/iotaledger/goshimmer/packages/jsonmodels" - "github.com/iotaledger/goshimmer/packages/ledger" - "github.com/iotaledger/goshimmer/packages/ledger/utxo" - "github.com/iotaledger/goshimmer/packages/ledger/vm/devnetvm" - "github.com/iotaledger/goshimmer/packages/shutdown" - "github.com/iotaledger/goshimmer/packages/tangle" + "github.com/iotaledger/goshimmer/packages/app/jsonmodels" + "github.com/iotaledger/goshimmer/packages/node/shutdown" + + "github.com/iotaledger/goshimmer/packages/core/conflictdag" + "github.com/iotaledger/goshimmer/packages/core/ledger" + "github.com/iotaledger/goshimmer/packages/core/ledger/utxo" + "github.com/iotaledger/goshimmer/packages/core/ledger/vm/devnetvm" + "github.com/iotaledger/goshimmer/packages/core/tangleold" ) var ( @@ -58,7 +59,7 @@ func runVisualizer() { } func registerTangleEvents() { - storeClosure := event.NewClosure(func(event *tangle.BlockStoredEvent) { + storeClosure := event.NewClosure(func(event *tangleold.BlockStoredEvent) { wsBlk := &wsBlock{ Type: BlkTypeTangleVertex, Data: newTangleVertex(event.Block), @@ -67,9 +68,9 @@ func registerTangleEvents() { storeWsBlock(wsBlk) }) - bookedClosure := event.NewClosure(func(event *tangle.BlockBookedEvent) { + bookedClosure := event.NewClosure(func(event *tangleold.BlockBookedEvent) { blockID := event.BlockID - deps.Tangle.Storage.BlockMetadata(blockID).Consume(func(blkMetadata *tangle.BlockMetadata) { + deps.Tangle.Storage.BlockMetadata(blockID).Consume(func(blkMetadata *tangleold.BlockMetadata) { conflictIDs, err := deps.Tangle.Booker.BlockConflictIDs(blockID) if err != nil { conflictIDs = set.NewAdvancedSet[utxo.TransactionID]() @@ -88,9 +89,9 @@ func registerTangleEvents() { }) }) - blkConfirmedClosure := event.NewClosure(func(event *tangle.BlockAcceptedEvent) { + blkConfirmedClosure := event.NewClosure(func(event *tangleold.BlockAcceptedEvent) { blockID := event.Block.ID() - deps.Tangle.Storage.BlockMetadata(blockID).Consume(func(blkMetadata *tangle.BlockMetadata) { + deps.Tangle.Storage.BlockMetadata(blockID).Consume(func(blkMetadata *tangleold.BlockMetadata) { wsBlk := &wsBlock{ Type: BlkTypeTangleConfirmed, Data: &tangleConfirmed{ @@ -105,8 +106,8 @@ func registerTangleEvents() { }) txAcceptedClosure := event.NewClosure(func(event *ledger.TransactionAcceptedEvent) { - var blkID tangle.BlockID - deps.Tangle.Storage.Attachments(event.TransactionID).Consume(func(a *tangle.Attachment) { + var blkID tangleold.BlockID + deps.Tangle.Storage.Attachments(event.TransactionID).Consume(func(a *tangleold.Attachment) { blkID = a.BlockID() }) @@ -128,7 +129,7 @@ func registerTangleEvents() { } func registerUTXOEvents() { - storeClosure := event.NewClosure(func(event *tangle.BlockStoredEvent) { + storeClosure := event.NewClosure(func(event *tangleold.BlockStoredEvent) { if event.Block.Payload().Type() == devnetvm.TransactionType { tx := event.Block.Payload().(*devnetvm.Transaction) wsBlk := &wsBlock{ @@ -140,9 +141,9 @@ func registerUTXOEvents() { } }) - bookedClosure := event.NewClosure(func(event *tangle.BlockBookedEvent) { + bookedClosure := event.NewClosure(func(event *tangleold.BlockBookedEvent) { blockID := event.BlockID - deps.Tangle.Storage.Block(blockID).Consume(func(block *tangle.Block) { + deps.Tangle.Storage.Block(blockID).Consume(func(block *tangleold.Block) { if block.Payload().Type() == devnetvm.TransactionType { tx := block.Payload().(*devnetvm.Transaction) deps.Tangle.Ledger.Storage.CachedTransactionMetadata(tx.ID()).Consume(func(txMetadata *ledger.TransactionMetadata) { @@ -218,7 +219,7 @@ func registerConflictEvents() { storeWsBlock(wsBlk) }) - conflictWeightChangedClosure := event.NewClosure(func(e *tangle.ConflictWeightChangedEvent) { + conflictWeightChangedClosure := event.NewClosure(func(e *tangleold.ConflictWeightChangedEvent) { conflictConfirmationState := deps.Tangle.Ledger.ConflictDAG.ConfirmationState(utxo.NewTransactionIDs(e.ConflictID)) wsBlk := &wsBlock{ Type: BlkTypeConflictWeightChanged, @@ -270,13 +271,13 @@ func setupDagsVisualizerRoutes(routeGroup *echo.Group) { txs := []*utxoVertex{} conflicts := []*conflictVertex{} conflictMap := set.NewAdvancedSet[utxo.TransactionID]() - entryBlks := tangle.NewBlockIDs() - deps.Tangle.Storage.Children(tangle.EmptyBlockID).Consume(func(child *tangle.Child) { + entryBlks := tangleold.NewBlockIDs() + deps.Tangle.Storage.Children(tangleold.EmptyBlockID).Consume(func(child *tangleold.Child) { entryBlks.Add(child.ChildBlockID()) }) - deps.Tangle.Utils.WalkBlockID(func(blockID tangle.BlockID, walker *walker.Walker[tangle.BlockID]) { - deps.Tangle.Storage.Block(blockID).Consume(func(blk *tangle.Block) { + deps.Tangle.Utils.WalkBlockID(func(blockID tangleold.BlockID, walker *walker.Walker[tangleold.BlockID]) { + deps.Tangle.Storage.Block(blockID).Consume(func(blk *tangleold.Block) { // only keep blocks that is issued in the given time interval if blk.IssuingTime().After(startTimestamp) && blk.IssuingTime().Before(endTimestamp) { // add block @@ -307,7 +308,7 @@ func setupDagsVisualizerRoutes(routeGroup *echo.Group) { // continue walking if the block is issued before endTimestamp if blk.IssuingTime().Before(endTimestamp) { - deps.Tangle.Storage.Children(blockID).Consume(func(child *tangle.Child) { + deps.Tangle.Storage.Children(blockID).Consume(func(child *tangleold.Child) { walker.Push(child.ChildBlockID()) }) } @@ -338,17 +339,17 @@ func isTimeIntervalValid(start, end time.Time) (valid bool) { return true } -func newTangleVertex(block *tangle.Block) (ret *tangleVertex) { - deps.Tangle.Storage.BlockMetadata(block.ID()).Consume(func(blkMetadata *tangle.BlockMetadata) { +func newTangleVertex(block *tangleold.Block) (ret *tangleVertex) { + deps.Tangle.Storage.BlockMetadata(block.ID()).Consume(func(blkMetadata *tangleold.BlockMetadata) { conflictIDs, err := deps.Tangle.Booker.BlockConflictIDs(block.ID()) if err != nil { conflictIDs = set.NewAdvancedSet[utxo.TransactionID]() } ret = &tangleVertex{ ID: block.ID().Base58(), - StrongParentIDs: block.ParentsByType(tangle.StrongParentType).Base58(), - WeakParentIDs: block.ParentsByType(tangle.WeakParentType).Base58(), - ShallowLikeParentIDs: block.ParentsByType(tangle.ShallowLikeParentType).Base58(), + StrongParentIDs: block.ParentsByType(tangleold.StrongParentType).Base58(), + WeakParentIDs: block.ParentsByType(tangleold.WeakParentType).Base58(), + ShallowLikeParentIDs: block.ParentsByType(tangleold.ShallowLikeParentType).Base58(), ConflictIDs: lo.Map(conflictIDs.Slice(), utxo.TransactionID.Base58), IsMarker: blkMetadata.StructureDetails() != nil && blkMetadata.StructureDetails().IsPastMarker(), IsTx: block.Payload().Type() == devnetvm.TransactionType, @@ -364,7 +365,7 @@ func newTangleVertex(block *tangle.Block) (ret *tangleVertex) { return } -func newUTXOVertex(blkID tangle.BlockID, tx *devnetvm.Transaction) (ret *utxoVertex) { +func newUTXOVertex(blkID tangleold.BlockID, tx *devnetvm.Transaction) (ret *utxoVertex) { inputs := make([]*jsonmodels.Input, len(tx.Essence().Inputs())) for i, input := range tx.Essence().Inputs() { inputs[i] = jsonmodels.NewInput(input) diff --git a/plugins/dashboard/chat_livefeed.go b/plugins/dashboard/chat_livefeed.go index 2f68984421..8c10d4a80f 100644 --- a/plugins/dashboard/chat_livefeed.go +++ b/plugins/dashboard/chat_livefeed.go @@ -3,12 +3,12 @@ package dashboard import ( "context" - "github.com/iotaledger/hive.go/daemon" - "github.com/iotaledger/hive.go/generics/event" - "github.com/iotaledger/hive.go/workerpool" + "github.com/iotaledger/hive.go/core/daemon" + "github.com/iotaledger/hive.go/core/generics/event" + "github.com/iotaledger/hive.go/core/workerpool" - "github.com/iotaledger/goshimmer/packages/chat" - "github.com/iotaledger/goshimmer/packages/shutdown" + "github.com/iotaledger/goshimmer/packages/app/chat" + "github.com/iotaledger/goshimmer/packages/node/shutdown" ) var ( diff --git a/plugins/dashboard/conflicts_livefeed.go b/plugins/dashboard/conflicts_livefeed.go index f5b44c7171..8a39fcacb9 100644 --- a/plugins/dashboard/conflicts_livefeed.go +++ b/plugins/dashboard/conflicts_livefeed.go @@ -6,19 +6,20 @@ import ( "sync" "time" - "github.com/iotaledger/hive.go/daemon" - "github.com/iotaledger/hive.go/generics/event" - "github.com/iotaledger/hive.go/generics/set" - "github.com/iotaledger/hive.go/identity" - "github.com/iotaledger/hive.go/types/confirmation" - "github.com/iotaledger/hive.go/workerpool" - - "github.com/iotaledger/goshimmer/packages/clock" - "github.com/iotaledger/goshimmer/packages/conflictdag" - "github.com/iotaledger/goshimmer/packages/ledger/utxo" - "github.com/iotaledger/goshimmer/packages/ledger/vm/devnetvm" - "github.com/iotaledger/goshimmer/packages/shutdown" - "github.com/iotaledger/goshimmer/packages/tangle" + "github.com/iotaledger/hive.go/core/daemon" + "github.com/iotaledger/hive.go/core/generics/event" + "github.com/iotaledger/hive.go/core/generics/set" + "github.com/iotaledger/hive.go/core/identity" + "github.com/iotaledger/hive.go/core/types/confirmation" + "github.com/iotaledger/hive.go/core/workerpool" + + "github.com/iotaledger/goshimmer/packages/core/conflictdag" + "github.com/iotaledger/goshimmer/packages/core/ledger/utxo" + "github.com/iotaledger/goshimmer/packages/core/ledger/vm/devnetvm" + "github.com/iotaledger/goshimmer/packages/core/tangleold" + "github.com/iotaledger/goshimmer/packages/node/clock" + + "github.com/iotaledger/goshimmer/packages/node/shutdown" ) var ( @@ -232,8 +233,8 @@ func sendAllConflicts() { func issuerOfOldestAttachment(conflictID utxo.TransactionID) (id identity.ID) { var oldestAttachmentTime time.Time - deps.Tangle.Storage.Attachments(utxo.TransactionID(conflictID)).Consume(func(attachment *tangle.Attachment) { - deps.Tangle.Storage.Block(attachment.BlockID()).Consume(func(block *tangle.Block) { + deps.Tangle.Storage.Attachments(utxo.TransactionID(conflictID)).Consume(func(attachment *tangleold.Attachment) { + deps.Tangle.Storage.Block(attachment.BlockID()).Consume(func(block *tangleold.Block) { if oldestAttachmentTime.IsZero() || block.IssuingTime().Before(oldestAttachmentTime) { oldestAttachmentTime = block.IssuingTime() id = identity.New(block.IssuerPublicKey()).ID() diff --git a/plugins/dashboard/explorer_routes.go b/plugins/dashboard/explorer_routes.go index 01681cb289..1e6b1faeb4 100644 --- a/plugins/dashboard/explorer_routes.go +++ b/plugins/dashboard/explorer_routes.go @@ -4,20 +4,20 @@ import ( "fmt" "net/http" - "github.com/iotaledger/hive.go/generics/lo" - "github.com/iotaledger/hive.go/identity" - "github.com/iotaledger/hive.go/types/confirmation" + "github.com/iotaledger/hive.go/core/generics/lo" + "github.com/iotaledger/hive.go/core/identity" + "github.com/iotaledger/hive.go/core/types/confirmation" "github.com/labstack/echo" "github.com/mr-tron/base58/base58" - "github.com/iotaledger/goshimmer/packages/epoch" - "github.com/iotaledger/goshimmer/packages/jsonmodels" - "github.com/iotaledger/goshimmer/packages/ledger" - "github.com/iotaledger/goshimmer/packages/ledger/utxo" - "github.com/iotaledger/goshimmer/packages/ledger/vm/devnetvm" - "github.com/iotaledger/goshimmer/packages/ledger/vm/devnetvm/indexer" - "github.com/iotaledger/goshimmer/packages/notarization" - "github.com/iotaledger/goshimmer/packages/tangle" + "github.com/iotaledger/goshimmer/packages/app/jsonmodels" + "github.com/iotaledger/goshimmer/packages/core/epoch" + "github.com/iotaledger/goshimmer/packages/core/ledger" + "github.com/iotaledger/goshimmer/packages/core/ledger/utxo" + "github.com/iotaledger/goshimmer/packages/core/ledger/vm/devnetvm" + "github.com/iotaledger/goshimmer/packages/core/ledger/vm/devnetvm/indexer" + "github.com/iotaledger/goshimmer/packages/core/notarization" + "github.com/iotaledger/goshimmer/packages/core/tangleold" "github.com/iotaledger/goshimmer/plugins/chat" ledgerstateAPI "github.com/iotaledger/goshimmer/plugins/webapi/ledgerstate" ) @@ -76,7 +76,7 @@ type ExplorerBlock struct { LatestConfirmedEpoch uint64 `json:"latestConfirmedEpoch"` } -func createExplorerBlock(blk *tangle.Block) *ExplorerBlock { +func createExplorerBlock(blk *tangleold.Block) *ExplorerBlock { blockID := blk.ID() cachedBlockMetadata := deps.Tangle.Storage.BlockMetadata(blockID) defer cachedBlockMetadata.Release() @@ -97,9 +97,9 @@ func createExplorerBlock(blk *tangle.Block) *ExplorerBlock { Signature: blk.Signature().String(), SequenceNumber: blk.SequenceNumber(), ParentsByType: prepareParentReferences(blk), - StrongChildren: deps.Tangle.Utils.ApprovingBlockIDs(blockID, tangle.StrongChild).Base58(), - WeakChildren: deps.Tangle.Utils.ApprovingBlockIDs(blockID, tangle.WeakChild).Base58(), - ShallowLikeChildren: deps.Tangle.Utils.ApprovingBlockIDs(blockID, tangle.ShallowLikeChild).Base58(), + StrongChildren: deps.Tangle.Utils.ApprovingBlockIDs(blockID, tangleold.StrongChild).Base58(), + WeakChildren: deps.Tangle.Utils.ApprovingBlockIDs(blockID, tangleold.WeakChild).Base58(), + ShallowLikeChildren: deps.Tangle.Utils.ApprovingBlockIDs(blockID, tangleold.ShallowLikeChild).Base58(), Solid: blockMetadata.IsSolid(), ConflictIDs: lo.Map(lo.Map(conflictIDs.Slice(), utxo.TransactionID.Bytes), base58.Encode), AddedConflictIDs: lo.Map(lo.Map(blockMetadata.AddedConflictIDs().Slice(), utxo.TransactionID.Bytes), base58.Encode), @@ -129,9 +129,9 @@ func createExplorerBlock(blk *tangle.Block) *ExplorerBlock { return t } -func prepareParentReferences(blk *tangle.Block) map[string][]string { +func prepareParentReferences(blk *tangleold.Block) map[string][]string { parentsByType := make(map[string][]string) - blk.ForEachParent(func(parent tangle.Parent) { + blk.ForEachParent(func(parent tangleold.Parent) { if _, ok := parentsByType[parent.Type.String()]; !ok { parentsByType[parent.Type.String()] = make([]string, 0) } @@ -165,7 +165,7 @@ type SearchResult struct { func setupExplorerRoutes(routeGroup *echo.Group) { routeGroup.GET("/block/:id", func(c echo.Context) (err error) { - var blockID tangle.BlockID + var blockID tangleold.BlockID err = blockID.FromBase58(c.Param("id")) if err != nil { return @@ -215,8 +215,8 @@ func setupExplorerRoutes(routeGroup *echo.Group) { result.Address = addr } - case tangle.BlockIDLength: - var blockID tangle.BlockID + case tangleold.BlockIDLength: + var blockID tangleold.BlockID err = blockID.FromBase58(c.Param("id")) if err != nil { return fmt.Errorf("%w: search ID %s", ErrInvalidParameter, search) @@ -235,8 +235,8 @@ func setupExplorerRoutes(routeGroup *echo.Group) { }) } -func findBlock(blockID tangle.BlockID) (explorerBlk *ExplorerBlock, err error) { - if !deps.Tangle.Storage.Block(blockID).Consume(func(blk *tangle.Block) { +func findBlock(blockID tangleold.BlockID) (explorerBlk *ExplorerBlock, err error) { + if !deps.Tangle.Storage.Block(blockID).Consume(func(blk *tangleold.Block) { explorerBlk = createExplorerBlock(blk) }) { err = fmt.Errorf("%w: block %s", ErrNotFound, blockID.Base58()) diff --git a/plugins/dashboard/frontend/yarn.lock b/plugins/dashboard/frontend/yarn.lock index be26afd67a..f34ab68243 100644 --- a/plugins/dashboard/frontend/yarn.lock +++ b/plugins/dashboard/frontend/yarn.lock @@ -1429,9 +1429,9 @@ buffer-fill@^1.0.0: integrity sha1-+PeLdniYiO858gXNY39o5wISKyw= buffer-from@^1.0.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" - integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A== + version "1.1.2" + resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.2.tgz#2b146a6fd72e80b4f55d255f35ed59a3a9a41bd5" + integrity sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ== buffer-indexof@^1.0.0: version "1.1.1" @@ -6503,9 +6503,9 @@ source-map-resolve@^0.5.0: urix "^0.1.0" source-map-support@~0.5.12: - version "0.5.19" - resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.19.tgz#a98b62f86dcaf4f67399648c085291ab9e8fed61" - integrity sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw== + version "0.5.21" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.21.tgz#04fe7c7f9e1ed2d662233c28cb2b35b9f63f6e4f" + integrity sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w== dependencies: buffer-from "^1.0.0" source-map "^0.6.0" @@ -6874,9 +6874,9 @@ terser-webpack-plugin@^1.4.3: worker-farm "^1.7.0" terser@^4.1.2, terser@^4.6.3: - version "4.8.0" - resolved "https://registry.yarnpkg.com/terser/-/terser-4.8.0.tgz#63056343d7c70bb29f3af665865a46fe03a0df17" - integrity sha512-EAPipTNeWsb/3wLPeup1tVPaXfIaU68xMnVdPafIL1TV05OhASArYyIfFvnvJCNrR2NIOvDVNNTFRa+Re2MWyw== + version "4.8.1" + resolved "https://registry.yarnpkg.com/terser/-/terser-4.8.1.tgz#a00e5634562de2239fd404c649051bf6fc21144f" + integrity sha512-4GnLC0x667eJG0ewJTa6z/yXrbLGv80D9Ru6HIpCQmO+Q4PfEtBFi0ObSckqwL6VyQv/7ENJieXHo2ANmdQwgw== dependencies: commander "^2.20.0" source-map "~0.6.1" diff --git a/plugins/dashboard/livefeed.go b/plugins/dashboard/livefeed.go index ae5997edec..60e8c8686f 100644 --- a/plugins/dashboard/livefeed.go +++ b/plugins/dashboard/livefeed.go @@ -3,12 +3,13 @@ package dashboard import ( "context" - "github.com/iotaledger/hive.go/daemon" - "github.com/iotaledger/hive.go/generics/event" - "github.com/iotaledger/hive.go/workerpool" + "github.com/iotaledger/hive.go/core/daemon" + "github.com/iotaledger/hive.go/core/generics/event" + "github.com/iotaledger/hive.go/core/workerpool" - "github.com/iotaledger/goshimmer/packages/shutdown" - "github.com/iotaledger/goshimmer/packages/tangle" + "github.com/iotaledger/goshimmer/packages/core/tangleold" + + "github.com/iotaledger/goshimmer/packages/node/shutdown" ) var ( @@ -19,7 +20,7 @@ var ( func configureLiveFeed() { liveFeedWorkerPool = workerpool.NewNonBlockingQueuedWorkerPool(func(task workerpool.Task) { - block := task.Param(0).(*tangle.Block) + block := task.Param(0).(*tangleold.Block) broadcastWsBlock(&wsblk{MsgTypeBlock, &blk{block.ID().Base58(), 0, uint32(block.Payload().Type())}}) @@ -28,7 +29,7 @@ func configureLiveFeed() { } func runLiveFeed() { - notifyNewBlk := event.NewClosure(func(event *tangle.BlockStoredEvent) { + notifyNewBlk := event.NewClosure(func(event *tangleold.BlockStoredEvent) { liveFeedWorkerPool.TrySubmit(event.Block) }) diff --git a/plugins/dashboard/manabuffer.go b/plugins/dashboard/manabuffer.go index 4db028bd9a..0dc0bde7b1 100644 --- a/plugins/dashboard/manabuffer.go +++ b/plugins/dashboard/manabuffer.go @@ -6,7 +6,7 @@ import ( "github.com/cockroachdb/errors" "github.com/gorilla/websocket" - "github.com/iotaledger/goshimmer/packages/mana" + "github.com/iotaledger/goshimmer/packages/core/mana" ) const ( diff --git a/plugins/dashboard/manafeed.go b/plugins/dashboard/manafeed.go index dd1858be04..f43c6525cb 100644 --- a/plugins/dashboard/manafeed.go +++ b/plugins/dashboard/manafeed.go @@ -8,14 +8,15 @@ import ( "github.com/cockroachdb/errors" "github.com/gorilla/websocket" - "github.com/iotaledger/hive.go/daemon" - "github.com/iotaledger/hive.go/generics/event" - "github.com/iotaledger/hive.go/identity" - "github.com/iotaledger/hive.go/workerpool" + "github.com/iotaledger/hive.go/core/daemon" + "github.com/iotaledger/hive.go/core/generics/event" + "github.com/iotaledger/hive.go/core/identity" + "github.com/iotaledger/hive.go/core/workerpool" "github.com/mr-tron/base58" - "github.com/iotaledger/goshimmer/packages/mana" - "github.com/iotaledger/goshimmer/packages/shutdown" + "github.com/iotaledger/goshimmer/packages/core/mana" + + "github.com/iotaledger/goshimmer/packages/node/shutdown" manaPlugin "github.com/iotaledger/goshimmer/plugins/blocklayer" ) diff --git a/plugins/dashboard/parameters.go b/plugins/dashboard/parameters.go index 1f2980ba96..550e02e2ea 100644 --- a/plugins/dashboard/parameters.go +++ b/plugins/dashboard/parameters.go @@ -1,8 +1,6 @@ package dashboard -import ( - "github.com/iotaledger/hive.go/configuration" -) +import "github.com/iotaledger/goshimmer/plugins/config" // ParametersDefinition contains the definition of configuration parameters used by the dashboard plugin. type ParametersDefinition struct { @@ -37,5 +35,5 @@ type ParametersDefinition struct { var Parameters = &ParametersDefinition{} func init() { - configuration.BindParameters(Parameters, "dashboard") + config.BindParameters(Parameters, "dashboard") } diff --git a/plugins/dashboard/payload_handler.go b/plugins/dashboard/payload_handler.go index 3aec6f4ca6..a237660b31 100644 --- a/plugins/dashboard/payload_handler.go +++ b/plugins/dashboard/payload_handler.go @@ -1,14 +1,14 @@ package dashboard import ( - "github.com/iotaledger/hive.go/generics/lo" + "github.com/iotaledger/hive.go/core/generics/lo" - chat2 "github.com/iotaledger/goshimmer/packages/chat" - "github.com/iotaledger/goshimmer/packages/faucet" - "github.com/iotaledger/goshimmer/packages/jsonmodels" - "github.com/iotaledger/goshimmer/packages/ledger/utxo" - "github.com/iotaledger/goshimmer/packages/ledger/vm/devnetvm" - "github.com/iotaledger/goshimmer/packages/tangle/payload" + chatPkg "github.com/iotaledger/goshimmer/packages/app/chat" + "github.com/iotaledger/goshimmer/packages/app/faucet" + "github.com/iotaledger/goshimmer/packages/app/jsonmodels" + "github.com/iotaledger/goshimmer/packages/core/ledger/utxo" + "github.com/iotaledger/goshimmer/packages/core/ledger/vm/devnetvm" + "github.com/iotaledger/goshimmer/packages/core/tangleold/payload" "github.com/iotaledger/goshimmer/plugins/chat" ) @@ -98,8 +98,8 @@ func ProcessPayload(p payload.Payload) interface{} { ContentTitle: "address", Content: p.(*faucet.Payload).Address().Base58(), } - case chat2.Type: - chatPayload := p.(*chat2.Payload) + case chatPkg.Type: + chatPayload := p.(*chatPkg.Payload) return chat.Request{ From: chatPayload.From(), To: chatPayload.To(), diff --git a/plugins/dashboard/plugin.go b/plugins/dashboard/plugin.go index 44851f83bf..090aebe6b6 100644 --- a/plugins/dashboard/plugin.go +++ b/plugins/dashboard/plugin.go @@ -9,23 +9,24 @@ import ( "time" "github.com/cockroachdb/errors" - "github.com/iotaledger/hive.go/autopeering/peer" - "github.com/iotaledger/hive.go/autopeering/peer/service" - "github.com/iotaledger/hive.go/autopeering/selection" - "github.com/iotaledger/hive.go/configuration" - "github.com/iotaledger/hive.go/daemon" - "github.com/iotaledger/hive.go/generics/event" - "github.com/iotaledger/hive.go/logger" - "github.com/iotaledger/hive.go/node" + "github.com/iotaledger/hive.go/core/autopeering/peer" + "github.com/iotaledger/hive.go/core/autopeering/peer/service" + "github.com/iotaledger/hive.go/core/autopeering/selection" + "github.com/iotaledger/hive.go/core/configuration" + "github.com/iotaledger/hive.go/core/daemon" + "github.com/iotaledger/hive.go/core/generics/event" + "github.com/iotaledger/hive.go/core/logger" + "github.com/iotaledger/hive.go/core/node" "github.com/labstack/echo" "github.com/labstack/echo/middleware" "go.uber.org/dig" - "github.com/iotaledger/goshimmer/packages/chat" - "github.com/iotaledger/goshimmer/packages/ledger/vm/devnetvm/indexer" - "github.com/iotaledger/goshimmer/packages/p2p" - "github.com/iotaledger/goshimmer/packages/shutdown" - "github.com/iotaledger/goshimmer/packages/tangle" + "github.com/iotaledger/goshimmer/packages/core/ledger/vm/devnetvm/indexer" + "github.com/iotaledger/goshimmer/packages/core/tangleold" + + "github.com/iotaledger/goshimmer/packages/app/chat" + "github.com/iotaledger/goshimmer/packages/node/p2p" + "github.com/iotaledger/goshimmer/packages/node/shutdown" "github.com/iotaledger/goshimmer/plugins/banner" "github.com/iotaledger/goshimmer/plugins/metrics" ) @@ -51,7 +52,7 @@ type dependencies struct { Node *configuration.Configuration Local *peer.Local - Tangle *tangle.Tangle + Tangle *tangleold.Tangle Selection *selection.Protocol `optional:"true"` P2PManager *p2p.Manager `optional:"true"` Chat *chat.Chat `optional:"true"` diff --git a/plugins/dashboard/visualizer.go b/plugins/dashboard/visualizer.go index 59077e9be6..661d9c8a4b 100644 --- a/plugins/dashboard/visualizer.go +++ b/plugins/dashboard/visualizer.go @@ -5,14 +5,15 @@ import ( "net/http" "sync" - "github.com/iotaledger/hive.go/daemon" - "github.com/iotaledger/hive.go/generics/event" - "github.com/iotaledger/hive.go/workerpool" + "github.com/iotaledger/hive.go/core/daemon" + "github.com/iotaledger/hive.go/core/generics/event" + "github.com/iotaledger/hive.go/core/workerpool" "github.com/labstack/echo" - "github.com/iotaledger/goshimmer/packages/ledger/vm/devnetvm" - "github.com/iotaledger/goshimmer/packages/shutdown" - "github.com/iotaledger/goshimmer/packages/tangle" + "github.com/iotaledger/goshimmer/packages/core/ledger/vm/devnetvm" + "github.com/iotaledger/goshimmer/packages/core/tangleold" + + "github.com/iotaledger/goshimmer/packages/node/shutdown" ) var ( @@ -22,7 +23,7 @@ var ( blkHistoryMutex sync.RWMutex blkFinalized map[string]bool - blkHistory []*tangle.Block + blkHistory []*tangleold.Block maxBlkHistorySize = 1000 numHistoryToRemove = 100 ) @@ -49,10 +50,10 @@ type history struct { func configureVisualizer() { visualizerWorkerPool = workerpool.NewNonBlockingQueuedWorkerPool(func(task workerpool.Task) { switch x := task.Param(0).(type) { - case *tangle.Block: + case *tangleold.Block: sendVertex(x, task.Param(1).(bool)) - case *tangle.TipEvent: - sendTipInfo(task.Param(1).(tangle.BlockID), task.Param(2).(bool)) + case *tangleold.TipEvent: + sendTipInfo(task.Param(1).(tangleold.BlockID), task.Param(2).(bool)) } task.Return(nil) @@ -60,10 +61,10 @@ func configureVisualizer() { // configure blkHistory, blkSolid blkFinalized = make(map[string]bool, maxBlkHistorySize) - blkHistory = make([]*tangle.Block, 0, maxBlkHistorySize) + blkHistory = make([]*tangleold.Block, 0, maxBlkHistorySize) } -func sendVertex(blk *tangle.Block, finalized bool) { +func sendVertex(blk *tangleold.Block, finalized bool) { broadcastWsBlock(&wsblk{MsgTypeVertex, &vertex{ ID: blk.ID().Base58(), ParentIDsByType: prepareParentReferences(blk), @@ -72,7 +73,7 @@ func sendVertex(blk *tangle.Block, finalized bool) { }}, true) } -func sendTipInfo(blockID tangle.BlockID, isTip bool) { +func sendTipInfo(blockID tangleold.BlockID, isTip bool) { broadcastWsBlock(&wsblk{MsgTypeTipInfo, &tipinfo{ ID: blockID.Base58(), IsTip: isTip, @@ -80,25 +81,25 @@ func sendTipInfo(blockID tangle.BlockID, isTip bool) { } func runVisualizer() { - processBlock := func(block *tangle.Block) { + processBlock := func(block *tangleold.Block) { finalized := deps.Tangle.ConfirmationOracle.IsBlockConfirmed(block.ID()) addToHistory(block, finalized) visualizerWorkerPool.TrySubmit(block, finalized) } - notifyNewBlkStored := event.NewClosure(func(event *tangle.BlockStoredEvent) { + notifyNewBlkStored := event.NewClosure(func(event *tangleold.BlockStoredEvent) { processBlock(event.Block) }) - notifyNewBlkAccepted := event.NewClosure(func(event *tangle.BlockAcceptedEvent) { + notifyNewBlkAccepted := event.NewClosure(func(event *tangleold.BlockAcceptedEvent) { processBlock(event.Block) }) - notifyNewTip := event.NewClosure(func(tipEvent *tangle.TipEvent) { + notifyNewTip := event.NewClosure(func(tipEvent *tangleold.TipEvent) { visualizerWorkerPool.TrySubmit(tipEvent, tipEvent.BlockID, true) }) - notifyDeletedTip := event.NewClosure(func(tipEvent *tangle.TipEvent) { + notifyDeletedTip := event.NewClosure(func(tipEvent *tangleold.TipEvent) { visualizerWorkerPool.TrySubmit(tipEvent, tipEvent.BlockID, false) }) @@ -125,7 +126,7 @@ func setupVisualizerRoutes(routeGroup *echo.Group) { blkHistoryMutex.RLock() defer blkHistoryMutex.RUnlock() - cpyHistory := make([]*tangle.Block, len(blkHistory)) + cpyHistory := make([]*tangleold.Block, len(blkHistory)) copy(cpyHistory, blkHistory) var res []vertex @@ -142,7 +143,7 @@ func setupVisualizerRoutes(routeGroup *echo.Group) { }) } -func addToHistory(blk *tangle.Block, finalized bool) { +func addToHistory(blk *tangleold.Block, finalized bool) { blkHistoryMutex.Lock() defer blkHistoryMutex.Unlock() if _, exist := blkFinalized[blk.ID().Base58()]; exist { diff --git a/plugins/dashboard/ws.go b/plugins/dashboard/ws.go index c4e79ea99f..35497da908 100644 --- a/plugins/dashboard/ws.go +++ b/plugins/dashboard/ws.go @@ -7,12 +7,12 @@ import ( "time" "github.com/gorilla/websocket" - "github.com/iotaledger/hive.go/daemon" - "github.com/iotaledger/hive.go/generics/event" - "github.com/iotaledger/hive.go/workerpool" + "github.com/iotaledger/hive.go/core/daemon" + "github.com/iotaledger/hive.go/core/generics/event" + "github.com/iotaledger/hive.go/core/workerpool" "github.com/labstack/echo" - "github.com/iotaledger/goshimmer/packages/shutdown" + "github.com/iotaledger/goshimmer/packages/node/shutdown" "github.com/iotaledger/goshimmer/plugins/metrics" ) diff --git a/plugins/database/health.go b/plugins/database/health.go index 30dff39b86..44d8970bfa 100644 --- a/plugins/database/health.go +++ b/plugins/database/health.go @@ -4,9 +4,9 @@ import ( "fmt" "github.com/cockroachdb/errors" - "github.com/iotaledger/hive.go/kvstore" + "github.com/iotaledger/hive.go/core/kvstore" - "github.com/iotaledger/goshimmer/packages/database" + "github.com/iotaledger/goshimmer/packages/node/database" ) var ( diff --git a/plugins/database/parameters.go b/plugins/database/parameters.go index 92875cf0c2..2315e62bf1 100644 --- a/plugins/database/parameters.go +++ b/plugins/database/parameters.go @@ -3,7 +3,7 @@ package database import ( "time" - "github.com/iotaledger/hive.go/configuration" + "github.com/iotaledger/goshimmer/plugins/config" ) // ParametersDefinition contains the definition of configuration parameters used by the storage layer. @@ -25,5 +25,5 @@ type ParametersDefinition struct { var Parameters = &ParametersDefinition{} func init() { - configuration.BindParameters(Parameters, "database") + config.BindParameters(Parameters, "database") } diff --git a/plugins/database/plugin.go b/plugins/database/plugin.go index 26c5b7ad36..cd900343f4 100644 --- a/plugins/database/plugin.go +++ b/plugins/database/plugin.go @@ -10,14 +10,14 @@ import ( "github.com/cockroachdb/errors" "go.uber.org/dig" - "github.com/iotaledger/hive.go/daemon" - "github.com/iotaledger/hive.go/generics/event" - "github.com/iotaledger/hive.go/kvstore" - "github.com/iotaledger/hive.go/logger" - "github.com/iotaledger/hive.go/node" - - "github.com/iotaledger/goshimmer/packages/database" - "github.com/iotaledger/goshimmer/packages/shutdown" + "github.com/iotaledger/hive.go/core/daemon" + "github.com/iotaledger/hive.go/core/generics/event" + "github.com/iotaledger/hive.go/core/kvstore" + "github.com/iotaledger/hive.go/core/logger" + "github.com/iotaledger/hive.go/core/node" + + "github.com/iotaledger/goshimmer/packages/node/database" + "github.com/iotaledger/goshimmer/packages/node/shutdown" ) // PluginName is the name of the database plugin. diff --git a/plugins/database/versioning.go b/plugins/database/versioning.go index 7f1fcefb10..dc3ef96348 100644 --- a/plugins/database/versioning.go +++ b/plugins/database/versioning.go @@ -5,13 +5,13 @@ import ( "github.com/cockroachdb/errors" - "github.com/iotaledger/hive.go/kvstore" + "github.com/iotaledger/hive.go/core/kvstore" ) const ( // DBVersion defines the version of the database schema this version of GoShimmer supports. // Every time there's a breaking change regarding the stored data, this version flag should be adjusted. - DBVersion = 61 + DBVersion = 62 ) var ( diff --git a/plugins/epochstorage/plugin.go b/plugins/epochstorage/plugin.go index 8abd55f1b2..774ec62343 100644 --- a/plugins/epochstorage/plugin.go +++ b/plugins/epochstorage/plugin.go @@ -9,20 +9,22 @@ import ( "go.uber.org/dig" - "github.com/iotaledger/hive.go/daemon" - "github.com/iotaledger/hive.go/generics/event" - "github.com/iotaledger/hive.go/identity" - "github.com/iotaledger/hive.go/kvstore" - "github.com/iotaledger/hive.go/node" - "github.com/iotaledger/hive.go/types" - - "github.com/iotaledger/goshimmer/packages/database" - "github.com/iotaledger/goshimmer/packages/epoch" - "github.com/iotaledger/goshimmer/packages/ledger" - "github.com/iotaledger/goshimmer/packages/ledger/utxo" - "github.com/iotaledger/goshimmer/packages/notarization" - "github.com/iotaledger/goshimmer/packages/shutdown" - "github.com/iotaledger/goshimmer/packages/tangle" + "github.com/iotaledger/hive.go/core/daemon" + "github.com/iotaledger/hive.go/core/generics/event" + "github.com/iotaledger/hive.go/core/identity" + "github.com/iotaledger/hive.go/core/kvstore" + "github.com/iotaledger/hive.go/core/node" + "github.com/iotaledger/hive.go/core/types" + + "github.com/iotaledger/goshimmer/packages/core/epoch" + "github.com/iotaledger/goshimmer/packages/core/ledger" + "github.com/iotaledger/goshimmer/packages/core/ledger/utxo" + + "github.com/iotaledger/goshimmer/packages/core/notarization" + "github.com/iotaledger/goshimmer/packages/node/database" + "github.com/iotaledger/goshimmer/packages/node/shutdown" + + "github.com/iotaledger/goshimmer/packages/core/tangleold" ) // region Plugin /////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -56,7 +58,7 @@ type latestVote struct { type dependencies struct { dig.In - Tangle *tangle.Tangle + Tangle *tangleold.Tangle NotarizationMgr *notarization.Manager Storage kvstore.KVStore } @@ -126,7 +128,7 @@ func configure(plugin *node.Plugin) { committableEpochs = append(committableEpochs, event.ECRecord) })) - deps.Tangle.ConfirmationOracle.Events().BlockAccepted.Attach(event.NewClosure(func(event *tangle.BlockAcceptedEvent) { + deps.Tangle.ConfirmationOracle.Events().BlockAccepted.Attach(event.NewClosure(func(event *tangleold.BlockAcceptedEvent) { block := event.Block saveEpochVotersWeight(block) })) @@ -190,11 +192,11 @@ func GetPendingConflictCount() map[epoch.Index]uint64 { return deps.NotarizationMgr.PendingConflictsCountAll() } -func GetEpochblocks(ei epoch.Index) (blockIDs []tangle.BlockID) { +func GetEpochblocks(ei epoch.Index) (blockIDs []tangleold.BlockID) { prefix := append([]byte{database.PrefixEpochsStorage, prefixBlockIDs}, ei.Bytes()...) baseStore.IterateKeys(prefix, func(key kvstore.Key) bool { - var blockID tangle.BlockID + var blockID tangleold.BlockID if _, err := blockID.FromBytes(key); err != nil { panic("BlockID could not be parsed!") } @@ -263,7 +265,7 @@ func GetEpochVotersWeight(ei epoch.Index) (weights map[epoch.ECR]map[identity.ID return weights } -func insertblockToEpoch(ei epoch.Index, blkID tangle.BlockID) error { +func insertblockToEpoch(ei epoch.Index, blkID tangleold.BlockID) error { blockStore, err := baseStore.WithRealm(append([]byte{database.PrefixEpochsStorage, prefixBlockIDs}, ei.Bytes()...)) if err != nil { panic(err) @@ -275,7 +277,7 @@ func insertblockToEpoch(ei epoch.Index, blkID tangle.BlockID) error { return nil } -func removeblockFromEpoch(ei epoch.Index, blkID tangle.BlockID) error { +func removeblockFromEpoch(ei epoch.Index, blkID tangleold.BlockID) error { blockStore, err := baseStore.WithRealm(append([]byte{database.PrefixEpochsStorage, prefixBlockIDs}, ei.Bytes()...)) if err != nil { panic(err) @@ -363,7 +365,7 @@ func removeOutputsFromEpoch(ei epoch.Index, spent, created []*ledger.OutputWithM return nil } -func saveEpochVotersWeight(block *tangle.Block) { +func saveEpochVotersWeight(block *tangleold.Block) { voter := identity.NewID(block.IssuerPublicKey()) activeWeights, _ := deps.Tangle.WeightProvider.WeightsOfRelevantVoters() diff --git a/plugins/faucet/parameters.go b/plugins/faucet/parameters.go index fb279e6f50..0c7e2e9347 100644 --- a/plugins/faucet/parameters.go +++ b/plugins/faucet/parameters.go @@ -3,7 +3,7 @@ package faucet import ( "time" - "github.com/iotaledger/hive.go/configuration" + "github.com/iotaledger/goshimmer/plugins/config" ) // ParametersDefinition contains the definition of configuration parameters used by the faucet plugin. @@ -40,5 +40,5 @@ type ParametersDefinition struct { var Parameters = &ParametersDefinition{} func init() { - configuration.BindParameters(Parameters, "faucet") + config.BindParameters(Parameters, "faucet") } diff --git a/plugins/faucet/plugin.go b/plugins/faucet/plugin.go index 4dd80eb15b..538990f7c5 100644 --- a/plugins/faucet/plugin.go +++ b/plugins/faucet/plugin.go @@ -7,26 +7,27 @@ import ( "time" "github.com/cockroachdb/errors" - "github.com/iotaledger/hive.go/autopeering/peer" - "github.com/iotaledger/hive.go/daemon" - "github.com/iotaledger/hive.go/generics/event" - "github.com/iotaledger/hive.go/generics/orderedmap" - "github.com/iotaledger/hive.go/identity" - "github.com/iotaledger/hive.go/node" - "github.com/iotaledger/hive.go/workerpool" + "github.com/iotaledger/hive.go/core/autopeering/peer" + "github.com/iotaledger/hive.go/core/daemon" + "github.com/iotaledger/hive.go/core/generics/event" + "github.com/iotaledger/hive.go/core/generics/orderedmap" + "github.com/iotaledger/hive.go/core/identity" + "github.com/iotaledger/hive.go/core/node" + "github.com/iotaledger/hive.go/core/workerpool" "github.com/mr-tron/base58" "go.uber.org/atomic" "go.uber.org/dig" + "github.com/iotaledger/goshimmer/packages/core/ledger/vm/devnetvm" + "github.com/iotaledger/goshimmer/packages/core/ledger/vm/devnetvm/indexer" + "github.com/iotaledger/goshimmer/packages/core/mana" + "github.com/iotaledger/goshimmer/packages/core/pow" + "github.com/iotaledger/goshimmer/packages/core/tangleold" + walletseed "github.com/iotaledger/goshimmer/client/wallet/packages/seed" - "github.com/iotaledger/goshimmer/packages/bootstrapmanager" - "github.com/iotaledger/goshimmer/packages/faucet" - "github.com/iotaledger/goshimmer/packages/ledger/vm/devnetvm" - "github.com/iotaledger/goshimmer/packages/ledger/vm/devnetvm/indexer" - "github.com/iotaledger/goshimmer/packages/mana" - "github.com/iotaledger/goshimmer/packages/pow" - "github.com/iotaledger/goshimmer/packages/shutdown" - "github.com/iotaledger/goshimmer/packages/tangle" + "github.com/iotaledger/goshimmer/packages/app/faucet" + "github.com/iotaledger/goshimmer/packages/core/bootstrapmanager" + "github.com/iotaledger/goshimmer/packages/node/shutdown" "github.com/iotaledger/goshimmer/plugins/blocklayer" ) @@ -63,7 +64,7 @@ type dependencies struct { dig.In Local *peer.Local - Tangle *tangle.Tangle + Tangle *tangleold.Tangle BootstrapManager *bootstrapmanager.Manager Indexer *indexer.Indexer } @@ -75,26 +76,26 @@ func init() { // newFaucet gets the faucet component instance the faucet plugin has initialized. func newFaucet() *StateManager { if Parameters.Seed == "" { - Plugin.LogFatal("a seed must be defined when enabling the faucet plugin") + Plugin.LogFatalAndExit("a seed must be defined when enabling the faucet plugin") } seedBytes, err := base58.Decode(Parameters.Seed) if err != nil { - Plugin.LogFatalf("configured seed for the faucet is invalid: %s", err) + Plugin.LogFatalfAndExit("configured seed for the faucet is invalid: %s", err) } if Parameters.TokensPerRequest <= 0 { - Plugin.LogFatalf("the amount of tokens to fulfill per request must be above zero") + Plugin.LogFatalfAndExit("the amount of tokens to fulfill per request must be above zero") } if Parameters.MaxTransactionBookedAwaitTime <= 0 { - Plugin.LogFatalf("the max transaction booked await time must be more than 0") + Plugin.LogFatalfAndExit("the max transaction booked await time must be more than 0") } if Parameters.SupplyOutputsCount <= 0 { - Plugin.LogFatalf("the number of faucet supply outputs should be more than 0") + Plugin.LogFatalfAndExit("the number of faucet supply outputs should be more than 0") } if Parameters.SplittingMultiplier <= 0 { - Plugin.LogFatalf("the number of outputs for each supply transaction during funds splitting should be more than 0") + Plugin.LogFatalfAndExit("the number of outputs for each supply transaction during funds splitting should be more than 0") } if Parameters.GenesisTokenAmount <= 0 { - Plugin.LogFatalf("the total supply should be more than 0") + Plugin.LogFatalfAndExit("the total supply should be more than 0") } return NewStateManager( uint64(Parameters.TokensPerRequest), @@ -200,16 +201,16 @@ func waitForMana(ctx context.Context) error { if err != nil && !errors.Is(err, mana.ErrNodeNotFoundInBaseManaVector) { return err } - if aMana >= tangle.MinMana { + if aMana >= tangleold.MinMana { return nil } - Plugin.LogDebugf("insufficient access mana: %f < %f", aMana, tangle.MinMana) + Plugin.LogDebugf("insufficient access mana: %f < %f", aMana, tangleold.MinMana) time.Sleep(waitForManaWindow) } } func configureEvents() { - deps.Tangle.ApprovalWeightManager.Events.BlockProcessed.Attach(event.NewClosure(func(event *tangle.BlockProcessedEvent) { + deps.Tangle.ApprovalWeightManager.Events.BlockProcessed.Attach(event.NewClosure(func(event *tangleold.BlockProcessedEvent) { onBlockProcessed(event.BlockID) })) deps.BootstrapManager.Events.Bootstrapped.Attach(event.NewClosure(func(event *bootstrapmanager.BootstrappedEvent) { @@ -233,7 +234,7 @@ func OnWebAPIRequest(fundingRequest *faucet.Payload) error { return nil } -func onBlockProcessed(blockID tangle.BlockID) { +func onBlockProcessed(blockID tangleold.BlockID) { // Do not start picking up request while waiting for initialization. // If faucet nodes crashes, and you restart with a clean db, all previous faucet req blks will be enqueued // and addresses will be funded again. Therefore, do not process any faucet request blocks until we are in @@ -241,7 +242,7 @@ func onBlockProcessed(blockID tangle.BlockID) { if !initDone.Load() { return } - deps.Tangle.Storage.Block(blockID).Consume(func(block *tangle.Block) { + deps.Tangle.Storage.Block(blockID).Consume(func(block *tangleold.Block) { if !faucet.IsFaucetReq(block) { return } diff --git a/plugins/faucet/state_manager.go b/plugins/faucet/state_manager.go index 16252841f7..7a3f41cdad 100644 --- a/plugins/faucet/state_manager.go +++ b/plugins/faucet/state_manager.go @@ -7,23 +7,23 @@ import ( "time" "github.com/cockroachdb/errors" - "github.com/iotaledger/hive.go/crypto/ed25519" - "github.com/iotaledger/hive.go/generics/event" - "github.com/iotaledger/hive.go/generics/lo" - "github.com/iotaledger/hive.go/identity" - "github.com/iotaledger/hive.go/types" - "github.com/iotaledger/hive.go/typeutils" - "github.com/iotaledger/hive.go/workerpool" + "github.com/iotaledger/hive.go/core/crypto/ed25519" + "github.com/iotaledger/hive.go/core/generics/event" + "github.com/iotaledger/hive.go/core/generics/lo" + "github.com/iotaledger/hive.go/core/identity" + "github.com/iotaledger/hive.go/core/types" + "github.com/iotaledger/hive.go/core/typeutils" + "github.com/iotaledger/hive.go/core/workerpool" "go.uber.org/atomic" walletseed "github.com/iotaledger/goshimmer/client/wallet/packages/seed" - "github.com/iotaledger/goshimmer/packages/clock" - "github.com/iotaledger/goshimmer/packages/faucet" - "github.com/iotaledger/goshimmer/packages/ledger" - "github.com/iotaledger/goshimmer/packages/ledger/utxo" - "github.com/iotaledger/goshimmer/packages/ledger/vm/devnetvm" - "github.com/iotaledger/goshimmer/packages/ledger/vm/devnetvm/indexer" - "github.com/iotaledger/goshimmer/packages/tangle" + "github.com/iotaledger/goshimmer/packages/app/faucet" + "github.com/iotaledger/goshimmer/packages/core/ledger" + "github.com/iotaledger/goshimmer/packages/core/ledger/utxo" + "github.com/iotaledger/goshimmer/packages/core/ledger/vm/devnetvm" + "github.com/iotaledger/goshimmer/packages/core/ledger/vm/devnetvm/indexer" + "github.com/iotaledger/goshimmer/packages/core/tangleold" + "github.com/iotaledger/goshimmer/packages/node/clock" "github.com/iotaledger/goshimmer/plugins/blocklayer" ) @@ -178,7 +178,7 @@ func (s *StateManager) DeriveStateFromTangle(ctx context.Context) (err error) { // FulFillFundingRequest fulfills a faucet request by spending the next funding output to the requested address. // Mana of the transaction is pledged to the requesting node. -func (s *StateManager) FulFillFundingRequest(faucetReq *faucet.Payload) (*tangle.Block, string, error) { +func (s *StateManager) FulFillFundingRequest(faucetReq *faucet.Payload) (*tangleold.Block, string, error) { if s.replenishThresholdReached() { // wait for replenishment to finish if there is no funding outputs prepared waitForPreparation := s.fundingState.FundingOutputsCount() == 0 @@ -707,9 +707,9 @@ func (s *StateManager) createOutput(addr devnetvm.Address, balance uint64) devne } // issueTx issues a transaction to the Tangle and waits for it to become booked. -func (s *StateManager) issueTx(tx *devnetvm.Transaction) (blk *tangle.Block, err error) { +func (s *StateManager) issueTx(tx *devnetvm.Transaction) (blk *tangleold.Block, err error) { // attach to block layer - issueTransaction := func() (*tangle.Block, error) { + issueTransaction := func() (*tangleold.Block, error) { block, e := deps.Tangle.IssuePayload(tx) if e != nil { return nil, e diff --git a/plugins/firewall/plugin.go b/plugins/firewall/plugin.go index 8440283e0a..2668542eaa 100644 --- a/plugins/firewall/plugin.go +++ b/plugins/firewall/plugin.go @@ -6,17 +6,18 @@ import ( "github.com/labstack/echo" "go.uber.org/dig" - "github.com/iotaledger/hive.go/autopeering/selection" - "github.com/iotaledger/hive.go/daemon" - "github.com/iotaledger/hive.go/generics/event" - "github.com/iotaledger/hive.go/node" - - "github.com/iotaledger/goshimmer/packages/firewall" - "github.com/iotaledger/goshimmer/packages/gossip" - "github.com/iotaledger/goshimmer/packages/p2p" - "github.com/iotaledger/goshimmer/packages/ratelimiter" - "github.com/iotaledger/goshimmer/packages/shutdown" - "github.com/iotaledger/goshimmer/packages/tangle" + "github.com/iotaledger/hive.go/core/autopeering/selection" + "github.com/iotaledger/hive.go/core/daemon" + "github.com/iotaledger/hive.go/core/generics/event" + "github.com/iotaledger/hive.go/core/node" + + "github.com/iotaledger/goshimmer/packages/core/tangleold" + + "github.com/iotaledger/goshimmer/packages/app/firewall" + "github.com/iotaledger/goshimmer/packages/app/ratelimiter" + "github.com/iotaledger/goshimmer/packages/node/gossip" + "github.com/iotaledger/goshimmer/packages/node/p2p" + "github.com/iotaledger/goshimmer/packages/node/shutdown" ) // PluginName is the name of the gossip plugin. @@ -35,7 +36,7 @@ type dependencies struct { GossipMgr *gossip.Manager Server *echo.Echo Firewall *firewall.Firewall - Tangle *tangle.Tangle + Tangle *tangleold.Tangle } type firewallDeps struct { @@ -57,7 +58,7 @@ func init() { func createFirewall(fDeps firewallDeps) *firewall.Firewall { f, err := firewall.NewFirewall(fDeps.P2PMgr, fDeps.AutopeeringMgr, Plugin.Logger()) if err != nil { - Plugin.LogFatalf("Couldn't initialize firewall instance: %+v", err) + Plugin.LogFatalfAndExit("Couldn't initialize firewall instance: %+v", err) } return f } diff --git a/plugins/firewall/webapi.go b/plugins/firewall/webapi.go index 15f0c180cd..df404cf19b 100644 --- a/plugins/firewall/webapi.go +++ b/plugins/firewall/webapi.go @@ -4,10 +4,10 @@ import ( "net/http" "github.com/cockroachdb/errors" - "github.com/iotaledger/hive.go/identity" + "github.com/iotaledger/hive.go/core/identity" "github.com/labstack/echo" - "github.com/iotaledger/goshimmer/packages/jsonmodels" + "github.com/iotaledger/goshimmer/packages/app/jsonmodels" ) // RoutePeerFaultinessCount defines the HTTP path for firewall/is-peer-faulty endpoint. diff --git a/plugins/gossip/gossip.go b/plugins/gossip/gossip.go index 557171083d..421708d573 100644 --- a/plugins/gossip/gossip.go +++ b/plugins/gossip/gossip.go @@ -4,20 +4,21 @@ import ( "context" "github.com/cockroachdb/errors" - "github.com/iotaledger/hive.go/crypto" + "github.com/iotaledger/hive.go/core/crypto" - "github.com/iotaledger/goshimmer/packages/gossip" - "github.com/iotaledger/goshimmer/packages/p2p" - "github.com/iotaledger/goshimmer/packages/ratelimiter" - "github.com/iotaledger/goshimmer/packages/tangle" + "github.com/iotaledger/goshimmer/packages/core/tangleold" + + "github.com/iotaledger/goshimmer/packages/app/ratelimiter" + "github.com/iotaledger/goshimmer/packages/node/gossip" + "github.com/iotaledger/goshimmer/packages/node/p2p" ) // ErrBlockNotFound is returned when a block could not be found in the Tangle. var ErrBlockNotFound = errors.New("block not found") -func createManager(p2pManager *p2p.Manager, t *tangle.Tangle) *gossip.Manager { +func createManager(p2pManager *p2p.Manager, t *tangleold.Tangle) *gossip.Manager { // loads the given block from the block layer and returns it or an error if not found. - loadBlock := func(blkID tangle.BlockID) ([]byte, error) { + loadBlock := func(blkID tangleold.BlockID) ([]byte, error) { cachedBlock := t.Storage.Block(blkID) defer cachedBlock.Release() if !cachedBlock.Exists() { @@ -39,7 +40,7 @@ func createManager(p2pManager *p2p.Manager, t *tangle.Tangle) *gossip.Manager { Plugin.Logger().With("rateLimiter", "blocksRateLimiter"), ) if mrlErr != nil { - Plugin.LogFatalf("Failed to initialize blocks rate limiter: %+v", mrlErr) + Plugin.LogFatalfAndExit("Failed to initialize blocks rate limiter: %+v", mrlErr) } opts = append(opts, gossip.WithBlocksRateLimiter(mrl)) } @@ -51,7 +52,7 @@ func createManager(p2pManager *p2p.Manager, t *tangle.Tangle) *gossip.Manager { Plugin.Logger().With("rateLimiter", "blockRequestsRateLimiter"), ) if mrrlErr != nil { - Plugin.LogFatalf("Failed to initialize block requests rate limiter: %+v", mrrlErr) + Plugin.LogFatalfAndExit("Failed to initialize block requests rate limiter: %+v", mrrlErr) } opts = append(opts, gossip.WithBlockRequestsRateLimiter(mrrl)) } diff --git a/plugins/gossip/parameters.go b/plugins/gossip/parameters.go index 1e18fc1b72..fd01f7c352 100644 --- a/plugins/gossip/parameters.go +++ b/plugins/gossip/parameters.go @@ -3,7 +3,7 @@ package gossip import ( "time" - "github.com/iotaledger/hive.go/configuration" + "github.com/iotaledger/goshimmer/plugins/config" ) // ParametersDefinition contains the definition of configuration parameters used by the gossip plugin. @@ -29,5 +29,5 @@ type blockRequestsLimitParameters struct { var Parameters = &ParametersDefinition{} func init() { - configuration.BindParameters(Parameters, "gossip") + config.BindParameters(Parameters, "gossip") } diff --git a/plugins/gossip/plugin.go b/plugins/gossip/plugin.go index a9d396c8dd..374afbf00e 100644 --- a/plugins/gossip/plugin.go +++ b/plugins/gossip/plugin.go @@ -1,17 +1,18 @@ package gossip import ( - "github.com/iotaledger/hive.go/generics/lo" + "github.com/iotaledger/hive.go/core/generics/lo" "go.uber.org/dig" - "github.com/iotaledger/hive.go/daemon" - "github.com/iotaledger/hive.go/generics/event" - "github.com/iotaledger/hive.go/node" + "github.com/iotaledger/hive.go/core/daemon" + "github.com/iotaledger/hive.go/core/generics/event" + "github.com/iotaledger/hive.go/core/node" - "github.com/iotaledger/goshimmer/packages/gossip" - "github.com/iotaledger/goshimmer/packages/p2p" - "github.com/iotaledger/goshimmer/packages/shutdown" - "github.com/iotaledger/goshimmer/packages/tangle" + "github.com/iotaledger/goshimmer/packages/node/gossip" + "github.com/iotaledger/goshimmer/packages/node/p2p" + "github.com/iotaledger/goshimmer/packages/node/shutdown" + + "github.com/iotaledger/goshimmer/packages/core/tangleold" ) // PluginName is the name of the gossip plugin. @@ -27,7 +28,7 @@ var ( type dependencies struct { dig.In - Tangle *tangle.Tangle + Tangle *tangleold.Tangle GossipMgr *gossip.Manager P2PMgr *p2p.Manager } @@ -55,13 +56,13 @@ func run(plugin *node.Plugin) { func configureLogging() { // log the gossip events - deps.Tangle.Requester.Events.RequestStarted.Attach(event.NewClosure(func(event *tangle.RequestStartedEvent) { + deps.Tangle.Requester.Events.RequestStarted.Attach(event.NewClosure(func(event *tangleold.RequestStartedEvent) { Plugin.LogDebugf("started to request missing Block with %s", event.BlockID) })) - deps.Tangle.Requester.Events.RequestStopped.Attach(event.NewClosure(func(event *tangle.RequestStoppedEvent) { + deps.Tangle.Requester.Events.RequestStopped.Attach(event.NewClosure(func(event *tangleold.RequestStoppedEvent) { Plugin.LogDebugf("stopped to request missing Block with %s", event.BlockID) })) - deps.Tangle.Requester.Events.RequestFailed.Attach(event.NewClosure(func(event *tangle.RequestFailedEvent) { + deps.Tangle.Requester.Events.RequestFailed.Attach(event.NewClosure(func(event *tangleold.RequestFailedEvent) { Plugin.LogDebugf("failed to request missing Block with %s", event.BlockID) })) } @@ -73,14 +74,14 @@ func configureBlockLayer() { })) // configure flow of outgoing blocks (gossip upon dispatched blocks) - deps.Tangle.Scheduler.Events.BlockScheduled.Attach(event.NewClosure(func(event *tangle.BlockScheduledEvent) { - deps.Tangle.Storage.Block(event.BlockID).Consume(func(block *tangle.Block) { + deps.Tangle.Scheduler.Events.BlockScheduled.Attach(event.NewClosure(func(event *tangleold.BlockScheduledEvent) { + deps.Tangle.Storage.Block(event.BlockID).Consume(func(block *tangleold.Block) { deps.GossipMgr.SendBlock(lo.PanicOnErr(block.Bytes())) }) })) // request missing blocks - deps.Tangle.Requester.Events.RequestIssued.Attach(event.NewClosure(func(event *tangle.RequestIssuedEvent) { + deps.Tangle.Requester.Events.RequestIssued.Attach(event.NewClosure(func(event *tangleold.RequestIssuedEvent) { id := event.BlockID Plugin.LogDebugf("requesting missing Block with %s", id) diff --git a/plugins/gracefulshutdown/parameters.go b/plugins/gracefulshutdown/parameters.go index a5485c0d5b..2981528083 100644 --- a/plugins/gracefulshutdown/parameters.go +++ b/plugins/gracefulshutdown/parameters.go @@ -3,7 +3,7 @@ package gracefulshutdown import ( "time" - "github.com/iotaledger/hive.go/configuration" + "github.com/iotaledger/goshimmer/plugins/config" ) // ParametersDefinition contains the definition of configuration parameters used by the graceful shutdown plugin. @@ -16,5 +16,5 @@ type ParametersDefinition struct { var Parameters = &ParametersDefinition{} func init() { - configuration.BindParameters(Parameters, "gracefulShutdown") + config.BindParameters(Parameters, "gracefulShutdown") } diff --git a/plugins/gracefulshutdown/plugin.go b/plugins/gracefulshutdown/plugin.go index c9951e0abc..a8ed36f97e 100644 --- a/plugins/gracefulshutdown/plugin.go +++ b/plugins/gracefulshutdown/plugin.go @@ -9,8 +9,8 @@ import ( "syscall" "time" - "github.com/iotaledger/hive.go/daemon" - "github.com/iotaledger/hive.go/node" + "github.com/iotaledger/hive.go/core/daemon" + "github.com/iotaledger/hive.go/core/node" ) // PluginName is the name of the graceful shutdown plugin. diff --git a/plugins/logger/parameters.go b/plugins/logger/parameters.go index 55ea631ae8..14882d6b66 100644 --- a/plugins/logger/parameters.go +++ b/plugins/logger/parameters.go @@ -1,6 +1,6 @@ package logger -import "github.com/iotaledger/hive.go/configuration" +import "github.com/iotaledger/goshimmer/plugins/config" // ParametersDefinition contains the definition of configuration parameters used by the logger plugin. type ParametersDefinition struct { @@ -27,5 +27,5 @@ type ParametersDefinition struct { var Parameters = &ParametersDefinition{} func init() { - configuration.BindParameters(Parameters, "logger") + config.BindParameters(Parameters, "logger") } diff --git a/plugins/logger/plugin.go b/plugins/logger/plugin.go index 8546b1ff04..921b1ac6e9 100644 --- a/plugins/logger/plugin.go +++ b/plugins/logger/plugin.go @@ -3,11 +3,11 @@ package logger import ( "go.uber.org/dig" - "github.com/iotaledger/hive.go/configuration" - "github.com/iotaledger/hive.go/daemon" - "github.com/iotaledger/hive.go/generics/event" - "github.com/iotaledger/hive.go/logger" - "github.com/iotaledger/hive.go/node" + "github.com/iotaledger/hive.go/core/configuration" + "github.com/iotaledger/hive.go/core/daemon" + "github.com/iotaledger/hive.go/core/generics/event" + "github.com/iotaledger/hive.go/core/logger" + "github.com/iotaledger/hive.go/core/node" ) // PluginName is the name of the logger plugin. diff --git a/plugins/manaeventlogger/parameters.go b/plugins/manaeventlogger/parameters.go index 1812930dfc..8fb4c223ad 100644 --- a/plugins/manaeventlogger/parameters.go +++ b/plugins/manaeventlogger/parameters.go @@ -3,7 +3,7 @@ package manaeventlogger import ( "time" - "github.com/iotaledger/hive.go/configuration" + "github.com/iotaledger/goshimmer/plugins/config" ) // ParametersDefinition contains the definition of the parameters used by the mana event logger plugin. @@ -20,5 +20,5 @@ type ParametersDefinition struct { var Parameters = &ParametersDefinition{} func init() { - configuration.BindParameters(Parameters, "manaEventLogger") + config.BindParameters(Parameters, "manaEventLogger") } diff --git a/plugins/manaeventlogger/plugin.go b/plugins/manaeventlogger/plugin.go index 76e0598d7d..b4b896f920 100644 --- a/plugins/manaeventlogger/plugin.go +++ b/plugins/manaeventlogger/plugin.go @@ -7,13 +7,14 @@ import ( "sync" "time" - "github.com/iotaledger/hive.go/daemon" - "github.com/iotaledger/hive.go/generics/event" - "github.com/iotaledger/hive.go/logger" - "github.com/iotaledger/hive.go/node" + "github.com/iotaledger/hive.go/core/daemon" + "github.com/iotaledger/hive.go/core/generics/event" + "github.com/iotaledger/hive.go/core/logger" + "github.com/iotaledger/hive.go/core/node" - "github.com/iotaledger/goshimmer/packages/mana" - "github.com/iotaledger/goshimmer/packages/shutdown" + "github.com/iotaledger/goshimmer/packages/core/mana" + + "github.com/iotaledger/goshimmer/packages/node/shutdown" ) const ( diff --git a/plugins/manainitializer/parameters.go b/plugins/manainitializer/parameters.go index dcbf07f1fd..8ba91b4624 100644 --- a/plugins/manainitializer/parameters.go +++ b/plugins/manainitializer/parameters.go @@ -1,8 +1,6 @@ package manainitializer -import ( - "github.com/iotaledger/hive.go/configuration" -) +import "github.com/iotaledger/goshimmer/plugins/config" // ParametersDefinition contains the definition of the parameters used by the manainitializer plugin. type ParametersDefinition struct { @@ -16,5 +14,5 @@ type ParametersDefinition struct { var Parameters = &ParametersDefinition{} func init() { - configuration.BindParameters(Parameters, "manaInitializer") + config.BindParameters(Parameters, "manaInitializer") } diff --git a/plugins/manainitializer/plugin.go b/plugins/manainitializer/plugin.go index 983fb8c7b6..c8ba113b74 100644 --- a/plugins/manainitializer/plugin.go +++ b/plugins/manainitializer/plugin.go @@ -4,8 +4,8 @@ import ( // import required to profile _ "net/http/pprof" - "github.com/iotaledger/hive.go/autopeering/peer" - "github.com/iotaledger/hive.go/node" + "github.com/iotaledger/hive.go/core/autopeering/peer" + "github.com/iotaledger/hive.go/core/node" "go.uber.org/dig" "github.com/iotaledger/goshimmer/client" diff --git a/plugins/manualpeering/parameters.go b/plugins/manualpeering/parameters.go index 11624c71b9..22b11dc0fd 100644 --- a/plugins/manualpeering/parameters.go +++ b/plugins/manualpeering/parameters.go @@ -1,6 +1,6 @@ package manualpeering -import "github.com/iotaledger/hive.go/configuration" +import "github.com/iotaledger/goshimmer/plugins/config" // ParametersDefinition contains the definition of the parameters used by the manualPeering plugin. type ParametersDefinition struct { @@ -12,5 +12,5 @@ type ParametersDefinition struct { var Parameters = &ParametersDefinition{} func init() { - configuration.BindParameters(Parameters, "manualPeering") + config.BindParameters(Parameters, "manualPeering") } diff --git a/plugins/manualpeering/plugin.go b/plugins/manualpeering/plugin.go index 36f7fdb7e6..c484e094ff 100644 --- a/plugins/manualpeering/plugin.go +++ b/plugins/manualpeering/plugin.go @@ -8,16 +8,16 @@ import ( "github.com/labstack/echo" "go.uber.org/dig" - "github.com/iotaledger/hive.go/autopeering/peer" - "github.com/iotaledger/hive.go/daemon" - "github.com/iotaledger/hive.go/generics/event" - "github.com/iotaledger/hive.go/logger" - "github.com/iotaledger/hive.go/node" + "github.com/iotaledger/hive.go/core/autopeering/peer" + "github.com/iotaledger/hive.go/core/daemon" + "github.com/iotaledger/hive.go/core/generics/event" + "github.com/iotaledger/hive.go/core/logger" + "github.com/iotaledger/hive.go/core/node" - "github.com/iotaledger/goshimmer/packages/gossip" - "github.com/iotaledger/goshimmer/packages/manualpeering" - "github.com/iotaledger/goshimmer/packages/p2p" - "github.com/iotaledger/goshimmer/packages/shutdown" + "github.com/iotaledger/goshimmer/packages/node/gossip" + "github.com/iotaledger/goshimmer/packages/node/manualpeering" + "github.com/iotaledger/goshimmer/packages/node/p2p" + "github.com/iotaledger/goshimmer/packages/node/shutdown" ) // PluginName is the name of the manual peering plugin. diff --git a/plugins/manualpeering/webapi.go b/plugins/manualpeering/webapi.go index 1554343c26..a63f7da440 100644 --- a/plugins/manualpeering/webapi.go +++ b/plugins/manualpeering/webapi.go @@ -4,11 +4,11 @@ import ( "net/http" "github.com/cockroachdb/errors" - "github.com/iotaledger/hive.go/crypto/ed25519" + "github.com/iotaledger/hive.go/core/crypto/ed25519" "github.com/labstack/echo" - "github.com/iotaledger/goshimmer/packages/jsonmodels" - "github.com/iotaledger/goshimmer/packages/manualpeering" + "github.com/iotaledger/goshimmer/packages/app/jsonmodels" + "github.com/iotaledger/goshimmer/packages/node/manualpeering" "github.com/iotaledger/goshimmer/plugins/webapi" ) diff --git a/plugins/metrics/autopeering.go b/plugins/metrics/autopeering.go index 5bf8da60e1..8ba9e8c705 100644 --- a/plugins/metrics/autopeering.go +++ b/plugins/metrics/autopeering.go @@ -4,10 +4,11 @@ import ( "sync" "time" - "github.com/iotaledger/goshimmer/packages/p2p" - "github.com/iotaledger/hive.go/autopeering/selection" - "github.com/iotaledger/hive.go/generics/event" + "github.com/iotaledger/hive.go/core/autopeering/selection" + "github.com/iotaledger/hive.go/core/generics/event" "go.uber.org/atomic" + + "github.com/iotaledger/goshimmer/packages/node/p2p" ) var ( diff --git a/plugins/metrics/block.go b/plugins/metrics/block.go index 7229e6338b..1a9ba9f0b1 100644 --- a/plugins/metrics/block.go +++ b/plugins/metrics/block.go @@ -3,11 +3,11 @@ package metrics import ( "time" - "github.com/iotaledger/hive.go/syncutils" + "github.com/iotaledger/hive.go/core/syncutils" "go.uber.org/atomic" - "github.com/iotaledger/goshimmer/packages/tangle" - "github.com/iotaledger/goshimmer/packages/tangle/payload" + "github.com/iotaledger/goshimmer/packages/core/tangleold" + "github.com/iotaledger/goshimmer/packages/core/tangleold/payload" ) // BlockType defines the component for the different BPS metrics. @@ -127,7 +127,7 @@ var ( blockTips atomic.Uint64 // total number of parents of all blocks per parent type. - parentsCountPerType = make(map[tangle.ParentsType]uint64) + parentsCountPerType = make(map[tangleold.ParentsType]uint64) parentsCountPerTypeMutex syncutils.RWMutex // Number of blocks per payload type since start of the node. @@ -328,12 +328,12 @@ func FinalizedBlockCountPerType() map[BlockType]uint64 { } // ParentCountPerType returns a map of parent counts per parent type. -func ParentCountPerType() map[tangle.ParentsType]uint64 { +func ParentCountPerType() map[tangleold.ParentsType]uint64 { parentsCountPerTypeMutex.RLock() defer parentsCountPerTypeMutex.RUnlock() // copy the original map - clone := make(map[tangle.ParentsType]uint64) + clone := make(map[tangleold.ParentsType]uint64) for key, element := range parentsCountPerType { clone[key] = element } @@ -359,7 +359,7 @@ func increasePerComponentCounter(c ComponentType) { blockCountPerComponentGrafana[c]++ } -func increasePerParentType(c tangle.ParentsType) { +func increasePerParentType(c tangleold.ParentsType) { parentsCountPerTypeMutex.Lock() defer parentsCountPerTypeMutex.Unlock() diff --git a/plugins/metrics/block_test.go b/plugins/metrics/block_test.go index 8b6f091cd2..20816123f4 100644 --- a/plugins/metrics/block_test.go +++ b/plugins/metrics/block_test.go @@ -5,8 +5,8 @@ import ( "github.com/magiconair/properties/assert" - "github.com/iotaledger/goshimmer/packages/ledger/vm/devnetvm" - "github.com/iotaledger/goshimmer/packages/tangle/payload" + "github.com/iotaledger/goshimmer/packages/core/ledger/vm/devnetvm" + "github.com/iotaledger/goshimmer/packages/core/tangleold/payload" ) func TestBlockCountPerPayload(t *testing.T) { diff --git a/plugins/metrics/conflict.go b/plugins/metrics/conflict.go index 159f7fa462..f0072aff02 100644 --- a/plugins/metrics/conflict.go +++ b/plugins/metrics/conflict.go @@ -3,11 +3,11 @@ package metrics import ( "sync" - "github.com/iotaledger/hive.go/types" + "github.com/iotaledger/hive.go/core/types" "go.uber.org/atomic" - "github.com/iotaledger/goshimmer/packages/conflictdag" - "github.com/iotaledger/goshimmer/packages/ledger/utxo" + "github.com/iotaledger/goshimmer/packages/core/conflictdag" + "github.com/iotaledger/goshimmer/packages/core/ledger/utxo" ) var ( diff --git a/plugins/metrics/epochcommittment.go b/plugins/metrics/epochcommittment.go index f7840efe91..315504d8ab 100644 --- a/plugins/metrics/epochcommittment.go +++ b/plugins/metrics/epochcommittment.go @@ -3,10 +3,10 @@ package metrics import ( "sync" - "github.com/iotaledger/hive.go/generics/event" + "github.com/iotaledger/hive.go/core/generics/event" - "github.com/iotaledger/goshimmer/packages/epoch" - "github.com/iotaledger/goshimmer/packages/notarization" + "github.com/iotaledger/goshimmer/packages/core/epoch" + "github.com/iotaledger/goshimmer/packages/core/notarization" ) var ( diff --git a/plugins/metrics/events.go b/plugins/metrics/events.go index 82a6c07418..b74955386b 100644 --- a/plugins/metrics/events.go +++ b/plugins/metrics/events.go @@ -3,7 +3,7 @@ package metrics import ( "time" - "github.com/iotaledger/hive.go/generics/event" + "github.com/iotaledger/hive.go/core/generics/event" ) // Events defines the events of the plugin. diff --git a/plugins/metrics/global_metrics.go b/plugins/metrics/global_metrics.go index b3f7791625..0d3dc63d15 100644 --- a/plugins/metrics/global_metrics.go +++ b/plugins/metrics/global_metrics.go @@ -3,8 +3,8 @@ package metrics import ( "sync" - "github.com/iotaledger/hive.go/generics/event" - "github.com/iotaledger/hive.go/identity" + "github.com/iotaledger/hive.go/core/generics/event" + "github.com/iotaledger/hive.go/core/identity" "go.uber.org/atomic" analysisserver "github.com/iotaledger/goshimmer/plugins/analysis/server" diff --git a/plugins/metrics/mana.go b/plugins/metrics/mana.go index b3d0265345..eb38c6dae4 100644 --- a/plugins/metrics/mana.go +++ b/plugins/metrics/mana.go @@ -3,10 +3,10 @@ package metrics import ( "sync" - "github.com/iotaledger/hive.go/identity" + "github.com/iotaledger/hive.go/core/identity" "go.uber.org/atomic" - "github.com/iotaledger/goshimmer/packages/mana" + "github.com/iotaledger/goshimmer/packages/core/mana" manaPlugin "github.com/iotaledger/goshimmer/plugins/blocklayer" ) diff --git a/plugins/metrics/manaresearch.go b/plugins/metrics/manaresearch.go index daaa8f0ae6..184a2f0ce4 100644 --- a/plugins/metrics/manaresearch.go +++ b/plugins/metrics/manaresearch.go @@ -5,7 +5,7 @@ import ( "go.uber.org/atomic" - "github.com/iotaledger/goshimmer/packages/mana" + "github.com/iotaledger/goshimmer/packages/core/mana" manaPlugin "github.com/iotaledger/goshimmer/plugins/blocklayer" ) diff --git a/plugins/metrics/network.go b/plugins/metrics/network.go index f15d148558..9fad941f63 100644 --- a/plugins/metrics/network.go +++ b/plugins/metrics/network.go @@ -1,7 +1,7 @@ package metrics import ( - "github.com/iotaledger/hive.go/identity" + "github.com/iotaledger/hive.go/core/identity" "go.uber.org/atomic" ) diff --git a/plugins/metrics/parameters.go b/plugins/metrics/parameters.go index 4b807998b0..2a812db064 100644 --- a/plugins/metrics/parameters.go +++ b/plugins/metrics/parameters.go @@ -3,7 +3,7 @@ package metrics import ( "time" - "github.com/iotaledger/hive.go/configuration" + "github.com/iotaledger/goshimmer/plugins/config" ) // ParametersDefinition contains the definition of the parameters used by the metrics plugin. @@ -22,5 +22,5 @@ type ParametersDefinition struct { var Parameters = &ParametersDefinition{} func init() { - configuration.BindParameters(Parameters, "metrics") + config.BindParameters(Parameters, "metrics") } diff --git a/plugins/metrics/plugin.go b/plugins/metrics/plugin.go index 1fa5dff3bf..1ec18b6080 100644 --- a/plugins/metrics/plugin.go +++ b/plugins/metrics/plugin.go @@ -4,25 +4,27 @@ import ( "context" "time" - "github.com/iotaledger/hive.go/autopeering/peer" - "github.com/iotaledger/hive.go/autopeering/selection" - "github.com/iotaledger/hive.go/daemon" - "github.com/iotaledger/hive.go/generics/event" - "github.com/iotaledger/hive.go/logger" - "github.com/iotaledger/hive.go/node" - "github.com/iotaledger/hive.go/timeutil" - "github.com/iotaledger/hive.go/types" + "github.com/iotaledger/hive.go/core/autopeering/peer" + "github.com/iotaledger/hive.go/core/autopeering/selection" + "github.com/iotaledger/hive.go/core/daemon" + "github.com/iotaledger/hive.go/core/generics/event" + "github.com/iotaledger/hive.go/core/logger" + "github.com/iotaledger/hive.go/core/node" + "github.com/iotaledger/hive.go/core/timeutil" + "github.com/iotaledger/hive.go/core/types" "go.uber.org/dig" - "github.com/iotaledger/goshimmer/packages/clock" - "github.com/iotaledger/goshimmer/packages/conflictdag" - "github.com/iotaledger/goshimmer/packages/ledger/utxo" - "github.com/iotaledger/goshimmer/packages/mana" - "github.com/iotaledger/goshimmer/packages/metrics" - "github.com/iotaledger/goshimmer/packages/notarization" - "github.com/iotaledger/goshimmer/packages/p2p" - "github.com/iotaledger/goshimmer/packages/shutdown" - "github.com/iotaledger/goshimmer/packages/tangle" + "github.com/iotaledger/goshimmer/packages/core/conflictdag" + "github.com/iotaledger/goshimmer/packages/node/clock" + + "github.com/iotaledger/goshimmer/packages/core/ledger/utxo" + "github.com/iotaledger/goshimmer/packages/core/mana" + "github.com/iotaledger/goshimmer/packages/core/tangleold" + + "github.com/iotaledger/goshimmer/packages/app/metrics" + "github.com/iotaledger/goshimmer/packages/core/notarization" + "github.com/iotaledger/goshimmer/packages/node/p2p" + "github.com/iotaledger/goshimmer/packages/node/shutdown" "github.com/iotaledger/goshimmer/plugins/analysis/server" ) @@ -39,7 +41,7 @@ var ( type dependencies struct { dig.In - Tangle *tangle.Tangle + Tangle *tangleold.Tangle P2Pmgr *p2p.Manager `optional:"true"` Selection *selection.Protocol `optional:"true"` Local *peer.Local @@ -135,26 +137,26 @@ func registerLocalMetrics() { // // Events declared in other packages which we want to listen to here //// // increase received BPS counter whenever we attached a block - deps.Tangle.Storage.Events.BlockStored.Attach(event.NewClosure(func(event *tangle.BlockStoredEvent) { + deps.Tangle.Storage.Events.BlockStored.Attach(event.NewClosure(func(event *tangleold.BlockStoredEvent) { sumTimeMutex.Lock() defer sumTimeMutex.Unlock() increaseReceivedBPSCounter() increasePerPayloadCounter(event.Block.Payload().Type()) - deps.Tangle.Storage.BlockMetadata(event.Block.ID()).Consume(func(blkMetaData *tangle.BlockMetadata) { + deps.Tangle.Storage.BlockMetadata(event.Block.ID()).Consume(func(blkMetaData *tangleold.BlockMetadata) { sumTimesSinceIssued[Store] += blkMetaData.ReceivedTime().Sub(event.Block.IssuingTime()) }) increasePerComponentCounter(Store) })) // blocks can only become solid once, then they stay like that, hence no .Dec() part - deps.Tangle.Solidifier.Events.BlockSolid.Attach(event.NewClosure(func(event *tangle.BlockSolidEvent) { + deps.Tangle.Solidifier.Events.BlockSolid.Attach(event.NewClosure(func(event *tangleold.BlockSolidEvent) { increasePerComponentCounter(Solidifier) sumTimeMutex.Lock() defer sumTimeMutex.Unlock() // Consume should release cachedBlockMetadata - deps.Tangle.Storage.BlockMetadata(event.Block.ID()).Consume(func(blkMetaData *tangle.BlockMetadata) { + deps.Tangle.Storage.BlockMetadata(event.Block.ID()).Consume(func(blkMetaData *tangleold.BlockMetadata) { if blkMetaData.IsSolid() { sumTimesSinceReceived[Solidifier] += blkMetaData.SolidificationTime().Sub(blkMetaData.ReceivedTime()) } @@ -162,17 +164,17 @@ func registerLocalMetrics() { })) // fired when a block gets added to missing block storage - deps.Tangle.Solidifier.Events.BlockMissing.Attach(event.NewClosure(func(_ *tangle.BlockMissingEvent) { + deps.Tangle.Solidifier.Events.BlockMissing.Attach(event.NewClosure(func(_ *tangleold.BlockMissingEvent) { missingBlockCountDB.Inc() solidificationRequests.Inc() })) // fired when a missing block was received and removed from missing block storage - deps.Tangle.Storage.Events.MissingBlockStored.Attach(event.NewClosure(func(_ *tangle.MissingBlockStoredEvent) { + deps.Tangle.Storage.Events.MissingBlockStored.Attach(event.NewClosure(func(_ *tangleold.MissingBlockStoredEvent) { missingBlockCountDB.Dec() })) - deps.Tangle.Scheduler.Events.BlockScheduled.Attach(event.NewClosure(func(event *tangle.BlockScheduledEvent) { + deps.Tangle.Scheduler.Events.BlockScheduled.Attach(event.NewClosure(func(event *tangleold.BlockScheduledEvent) { increasePerComponentCounter(Scheduler) sumTimeMutex.Lock() defer sumTimeMutex.Unlock() @@ -181,63 +183,63 @@ func registerLocalMetrics() { blockID := event.BlockID // Consume should release cachedBlockMetadata - deps.Tangle.Storage.BlockMetadata(blockID).Consume(func(blkMetaData *tangle.BlockMetadata) { + deps.Tangle.Storage.BlockMetadata(blockID).Consume(func(blkMetaData *tangleold.BlockMetadata) { if blkMetaData.Scheduled() { sumSchedulerBookedTime += blkMetaData.ScheduledTime().Sub(blkMetaData.BookedTime()) sumTimesSinceReceived[Scheduler] += blkMetaData.ScheduledTime().Sub(blkMetaData.ReceivedTime()) - deps.Tangle.Storage.Block(blockID).Consume(func(block *tangle.Block) { + deps.Tangle.Storage.Block(blockID).Consume(func(block *tangleold.Block) { sumTimesSinceIssued[Scheduler] += blkMetaData.ScheduledTime().Sub(block.IssuingTime()) }) } }) })) - deps.Tangle.Booker.Events.BlockBooked.Attach(event.NewClosure(func(event *tangle.BlockBookedEvent) { + deps.Tangle.Booker.Events.BlockBooked.Attach(event.NewClosure(func(event *tangleold.BlockBookedEvent) { increasePerComponentCounter(Booker) sumTimeMutex.Lock() defer sumTimeMutex.Unlock() blockID := event.BlockID - deps.Tangle.Storage.BlockMetadata(blockID).Consume(func(blkMetaData *tangle.BlockMetadata) { + deps.Tangle.Storage.BlockMetadata(blockID).Consume(func(blkMetaData *tangleold.BlockMetadata) { if blkMetaData.IsBooked() { sumTimesSinceReceived[Booker] += blkMetaData.BookedTime().Sub(blkMetaData.ReceivedTime()) - deps.Tangle.Storage.Block(blockID).Consume(func(block *tangle.Block) { + deps.Tangle.Storage.Block(blockID).Consume(func(block *tangleold.Block) { sumTimesSinceIssued[Booker] += blkMetaData.BookedTime().Sub(block.IssuingTime()) }) } }) })) - deps.Tangle.Scheduler.Events.BlockDiscarded.Attach(event.NewClosure(func(event *tangle.BlockDiscardedEvent) { + deps.Tangle.Scheduler.Events.BlockDiscarded.Attach(event.NewClosure(func(event *tangleold.BlockDiscardedEvent) { increasePerComponentCounter(SchedulerDropped) sumTimeMutex.Lock() defer sumTimeMutex.Unlock() blockID := event.BlockID - deps.Tangle.Storage.BlockMetadata(blockID).Consume(func(blkMetaData *tangle.BlockMetadata) { + deps.Tangle.Storage.BlockMetadata(blockID).Consume(func(blkMetaData *tangleold.BlockMetadata) { sumTimesSinceReceived[SchedulerDropped] += clock.Since(blkMetaData.ReceivedTime()) - deps.Tangle.Storage.Block(blockID).Consume(func(block *tangle.Block) { + deps.Tangle.Storage.Block(blockID).Consume(func(block *tangleold.Block) { sumTimesSinceIssued[SchedulerDropped] += clock.Since(block.IssuingTime()) }) }) })) - deps.Tangle.Scheduler.Events.BlockSkipped.Attach(event.NewClosure(func(event *tangle.BlockSkippedEvent) { + deps.Tangle.Scheduler.Events.BlockSkipped.Attach(event.NewClosure(func(event *tangleold.BlockSkippedEvent) { increasePerComponentCounter(SchedulerSkipped) sumTimeMutex.Lock() defer sumTimeMutex.Unlock() blockID := event.BlockID - deps.Tangle.Storage.BlockMetadata(blockID).Consume(func(blkMetaData *tangle.BlockMetadata) { + deps.Tangle.Storage.BlockMetadata(blockID).Consume(func(blkMetaData *tangleold.BlockMetadata) { sumTimesSinceReceived[SchedulerSkipped] += clock.Since(blkMetaData.ReceivedTime()) - deps.Tangle.Storage.Block(blockID).Consume(func(block *tangle.Block) { + deps.Tangle.Storage.Block(blockID).Consume(func(block *tangleold.Block) { sumTimesSinceIssued[SchedulerSkipped] += clock.Since(block.IssuingTime()) }) }) })) - deps.Tangle.ConfirmationOracle.Events().BlockAccepted.Attach(event.NewClosure(func(event *tangle.BlockAcceptedEvent) { + deps.Tangle.ConfirmationOracle.Events().BlockAccepted.Attach(event.NewClosure(func(event *tangleold.BlockAcceptedEvent) { blockType := DataBlock block := event.Block blockID := block.ID() @@ -249,11 +251,11 @@ func registerLocalMetrics() { finalizedBlockCountMutex.Lock() defer finalizedBlockCountMutex.Unlock() - block.ForEachParent(func(parent tangle.Parent) { + block.ForEachParent(func(parent tangleold.Parent) { increasePerParentType(parent.Type) }) blockFinalizationIssuedTotalTime[blockType] += uint64(clock.Since(block.IssuingTime()).Milliseconds()) - if deps.Tangle.Storage.BlockMetadata(blockID).Consume(func(blockMetadata *tangle.BlockMetadata) { + if deps.Tangle.Storage.BlockMetadata(blockID).Consume(func(blockMetadata *tangleold.BlockMetadata) { blockFinalizationReceivedTotalTime[blockType] += uint64(clock.Since(blockMetadata.ReceivedTime()).Milliseconds()) }) { finalizedBlockCount[blockType]++ diff --git a/plugins/metrics/process.go b/plugins/metrics/process.go index 38b2577228..ad40abfcc2 100644 --- a/plugins/metrics/process.go +++ b/plugins/metrics/process.go @@ -7,7 +7,7 @@ import ( "github.com/shirou/gopsutil/cpu" "go.uber.org/atomic" - "github.com/iotaledger/goshimmer/packages/metrics" + "github.com/iotaledger/goshimmer/packages/app/metrics" ) var ( diff --git a/plugins/metrics/process_test.go b/plugins/metrics/process_test.go index b5e9fe2a22..b3e7670cc2 100644 --- a/plugins/metrics/process_test.go +++ b/plugins/metrics/process_test.go @@ -6,8 +6,9 @@ import ( "github.com/stretchr/testify/assert" - "github.com/iotaledger/goshimmer/packages/metrics" - "github.com/iotaledger/hive.go/generics/event" + "github.com/iotaledger/hive.go/core/generics/event" + + "github.com/iotaledger/goshimmer/packages/app/metrics" ) func TestMemUsage(t *testing.T) { diff --git a/plugins/metrics/scheduler.go b/plugins/metrics/scheduler.go index 6b5441e8e1..d2fbff5ff8 100644 --- a/plugins/metrics/scheduler.go +++ b/plugins/metrics/scheduler.go @@ -3,10 +3,10 @@ package metrics import ( "time" - "github.com/iotaledger/goshimmer/packages/tangle/schedulerutils" + "github.com/iotaledger/goshimmer/packages/core/tangleold/schedulerutils" - "github.com/iotaledger/hive.go/identity" - "github.com/iotaledger/hive.go/syncutils" + "github.com/iotaledger/hive.go/core/identity" + "github.com/iotaledger/hive.go/core/syncutils" ) var ( diff --git a/plugins/networkdelay/parameters.go b/plugins/networkdelay/parameters.go index b387d87a8d..05c1cc8856 100644 --- a/plugins/networkdelay/parameters.go +++ b/plugins/networkdelay/parameters.go @@ -1,8 +1,6 @@ package networkdelay -import ( - "github.com/iotaledger/hive.go/configuration" -) +import "github.com/iotaledger/goshimmer/plugins/config" // ParametersDefinition contains the definition of the parameters used by the networkdelay plugin. type ParametersDefinition struct { @@ -14,5 +12,5 @@ type ParametersDefinition struct { var Parameters = &ParametersDefinition{} func init() { - configuration.BindParameters(Parameters, "networkdelay") + config.BindParameters(Parameters, "networkdelay") } diff --git a/plugins/networkdelay/payload.go b/plugins/networkdelay/payload.go index d97ac99aac..a4c1950dec 100644 --- a/plugins/networkdelay/payload.go +++ b/plugins/networkdelay/payload.go @@ -4,11 +4,11 @@ import ( "fmt" "sync" - "github.com/iotaledger/hive.go/generics/model" - "github.com/iotaledger/hive.go/serix" + "github.com/iotaledger/hive.go/core/generics/model" + "github.com/iotaledger/hive.go/core/serix" "github.com/mr-tron/base58" - "github.com/iotaledger/goshimmer/packages/tangle/payload" + "github.com/iotaledger/goshimmer/packages/core/tangleold/payload" ) func init() { diff --git a/plugins/networkdelay/plugin.go b/plugins/networkdelay/plugin.go index 3725685ecc..a3886c9c5b 100644 --- a/plugins/networkdelay/plugin.go +++ b/plugins/networkdelay/plugin.go @@ -4,16 +4,16 @@ import ( "sync" "time" - "github.com/iotaledger/hive.go/autopeering/peer" - "github.com/iotaledger/hive.go/crypto/ed25519" - "github.com/iotaledger/hive.go/generics/event" - "github.com/iotaledger/hive.go/node" + "github.com/iotaledger/hive.go/core/autopeering/peer" + "github.com/iotaledger/hive.go/core/crypto/ed25519" + "github.com/iotaledger/hive.go/core/generics/event" + "github.com/iotaledger/hive.go/core/node" "github.com/labstack/echo" "github.com/mr-tron/base58" "go.uber.org/dig" - "github.com/iotaledger/goshimmer/packages/clock" - "github.com/iotaledger/goshimmer/packages/tangle" + "github.com/iotaledger/goshimmer/packages/core/tangleold" + "github.com/iotaledger/goshimmer/packages/node/clock" "github.com/iotaledger/goshimmer/plugins/remotelog" ) @@ -40,7 +40,7 @@ var ( type dependencies struct { dig.In - Tangle *tangle.Tangle + Tangle *tangleold.Tangle Local *peer.Local RemoteLogger *remotelog.RemoteLoggerConn `optional:"true"` Server *echo.Echo @@ -69,25 +69,25 @@ func configure(plugin *node.Plugin) { // get origin public key from config bytes, err := base58.Decode(Parameters.OriginPublicKey) if err != nil { - plugin.LogFatalf("could not parse originPublicKey config entry as base58. %v", err) + plugin.LogFatalfAndExit("could not parse originPublicKey config entry as base58. %v", err) } originPublicKey, _, err = ed25519.PublicKeyFromBytes(bytes) if err != nil { - plugin.LogFatalf("could not parse originPublicKey config entry as public key. %v", err) + plugin.LogFatalfAndExit("could not parse originPublicKey config entry as public key. %v", err) } configureWebAPI() // subscribe to block-layer - deps.Tangle.ApprovalWeightManager.Events.BlockProcessed.Attach(event.NewClosure(func(event *tangle.BlockProcessedEvent) { + deps.Tangle.ApprovalWeightManager.Events.BlockProcessed.Attach(event.NewClosure(func(event *tangleold.BlockProcessedEvent) { onReceiveBlockFromBlockLayer(event.BlockID) })) clockEnabled = !node.IsSkipped(deps.ClockPlugin) } -func onReceiveBlockFromBlockLayer(blockID tangle.BlockID) { - deps.Tangle.Storage.Block(blockID).Consume(func(solidBlock *tangle.Block) { +func onReceiveBlockFromBlockLayer(blockID tangleold.BlockID) { + deps.Tangle.Storage.Block(blockID).Consume(func(solidBlock *tangleold.Block) { blockPayload := solidBlock.Payload() if blockPayload.Type() != Type { return diff --git a/plugins/networkdelay/webapi.go b/plugins/networkdelay/webapi.go index f8fd48d15f..47bd68a9ee 100644 --- a/plugins/networkdelay/webapi.go +++ b/plugins/networkdelay/webapi.go @@ -7,7 +7,7 @@ import ( "github.com/labstack/echo" - "github.com/iotaledger/goshimmer/packages/clock" + "github.com/iotaledger/goshimmer/packages/node/clock" ) func configureWebAPI() { diff --git a/plugins/p2p/p2p.go b/plugins/p2p/p2p.go index 6e4914713d..036a8aacca 100644 --- a/plugins/p2p/p2p.go +++ b/plugins/p2p/p2p.go @@ -5,11 +5,12 @@ import ( "fmt" "net" - "github.com/iotaledger/goshimmer/packages/libp2putil" - "github.com/iotaledger/goshimmer/packages/p2p" - "github.com/iotaledger/hive.go/autopeering/peer" - "github.com/iotaledger/hive.go/autopeering/peer/service" + "github.com/iotaledger/hive.go/core/autopeering/peer" + "github.com/iotaledger/hive.go/core/autopeering/peer/service" "github.com/libp2p/go-libp2p" + + "github.com/iotaledger/goshimmer/packages/node/libp2putil" + "github.com/iotaledger/goshimmer/packages/node/p2p" ) var localAddr *net.TCPAddr @@ -20,17 +21,17 @@ func createManager(lPeer *peer.Local) *p2p.Manager { // resolve the bind address localAddr, err = net.ResolveTCPAddr("tcp", Parameters.BindAddress) if err != nil { - Plugin.LogFatalf("bind address '%s' is invalid: %s", Parameters.BindAddress, err) + Plugin.LogFatalfAndExit("bind address '%s' is invalid: %s", Parameters.BindAddress, err) } // announce the service if err := lPeer.UpdateService(service.P2PKey, localAddr.Network(), localAddr.Port); err != nil { - Plugin.LogFatalf("could not update services: %s", err) + Plugin.LogFatalfAndExit("could not update services: %s", err) } libp2pIdentity, err := libp2putil.GetLibp2pIdentity(lPeer) if err != nil { - Plugin.LogFatalf("Could not build libp2p identity from local peer: %s", err) + Plugin.LogFatalfAndExit("Could not build libp2p identity from local peer: %s", err) } libp2pHost, err := libp2p.New( context.Background(), @@ -39,7 +40,7 @@ func createManager(lPeer *peer.Local) *p2p.Manager { libp2p.NATPortMap(), ) if err != nil { - Plugin.LogFatalf("Couldn't create libp2p host: %s", err) + Plugin.LogFatalfAndExit("Couldn't create libp2p host: %s", err) } return p2p.NewManager(libp2pHost, lPeer, Plugin.Logger()) diff --git a/plugins/p2p/parameters.go b/plugins/p2p/parameters.go index b9cf55ce86..69835b357d 100644 --- a/plugins/p2p/parameters.go +++ b/plugins/p2p/parameters.go @@ -1,8 +1,6 @@ package p2p -import ( - "github.com/iotaledger/hive.go/configuration" -) +import "github.com/iotaledger/goshimmer/plugins/config" // ParametersDefinition contains the definition of configuration parameters used by the p2p plugin. type ParametersDefinition struct { @@ -14,5 +12,5 @@ type ParametersDefinition struct { var Parameters = &ParametersDefinition{} func init() { - configuration.BindParameters(Parameters, "p2p") + config.BindParameters(Parameters, "p2p") } diff --git a/plugins/p2p/plugin.go b/plugins/p2p/plugin.go index 6ac49613ef..19837de179 100644 --- a/plugins/p2p/plugin.go +++ b/plugins/p2p/plugin.go @@ -3,13 +3,13 @@ package p2p import ( "go.uber.org/dig" - "github.com/iotaledger/hive.go/autopeering/peer" - "github.com/iotaledger/hive.go/daemon" - "github.com/iotaledger/hive.go/generics/event" - "github.com/iotaledger/hive.go/node" + "github.com/iotaledger/hive.go/core/autopeering/peer" + "github.com/iotaledger/hive.go/core/daemon" + "github.com/iotaledger/hive.go/core/generics/event" + "github.com/iotaledger/hive.go/core/node" - "github.com/iotaledger/goshimmer/packages/p2p" - "github.com/iotaledger/goshimmer/packages/shutdown" + "github.com/iotaledger/goshimmer/packages/node/p2p" + "github.com/iotaledger/goshimmer/packages/node/shutdown" ) // PluginName is the name of the p2p plugin. diff --git a/plugins/peer/parameters.go b/plugins/peer/parameters.go index 71dd147d4d..64064fe6dd 100644 --- a/plugins/peer/parameters.go +++ b/plugins/peer/parameters.go @@ -1,8 +1,6 @@ package peer -import ( - "github.com/iotaledger/hive.go/configuration" -) +import "github.com/iotaledger/goshimmer/plugins/config" // ParametersDefinition contains the definition of configuration parameters used by the local peer's network. type ParametersDefinition struct { @@ -23,5 +21,5 @@ type ParametersDefinition struct { var Parameters = &ParametersDefinition{} func init() { - configuration.BindParameters(Parameters, "node") + config.BindParameters(Parameters, "node") } diff --git a/plugins/peer/plugin.go b/plugins/peer/plugin.go index d23d94a23e..cd79dc1c25 100644 --- a/plugins/peer/plugin.go +++ b/plugins/peer/plugin.go @@ -14,16 +14,16 @@ import ( "github.com/mr-tron/base58" "go.uber.org/dig" - "github.com/iotaledger/hive.go/autopeering/peer" - "github.com/iotaledger/hive.go/autopeering/peer/service" - "github.com/iotaledger/hive.go/crypto/ed25519" - "github.com/iotaledger/hive.go/daemon" - "github.com/iotaledger/hive.go/generics/event" - "github.com/iotaledger/hive.go/kvstore" - "github.com/iotaledger/hive.go/node" - - databasePkg "github.com/iotaledger/goshimmer/packages/database" - "github.com/iotaledger/goshimmer/packages/shutdown" + "github.com/iotaledger/hive.go/core/autopeering/peer" + "github.com/iotaledger/hive.go/core/autopeering/peer/service" + "github.com/iotaledger/hive.go/core/crypto/ed25519" + "github.com/iotaledger/hive.go/core/daemon" + "github.com/iotaledger/hive.go/core/generics/event" + "github.com/iotaledger/hive.go/core/kvstore" + "github.com/iotaledger/hive.go/core/node" + + databasePkg "github.com/iotaledger/goshimmer/packages/node/database" + "github.com/iotaledger/goshimmer/packages/node/shutdown" "github.com/iotaledger/goshimmer/plugins/database" ) diff --git a/plugins/portcheck/plugin.go b/plugins/portcheck/plugin.go index 2b12265c2a..b17262862d 100644 --- a/plugins/portcheck/plugin.go +++ b/plugins/portcheck/plugin.go @@ -3,12 +3,12 @@ package portcheck import ( "net" - "github.com/iotaledger/hive.go/autopeering/discover" - "github.com/iotaledger/hive.go/autopeering/peer" - "github.com/iotaledger/hive.go/autopeering/peer/service" - "github.com/iotaledger/hive.go/autopeering/server" - "github.com/iotaledger/hive.go/logger" - "github.com/iotaledger/hive.go/node" + "github.com/iotaledger/hive.go/core/autopeering/discover" + "github.com/iotaledger/hive.go/core/autopeering/peer" + "github.com/iotaledger/hive.go/core/autopeering/peer/service" + "github.com/iotaledger/hive.go/core/autopeering/server" + "github.com/iotaledger/hive.go/core/logger" + "github.com/iotaledger/hive.go/core/node" "go.uber.org/dig" "github.com/iotaledger/goshimmer/plugins/autopeering" diff --git a/plugins/pow/parameters.go b/plugins/pow/parameters.go index 3a97907860..6c18a5a1d4 100644 --- a/plugins/pow/parameters.go +++ b/plugins/pow/parameters.go @@ -3,7 +3,7 @@ package pow import ( "time" - "github.com/iotaledger/hive.go/configuration" + "github.com/iotaledger/goshimmer/plugins/config" ) // ParametersDefinition contains the definition of the parameters used by the pow plugin. @@ -22,5 +22,5 @@ type ParametersDefinition struct { var Parameters = &ParametersDefinition{} func init() { - configuration.BindParameters(Parameters, "pow") + config.BindParameters(Parameters, "pow") } diff --git a/plugins/pow/plugin.go b/plugins/pow/plugin.go index 08e296aace..884ae2bd76 100644 --- a/plugins/pow/plugin.go +++ b/plugins/pow/plugin.go @@ -1,11 +1,11 @@ package pow import ( - "github.com/iotaledger/hive.go/logger" - "github.com/iotaledger/hive.go/node" + "github.com/iotaledger/hive.go/core/logger" + "github.com/iotaledger/hive.go/core/node" "go.uber.org/dig" - "github.com/iotaledger/goshimmer/packages/tangle" + "github.com/iotaledger/goshimmer/packages/core/tangleold" ) // PluginName is the name of the PoW plugin. @@ -20,7 +20,7 @@ var ( type dependencies struct { dig.In - Tangle *tangle.Tangle + Tangle *tangleold.Tangle BlocklayerPlugin *node.Plugin `name:"blocklayer"` } @@ -42,7 +42,7 @@ func configure(plugin *node.Plugin) { log.Infof("%s started: difficult=%d", PluginName, difficulty) - deps.Tangle.Parser.AddBytesFilter(tangle.NewPowFilter(worker, difficulty)) - deps.Tangle.BlockFactory.SetWorker(tangle.WorkerFunc(DoPOW)) + deps.Tangle.Parser.AddBytesFilter(tangleold.NewPowFilter(worker, difficulty)) + deps.Tangle.BlockFactory.SetWorker(tangleold.WorkerFunc(DoPOW)) deps.Tangle.BlockFactory.SetTimeout(timeout) } diff --git a/plugins/pow/pow.go b/plugins/pow/pow.go index 46dc5c90f9..d334b865b3 100644 --- a/plugins/pow/pow.go +++ b/plugins/pow/pow.go @@ -8,10 +8,10 @@ import ( "time" "github.com/cockroachdb/errors" - "github.com/iotaledger/hive.go/logger" + "github.com/iotaledger/hive.go/core/logger" _ "golang.org/x/crypto/blake2b" // required by crypto.BLAKE2b_512 - "github.com/iotaledger/goshimmer/packages/pow" + "github.com/iotaledger/goshimmer/packages/core/pow" ) // ErrBlockTooSmall is returned when the block is smaller than the 8-byte nonce. diff --git a/plugins/profiling/parameters.go b/plugins/profiling/parameters.go index af8a1fd07e..141ba7c0b3 100644 --- a/plugins/profiling/parameters.go +++ b/plugins/profiling/parameters.go @@ -1,8 +1,6 @@ package profiling -import ( - "github.com/iotaledger/hive.go/configuration" -) +import "github.com/iotaledger/goshimmer/plugins/config" // ParametersDefinition contains the definition of the parameters used by the profiling plugin. type ParametersDefinition struct { @@ -14,5 +12,5 @@ type ParametersDefinition struct { var Parameters = &ParametersDefinition{} func init() { - configuration.BindParameters(Parameters, "profiling") + config.BindParameters(Parameters, "profiling") } diff --git a/plugins/profiling/plugin.go b/plugins/profiling/plugin.go index fb0f3e6168..f12b4bdfe3 100644 --- a/plugins/profiling/plugin.go +++ b/plugins/profiling/plugin.go @@ -6,8 +6,8 @@ import ( _ "net/http/pprof" "runtime" - "github.com/iotaledger/hive.go/logger" - "github.com/iotaledger/hive.go/node" + "github.com/iotaledger/hive.go/core/logger" + "github.com/iotaledger/hive.go/core/node" ) // PluginName is the name of the profiling plugin. diff --git a/plugins/prometheus/parameters.go b/plugins/prometheus/parameters.go index 42cf599cde..9b957104a9 100644 --- a/plugins/prometheus/parameters.go +++ b/plugins/prometheus/parameters.go @@ -1,8 +1,6 @@ package prometheus -import ( - "github.com/iotaledger/hive.go/configuration" -) +import "github.com/iotaledger/goshimmer/plugins/config" // ParametersDefinition contains the definition of the parameters used by the prometheus plugin. type ParametersDefinition struct { @@ -22,5 +20,5 @@ type ParametersDefinition struct { var Parameters = &ParametersDefinition{} func init() { - configuration.BindParameters(Parameters, "prometheus") + config.BindParameters(Parameters, "prometheus") } diff --git a/plugins/prometheus/plugin.go b/plugins/prometheus/plugin.go index e8a8cd9738..9103768a4b 100644 --- a/plugins/prometheus/plugin.go +++ b/plugins/prometheus/plugin.go @@ -7,17 +7,17 @@ import ( "github.com/cockroachdb/errors" "github.com/gin-gonic/gin" - "github.com/iotaledger/hive.go/autopeering/peer" - "github.com/iotaledger/hive.go/daemon" - "github.com/iotaledger/hive.go/logger" - "github.com/iotaledger/hive.go/node" + "github.com/iotaledger/hive.go/core/autopeering/peer" + "github.com/iotaledger/hive.go/core/daemon" + "github.com/iotaledger/hive.go/core/logger" + "github.com/iotaledger/hive.go/core/node" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promhttp" "go.uber.org/dig" - "github.com/iotaledger/goshimmer/packages/gossip" - "github.com/iotaledger/goshimmer/packages/net" - "github.com/iotaledger/goshimmer/packages/shutdown" + "github.com/iotaledger/goshimmer/packages/app/metrics/net" + "github.com/iotaledger/goshimmer/packages/node/gossip" + "github.com/iotaledger/goshimmer/packages/node/shutdown" "github.com/iotaledger/goshimmer/plugins/metrics" ) diff --git a/plugins/remotelog/parameters.go b/plugins/remotelog/parameters.go index 3a0eb939b0..08c6018d35 100644 --- a/plugins/remotelog/parameters.go +++ b/plugins/remotelog/parameters.go @@ -1,8 +1,6 @@ package remotelog -import ( - "github.com/iotaledger/hive.go/configuration" -) +import "github.com/iotaledger/goshimmer/plugins/config" // ParametersDefinition contains the definition of the parameters used by the remotelog plugin. type ParametersDefinition struct { @@ -17,5 +15,5 @@ type ParametersDefinition struct { var Parameters = &ParametersDefinition{} func init() { - configuration.BindParameters(Parameters, "logger") + config.BindParameters(Parameters, "logger") } diff --git a/plugins/remotelog/plugin.go b/plugins/remotelog/plugin.go index fec33629bd..bdcff4d271 100644 --- a/plugins/remotelog/plugin.go +++ b/plugins/remotelog/plugin.go @@ -14,14 +14,14 @@ import ( "go.uber.org/dig" "gopkg.in/src-d/go-git.v4" - "github.com/iotaledger/hive.go/autopeering/peer" - "github.com/iotaledger/hive.go/daemon" - "github.com/iotaledger/hive.go/generics/event" - "github.com/iotaledger/hive.go/logger" - "github.com/iotaledger/hive.go/node" - "github.com/iotaledger/hive.go/workerpool" - - "github.com/iotaledger/goshimmer/packages/shutdown" + "github.com/iotaledger/hive.go/core/autopeering/peer" + "github.com/iotaledger/hive.go/core/daemon" + "github.com/iotaledger/hive.go/core/generics/event" + "github.com/iotaledger/hive.go/core/logger" + "github.com/iotaledger/hive.go/core/node" + "github.com/iotaledger/hive.go/core/workerpool" + + "github.com/iotaledger/goshimmer/packages/node/shutdown" logger_plugin "github.com/iotaledger/goshimmer/plugins/logger" ) @@ -60,7 +60,7 @@ func init() { if err := event.Container.Provide(func() *RemoteLoggerConn { remoteLogger, err := newRemoteLoggerConn(Parameters.RemoteLog.ServerAddress) if err != nil { - Plugin.LogFatal(err) + Plugin.LogFatalAndExit(err) return nil } return remoteLogger diff --git a/plugins/remotelog/remotelogger.go b/plugins/remotelog/remotelogger.go index e12b9c3d4d..5a24816be3 100644 --- a/plugins/remotelog/remotelogger.go +++ b/plugins/remotelog/remotelogger.go @@ -5,9 +5,9 @@ import ( "fmt" "net" - "github.com/iotaledger/hive.go/logger" + "github.com/iotaledger/hive.go/core/logger" - "github.com/iotaledger/goshimmer/packages/clock" + "github.com/iotaledger/goshimmer/packages/node/clock" "github.com/iotaledger/goshimmer/plugins/banner" ) diff --git a/plugins/remotemetrics/block.go b/plugins/remotemetrics/block.go index e38dd28797..864fc8af94 100644 --- a/plugins/remotemetrics/block.go +++ b/plugins/remotemetrics/block.go @@ -3,16 +3,17 @@ package remotemetrics import ( "time" - "github.com/iotaledger/hive.go/identity" + "github.com/iotaledger/hive.go/core/identity" - "github.com/iotaledger/goshimmer/packages/ledger" - "github.com/iotaledger/goshimmer/packages/ledger/utxo" + "github.com/iotaledger/goshimmer/packages/core/ledger" + "github.com/iotaledger/goshimmer/packages/core/ledger/utxo" - "github.com/iotaledger/goshimmer/packages/remotemetrics" - "github.com/iotaledger/goshimmer/packages/tangle" + "github.com/iotaledger/goshimmer/packages/core/tangleold" + + "github.com/iotaledger/goshimmer/packages/app/remotemetrics" ) -func sendBlockSchedulerRecord(blockID tangle.BlockID, recordType string) { +func sendBlockSchedulerRecord(blockID tangleold.BlockID, recordType string) { if !deps.Tangle.Synced() { return } @@ -28,20 +29,20 @@ func sendBlockSchedulerRecord(blockID tangle.BlockID, recordType string) { BlockID: blockID.Base58(), } - deps.Tangle.Storage.Block(blockID).Consume(func(block *tangle.Block) { + deps.Tangle.Storage.Block(blockID).Consume(func(block *tangleold.Block) { issuerID := identity.NewID(block.IssuerPublicKey()) record.IssuedTimestamp = block.IssuingTime() record.IssuerID = issuerID.String() record.AccessMana = deps.Tangle.Scheduler.GetManaFromCache(issuerID) - record.StrongEdgeCount = len(block.ParentsByType(tangle.StrongParentType)) - if weakParentsCount := len(block.ParentsByType(tangle.WeakParentType)); weakParentsCount > 0 { + record.StrongEdgeCount = len(block.ParentsByType(tangleold.StrongParentType)) + if weakParentsCount := len(block.ParentsByType(tangleold.WeakParentType)); weakParentsCount > 0 { record.StrongEdgeCount = weakParentsCount } - if likeParentsCount := len(block.ParentsByType(tangle.ShallowLikeParentType)); likeParentsCount > 0 { - record.StrongEdgeCount = len(block.ParentsByType(tangle.ShallowLikeParentType)) + if likeParentsCount := len(block.ParentsByType(tangleold.ShallowLikeParentType)); likeParentsCount > 0 { + record.StrongEdgeCount = len(block.ParentsByType(tangleold.ShallowLikeParentType)) } - deps.Tangle.Storage.BlockMetadata(blockID).Consume(func(blockMetadata *tangle.BlockMetadata) { + deps.Tangle.Storage.BlockMetadata(blockID).Consume(func(blockMetadata *tangleold.BlockMetadata) { record.ReceivedTimestamp = blockMetadata.ReceivedTime() record.ScheduledTimestamp = blockMetadata.ScheduledTime() record.DroppedTimestamp = blockMetadata.DiscardedTime() @@ -96,7 +97,7 @@ func onTransactionConfirmed(transactionID utxo.TransactionID) { deps.Tangle.Storage.Block(blockIDs.First()).Consume(onBlockFinalized) } -func onBlockFinalized(block *tangle.Block) { +func onBlockFinalized(block *tangleold.Block) { if !deps.Tangle.Synced() { return } @@ -118,14 +119,14 @@ func onBlockFinalized(block *tangle.Block) { issuerID := identity.NewID(block.IssuerPublicKey()) record.IssuedTimestamp = block.IssuingTime() record.IssuerID = issuerID.String() - record.StrongEdgeCount = len(block.ParentsByType(tangle.StrongParentType)) - if weakParentsCount := len(block.ParentsByType(tangle.WeakParentType)); weakParentsCount > 0 { + record.StrongEdgeCount = len(block.ParentsByType(tangleold.StrongParentType)) + if weakParentsCount := len(block.ParentsByType(tangleold.WeakParentType)); weakParentsCount > 0 { record.WeakEdgeCount = weakParentsCount } - if shallowLikeParentsCount := len(block.ParentsByType(tangle.ShallowLikeParentType)); shallowLikeParentsCount > 0 { + if shallowLikeParentsCount := len(block.ParentsByType(tangleold.ShallowLikeParentType)); shallowLikeParentsCount > 0 { record.ShallowLikeEdgeCount = shallowLikeParentsCount } - deps.Tangle.Storage.BlockMetadata(blockID).Consume(func(blockMetadata *tangle.BlockMetadata) { + deps.Tangle.Storage.BlockMetadata(blockID).Consume(func(blockMetadata *tangleold.BlockMetadata) { record.ScheduledTimestamp = blockMetadata.ScheduledTime() record.DeltaScheduled = blockMetadata.ScheduledTime().Sub(record.IssuedTimestamp).Nanoseconds() record.BookedTimestamp = blockMetadata.BookedTime() @@ -143,7 +144,7 @@ func onBlockFinalized(block *tangle.Block) { _ = deps.RemoteLogger.Send(record) } -func sendMissingBlockRecord(blockID tangle.BlockID, recordType string) { +func sendMissingBlockRecord(blockID tangleold.BlockID, recordType string) { if !deps.Tangle.Synced() { return } @@ -160,7 +161,7 @@ func sendMissingBlockRecord(blockID tangle.BlockID, recordType string) { BlockID: blockID.Base58(), } - deps.Tangle.Storage.Block(blockID).Consume(func(block *tangle.Block) { + deps.Tangle.Storage.Block(blockID).Consume(func(block *tangleold.Block) { record.IssuerID = identity.NewID(block.IssuerPublicKey()).String() }) diff --git a/plugins/remotemetrics/conflict.go b/plugins/remotemetrics/conflict.go index 2d1149451f..3e947fb4e7 100644 --- a/plugins/remotemetrics/conflict.go +++ b/plugins/remotemetrics/conflict.go @@ -4,15 +4,16 @@ import ( "sync" "time" - "github.com/iotaledger/hive.go/identity" - "github.com/iotaledger/hive.go/types" + "github.com/iotaledger/hive.go/core/identity" + "github.com/iotaledger/hive.go/core/types" "go.uber.org/atomic" - "github.com/iotaledger/goshimmer/packages/clock" - "github.com/iotaledger/goshimmer/packages/conflictdag" - "github.com/iotaledger/goshimmer/packages/ledger/utxo" - "github.com/iotaledger/goshimmer/packages/remotemetrics" - "github.com/iotaledger/goshimmer/packages/tangle" + "github.com/iotaledger/goshimmer/packages/core/conflictdag" + "github.com/iotaledger/goshimmer/packages/core/ledger/utxo" + "github.com/iotaledger/goshimmer/packages/core/tangleold" + "github.com/iotaledger/goshimmer/packages/node/clock" + + "github.com/iotaledger/goshimmer/packages/app/remotemetrics" ) var ( @@ -67,7 +68,7 @@ func onConflictConfirmed(conflictID utxo.TransactionID) { ConfirmedTimestamp: clock.SyncedTime(), DeltaConfirmed: clock.Since(oldestAttachmentTime).Nanoseconds(), } - deps.Tangle.Storage.Block(oldestAttachmentBlockID).Consume(func(block *tangle.Block) { + deps.Tangle.Storage.Block(oldestAttachmentBlockID).Consume(func(block *tangleold.Block) { issuerID := identity.NewID(block.IssuerPublicKey()) record.IssuerID = issuerID.String() }) @@ -102,10 +103,10 @@ func sendConflictMetrics() { _ = deps.RemoteLogger.Send(record) } -func updateMetricCounts(conflictID utxo.TransactionID, transactionID utxo.TransactionID) (time.Time, tangle.BlockID, error) { +func updateMetricCounts(conflictID utxo.TransactionID, transactionID utxo.TransactionID) (time.Time, tangleold.BlockID, error) { oldestAttachmentTime, oldestAttachmentBlockID, err := deps.Tangle.Utils.FirstAttachment(transactionID) if err != nil { - return time.Time{}, tangle.BlockID{}, err + return time.Time{}, tangleold.BlockID{}, err } deps.Tangle.Ledger.ConflictDAG.Utils.ForEachConflictingConflictID(conflictID, func(conflictingConflictID utxo.TransactionID) bool { if conflictingConflictID != conflictID { diff --git a/plugins/remotemetrics/parameters.go b/plugins/remotemetrics/parameters.go index 747a0c50aa..f1a304eb2e 100644 --- a/plugins/remotemetrics/parameters.go +++ b/plugins/remotemetrics/parameters.go @@ -1,8 +1,6 @@ package remotemetrics -import ( - "github.com/iotaledger/hive.go/configuration" -) +import "github.com/iotaledger/goshimmer/plugins/config" // ParametersDefinition contains the definition of the parameters used by the remotelog plugin. type ParametersDefinition struct { @@ -14,5 +12,5 @@ type ParametersDefinition struct { var Parameters = &ParametersDefinition{} func init() { - configuration.BindParameters(Parameters, "remotemetrics") + config.BindParameters(Parameters, "remotemetrics") } diff --git a/plugins/remotemetrics/plugin.go b/plugins/remotemetrics/plugin.go index 82f2cac744..5e8a65cb93 100644 --- a/plugins/remotemetrics/plugin.go +++ b/plugins/remotemetrics/plugin.go @@ -7,23 +7,24 @@ import ( "context" "time" - "github.com/iotaledger/hive.go/autopeering/peer" - "github.com/iotaledger/hive.go/generics/event" - "github.com/iotaledger/hive.go/types" + "github.com/iotaledger/hive.go/core/autopeering/peer" + "github.com/iotaledger/hive.go/core/generics/event" + "github.com/iotaledger/hive.go/core/types" - "github.com/iotaledger/goshimmer/packages/ledger" - "github.com/iotaledger/goshimmer/packages/ledger/utxo" + "github.com/iotaledger/goshimmer/packages/core/ledger" + "github.com/iotaledger/goshimmer/packages/core/ledger/utxo" + + "github.com/iotaledger/goshimmer/packages/app/remotemetrics" + "github.com/iotaledger/goshimmer/packages/node/shutdown" "github.com/iotaledger/goshimmer/plugins/remotelog" - "github.com/iotaledger/hive.go/daemon" - "github.com/iotaledger/hive.go/node" - "github.com/iotaledger/hive.go/timeutil" + "github.com/iotaledger/hive.go/core/daemon" + "github.com/iotaledger/hive.go/core/node" + "github.com/iotaledger/hive.go/core/timeutil" "go.uber.org/dig" - "github.com/iotaledger/goshimmer/packages/conflictdag" - "github.com/iotaledger/goshimmer/packages/remotemetrics" - "github.com/iotaledger/goshimmer/packages/shutdown" - "github.com/iotaledger/goshimmer/packages/tangle" + "github.com/iotaledger/goshimmer/packages/core/conflictdag" + "github.com/iotaledger/goshimmer/packages/core/tangleold" ) const ( @@ -52,7 +53,7 @@ type dependencies struct { dig.In Local *peer.Local - Tangle *tangle.Tangle + Tangle *tangleold.Tangle RemoteLogger *remotelog.RemoteLoggerConn `optional:"true"` ClockPlugin *node.Plugin `name:"clock" optional:"true"` } @@ -143,7 +144,7 @@ func configureBlockFinalizedMetrics() { onTransactionConfirmed(event.TransactionID) })) } else { - deps.Tangle.ConfirmationOracle.Events().BlockAccepted.Attach(event.NewClosure(func(event *tangle.BlockAcceptedEvent) { + deps.Tangle.ConfirmationOracle.Events().BlockAccepted.Attach(event.NewClosure(func(event *tangleold.BlockAcceptedEvent) { onBlockFinalized(event.Block) })) } @@ -153,14 +154,14 @@ func configureBlockScheduledMetrics() { if Parameters.MetricsLevel > Info { return } else if Parameters.MetricsLevel == Info { - deps.Tangle.Scheduler.Events.BlockDiscarded.Attach(event.NewClosure(func(event *tangle.BlockDiscardedEvent) { + deps.Tangle.Scheduler.Events.BlockDiscarded.Attach(event.NewClosure(func(event *tangleold.BlockDiscardedEvent) { sendBlockSchedulerRecord(event.BlockID, "blockDiscarded") })) } else { - deps.Tangle.Scheduler.Events.BlockScheduled.Attach(event.NewClosure(func(event *tangle.BlockScheduledEvent) { + deps.Tangle.Scheduler.Events.BlockScheduled.Attach(event.NewClosure(func(event *tangleold.BlockScheduledEvent) { sendBlockSchedulerRecord(event.BlockID, "blockScheduled") })) - deps.Tangle.Scheduler.Events.BlockDiscarded.Attach(event.NewClosure(func(event *tangle.BlockDiscardedEvent) { + deps.Tangle.Scheduler.Events.BlockDiscarded.Attach(event.NewClosure(func(event *tangleold.BlockDiscardedEvent) { sendBlockSchedulerRecord(event.BlockID, "blockDiscarded") })) } @@ -171,10 +172,10 @@ func configureMissingBlockMetrics() { return } - deps.Tangle.Solidifier.Events.BlockMissing.Attach(event.NewClosure(func(event *tangle.BlockMissingEvent) { + deps.Tangle.Solidifier.Events.BlockMissing.Attach(event.NewClosure(func(event *tangleold.BlockMissingEvent) { sendMissingBlockRecord(event.BlockID, "missingBlock") })) - deps.Tangle.Storage.Events.MissingBlockStored.Attach(event.NewClosure(func(event *tangle.MissingBlockStoredEvent) { + deps.Tangle.Storage.Events.MissingBlockStored.Attach(event.NewClosure(func(event *tangleold.MissingBlockStoredEvent) { sendMissingBlockRecord(event.BlockID, "missingBlockStored") })) } diff --git a/plugins/remotemetrics/scheduler.go b/plugins/remotemetrics/scheduler.go index be99a2c5c7..093438eee3 100644 --- a/plugins/remotemetrics/scheduler.go +++ b/plugins/remotemetrics/scheduler.go @@ -3,8 +3,9 @@ package remotemetrics import ( "time" - "github.com/iotaledger/goshimmer/packages/remotemetrics" - "github.com/iotaledger/goshimmer/packages/tangle" + "github.com/iotaledger/goshimmer/packages/core/tangleold" + + "github.com/iotaledger/goshimmer/packages/app/remotemetrics" ) func obtainSchedulerStats(timestamp time.Time) { @@ -31,7 +32,7 @@ func obtainSchedulerStats(timestamp time.Time) { _ = deps.RemoteLogger.Send(record) } -func prepQueueMaps(s *tangle.Scheduler) (queueMap map[string]uint32, aManaNormalizedMap map[string]float64) { +func prepQueueMaps(s *tangleold.Scheduler) (queueMap map[string]uint32, aManaNormalizedMap map[string]float64) { queueSizes := s.NodeQueueSizes() queueMap = make(map[string]uint32, len(queueSizes)) aManaNormalizedMap = make(map[string]float64, len(queueSizes)) diff --git a/plugins/remotemetrics/sync.go b/plugins/remotemetrics/sync.go index 5e4cfa4af7..854b63d316 100644 --- a/plugins/remotemetrics/sync.go +++ b/plugins/remotemetrics/sync.go @@ -3,8 +3,9 @@ package remotemetrics import ( "go.uber.org/atomic" - "github.com/iotaledger/goshimmer/packages/clock" - "github.com/iotaledger/goshimmer/packages/remotemetrics" + "github.com/iotaledger/goshimmer/packages/node/clock" + + "github.com/iotaledger/goshimmer/packages/app/remotemetrics" ) var isTangleTimeSynced atomic.Bool diff --git a/plugins/research.go b/plugins/research.go index 907a075563..dad45b25a5 100644 --- a/plugins/research.go +++ b/plugins/research.go @@ -1,7 +1,7 @@ package plugins import ( - "github.com/iotaledger/hive.go/node" + "github.com/iotaledger/hive.go/core/node" "github.com/iotaledger/goshimmer/plugins/activity" analysisclient "github.com/iotaledger/goshimmer/plugins/analysis/client" diff --git a/plugins/spammer/plugin.go b/plugins/spammer/plugin.go index 88d363ceaa..e09100a697 100644 --- a/plugins/spammer/plugin.go +++ b/plugins/spammer/plugin.go @@ -3,15 +3,16 @@ package spammer import ( "context" - "github.com/iotaledger/hive.go/daemon" - "github.com/iotaledger/hive.go/logger" - "github.com/iotaledger/hive.go/node" + "github.com/iotaledger/hive.go/core/daemon" + "github.com/iotaledger/hive.go/core/logger" + "github.com/iotaledger/hive.go/core/node" "github.com/labstack/echo" "go.uber.org/dig" - "github.com/iotaledger/goshimmer/packages/shutdown" - "github.com/iotaledger/goshimmer/packages/spammer" - "github.com/iotaledger/goshimmer/packages/tangle" + "github.com/iotaledger/goshimmer/packages/core/tangleold" + + "github.com/iotaledger/goshimmer/packages/app/spammer" + "github.com/iotaledger/goshimmer/packages/node/shutdown" ) var blockSpammer *spammer.Spammer @@ -29,7 +30,7 @@ var ( type dependencies struct { dig.In - Tangle *tangle.Tangle + Tangle *tangleold.Tangle Server *echo.Echo } diff --git a/plugins/spammer/webapi.go b/plugins/spammer/webapi.go index 5e83ba6f8f..b18127b0e6 100644 --- a/plugins/spammer/webapi.go +++ b/plugins/spammer/webapi.go @@ -7,7 +7,7 @@ import ( "github.com/labstack/echo" - "github.com/iotaledger/goshimmer/packages/jsonmodels" + "github.com/iotaledger/goshimmer/packages/app/jsonmodels" ) func handleRequest(c echo.Context) error { diff --git a/plugins/ui.go b/plugins/ui.go index c79927e1c5..22b979cdbc 100644 --- a/plugins/ui.go +++ b/plugins/ui.go @@ -1,7 +1,7 @@ package plugins import ( - "github.com/iotaledger/hive.go/node" + "github.com/iotaledger/hive.go/core/node" "github.com/iotaledger/goshimmer/plugins/dagsvisualizer" "github.com/iotaledger/goshimmer/plugins/dashboard" diff --git a/plugins/webapi.go b/plugins/webapi.go index f06af91e9e..a177e59a91 100644 --- a/plugins/webapi.go +++ b/plugins/webapi.go @@ -1,7 +1,7 @@ package plugins import ( - "github.com/iotaledger/hive.go/node" + "github.com/iotaledger/hive.go/core/node" "github.com/iotaledger/goshimmer/plugins/webapi" "github.com/iotaledger/goshimmer/plugins/webapi/autopeering" diff --git a/plugins/webapi/autopeering/plugin.go b/plugins/webapi/autopeering/plugin.go index e0737332db..4bc61dbb51 100644 --- a/plugins/webapi/autopeering/plugin.go +++ b/plugins/webapi/autopeering/plugin.go @@ -5,15 +5,15 @@ import ( "net/http" "strconv" - "github.com/iotaledger/hive.go/autopeering/discover" - "github.com/iotaledger/hive.go/autopeering/peer" - "github.com/iotaledger/hive.go/autopeering/peer/service" - "github.com/iotaledger/hive.go/autopeering/selection" - "github.com/iotaledger/hive.go/node" + "github.com/iotaledger/hive.go/core/autopeering/discover" + "github.com/iotaledger/hive.go/core/autopeering/peer" + "github.com/iotaledger/hive.go/core/autopeering/peer/service" + "github.com/iotaledger/hive.go/core/autopeering/selection" + "github.com/iotaledger/hive.go/core/node" "github.com/labstack/echo" "go.uber.org/dig" - "github.com/iotaledger/goshimmer/packages/jsonmodels" + "github.com/iotaledger/goshimmer/packages/app/jsonmodels" ) // PluginName is the name of the web API autopeering endpoint plugin. diff --git a/plugins/webapi/block/plugin.go b/plugins/webapi/block/plugin.go index e9b1321926..c861c1f2cd 100644 --- a/plugins/webapi/block/plugin.go +++ b/plugins/webapi/block/plugin.go @@ -5,20 +5,21 @@ import ( "net/http" "strconv" - "github.com/iotaledger/hive.go/generics/lo" - "github.com/iotaledger/hive.go/node" - "github.com/iotaledger/hive.go/stringify" + "github.com/iotaledger/hive.go/core/generics/lo" + "github.com/iotaledger/hive.go/core/node" + "github.com/iotaledger/hive.go/core/stringify" "github.com/labstack/echo" "go.uber.org/dig" - "github.com/iotaledger/goshimmer/packages/epoch" - "github.com/iotaledger/goshimmer/packages/jsonmodels" - "github.com/iotaledger/goshimmer/packages/ledger/utxo" - "github.com/iotaledger/goshimmer/packages/ledger/vm/devnetvm" - "github.com/iotaledger/goshimmer/packages/markers" - "github.com/iotaledger/goshimmer/packages/notarization" - "github.com/iotaledger/goshimmer/packages/tangle" - "github.com/iotaledger/goshimmer/packages/tangle/payload" + "github.com/iotaledger/goshimmer/packages/core/tangleold/payload" + + "github.com/iotaledger/goshimmer/packages/app/jsonmodels" + "github.com/iotaledger/goshimmer/packages/core/epoch" + "github.com/iotaledger/goshimmer/packages/core/ledger/utxo" + "github.com/iotaledger/goshimmer/packages/core/ledger/vm/devnetvm" + "github.com/iotaledger/goshimmer/packages/core/markers" + "github.com/iotaledger/goshimmer/packages/core/notarization" + "github.com/iotaledger/goshimmer/packages/core/tangleold" ) // region Plugin /////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -34,7 +35,7 @@ type dependencies struct { dig.In Server *echo.Echo - Tangle *tangle.Tangle + Tangle *tangleold.Tangle } func init() { @@ -87,7 +88,7 @@ func GetMarkerIndexConflictIDMapping(c echo.Context) (err error) { return c.JSON(http.StatusBadRequest, jsonmodels.NewErrorResponse(err)) } - if deps.Tangle.Storage.MarkerIndexConflictIDMapping(sequenceID).Consume(func(markerIndexConflictIDMapping *tangle.MarkerIndexConflictIDMapping) { + if deps.Tangle.Storage.MarkerIndexConflictIDMapping(sequenceID).Consume(func(markerIndexConflictIDMapping *tangleold.MarkerIndexConflictIDMapping) { err = c.String(http.StatusOK, markerIndexConflictIDMapping.String()) }) { return @@ -107,7 +108,7 @@ func GetBlock(c echo.Context) (err error) { return c.JSON(http.StatusBadRequest, jsonmodels.NewErrorResponse(err)) } - if deps.Tangle.Storage.Block(blockID).Consume(func(block *tangle.Block) { + if deps.Tangle.Storage.Block(blockID).Consume(func(block *tangleold.Block) { var payloadBytes []byte payloadBytes, err = block.Payload().Bytes() @@ -117,12 +118,12 @@ func GetBlock(c echo.Context) (err error) { err = c.JSON(http.StatusOK, jsonmodels.Block{ ID: block.ID().Base58(), - StrongParents: block.ParentsByType(tangle.StrongParentType).Base58(), - WeakParents: block.ParentsByType(tangle.WeakParentType).Base58(), - ShallowLikeParents: block.ParentsByType(tangle.ShallowLikeParentType).Base58(), - StrongChildren: deps.Tangle.Utils.ApprovingBlockIDs(block.ID(), tangle.StrongChild).Base58(), - WeakChildren: deps.Tangle.Utils.ApprovingBlockIDs(block.ID(), tangle.WeakChild).Base58(), - ShallowLikeChildren: deps.Tangle.Utils.ApprovingBlockIDs(block.ID(), tangle.ShallowLikeChild).Base58(), + StrongParents: block.ParentsByType(tangleold.StrongParentType).Base58(), + WeakParents: block.ParentsByType(tangleold.WeakParentType).Base58(), + ShallowLikeParents: block.ParentsByType(tangleold.ShallowLikeParentType).Base58(), + StrongChildren: deps.Tangle.Utils.ApprovingBlockIDs(block.ID(), tangleold.StrongChild).Base58(), + WeakChildren: deps.Tangle.Utils.ApprovingBlockIDs(block.ID(), tangleold.WeakChild).Base58(), + ShallowLikeChildren: deps.Tangle.Utils.ApprovingBlockIDs(block.ID(), tangleold.ShallowLikeChild).Base58(), IssuerPublicKey: block.IssuerPublicKey().String(), IssuingTime: block.IssuingTime().Unix(), SequenceNumber: block.SequenceNumber(), @@ -160,7 +161,7 @@ func GetBlockMetadata(c echo.Context) (err error) { return c.JSON(http.StatusBadRequest, jsonmodels.NewErrorResponse(err)) } - if deps.Tangle.Storage.BlockMetadata(blockID).Consume(func(blockMetadata *tangle.BlockMetadata) { + if deps.Tangle.Storage.BlockMetadata(blockID).Consume(func(blockMetadata *tangleold.BlockMetadata) { err = c.JSON(http.StatusOK, NewBlockMetadata(blockMetadata)) }) { return @@ -169,8 +170,8 @@ func GetBlockMetadata(c echo.Context) (err error) { return c.JSON(http.StatusNotFound, jsonmodels.NewErrorResponse(fmt.Errorf("failed to load BlockMetadata with %s", blockID))) } -// NewBlockMetadata returns BlockMetadata from the given tangle.BlockMetadata. -func NewBlockMetadata(metadata *tangle.BlockMetadata) jsonmodels.BlockMetadata { +// NewBlockMetadata returns BlockMetadata from the given tangleold.BlockMetadata. +func NewBlockMetadata(metadata *tangleold.BlockMetadata) jsonmodels.BlockMetadata { conflictIDs, _ := deps.Tangle.Booker.BlockConflictIDs(metadata.ID()) return jsonmodels.BlockMetadata{ @@ -224,10 +225,10 @@ func PostPayload(c echo.Context) error { // blockIDFromContext determines the BlockID from the blockID parameter in an echo.Context. It expects it to // either be a base58 encoded string or the builtin alias EmptyBlockID. -func blockIDFromContext(c echo.Context) (blockID tangle.BlockID, err error) { +func blockIDFromContext(c echo.Context) (blockID tangleold.BlockID, err error) { switch blockIDString := c.Param("blockID"); blockIDString { case "EmptyBlockID": - blockID = tangle.EmptyBlockID + blockID = tangleold.EmptyBlockID default: err = blockID.FromBase58(blockIDString) } diff --git a/plugins/webapi/data/plugin.go b/plugins/webapi/data/plugin.go index f81b12f7ee..f183eda427 100644 --- a/plugins/webapi/data/plugin.go +++ b/plugins/webapi/data/plugin.go @@ -5,14 +5,14 @@ import ( "net/http" "time" - "github.com/iotaledger/hive.go/logger" - "github.com/iotaledger/hive.go/node" + "github.com/iotaledger/hive.go/core/logger" + "github.com/iotaledger/hive.go/core/node" "github.com/labstack/echo" "go.uber.org/dig" - "github.com/iotaledger/goshimmer/packages/jsonmodels" - "github.com/iotaledger/goshimmer/packages/tangle" - "github.com/iotaledger/goshimmer/packages/tangle/payload" + "github.com/iotaledger/goshimmer/packages/app/jsonmodels" + "github.com/iotaledger/goshimmer/packages/core/tangleold" + "github.com/iotaledger/goshimmer/packages/core/tangleold/payload" "github.com/iotaledger/goshimmer/plugins/blocklayer" ) @@ -25,7 +25,7 @@ type dependencies struct { dig.In Server *echo.Echo - Tangle *tangle.Tangle + Tangle *tangleold.Tangle } var ( @@ -63,7 +63,7 @@ func broadcastData(c echo.Context) error { }) } - issueData := func() (*tangle.Block, error) { + issueData := func() (*tangleold.Block, error) { return deps.Tangle.IssuePayload(payload.NewGenericDataPayload(request.Data)) } diff --git a/plugins/webapi/epoch/plugin.go b/plugins/webapi/epoch/plugin.go index 7c29d87a5d..e5bbe4691a 100644 --- a/plugins/webapi/epoch/plugin.go +++ b/plugins/webapi/epoch/plugin.go @@ -6,13 +6,13 @@ import ( "strconv" "github.com/cockroachdb/errors" - "github.com/iotaledger/hive.go/node" + "github.com/iotaledger/hive.go/core/node" "github.com/labstack/echo" "go.uber.org/dig" - "github.com/iotaledger/goshimmer/packages/epoch" - "github.com/iotaledger/goshimmer/packages/jsonmodels" - "github.com/iotaledger/goshimmer/packages/notarization" + "github.com/iotaledger/goshimmer/packages/app/jsonmodels" + "github.com/iotaledger/goshimmer/packages/core/epoch" + "github.com/iotaledger/goshimmer/packages/core/notarization" "github.com/iotaledger/goshimmer/plugins/epochstorage" ) diff --git a/plugins/webapi/faucet/plugin.go b/plugins/webapi/faucet/plugin.go index 98f5b2946e..640ec57a82 100644 --- a/plugins/webapi/faucet/plugin.go +++ b/plugins/webapi/faucet/plugin.go @@ -3,16 +3,16 @@ package faucet import ( "net/http" - "github.com/iotaledger/hive.go/identity" - "github.com/iotaledger/hive.go/node" + "github.com/iotaledger/hive.go/core/identity" + "github.com/iotaledger/hive.go/core/node" "github.com/labstack/echo" "go.uber.org/dig" - faucetpkg "github.com/iotaledger/goshimmer/packages/faucet" - "github.com/iotaledger/goshimmer/packages/jsonmodels" - "github.com/iotaledger/goshimmer/packages/ledger/vm/devnetvm" - "github.com/iotaledger/goshimmer/packages/mana" - "github.com/iotaledger/goshimmer/packages/tangle" + faucetpkg "github.com/iotaledger/goshimmer/packages/app/faucet" + "github.com/iotaledger/goshimmer/packages/app/jsonmodels" + "github.com/iotaledger/goshimmer/packages/core/ledger/vm/devnetvm" + "github.com/iotaledger/goshimmer/packages/core/mana" + "github.com/iotaledger/goshimmer/packages/core/tangleold" "github.com/iotaledger/goshimmer/plugins/faucet" ) @@ -26,7 +26,7 @@ type dependencies struct { dig.In Server *echo.Echo - Tangle *tangle.Tangle + Tangle *tangleold.Tangle } // Plugin gets the plugin instance. diff --git a/plugins/webapi/faucetrequest/plugin.go b/plugins/webapi/faucetrequest/plugin.go index aeb5ec0c82..5697780f90 100644 --- a/plugins/webapi/faucetrequest/plugin.go +++ b/plugins/webapi/faucetrequest/plugin.go @@ -4,16 +4,16 @@ import ( "fmt" "net/http" - "github.com/iotaledger/hive.go/identity" - "github.com/iotaledger/hive.go/node" + "github.com/iotaledger/hive.go/core/identity" + "github.com/iotaledger/hive.go/core/node" "github.com/labstack/echo" "go.uber.org/dig" - faucetpkg "github.com/iotaledger/goshimmer/packages/faucet" - "github.com/iotaledger/goshimmer/packages/jsonmodels" - "github.com/iotaledger/goshimmer/packages/ledger/vm/devnetvm" - "github.com/iotaledger/goshimmer/packages/mana" - "github.com/iotaledger/goshimmer/packages/tangle" + faucetpkg "github.com/iotaledger/goshimmer/packages/app/faucet" + "github.com/iotaledger/goshimmer/packages/app/jsonmodels" + "github.com/iotaledger/goshimmer/packages/core/ledger/vm/devnetvm" + "github.com/iotaledger/goshimmer/packages/core/mana" + "github.com/iotaledger/goshimmer/packages/core/tangleold" ) var ( @@ -26,7 +26,7 @@ type dependencies struct { dig.In Server *echo.Echo - Tangle *tangle.Tangle + Tangle *tangleold.Tangle } // Plugin gets the plugin instance. diff --git a/plugins/webapi/healthz/plugin.go b/plugins/webapi/healthz/plugin.go index d2108055bf..b4e2098b56 100644 --- a/plugins/webapi/healthz/plugin.go +++ b/plugins/webapi/healthz/plugin.go @@ -4,13 +4,14 @@ import ( "context" "net/http" - "github.com/iotaledger/hive.go/daemon" - "github.com/iotaledger/hive.go/node" + "github.com/iotaledger/hive.go/core/daemon" + "github.com/iotaledger/hive.go/core/node" "github.com/labstack/echo" "go.uber.org/dig" - "github.com/iotaledger/goshimmer/packages/shutdown" - "github.com/iotaledger/goshimmer/packages/tangle" + "github.com/iotaledger/goshimmer/packages/core/tangleold" + + "github.com/iotaledger/goshimmer/packages/node/shutdown" ) // PluginName is the name of the web API healthz endpoint plugin. @@ -20,7 +21,7 @@ type dependencies struct { dig.In Server *echo.Echo - Tangle *tangle.Tangle `optional:"true"` + Tangle *tangleold.Tangle `optional:"true"` } var ( diff --git a/plugins/webapi/info/plugin.go b/plugins/webapi/info/plugin.go index 3885362b4a..dfd132b732 100644 --- a/plugins/webapi/info/plugin.go +++ b/plugins/webapi/info/plugin.go @@ -5,14 +5,14 @@ import ( "sort" "time" - "github.com/iotaledger/hive.go/autopeering/peer" - "github.com/iotaledger/hive.go/node" + "github.com/iotaledger/hive.go/core/autopeering/peer" + "github.com/iotaledger/hive.go/core/node" "github.com/labstack/echo" "github.com/mr-tron/base58/base58" "go.uber.org/dig" - "github.com/iotaledger/goshimmer/packages/jsonmodels" - "github.com/iotaledger/goshimmer/packages/tangle" + "github.com/iotaledger/goshimmer/packages/app/jsonmodels" + "github.com/iotaledger/goshimmer/packages/core/tangleold" "github.com/iotaledger/goshimmer/plugins/autopeering/discovery" "github.com/iotaledger/goshimmer/plugins/banner" "github.com/iotaledger/goshimmer/plugins/blocklayer" @@ -27,7 +27,7 @@ type dependencies struct { Server *echo.Echo Local *peer.Local - Tangle *tangle.Tangle + Tangle *tangleold.Tangle } var ( diff --git a/plugins/webapi/ledgerstate/doublespend_filter.go b/plugins/webapi/ledgerstate/doublespend_filter.go index 4baa8a8b5a..71d0bfee57 100644 --- a/plugins/webapi/ledgerstate/doublespend_filter.go +++ b/plugins/webapi/ledgerstate/doublespend_filter.go @@ -5,9 +5,9 @@ import ( "sync" "time" - "github.com/iotaledger/goshimmer/packages/clock" - "github.com/iotaledger/goshimmer/packages/ledger/utxo" - "github.com/iotaledger/goshimmer/packages/ledger/vm/devnetvm" + "github.com/iotaledger/goshimmer/packages/core/ledger/utxo" + "github.com/iotaledger/goshimmer/packages/core/ledger/vm/devnetvm" + "github.com/iotaledger/goshimmer/packages/node/clock" ) // DoubleSpendFilter keeps a log of recently submitted transactions and their consumed outputs. diff --git a/plugins/webapi/ledgerstate/plugin.go b/plugins/webapi/ledgerstate/plugin.go index 2fa944814d..2cb440346a 100644 --- a/plugins/webapi/ledgerstate/plugin.go +++ b/plugins/webapi/ledgerstate/plugin.go @@ -8,23 +8,24 @@ import ( "time" "github.com/cockroachdb/errors" - "github.com/iotaledger/hive.go/daemon" - "github.com/iotaledger/hive.go/generics/event" - "github.com/iotaledger/hive.go/logger" - "github.com/iotaledger/hive.go/node" + "github.com/iotaledger/hive.go/core/daemon" + "github.com/iotaledger/hive.go/core/generics/event" + "github.com/iotaledger/hive.go/core/logger" + "github.com/iotaledger/hive.go/core/node" "github.com/labstack/echo" "go.uber.org/dig" - "github.com/iotaledger/goshimmer/packages/clock" - "github.com/iotaledger/goshimmer/packages/conflictdag" - "github.com/iotaledger/goshimmer/packages/jsonmodels" - "github.com/iotaledger/goshimmer/packages/ledger" - "github.com/iotaledger/goshimmer/packages/ledger/utxo" - "github.com/iotaledger/goshimmer/packages/ledger/vm/devnetvm" - "github.com/iotaledger/goshimmer/packages/ledger/vm/devnetvm/indexer" - "github.com/iotaledger/goshimmer/packages/mana" - "github.com/iotaledger/goshimmer/packages/shutdown" - "github.com/iotaledger/goshimmer/packages/tangle" + "github.com/iotaledger/goshimmer/packages/core/conflictdag" + "github.com/iotaledger/goshimmer/packages/core/ledger" + "github.com/iotaledger/goshimmer/packages/core/ledger/utxo" + "github.com/iotaledger/goshimmer/packages/core/ledger/vm/devnetvm" + "github.com/iotaledger/goshimmer/packages/core/ledger/vm/devnetvm/indexer" + "github.com/iotaledger/goshimmer/packages/core/mana" + "github.com/iotaledger/goshimmer/packages/core/tangleold" + "github.com/iotaledger/goshimmer/packages/node/clock" + + "github.com/iotaledger/goshimmer/packages/app/jsonmodels" + "github.com/iotaledger/goshimmer/packages/node/shutdown" "github.com/iotaledger/goshimmer/plugins/blocklayer" "github.com/iotaledger/goshimmer/plugins/webapi" ) @@ -41,7 +42,7 @@ type dependencies struct { dig.In Server *echo.Echo - Tangle *tangle.Tangle + Tangle *tangleold.Tangle Indexer *indexer.Indexer } @@ -340,7 +341,7 @@ func GetConflictVoters(c echo.Context) (err error) { return c.JSON(http.StatusBadRequest, jsonmodels.NewErrorResponse(err)) } - voters := tangle.NewVoters() + voters := tangleold.NewVoters() voters.AddAll(deps.Tangle.ApprovalWeightManager.VotersOfConflict(conflictID)) return c.JSON(http.StatusOK, jsonmodels.NewGetConflictVotersResponse(conflictID, voters)) @@ -481,8 +482,8 @@ func GetTransactionAttachments(c echo.Context) (err error) { return c.JSON(http.StatusBadRequest, jsonmodels.NewErrorResponse(err)) } - blockIDs := tangle.NewBlockIDs() - if !deps.Tangle.Storage.Attachments(transactionID).Consume(func(attachment *tangle.Attachment) { + blockIDs := tangleold.NewBlockIDs() + if !deps.Tangle.Storage.Attachments(transactionID).Consume(func(attachment *tangleold.Attachment) { blockIDs.Add(attachment.BlockID()) }) { return c.JSON(http.StatusNotFound, jsonmodels.NewErrorResponse(errors.Errorf("failed to load GetTransactionAttachmentsResponse of Transaction with %s", transactionID))) @@ -563,8 +564,8 @@ func PostTransaction(c echo.Context) error { } // check if transaction is too old - if tx.Essence().Timestamp().Before(clock.SyncedTime().Add(-tangle.MaxReattachmentTimeMin)) { - return c.JSON(http.StatusBadRequest, &jsonmodels.PostTransactionResponse{Error: fmt.Sprintf("transaction timestamp is older than MaxReattachmentTime (%s) and cannot be issued", tangle.MaxReattachmentTimeMin)}) + if tx.Essence().Timestamp().Before(clock.SyncedTime().Add(-tangleold.MaxReattachmentTimeMin)) { + return c.JSON(http.StatusBadRequest, &jsonmodels.PostTransactionResponse{Error: fmt.Sprintf("transaction timestamp is older than MaxReattachmentTime (%s) and cannot be issued", tangleold.MaxReattachmentTimeMin)}) } // if transaction is in the future we wait until the time arrives @@ -575,7 +576,7 @@ func PostTransaction(c echo.Context) error { time.Sleep(tx.Essence().Timestamp().Sub(clock.SyncedTime()) + 1*time.Nanosecond) } - issueTransaction := func() (*tangle.Block, error) { + issueTransaction := func() (*tangleold.Block, error) { return deps.Tangle.IssuePayload(tx) } diff --git a/plugins/webapi/mana/allmana.go b/plugins/webapi/mana/allmana.go index eaf2462a52..e8d63342a1 100644 --- a/plugins/webapi/mana/allmana.go +++ b/plugins/webapi/mana/allmana.go @@ -7,8 +7,8 @@ import ( "github.com/labstack/echo" - "github.com/iotaledger/goshimmer/packages/jsonmodels" - "github.com/iotaledger/goshimmer/packages/mana" + "github.com/iotaledger/goshimmer/packages/app/jsonmodels" + "github.com/iotaledger/goshimmer/packages/core/mana" manaPlugin "github.com/iotaledger/goshimmer/plugins/blocklayer" ) diff --git a/plugins/webapi/mana/allowedmanapledge.go b/plugins/webapi/mana/allowedmanapledge.go index 35f75c5c4c..3106260ffd 100644 --- a/plugins/webapi/mana/allowedmanapledge.go +++ b/plugins/webapi/mana/allowedmanapledge.go @@ -3,12 +3,12 @@ package mana import ( "net/http" - "github.com/iotaledger/hive.go/identity" + "github.com/iotaledger/hive.go/core/identity" "github.com/labstack/echo" "github.com/mr-tron/base58" - "github.com/iotaledger/goshimmer/packages/jsonmodels" - "github.com/iotaledger/goshimmer/packages/mana" + "github.com/iotaledger/goshimmer/packages/app/jsonmodels" + "github.com/iotaledger/goshimmer/packages/core/mana" manaPlugin "github.com/iotaledger/goshimmer/plugins/blocklayer" ) diff --git a/plugins/webapi/mana/logsHandler.go b/plugins/webapi/mana/logsHandler.go index fddebf0777..b5b8263686 100644 --- a/plugins/webapi/mana/logsHandler.go +++ b/plugins/webapi/mana/logsHandler.go @@ -1,21 +1,21 @@ package mana // -//import ( +// import ( // "net/http" // "time" // -// "github.com/iotaledger/hive.go/identity" +// "github.com/iotaledger/hive.go/core/identity" // "github.com/labstack/echo" // "github.com/mr-tron/base58" // -// "github.com/iotaledger/goshimmer/packages/mana" +// "github.com/iotaledger/goshimmer/packages/core/mana" // manaPlugin "github.com/iotaledger/goshimmer/plugins/blocklayer" // "github.com/iotaledger/goshimmer/plugins/webapi/jsonmodels" -//) +// ) // -//// getEventLogsHandler handles the request. -//func getEventLogsHandler(c echo.Context) error { +// // getEventLogsHandler handles the request. +// func getEventLogsHandler(c echo.Context) error { // var req jsonmodels.GetEventLogsRequest // if err := c.Bind(&req); err != nil { // return c.JSON(http.StatusBadRequest, jsonmodels.GetEventLogsResponse{Error: err.Error()}) diff --git a/plugins/webapi/mana/mana.go b/plugins/webapi/mana/mana.go index 03c01b2f49..7dfad6823f 100644 --- a/plugins/webapi/mana/mana.go +++ b/plugins/webapi/mana/mana.go @@ -8,8 +8,8 @@ import ( "github.com/labstack/echo" "github.com/mr-tron/base58" - "github.com/iotaledger/goshimmer/packages/jsonmodels" - "github.com/iotaledger/goshimmer/packages/mana" + "github.com/iotaledger/goshimmer/packages/app/jsonmodels" + "github.com/iotaledger/goshimmer/packages/core/mana" manaPlugin "github.com/iotaledger/goshimmer/plugins/blocklayer" ) diff --git a/plugins/webapi/mana/nhighest.go b/plugins/webapi/mana/nhighest.go index 5c2f48653e..1781796c1d 100644 --- a/plugins/webapi/mana/nhighest.go +++ b/plugins/webapi/mana/nhighest.go @@ -6,8 +6,8 @@ import ( "github.com/labstack/echo" - "github.com/iotaledger/goshimmer/packages/jsonmodels" - "github.com/iotaledger/goshimmer/packages/mana" + "github.com/iotaledger/goshimmer/packages/app/jsonmodels" + "github.com/iotaledger/goshimmer/packages/core/mana" manaPlugin "github.com/iotaledger/goshimmer/plugins/blocklayer" ) diff --git a/plugins/webapi/mana/online.go b/plugins/webapi/mana/online.go index 5b6a742152..ae346f1c8c 100644 --- a/plugins/webapi/mana/online.go +++ b/plugins/webapi/mana/online.go @@ -6,8 +6,8 @@ import ( "github.com/labstack/echo" "github.com/mr-tron/base58" - "github.com/iotaledger/goshimmer/packages/jsonmodels" - "github.com/iotaledger/goshimmer/packages/mana" + "github.com/iotaledger/goshimmer/packages/app/jsonmodels" + "github.com/iotaledger/goshimmer/packages/core/mana" manaPlugin "github.com/iotaledger/goshimmer/plugins/blocklayer" ) diff --git a/plugins/webapi/mana/percentile.go b/plugins/webapi/mana/percentile.go index a281566c54..ecfce53096 100644 --- a/plugins/webapi/mana/percentile.go +++ b/plugins/webapi/mana/percentile.go @@ -8,8 +8,8 @@ import ( "github.com/labstack/echo" "github.com/mr-tron/base58" - "github.com/iotaledger/goshimmer/packages/jsonmodels" - "github.com/iotaledger/goshimmer/packages/mana" + "github.com/iotaledger/goshimmer/packages/app/jsonmodels" + "github.com/iotaledger/goshimmer/packages/core/mana" manaPlugin "github.com/iotaledger/goshimmer/plugins/blocklayer" ) diff --git a/plugins/webapi/mana/plugin.go b/plugins/webapi/mana/plugin.go index 3712c5ede1..04ec8dd09c 100644 --- a/plugins/webapi/mana/plugin.go +++ b/plugins/webapi/mana/plugin.go @@ -1,8 +1,8 @@ package mana import ( - "github.com/iotaledger/hive.go/autopeering/peer" - "github.com/iotaledger/hive.go/node" + "github.com/iotaledger/hive.go/core/autopeering/peer" + "github.com/iotaledger/hive.go/core/node" "github.com/labstack/echo" "go.uber.org/dig" ) diff --git a/plugins/webapi/parameters.go b/plugins/webapi/parameters.go index b5f8b12340..9a12f27475 100644 --- a/plugins/webapi/parameters.go +++ b/plugins/webapi/parameters.go @@ -1,8 +1,6 @@ package webapi -import ( - "github.com/iotaledger/hive.go/configuration" -) +import "github.com/iotaledger/goshimmer/plugins/config" // ParametersDefinition contains the definition of the parameters used by the webAPI plugin. type ParametersDefinition struct { @@ -27,5 +25,5 @@ type ParametersDefinition struct { var Parameters = &ParametersDefinition{} func init() { - configuration.BindParameters(Parameters, "webAPI") + config.BindParameters(Parameters, "webAPI") } diff --git a/plugins/webapi/plugin.go b/plugins/webapi/plugin.go index 86c4deff8b..17416c4cbd 100644 --- a/plugins/webapi/plugin.go +++ b/plugins/webapi/plugin.go @@ -11,12 +11,12 @@ import ( "github.com/labstack/echo/middleware" "go.uber.org/dig" - "github.com/iotaledger/hive.go/daemon" - "github.com/iotaledger/hive.go/generics/event" - "github.com/iotaledger/hive.go/logger" - "github.com/iotaledger/hive.go/node" + "github.com/iotaledger/hive.go/core/daemon" + "github.com/iotaledger/hive.go/core/generics/event" + "github.com/iotaledger/hive.go/core/logger" + "github.com/iotaledger/hive.go/core/node" - "github.com/iotaledger/goshimmer/packages/shutdown" + "github.com/iotaledger/goshimmer/packages/node/shutdown" ) // PluginName is the name of the web API plugin. diff --git a/plugins/webapi/ratesetter/plugin.go b/plugins/webapi/ratesetter/plugin.go index ba2b5d7916..7cce205cc5 100644 --- a/plugins/webapi/ratesetter/plugin.go +++ b/plugins/webapi/ratesetter/plugin.go @@ -3,12 +3,12 @@ package ratesetter import ( "net/http" - "github.com/iotaledger/hive.go/node" + "github.com/iotaledger/hive.go/core/node" "github.com/labstack/echo" "go.uber.org/dig" - "github.com/iotaledger/goshimmer/packages/jsonmodels" - "github.com/iotaledger/goshimmer/packages/tangle" + "github.com/iotaledger/goshimmer/packages/app/jsonmodels" + "github.com/iotaledger/goshimmer/packages/core/tangleold" ) // PluginName is the name of the web API info endpoint plugin. @@ -18,7 +18,7 @@ type dependencies struct { dig.In Server *echo.Echo - Tangle *tangle.Tangle + Tangle *tangleold.Tangle } var ( diff --git a/plugins/webapi/scheduler/plugin.go b/plugins/webapi/scheduler/plugin.go index da58978b78..6d5e495849 100644 --- a/plugins/webapi/scheduler/plugin.go +++ b/plugins/webapi/scheduler/plugin.go @@ -3,13 +3,13 @@ package scheduler import ( "net/http" - "github.com/iotaledger/hive.go/autopeering/peer" - "github.com/iotaledger/hive.go/node" + "github.com/iotaledger/hive.go/core/autopeering/peer" + "github.com/iotaledger/hive.go/core/node" "github.com/labstack/echo" "go.uber.org/dig" - "github.com/iotaledger/goshimmer/packages/jsonmodels" - "github.com/iotaledger/goshimmer/packages/tangle" + "github.com/iotaledger/goshimmer/packages/app/jsonmodels" + "github.com/iotaledger/goshimmer/packages/core/tangleold" ) // PluginName is the name of the web API info endpoint plugin. @@ -20,7 +20,7 @@ type dependencies struct { Server *echo.Echo Local *peer.Local - Tangle *tangle.Tangle + Tangle *tangleold.Tangle } var ( diff --git a/plugins/webapi/snapshot/plugin.go b/plugins/webapi/snapshot/plugin.go index 430c98b3ef..6808d95db9 100644 --- a/plugins/webapi/snapshot/plugin.go +++ b/plugins/webapi/snapshot/plugin.go @@ -1,15 +1,20 @@ package snapshot import ( - "os" + "net/http" "go.uber.org/dig" - "github.com/iotaledger/hive.go/node" + "github.com/iotaledger/hive.go/core/node" "github.com/labstack/echo" - "github.com/iotaledger/goshimmer/packages/snapshot" - "github.com/iotaledger/goshimmer/packages/tangle" + "github.com/iotaledger/goshimmer/packages/app/jsonmodels" + "github.com/iotaledger/goshimmer/packages/core/epoch" + "github.com/iotaledger/goshimmer/packages/core/ledger" + "github.com/iotaledger/goshimmer/packages/core/notarization" + "github.com/iotaledger/goshimmer/packages/core/tangleold" + + "github.com/iotaledger/goshimmer/packages/core/snapshot" ) // region Plugin /////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -21,8 +26,9 @@ const ( type dependencies struct { dig.In - Server *echo.Echo - Tangle *tangle.Tangle + Server *echo.Echo + Tangle *tangleold.Tangle + NotarizationMgr *notarization.Manager } var ( @@ -46,21 +52,42 @@ func configure(_ *node.Plugin) { // DumpCurrentLedger dumps a snapshot (all unspent UTXO and all of the access mana) from now. func DumpCurrentLedger(c echo.Context) (err error) { - nodeSnapshot := new(snapshot.Snapshot) - nodeSnapshot.FromNode(deps.Tangle.Ledger) - - snapshotBytes := nodeSnapshot.Bytes() - if err = os.WriteFile(snapshotFileName, snapshotBytes, 0o666); err != nil { - Plugin.LogErrorf("unable to create snapshot file %s", err) + ecRecord, lastConfirmedEpoch, err := deps.Tangle.Options.CommitmentFunc() + if err != nil { + return c.JSON(http.StatusInternalServerError, jsonmodels.NewErrorResponse(err)) } - Plugin.LogInfo("Snapshot information: ") - Plugin.LogInfo(" Number of outputs: ", len(nodeSnapshot.LedgerSnapshot.OutputsWithMetadata)) - Plugin.LogInfo(" Number of epochdiffs: ", len(nodeSnapshot.LedgerSnapshot.EpochDiffs)) + // lock the entire ledger in notarization manager until the snapshot is created. + deps.NotarizationMgr.WriteLockLedger() + defer deps.NotarizationMgr.WriteUnlockLedger() - Plugin.LogInfof("Bytes written %d", len(snapshotBytes)) + headerPord := headerProducer(ecRecord, lastConfirmedEpoch) + outputWithMetadataProd := snapshot.NewLedgerUTXOStatesProducer(lastConfirmedEpoch, deps.NotarizationMgr) + epochDiffsProd := snapshot.NewEpochDiffsProducer(lastConfirmedEpoch, ecRecord.EI(), deps.NotarizationMgr) + + header, err := snapshot.CreateSnapshot(snapshotFileName, headerPord, outputWithMetadataProd, epochDiffsProd) + if err != nil { + Plugin.LogErrorf("unable to get snapshot bytes %s", err) + return c.JSON(http.StatusInternalServerError, jsonmodels.NewErrorResponse(err)) + } + Plugin.LogInfo("Snapshot information: ") + Plugin.LogInfo(" Number of outputs: ", header.OutputWithMetadataCount) + Plugin.LogInfo(" FullEpochIndex: ", header.FullEpochIndex) + Plugin.LogInfo(" DiffEpochIndex: ", header.DiffEpochIndex) + Plugin.LogInfo(" LatestECRecord: ", header.LatestECRecord) return c.Attachment(snapshotFileName, snapshotFileName) } +func headerProducer(ecRecord *epoch.ECRecord, lastConfirmedEpoch epoch.Index) snapshot.HeaderProducerFunc { + return func() (header *ledger.SnapshotHeader, err error) { + header = &ledger.SnapshotHeader{ + FullEpochIndex: lastConfirmedEpoch, + DiffEpochIndex: ecRecord.EI(), + LatestECRecord: ecRecord, + } + return header, nil + } +} + // endregion /////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/plugins/webapi/weightprovider/plugin.go b/plugins/webapi/weightprovider/plugin.go index 9137b00079..17e6f196a1 100644 --- a/plugins/webapi/weightprovider/plugin.go +++ b/plugins/webapi/weightprovider/plugin.go @@ -3,11 +3,11 @@ package weightprovider import ( "net/http" - "github.com/iotaledger/hive.go/node" + "github.com/iotaledger/hive.go/core/node" "github.com/labstack/echo" "go.uber.org/dig" - "github.com/iotaledger/goshimmer/packages/tangle" + "github.com/iotaledger/goshimmer/packages/core/tangleold" ) var ( @@ -20,7 +20,7 @@ type dependencies struct { dig.In Server *echo.Echo - Tangle *tangle.Tangle + Tangle *tangleold.Tangle } func init() { @@ -33,7 +33,7 @@ func configure(_ *node.Plugin) { } func getNodesHandler(c echo.Context) (err error) { - activeNodes := deps.Tangle.WeightProvider.(*tangle.CManaWeightProvider).ActiveNodes() + activeNodes := deps.Tangle.WeightProvider.(*tangleold.CManaWeightProvider).ActiveNodes() activeNodesString := make(map[string][]int64) for nodeID, al := range activeNodes { diff --git a/tools/cli-wallet/asset_info.go b/tools/cli-wallet/asset_info.go index 656be20047..b1d1adddbc 100644 --- a/tools/cli-wallet/asset_info.go +++ b/tools/cli-wallet/asset_info.go @@ -7,7 +7,7 @@ import ( "text/tabwriter" "github.com/iotaledger/goshimmer/client/wallet" - "github.com/iotaledger/goshimmer/packages/ledger/vm/devnetvm" + "github.com/iotaledger/goshimmer/packages/core/ledger/vm/devnetvm" ) func execAssetInfoCommand(command *flag.FlagSet, cliWallet *wallet.Wallet) { diff --git a/tools/cli-wallet/balance.go b/tools/cli-wallet/balance.go index 93fa7c274a..25731f9bcd 100644 --- a/tools/cli-wallet/balance.go +++ b/tools/cli-wallet/balance.go @@ -7,7 +7,7 @@ import ( "text/tabwriter" "github.com/iotaledger/goshimmer/client/wallet" - "github.com/iotaledger/goshimmer/packages/ledger/vm/devnetvm" + "github.com/iotaledger/goshimmer/packages/core/ledger/vm/devnetvm" ) func execBalanceCommand(command *flag.FlagSet, cliWallet *wallet.Wallet) { diff --git a/tools/cli-wallet/consolidate_funds.go b/tools/cli-wallet/consolidate_funds.go index a45a18c1ef..03f9dbd8b6 100644 --- a/tools/cli-wallet/consolidate_funds.go +++ b/tools/cli-wallet/consolidate_funds.go @@ -7,7 +7,7 @@ import ( "github.com/iotaledger/goshimmer/client/wallet" "github.com/iotaledger/goshimmer/client/wallet/packages/consolidateoptions" - "github.com/iotaledger/goshimmer/packages/ledger/vm/devnetvm" + "github.com/iotaledger/goshimmer/packages/core/ledger/vm/devnetvm" ) func execConsolidateFundsCommand(command *flag.FlagSet, cliWallet *wallet.Wallet) { diff --git a/tools/cli-wallet/create_nft.go b/tools/cli-wallet/create_nft.go index 8507adbaeb..5b07ba2d22 100644 --- a/tools/cli-wallet/create_nft.go +++ b/tools/cli-wallet/create_nft.go @@ -10,7 +10,7 @@ import ( "github.com/iotaledger/goshimmer/client/wallet" "github.com/iotaledger/goshimmer/client/wallet/packages/createnftoptions" - "github.com/iotaledger/goshimmer/packages/ledger/vm/devnetvm" + "github.com/iotaledger/goshimmer/packages/core/ledger/vm/devnetvm" ) func execCreateNFTCommand(command *flag.FlagSet, cliWallet *wallet.Wallet) { diff --git a/tools/cli-wallet/deposit_to_nft.go b/tools/cli-wallet/deposit_to_nft.go index 7750e7d289..86104c3d03 100644 --- a/tools/cli-wallet/deposit_to_nft.go +++ b/tools/cli-wallet/deposit_to_nft.go @@ -9,7 +9,7 @@ import ( "github.com/iotaledger/goshimmer/client/wallet" "github.com/iotaledger/goshimmer/client/wallet/packages/deposittonftoptions" - "github.com/iotaledger/goshimmer/packages/ledger/vm/devnetvm" + "github.com/iotaledger/goshimmer/packages/core/ledger/vm/devnetvm" ) func execDepositToNFTCommand(command *flag.FlagSet, cliWallet *wallet.Wallet) { diff --git a/tools/cli-wallet/destroy_nft.go b/tools/cli-wallet/destroy_nft.go index 6afa04f96f..77220b1ab9 100644 --- a/tools/cli-wallet/destroy_nft.go +++ b/tools/cli-wallet/destroy_nft.go @@ -7,7 +7,7 @@ import ( "github.com/iotaledger/goshimmer/client/wallet" "github.com/iotaledger/goshimmer/client/wallet/packages/destroynftoptions" - "github.com/iotaledger/goshimmer/packages/ledger/vm/devnetvm" + "github.com/iotaledger/goshimmer/packages/core/ledger/vm/devnetvm" ) func execDestroyNFTCommand(command *flag.FlagSet, cliWallet *wallet.Wallet) { diff --git a/tools/cli-wallet/lib.go b/tools/cli-wallet/lib.go index 70b438069b..c72321e1cf 100644 --- a/tools/cli-wallet/lib.go +++ b/tools/cli-wallet/lib.go @@ -8,9 +8,9 @@ import ( "unsafe" "github.com/capossele/asset-registry/pkg/registryservice" - "github.com/iotaledger/hive.go/bitmask" - "github.com/iotaledger/hive.go/crypto/ed25519" - "github.com/iotaledger/hive.go/marshalutil" + "github.com/iotaledger/hive.go/core/bitmask" + "github.com/iotaledger/hive.go/core/crypto/ed25519" + "github.com/iotaledger/hive.go/core/marshalutil" "github.com/mr-tron/base58" "github.com/iotaledger/goshimmer/client" diff --git a/tools/cli-wallet/pendingmana.go b/tools/cli-wallet/pendingmana.go index fc52321008..0bde09b148 100644 --- a/tools/cli-wallet/pendingmana.go +++ b/tools/cli-wallet/pendingmana.go @@ -6,7 +6,7 @@ import ( "os" "github.com/iotaledger/goshimmer/client/wallet" - "github.com/iotaledger/goshimmer/packages/ledger/vm/devnetvm" + "github.com/iotaledger/goshimmer/packages/core/ledger/vm/devnetvm" ) func execPendingMana(command *flag.FlagSet, cliWallet *wallet.Wallet) { diff --git a/tools/cli-wallet/sendfunds.go b/tools/cli-wallet/sendfunds.go index eccffc4194..051469d393 100644 --- a/tools/cli-wallet/sendfunds.go +++ b/tools/cli-wallet/sendfunds.go @@ -11,7 +11,7 @@ import ( "github.com/iotaledger/goshimmer/client/wallet" "github.com/iotaledger/goshimmer/client/wallet/packages/address" "github.com/iotaledger/goshimmer/client/wallet/packages/sendoptions" - "github.com/iotaledger/goshimmer/packages/ledger/vm/devnetvm" + "github.com/iotaledger/goshimmer/packages/core/ledger/vm/devnetvm" ) func execSendFundsCommand(command *flag.FlagSet, cliWallet *wallet.Wallet) { diff --git a/tools/cli-wallet/sweep_nft_owned.go b/tools/cli-wallet/sweep_nft_owned.go index d5da7feca4..5cfca8917f 100644 --- a/tools/cli-wallet/sweep_nft_owned.go +++ b/tools/cli-wallet/sweep_nft_owned.go @@ -8,7 +8,7 @@ import ( "github.com/iotaledger/goshimmer/client/wallet" "github.com/iotaledger/goshimmer/client/wallet/packages/sweepnftownednftsoptions" "github.com/iotaledger/goshimmer/client/wallet/packages/sweepnftownedoptions" - "github.com/iotaledger/goshimmer/packages/ledger/vm/devnetvm" + "github.com/iotaledger/goshimmer/packages/core/ledger/vm/devnetvm" ) func execSweepNFTOwnedFundsCommand(command *flag.FlagSet, cliWallet *wallet.Wallet) { diff --git a/tools/cli-wallet/transfer_nft.go b/tools/cli-wallet/transfer_nft.go index 56a3b55b58..15cef0c932 100644 --- a/tools/cli-wallet/transfer_nft.go +++ b/tools/cli-wallet/transfer_nft.go @@ -7,7 +7,7 @@ import ( "github.com/iotaledger/goshimmer/client/wallet" "github.com/iotaledger/goshimmer/client/wallet/packages/transfernftoptions" - "github.com/iotaledger/goshimmer/packages/ledger/vm/devnetvm" + "github.com/iotaledger/goshimmer/packages/core/ledger/vm/devnetvm" ) func execTransferNFTCommand(command *flag.FlagSet, cliWallet *wallet.Wallet) { diff --git a/tools/cli-wallet/withdraw-from-nft.go b/tools/cli-wallet/withdraw-from-nft.go index 3358415496..bc0cff4329 100644 --- a/tools/cli-wallet/withdraw-from-nft.go +++ b/tools/cli-wallet/withdraw-from-nft.go @@ -9,7 +9,7 @@ import ( "github.com/iotaledger/goshimmer/client/wallet" "github.com/iotaledger/goshimmer/client/wallet/packages/withdrawfromnftoptions" - "github.com/iotaledger/goshimmer/packages/ledger/vm/devnetvm" + "github.com/iotaledger/goshimmer/packages/core/ledger/vm/devnetvm" ) func execWithdrawFromFTCommand(command *flag.FlagSet, cliWallet *wallet.Wallet) { diff --git a/tools/docker-network/docker-network.snapshot b/tools/docker-network/docker-network.snapshot index 7d7ac3e95c..0ecab7e575 100644 Binary files a/tools/docker-network/docker-network.snapshot and b/tools/docker-network/docker-network.snapshot differ diff --git a/tools/double-spend/double-spend.go b/tools/double-spend/double-spend.go index 4145f3cc69..94f571804f 100644 --- a/tools/double-spend/double-spend.go +++ b/tools/double-spend/double-spend.go @@ -7,13 +7,13 @@ import ( "sync" "time" - "github.com/iotaledger/hive.go/generics/lo" - "github.com/iotaledger/hive.go/identity" + "github.com/iotaledger/hive.go/core/generics/lo" + "github.com/iotaledger/hive.go/core/identity" "github.com/iotaledger/goshimmer/client" walletseed "github.com/iotaledger/goshimmer/client/wallet/packages/seed" - "github.com/iotaledger/goshimmer/packages/ledger/utxo" - "github.com/iotaledger/goshimmer/packages/ledger/vm/devnetvm" + "github.com/iotaledger/goshimmer/packages/core/ledger/utxo" + "github.com/iotaledger/goshimmer/packages/core/ledger/vm/devnetvm" ) func main() { diff --git a/tools/evil-spammer/evillogger/logger.go b/tools/evil-spammer/evillogger/logger.go index b43eef9146..b3c89cdd9a 100644 --- a/tools/evil-spammer/evillogger/logger.go +++ b/tools/evil-spammer/evillogger/logger.go @@ -3,8 +3,8 @@ package evillogger import ( "fmt" - "github.com/iotaledger/hive.go/configuration" - "github.com/iotaledger/hive.go/logger" + "github.com/iotaledger/hive.go/core/configuration" + "github.com/iotaledger/hive.go/core/logger" ) var New = logger.NewLogger diff --git a/tools/evil-spammer/interactive.go b/tools/evil-spammer/interactive.go index d0277fc791..9346c1015a 100644 --- a/tools/evil-spammer/interactive.go +++ b/tools/evil-spammer/interactive.go @@ -11,7 +11,7 @@ import ( "time" "github.com/AlecAivazis/survey/v2" - "github.com/iotaledger/hive.go/types" + "github.com/iotaledger/hive.go/core/types" "go.uber.org/atomic" "github.com/iotaledger/goshimmer/client" diff --git a/tools/genesis-snapshot/main.go b/tools/genesis-snapshot/main.go index 002657a934..0b5d968572 100644 --- a/tools/genesis-snapshot/main.go +++ b/tools/genesis-snapshot/main.go @@ -4,9 +4,11 @@ import ( "fmt" "log" - "github.com/iotaledger/hive.go/identity" + "github.com/iotaledger/hive.go/core/identity" - "github.com/iotaledger/goshimmer/packages/snapshot" + "github.com/iotaledger/goshimmer/packages/core/epoch" + "github.com/iotaledger/goshimmer/packages/core/ledger" + "github.com/iotaledger/goshimmer/packages/core/snapshot" "github.com/iotaledger/goshimmer/tools/genesis-snapshot/snapshotcreator" "github.com/mr-tron/base58" @@ -95,24 +97,16 @@ func main() { manaDistribution := createManaDistribution(totalTokensToPledge) - createdSnapshot, err := snapshotcreator.CreateSnapshot(genesisTokenAmount, genesisSeed, manaDistribution) + err = snapshotcreator.CreateSnapshot(snapshotFileName, genesisTokenAmount, genesisSeed, manaDistribution) if err != nil { - log.Fatal("Failed to create createdSnapshot %w", err) + log.Fatal(fmt.Errorf("failed to create snapshot: %w", err)) + return } - if err = createdSnapshot.WriteFile(snapshotFileName); err != nil { - panic(err) - } - - fmt.Println("created", createdSnapshot) - - u := new(snapshot.Snapshot) - err = u.FromBytes(createdSnapshot.Bytes()) + err = readSnapshotFromFile(snapshotFileName) if err != nil { - panic(err) + log.Fatal(fmt.Errorf("failed to read snapshot: %w", err)) } - - fmt.Println("unmarshalled", u.LedgerSnapshot) } func createManaDistribution(totalTokensToPledge uint64) (manaDistribution map[identity.ID]uint64) { @@ -140,3 +134,19 @@ func init() { panic(err) } } + +func readSnapshotFromFile(filePath string) (err error) { + outputWithMetadataConsumer := func(outputWithMetadatas []*ledger.OutputWithMetadata) { + fmt.Println(outputWithMetadatas) + } + epochDiffsConsumer := func(_ *ledger.SnapshotHeader, epochDiffs map[epoch.Index]*ledger.EpochDiff) { + fmt.Println(epochDiffs) + } + headerConsumer := func(h *ledger.SnapshotHeader) { + fmt.Println(h) + } + + err = snapshot.LoadSnapshot(filePath, headerConsumer, outputWithMetadataConsumer, epochDiffsConsumer) + + return +} diff --git a/tools/genesis-snapshot/snapshotcreator/snapshotcreator.go b/tools/genesis-snapshot/snapshotcreator/snapshotcreator.go index f8189159f6..5b66a12538 100644 --- a/tools/genesis-snapshot/snapshotcreator/snapshotcreator.go +++ b/tools/genesis-snapshot/snapshotcreator/snapshotcreator.go @@ -1,18 +1,20 @@ package snapshotcreator import ( + "fmt" "time" - "github.com/iotaledger/hive.go/crypto/ed25519" - "github.com/iotaledger/hive.go/identity" - "github.com/iotaledger/hive.go/types/confirmation" + "github.com/iotaledger/hive.go/core/crypto/ed25519" + "github.com/iotaledger/hive.go/core/identity" + "github.com/iotaledger/hive.go/core/types/confirmation" + + "github.com/iotaledger/goshimmer/packages/core/epoch" + "github.com/iotaledger/goshimmer/packages/core/ledger" + "github.com/iotaledger/goshimmer/packages/core/ledger/utxo" + "github.com/iotaledger/goshimmer/packages/core/ledger/vm/devnetvm" "github.com/iotaledger/goshimmer/client/wallet/packages/seed" - "github.com/iotaledger/goshimmer/packages/epoch" - "github.com/iotaledger/goshimmer/packages/ledger" - "github.com/iotaledger/goshimmer/packages/ledger/utxo" - "github.com/iotaledger/goshimmer/packages/ledger/vm/devnetvm" - "github.com/iotaledger/goshimmer/packages/snapshot" + "github.com/iotaledger/goshimmer/packages/core/snapshot" ) // CreateSnapshot creates a new snapshot. Genesis is defined by genesisTokenAmount and seedBytes, it is pledged to the @@ -23,10 +25,33 @@ import ( // | empty | genesisSeed | // | node1 | empty/burned | // | node2 | empty/burned | -func CreateSnapshot(genesisTokenAmount uint64, genesisSeedBytes []byte, nodesToPledge map[identity.ID]uint64) (createdSnapshot *snapshot.Snapshot, err error) { +func CreateSnapshot(snapshotFileName string, genesisTokenAmount uint64, genesisSeedBytes []byte, nodesToPledge map[identity.ID]uint64) (err error) { now := time.Now() - outputsWithMetadata := make([]*ledger.OutputWithMetadata, 0) + headerProd := func() (header *ledger.SnapshotHeader, err error) { + ecRecord := epoch.NewECRecord(0) + ecRecord.SetECR(epoch.MerkleRoot{}) + ecRecord.SetPrevEC(epoch.MerkleRoot{}) + + header = &ledger.SnapshotHeader{ + FullEpochIndex: 0, + DiffEpochIndex: 0, + LatestECRecord: ecRecord, + } + + fmt.Println(header) + + return + } + + epochDiffsProd := func() (epochDiffs map[epoch.Index]*ledger.EpochDiff, err error) { + epochDiffs = make(map[epoch.Index]*ledger.EpochDiff) + fmt.Println(epochDiffs) + return + } + + // prepare outputsWithMetadata + outputsWithMetadata := make([]*ledger.OutputWithMetadata, 0) output, outputMetadata := createOutput(seed.NewSeed(genesisSeedBytes).Address(0).Address(), genesisTokenAmount, identity.ID{}, now) outputsWithMetadata = append(outputsWithMetadata, ledger.NewOutputWithMetadata(output.ID(), output, outputMetadata.CreationTime(), outputMetadata.ConsensusManaPledgeID(), outputMetadata.AccessManaPledgeID())) @@ -35,18 +60,22 @@ func CreateSnapshot(genesisTokenAmount uint64, genesisSeedBytes []byte, nodesToP output, outputMetadata = createOutput(devnetvm.NewED25519Address(ed25519.GenerateKeyPair().PublicKey), value, nodeID, now) outputsWithMetadata = append(outputsWithMetadata, ledger.NewOutputWithMetadata(output.ID(), output, outputMetadata.CreationTime(), outputMetadata.ConsensusManaPledgeID(), outputMetadata.AccessManaPledgeID())) } + i := 0 + + utxoStatesProd := func() *ledger.OutputWithMetadata { + if i == len(outputsWithMetadata) { + return nil + } - ledgerSnapshot := ledger.NewSnapshot(outputsWithMetadata) - ledgerSnapshot.FullEpochIndex = 0 - ledgerSnapshot.DiffEpochIndex = 0 - ledgerSnapshot.EpochDiffs = make(map[epoch.Index]*ledger.EpochDiff) - ledgerSnapshot.LatestECRecord = epoch.NewECRecord(0) - ledgerSnapshot.LatestECRecord.SetECR(epoch.MerkleRoot{}) - ledgerSnapshot.LatestECRecord.SetPrevEC(epoch.MerkleRoot{}) - - return &snapshot.Snapshot{ - LedgerSnapshot: ledgerSnapshot, - }, nil + o := outputsWithMetadata[i] + i++ + fmt.Println(o) + return o + } + + _, err = snapshot.CreateSnapshot(snapshotFileName, headerProd, utxoStatesProd, epochDiffsProd) + + return } // CreateSnapshotForIntegrationTest creates a new snapshot. Genesis is defined by genesisTokenAmount and seedBytes, it @@ -57,7 +86,7 @@ func CreateSnapshot(genesisTokenAmount uint64, genesisSeedBytes []byte, nodesToP // | genesisSeed | genesisSeed | // | node1 | node1 | // | node2 | node2 | -func CreateSnapshotForIntegrationTest(genesisTokenAmount uint64, genesisSeedBytes []byte, genesisNodePledge []byte, nodesToPledge map[[32]byte]uint64) (createdSnapshot *snapshot.Snapshot, err error) { +func CreateSnapshotForIntegrationTest(snapshotFileName string, genesisTokenAmount uint64, genesisSeedBytes []byte, genesisNodePledge []byte, nodesToPledge map[[32]byte]uint64) (err error) { now := time.Now() outputsWithMetadata := make([]*ledger.OutputWithMetadata, 0) @@ -71,18 +100,43 @@ func CreateSnapshotForIntegrationTest(genesisTokenAmount uint64, genesisSeedByte output, outputMetadata = createOutput(seed.NewSeed(nodeSeedBytes[:]).Address(0).Address(), value, nodeID, now) outputsWithMetadata = append(outputsWithMetadata, ledger.NewOutputWithMetadata(output.ID(), output, outputMetadata.CreationTime(), outputMetadata.ConsensusManaPledgeID(), outputMetadata.AccessManaPledgeID())) } + i := 0 + utxoStatesProd := func() *ledger.OutputWithMetadata { + if i == len(outputsWithMetadata) { + return nil + } + + o := outputsWithMetadata[i] + i++ + fmt.Println(o) + return o + } + + headerProd := func() (header *ledger.SnapshotHeader, err error) { + ecRecord := epoch.NewECRecord(0) + ecRecord.SetECR(epoch.MerkleRoot{}) + ecRecord.SetPrevEC(epoch.MerkleRoot{}) + + header = &ledger.SnapshotHeader{ + FullEpochIndex: 0, + DiffEpochIndex: 0, + LatestECRecord: ecRecord, + } + + fmt.Println(header) + + return + } + + epochDiffsProd := func() (epochDiffs map[epoch.Index]*ledger.EpochDiff, err error) { + epochDiffs = make(map[epoch.Index]*ledger.EpochDiff) + fmt.Println(epochDiffs) + return + } + + _, err = snapshot.CreateSnapshot(snapshotFileName, headerProd, utxoStatesProd, epochDiffsProd) - ledgerSnapshot := ledger.NewSnapshot(outputsWithMetadata) - ledgerSnapshot.FullEpochIndex = 0 - ledgerSnapshot.DiffEpochIndex = 0 - ledgerSnapshot.EpochDiffs = make(map[epoch.Index]*ledger.EpochDiff) - ledgerSnapshot.LatestECRecord = epoch.NewECRecord(0) - ledgerSnapshot.LatestECRecord.SetECR(epoch.MerkleRoot{}) - ledgerSnapshot.LatestECRecord.SetPrevEC(epoch.MerkleRoot{}) - - return &snapshot.Snapshot{ - LedgerSnapshot: ledgerSnapshot, - }, nil + return } var outputCounter uint16 = 1 diff --git a/tools/integration-tests/tester/framework/config/config.go b/tools/integration-tests/tester/framework/config/config.go index f41d910de2..0abd8625ac 100644 --- a/tools/integration-tests/tester/framework/config/config.go +++ b/tools/integration-tests/tester/framework/config/config.go @@ -3,8 +3,8 @@ package config import ( "reflect" - "github.com/iotaledger/hive.go/crypto/ed25519" - "github.com/iotaledger/hive.go/identity" + "github.com/iotaledger/hive.go/core/crypto/ed25519" + "github.com/iotaledger/hive.go/core/identity" "github.com/iotaledger/goshimmer/plugins/activity" "github.com/iotaledger/goshimmer/plugins/autopeering" diff --git a/tools/integration-tests/tester/framework/framework.go b/tools/integration-tests/tester/framework/framework.go index 8f169e0d07..3b57ba2ab0 100644 --- a/tools/integration-tests/tester/framework/framework.go +++ b/tools/integration-tests/tester/framework/framework.go @@ -153,19 +153,17 @@ func createSnapshot(snapshotInfo SnapshotInfo) error { if err != nil { return errors.Wrap(err, "failed to decode master seed") } - createdSnapshot, err := snapshotcreator.CreateSnapshotForIntegrationTest(snapshotInfo.GenesisTokenAmount, GenesisSeedBytes, masterSeed, nodesToPledgeMap) - if err != nil { - return err - } // default to /assets/snapshot.bin if snapshotInfo.FilePath == "" { snapshotInfo.FilePath = "/assets/snapshot.bin" } - if err = createdSnapshot.WriteFile(snapshotInfo.FilePath); err != nil { + err = snapshotcreator.CreateSnapshotForIntegrationTest(snapshotInfo.FilePath, snapshotInfo.GenesisTokenAmount, GenesisSeedBytes, masterSeed, nodesToPledgeMap) + if err != nil { return err } + return nil } diff --git a/tools/integration-tests/tester/framework/network.go b/tools/integration-tests/tester/framework/network.go index bbfd753fc6..fb2ed16d16 100644 --- a/tools/integration-tests/tester/framework/network.go +++ b/tools/integration-tests/tester/framework/network.go @@ -9,13 +9,13 @@ import ( "github.com/cockroachdb/errors" "github.com/docker/docker/api/types" "github.com/docker/docker/client" - "github.com/iotaledger/hive.go/crypto/ed25519" + "github.com/iotaledger/hive.go/core/crypto/ed25519" "github.com/mr-tron/base58" "golang.org/x/sync/errgroup" walletseed "github.com/iotaledger/goshimmer/client/wallet/packages/seed" - "github.com/iotaledger/goshimmer/packages/jsonmodels" - "github.com/iotaledger/goshimmer/packages/manualpeering" + "github.com/iotaledger/goshimmer/packages/app/jsonmodels" + "github.com/iotaledger/goshimmer/packages/node/manualpeering" "github.com/iotaledger/goshimmer/tools/integration-tests/tester/framework/config" ) diff --git a/tools/integration-tests/tester/framework/node.go b/tools/integration-tests/tester/framework/node.go index 26c626b7f3..09b2feda56 100644 --- a/tools/integration-tests/tester/framework/node.go +++ b/tools/integration-tests/tester/framework/node.go @@ -7,9 +7,9 @@ import ( "time" "github.com/cockroachdb/errors" - "github.com/iotaledger/hive.go/identity" + "github.com/iotaledger/hive.go/core/identity" - "github.com/iotaledger/goshimmer/packages/ledger/vm/devnetvm" + "github.com/iotaledger/goshimmer/packages/core/ledger/vm/devnetvm" "github.com/iotaledger/goshimmer/tools/integration-tests/tester/framework/config" "github.com/iotaledger/goshimmer/client" diff --git a/tools/integration-tests/tester/go.mod b/tools/integration-tests/tester/go.mod index 6c78fd8e12..8aae683e7f 100644 --- a/tools/integration-tests/tester/go.mod +++ b/tools/integration-tests/tester/go.mod @@ -3,15 +3,15 @@ module github.com/iotaledger/goshimmer/tools/integration-tests/tester go 1.18 require ( - github.com/cockroachdb/errors v1.8.4 + github.com/cockroachdb/errors v1.9.0 github.com/docker/docker v1.13.1 github.com/docker/go-connections v0.4.0 github.com/iotaledger/goshimmer v0.1.3 - github.com/iotaledger/hive.go v0.0.0-20220714132400-7fd91bb37663 + github.com/iotaledger/hive.go/core v0.0.0-20220804174551-efbca20a83e4 github.com/mr-tron/base58 v1.2.0 - github.com/stretchr/testify v1.7.1 - golang.org/x/crypto v0.0.0-20220214200702-86341886e292 - golang.org/x/sync v0.0.0-20210220032951-036812b2e83c + github.com/stretchr/testify v1.8.0 + golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa + golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4 ) require ( @@ -24,21 +24,21 @@ require ( github.com/btcsuite/btcd v0.22.0-beta // indirect github.com/capossele/asset-registry v0.0.0-20210521112927-c9d6e74574e8 // indirect github.com/celestiaorg/smt v0.2.1-0.20220414134126-dba215ccb884 // indirect - github.com/cespare/xxhash/v2 v2.1.1 // indirect - github.com/cockroachdb/logtags v0.0.0-20190617123548-eb05cc24525f // indirect - github.com/cockroachdb/redact v1.0.8 // indirect - github.com/cockroachdb/sentry-go v0.6.1-cockroachdb.2 // indirect + github.com/cespare/xxhash/v2 v2.1.2 // indirect + github.com/cockroachdb/logtags v0.0.0-20211118104740-dabe8e521a4f // indirect + github.com/cockroachdb/redact v1.1.3 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/davidlazar/go-crypto v0.0.0-20200604182044-b73af7476f6c // indirect github.com/dgrijalva/jwt-go v3.2.0+incompatible // indirect github.com/docker/distribution v2.7.1+incompatible // indirect github.com/docker/go-units v0.4.0 // indirect - github.com/emirpasic/gods v1.12.0 // indirect + github.com/emirpasic/gods v1.18.1 // indirect github.com/fatih/structs v1.1.0 // indirect github.com/flynn/noise v1.0.0 // indirect - github.com/fsnotify/fsnotify v1.4.9 // indirect + github.com/fsnotify/fsnotify v1.5.4 // indirect + github.com/getsentry/sentry-go v0.13.0 // indirect github.com/gin-contrib/sse v0.1.0 // indirect - github.com/gin-gonic/gin v1.7.0 // indirect + github.com/gin-gonic/gin v1.7.7 // indirect github.com/go-ole/go-ole v1.2.4 // indirect github.com/go-playground/locales v0.13.0 // indirect github.com/go-playground/universal-translator v0.17.0 // indirect @@ -54,6 +54,7 @@ require ( github.com/gorilla/websocket v1.5.0 // indirect github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d // indirect github.com/huin/goupnp v1.0.2 // indirect + github.com/iotaledger/hive.go/serializer/v2 v2.0.0-20220804174551-efbca20a83e4 // indirect github.com/ipfs/go-cid v0.0.7 // indirect github.com/ipfs/go-ipfs-util v0.0.2 // indirect github.com/ipfs/go-log v1.0.5 // indirect @@ -62,14 +63,15 @@ require ( github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect github.com/jbenet/go-temp-err-catcher v0.1.0 // indirect github.com/jbenet/goprocess v0.1.4 // indirect + github.com/jellydator/ttlcache/v2 v2.11.1 // indirect github.com/jmespath/go-jmespath v0.4.0 // indirect - github.com/json-iterator/go v1.1.11 // indirect + github.com/json-iterator/go v1.1.12 // indirect github.com/kevinburke/ssh_config v0.0.0-20190725054713-01f96b0aa0cd // indirect - github.com/klauspost/compress v1.12.3 // indirect + github.com/klauspost/compress v1.15.9 // indirect github.com/klauspost/cpuid/v2 v2.0.9 // indirect - github.com/knadh/koanf v1.4.0 // indirect + github.com/knadh/koanf v1.4.2 // indirect github.com/koron/go-ssdp v0.0.2 // indirect - github.com/kr/pretty v0.2.1 // indirect + github.com/kr/pretty v0.3.0 // indirect github.com/kr/text v0.2.0 // indirect github.com/labstack/echo v3.3.10+incompatible // indirect github.com/labstack/gommon v0.3.0 // indirect @@ -109,8 +111,8 @@ require ( github.com/libp2p/go-yamux/v2 v2.2.0 // indirect github.com/markbates/pkger v0.17.1 // indirect github.com/marten-seemann/tcp v0.0.0-20210406111302-dfbc87cc63fd // indirect - github.com/mattn/go-colorable v0.1.8 // indirect - github.com/mattn/go-isatty v0.0.13 // indirect + github.com/mattn/go-colorable v0.1.12 // indirect + github.com/mattn/go-isatty v0.0.14 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect github.com/miekg/dns v1.1.43 // indirect github.com/mikioh/tcpinfo v0.0.0-20190314235526-30a79bb1804b // indirect @@ -119,10 +121,10 @@ require ( github.com/minio/sha256-simd v1.0.0 // indirect github.com/mitchellh/copystructure v1.2.0 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect - github.com/mitchellh/mapstructure v1.4.1 // indirect + github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/mitchellh/reflectwalk v1.0.2 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect - github.com/modern-go/reflect2 v1.0.1 // indirect + github.com/modern-go/reflect2 v1.0.2 // indirect github.com/multiformats/go-base32 v0.0.3 // indirect github.com/multiformats/go-base36 v0.1.0 // indirect github.com/multiformats/go-multiaddr v0.4.1 // indirect @@ -135,23 +137,25 @@ require ( github.com/oasisprotocol/ed25519 v0.0.0-20210505154701-76d8c688d86e // indirect github.com/opencontainers/go-digest v1.0.0 // indirect github.com/opentracing/opentracing-go v1.2.0 // indirect - github.com/panjf2000/ants/v2 v2.4.8 // indirect + github.com/panjf2000/ants/v2 v2.5.0 // indirect github.com/paulbellamy/ratecounter v0.2.0 // indirect - github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5 // indirect + github.com/pelletier/go-toml/v2 v2.0.2 // indirect + github.com/petermattis/goid v0.0.0-20220712135657-ac599d9cba15 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/client_golang v1.11.0 // indirect + github.com/prometheus/client_golang v1.11.1 // indirect github.com/prometheus/client_model v0.2.0 // indirect github.com/prometheus/common v0.30.0 // indirect github.com/prometheus/procfs v0.7.3 // indirect + github.com/rogpeppe/go-internal v1.8.1 // indirect github.com/sasha-s/go-deadlock v0.3.1 // indirect github.com/sergi/go-diff v1.1.0 // indirect github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible // indirect github.com/spacemonkeygo/spacelog v0.0.0-20180420211403-2296661a0572 // indirect - github.com/spf13/cast v1.4.1 // indirect + github.com/spf13/cast v1.5.0 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/src-d/gcfg v1.4.0 // indirect - github.com/stretchr/objx v0.3.0 // indirect + github.com/stretchr/objx v0.4.0 // indirect github.com/tklauser/go-sysconf v0.3.5 // indirect github.com/tklauser/numcpus v0.2.2 // indirect github.com/ugorji/go/codec v1.1.7 // indirect @@ -168,19 +172,19 @@ require ( go.dedis.ch/kyber/v3 v3.0.13 // indirect go.mongodb.org/mongo-driver v1.5.1 // indirect go.uber.org/atomic v1.9.0 // indirect - go.uber.org/dig v1.14.1 // indirect - go.uber.org/multierr v1.7.0 // indirect + go.uber.org/dig v1.15.0 // indirect + go.uber.org/multierr v1.8.0 // indirect go.uber.org/zap v1.21.0 // indirect - golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2 // indirect - golang.org/x/sys v0.0.0-20210909193231-528a39cd75f3 // indirect + golang.org/x/net v0.0.0-20220802222814-0bcc04d9c69b // indirect + golang.org/x/sys v0.0.0-20220803195053-6e608f9ce704 // indirect golang.org/x/text v0.3.7 // indirect - golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect - google.golang.org/protobuf v1.27.1 // indirect + golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f // indirect + google.golang.org/protobuf v1.28.1 // indirect gopkg.in/src-d/go-billy.v4 v4.3.2 // indirect gopkg.in/src-d/go-git.v4 v4.13.1 // indirect gopkg.in/warnings.v0 v0.1.2 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect - gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect ) replace github.com/iotaledger/goshimmer => ../../.. diff --git a/tools/integration-tests/tester/go.sum b/tools/integration-tests/tester/go.sum index e9e93957d4..0737d7dede 100644 --- a/tools/integration-tests/tester/go.sum +++ b/tools/integration-tests/tester/go.sum @@ -44,7 +44,9 @@ github.com/AndreasBriese/bbloom v0.0.0-20190825152654-46b345b51c96/go.mod h1:bOv github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/CloudyKit/fastprinter v0.0.0-20170127035650-74b38d55f37a/go.mod h1:EFZQ978U7x8IRnstaskI3IysnWY5Ao3QgZUKOXlsAdw= +github.com/CloudyKit/fastprinter v0.0.0-20200109182630-33d98a066a53/go.mod h1:+3IMCy2vIlbG1XG/0ggNQv0SvxCAIpPM5b1nCz56Xno= github.com/CloudyKit/jet v2.1.3-0.20180809161101-62edd43e4f88+incompatible/go.mod h1:HPYO+50pSWkPoj9Q/eq0aRGByCL6ScRlUmiEX5Zgm+w= +github.com/CloudyKit/jet/v3 v3.0.0/go.mod h1:HKQPgSJmdK8hdoAbKUUWajkHyHo4RaU5rMdUywE7VMo= github.com/Joker/hpp v1.0.0/go.mod h1:8x5n+M1Hp5hC0g8okX3sR3vFQwynaX/UgSOM9MeBKzY= github.com/Joker/jade v1.0.1-0.20190614124447-d475f43051e7/go.mod h1:6E6s8o2AE4KhCrqr6GRJjdC/gNfTdxkIXvuGZZda2VM= github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= @@ -114,7 +116,7 @@ github.com/btcsuite/btcd v0.0.0-20190824003749-130ea5bddde3/go.mod h1:3J08xEfcug github.com/btcsuite/btcd v0.20.1-beta/go.mod h1:wVuoA8VJLEcwgqHBwHmzLRazpKxTv13Px/pDuV7OomQ= github.com/btcsuite/btcd v0.22.0-beta h1:LTDpDKUM5EeOFBPM8IXpinEcmZ6FWfNZbE3lfrfdnWo= github.com/btcsuite/btcd v0.22.0-beta/go.mod h1:9n5ntfhhHQBIhUvlhDvD3Qg6fRUj4jkN0VB8L8svzOA= -github.com/btcsuite/btcd/btcec/v2 v2.1.2 h1:YoYoC9J0jwfukodSBMzZYUVQ8PTiYg4BnOWiJVzTmLs= +github.com/btcsuite/btcd/btcec/v2 v2.2.0 h1:fzn1qaOt32TuLjFlkzYSsBC35Q3KUjT1SwPxiMSCF5k= github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f/go.mod h1:TdznJufoqS23FtqVCzL0ZqgP5MqXbb4fg/WgDys70nA= github.com/btcsuite/btcutil v0.0.0-20190207003914-4c204d697803/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg= github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg= @@ -136,8 +138,9 @@ github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QH github.com/cenkalti/backoff/v4 v4.1.1/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= -github.com/cespare/xxhash/v2 v2.1.1 h1:6MnRN8NT7+YBpUIWxHtefFZOKTAPgGjpQSxqLNn0+qY= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE= +github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cheekybits/genny v1.0.0 h1:uGGa4nei+j20rOSeDeP5Of12XVm7TGUd4dJA9RDitfE= github.com/cheekybits/genny v1.0.0/go.mod h1:+tQajlRqAUrPI7DOSpB0XAqZYtQakVtB7wXkRAgjxjQ= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= @@ -150,14 +153,19 @@ github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnht github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= github.com/cockroachdb/datadriven v1.0.0/go.mod h1:5Ib8Meh+jk1RlHIXej6Pzevx/NLlNvQB9pmSBZErGA4= +github.com/cockroachdb/datadriven v1.0.1-0.20211007161720-b558070c3be0/go.mod h1:5Ib8Meh+jk1RlHIXej6Pzevx/NLlNvQB9pmSBZErGA4= +github.com/cockroachdb/datadriven v1.0.1-0.20220214170620-9913f5bc19b7/go.mod h1:hi0MtSY3AYDQNDi83kDkMH5/yqM/CsIrsOITkSoH7KI= github.com/cockroachdb/errors v1.6.1/go.mod h1:tm6FTP5G81vwJ5lC0SizQo374JNCOPrHyXGitRJoDqM= -github.com/cockroachdb/errors v1.8.4 h1:41oZ1A4Eju6LviqkGpu5R2M39gHHVAFvOYsQjot1jNc= github.com/cockroachdb/errors v1.8.4/go.mod h1:GScl7wnuvY335l6h0jbkHIKJ+8uEmUmJRVWKnenUbfI= -github.com/cockroachdb/logtags v0.0.0-20190617123548-eb05cc24525f h1:o/kfcElHqOiXqcou5a3rIlMc7oJbMQkeLk0VQJ7zgqY= +github.com/cockroachdb/errors v1.8.8/go.mod h1:z6VnEL3hZ/2ONZEvG7S5Ym0bU2AqPcEKnIiA1wbsSu0= +github.com/cockroachdb/errors v1.9.0 h1:B48dYem5SlAY7iU8AKsgedb4gH6mo+bDkbtLIvM/a88= +github.com/cockroachdb/errors v1.9.0/go.mod h1:vaNcEYYqbIqB5JhKBhFV9CneUqeuEbB2OYJBK4GBNYQ= github.com/cockroachdb/logtags v0.0.0-20190617123548-eb05cc24525f/go.mod h1:i/u985jwjWRlyHXQbwatDASoW0RMlZ/3i9yJHE2xLkI= -github.com/cockroachdb/redact v1.0.8 h1:8QG/764wK+vmEYoOlfobpe12EQcS81ukx/a4hdVMxNw= +github.com/cockroachdb/logtags v0.0.0-20211118104740-dabe8e521a4f h1:6jduT9Hfc0njg5jJ1DdKCFPdMBrp/mdZfCpa5h+WM74= +github.com/cockroachdb/logtags v0.0.0-20211118104740-dabe8e521a4f/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= github.com/cockroachdb/redact v1.0.8/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= -github.com/cockroachdb/sentry-go v0.6.1-cockroachdb.2 h1:IKgmqgMQlVJIZj19CdocBeSfSaiCbEBZGKODaixqtHM= +github.com/cockroachdb/redact v1.1.3 h1:AKZds10rFSIj7qADf0g46UixK8NNLwWTNdCIGS5wfSQ= +github.com/cockroachdb/redact v1.1.3/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= github.com/cockroachdb/sentry-go v0.6.1-cockroachdb.2/go.mod h1:8BT+cPK6xvFOcRlk0R8eg+OTkcqI6baNH4xAkpiYVvQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= github.com/codegangsta/inject v0.0.0-20150114235600-33e0aa1cb7c0/go.mod h1:4Zcjuz89kmFXt9morQgcfYZAYZ5n8WHjt81YYWIwtTM= @@ -207,17 +215,19 @@ github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1 github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= github.com/eknkc/amber v0.0.0-20171010120322-cdade1c07385/go.mod h1:0vRUJqYpeSZifjYj7uP3BG/gKcuzL9xWVV/Y+cK33KM= -github.com/emirpasic/gods v1.12.0 h1:QAUIPSaCu4G+POclxeqb3F+WPpdKqFGlw36+yOzGlrg= github.com/emirpasic/gods v1.12.0/go.mod h1:YfzfFFoVP/catgzJb4IKIqXjX78Ha8FMSDh3ymbK86o= +github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc= +github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ= github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4safvEdbitLhGGK48rN6g= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= +github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/etcd-io/bbolt v1.3.3/go.mod h1:ZF2nL25h33cCyBtcyWeZ2/I3HQOfTP+0PIEvHjkjCrw= -github.com/ethereum/go-ethereum v1.10.17 h1:XEcumY+qSr1cZQaWsQs5Kck3FHB0V2RiMHPdTBJ+oT8= +github.com/ethereum/go-ethereum v1.10.21 h1:5lqsEx92ZaZzRyOqBEXux4/UR06m296RGzN3ol3teJY= github.com/fasthttp-contrib/websocket v0.0.0-20160511215533-1f3b11f56072/go.mod h1:duJ4Jxv5lDcvg4QuQr0oowTf7dz4/CR8NtyCooz9HL8= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/structs v1.1.0 h1:Q7juDM0QtcnhCpeyLGQKyg4TOIghuNXrkL32pHAUMxo= @@ -230,17 +240,22 @@ github.com/francoispqt/gojay v1.2.13 h1:d2m3sFjloqoIUQU3TsHBgj6qg/BVGlTBeHDUmyJn github.com/francoispqt/gojay v1.2.13/go.mod h1:ehT5mTG4ua4581f1++1WLG0vPdaA9HaiDsoyrBGkyDY= github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20= +github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= -github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= +github.com/fsnotify/fsnotify v1.5.4 h1:jRbGcIw6P2Meqdwuo0H1p6JVLbL5DHKAKlYndzMwVZI= +github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= github.com/gavv/httpexpect v2.0.0+incompatible/go.mod h1:x+9tiU1YnrOvnB725RkpoLv1M62hOWzwo5OXotisrKc= +github.com/getsentry/sentry-go v0.12.0/go.mod h1:NSap0JBYWzHND8oMbyi0+XZhUalc1TBdRL1M71JZW2c= +github.com/getsentry/sentry-go v0.13.0 h1:20dgTiUSfxRB/EhMPtxcL9ZEbM1ZdR+W/7f7NWD+xWo= +github.com/getsentry/sentry-go v0.13.0/go.mod h1:EOsfu5ZdvKPfeHYV6pTVQnsjfp30+XA7//UooKNumH0= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gin-contrib/sse v0.0.0-20190301062529-5545eab6dad3/go.mod h1:VJ0WA2NBN22VlZ2dKZQPAPnyWw5XTlK1KymzLKsr59s= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= github.com/gin-gonic/gin v1.4.0/go.mod h1:OW2EZn3DO8Ln9oIKOvM++LBO+5UPHJJDH72/q/3rZdM= -github.com/gin-gonic/gin v1.7.0 h1:jGB9xAJQ12AIGNB4HguylppmDK1Am9ppF7XnGXXJuoU= -github.com/gin-gonic/gin v1.7.0/go.mod h1:jD2toBW3GZUr5UMcdrwQA10I7RuaFOl/SGeDjXkfUtY= +github.com/gin-gonic/gin v1.7.7 h1:3DoBmSbJbZAWqXJC3SLjAPfutPJJRN1U5pALB7EeTTs= +github.com/gin-gonic/gin v1.7.7/go.mod h1:axIBovoeJpVj8S3BwE0uPMTeReE4+AfFtqpqaZ1qq1U= github.com/gliderlabs/ssh v0.1.1/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= github.com/gliderlabs/ssh v0.2.2 h1:6zsha5zo/TWhRhwqCD3+EarCAgZ2yN28ipRnGPnwkI0= github.com/gliderlabs/ssh v0.2.2/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= @@ -310,6 +325,7 @@ github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/E github.com/gogo/googleapis v0.0.0-20180223154316-0cd9801be74a/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= github.com/gogo/googleapis v1.2.0/go.mod h1:Njal3psf3qN6dwBtQfUmBZh2ybovJ0tlu3o/AC7HYjU= +github.com/gogo/googleapis v1.4.1/go.mod h1:2lpHqI5OcWCtVElxXnPt+s8oJvMpySlOyM6xDCrzib4= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= @@ -320,6 +336,7 @@ github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69 github.com/gogo/status v1.1.0/go.mod h1:BFv9nrluPLmrS0EmGVvLaPNmRosr9KapBYd5/hpY1WM= github.com/gohornet/grocksdb v1.7.1-0.20220426081058-60f50d7c59e8 h1:JBcaA1xdFtalpZsMTYZuwUSOZxPAqqYAZa1gKYpK9nw= github.com/gohornet/grocksdb v1.7.1-0.20220426081058-60f50d7c59e8/go.mod h1:RlgTltBHJ3ha/p0pWAd1g2zjw/524L1Vw6pjBTYLdIA= +github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -355,7 +372,6 @@ github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiu github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.2/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/gomodule/redigo v1.7.1-0.20190724094224-574c33c3df38/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4= @@ -371,8 +387,8 @@ github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.7 h1:81/ik6ipDQS2aGcBfIN5dHDB36BwrStyeAQquSYCV4o= github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ= github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -459,12 +475,15 @@ github.com/huin/goupnp v1.0.2 h1:RfGLP+h3mvisuWEyybxNq5Eft3NWhHLPeUN72kpKZoI= github.com/huin/goupnp v1.0.2/go.mod h1:0dxJBVBHqTMjIUMkESDTNgOOx/Mw5wYIfyFmdzSamkM= github.com/huin/goutil v0.0.0-20170803182201-1ca381bf3150/go.mod h1:PpLOETDnJ0o3iZrZfqZzyLl6l7F3c6L1oWn7OICBi6o= github.com/hydrogen18/memlistener v0.0.0-20141126152155-54553eb933fb/go.mod h1:qEIFzExnS6016fRpRfxrExeVn2gbClQA99gQhnIcdhE= +github.com/hydrogen18/memlistener v0.0.0-20200120041712-dcc25e7acd91/go.mod h1:qEIFzExnS6016fRpRfxrExeVn2gbClQA99gQhnIcdhE= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/imkira/go-interpol v1.1.0/go.mod h1:z0h2/2T3XF8kyEPpRgJ3kmNv+C43p+I/CoI+jC3w2iA= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= -github.com/iotaledger/hive.go v0.0.0-20220714132400-7fd91bb37663 h1:9Iyp28UlCFLJ4inXjU7zx5WwpgvsJx8WoFiwP+SmoFQ= -github.com/iotaledger/hive.go v0.0.0-20220714132400-7fd91bb37663/go.mod h1:8f9U7qHFby0W3cxv/nKnz9LHn9BbwWU0tMsWDnfqzRI= +github.com/iotaledger/hive.go/core v0.0.0-20220804174551-efbca20a83e4 h1:LyZZsG5V5esS3iN6f42AVyUTxodo8s8KkkHYQi+CC8o= +github.com/iotaledger/hive.go/core v0.0.0-20220804174551-efbca20a83e4/go.mod h1:iiNz8/E6xPs6TWPiBKLB7QZEbaaSSNylnfWKThZNCEc= +github.com/iotaledger/hive.go/serializer/v2 v2.0.0-20220804174551-efbca20a83e4 h1:B2N7jbiIKEkLPPA5/kyDXqO6T+cPr5xhhDKS3Tjph9I= +github.com/iotaledger/hive.go/serializer/v2 v2.0.0-20220804174551-efbca20a83e4/go.mod h1:R6Q0aeFvUzt7+Mjd7fEXeCHOHasMLmXPxUGhCybTSw4= github.com/ipfs/go-cid v0.0.1/go.mod h1:GHWU/WuQdMPmIosc4Yn1bcCT7dSeX4lBafM7iqUPQvM= github.com/ipfs/go-cid v0.0.2/go.mod h1:GHWU/WuQdMPmIosc4Yn1bcCT7dSeX4lBafM7iqUPQvM= github.com/ipfs/go-cid v0.0.3/go.mod h1:GHWU/WuQdMPmIosc4Yn1bcCT7dSeX4lBafM7iqUPQvM= @@ -509,6 +528,8 @@ github.com/ipfs/go-log/v2 v2.3.0/go.mod h1:QqGoj30OTpnKaG/LKTGTxoP2mmQtjVMEnK72g github.com/iris-contrib/blackfriday v2.0.0+incompatible/go.mod h1:UzZ2bDEoaSGPbkg6SAB4att1aAwTmVIx/5gCVqeyUdI= github.com/iris-contrib/go.uuid v2.0.0+incompatible/go.mod h1:iz2lgM/1UnEf1kP0L/+fafWORmlnuysV2EMP8MW+qe0= github.com/iris-contrib/i18n v0.0.0-20171121225848-987a633949d0/go.mod h1:pMCz62A0xJL6I+umB2YTlFRwWXaDFA0jy+5HzGiJjqI= +github.com/iris-contrib/jade v1.1.3/go.mod h1:H/geBymxJhShH5kecoiOCSssPX7QWYH7UaeZTSWddIk= +github.com/iris-contrib/pongo2 v0.0.1/go.mod h1:Ssh+00+3GAZqSQb30AvBRNxBx7rf0GqwkjqxNd0u65g= github.com/iris-contrib/schema v0.0.1/go.mod h1:urYA3uvUNG1TIIjOSCzHr9/LmbQo8LrOcOqfqxa4hXw= github.com/jackpal/gateway v1.0.5/go.mod h1:lTpwd4ACLXmpyiCTRtfiNyVnUmqT9RivzCDQetPfnjA= github.com/jackpal/go-nat-pmp v1.0.1/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc= @@ -527,6 +548,8 @@ github.com/jbenet/goprocess v0.1.3/go.mod h1:5yspPrukOVuOLORacaBi858NqyClJPQxYZl github.com/jbenet/goprocess v0.1.4 h1:DRGOFReOMqqDNXwW70QkacFW0YN9QnwLV0Vqk+3oU0o= github.com/jbenet/goprocess v0.1.4/go.mod h1:5yspPrukOVuOLORacaBi858NqyClJPQxYZlqdZVfqY4= github.com/jellevandenhooff/dkim v0.0.0-20150330215556-f50fe3d243e1/go.mod h1:E0B/fFc00Y+Rasa88328GlI/XbtyysCtTHZS8h7IrBU= +github.com/jellydator/ttlcache/v2 v2.11.1 h1:AZGME43Eh2Vv3giG6GeqeLeFXxwxn1/qHItqWZl6U64= +github.com/jellydator/ttlcache/v2 v2.11.1/go.mod h1:RtE5Snf0/57e+2cLWFYWCCsLas2Hy3c5Z4n14XmSvTI= 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/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= @@ -544,8 +567,9 @@ github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/u github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.11 h1:uVUAXhF2To8cbw/3xN3pxj6kk7TYKs98NIrTqPlMWAQ= github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= +github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= @@ -559,9 +583,14 @@ github.com/kami-zh/go-capturer v0.0.0-20171211120116-e492ea43421d/go.mod h1:P2vi github.com/karrick/godirwalk v1.8.0/go.mod h1:H5KPZjojv4lE+QYImBI8xVtrBRgYrIVsaRPx4tDPEn4= github.com/karrick/godirwalk v1.10.3/go.mod h1:RoGL9dQei4vP9ilrpETWE8CLOZ1kiN0LhBygSwrAsHA= github.com/kataras/golog v0.0.9/go.mod h1:12HJgwBIZFNGL0EJnMRhmvGA0PQGx8VFwrZtM4CqbAk= +github.com/kataras/golog v0.0.10/go.mod h1:yJ8YKCmyL+nWjERB90Qwn+bdyBZsaQwU3bTVFgkFIp8= github.com/kataras/iris/v12 v12.0.1/go.mod h1:udK4vLQKkdDqMGJJVd/msuMtN6hpYJhg/lSzuxjhO+U= +github.com/kataras/iris/v12 v12.1.8/go.mod h1:LMYy4VlP67TQ3Zgriz8RE2h2kMZV2SgMYbq3UhfoFmE= github.com/kataras/neffos v0.0.10/go.mod h1:ZYmJC07hQPW67eKuzlfY7SO3bC0mw83A3j6im82hfqw= +github.com/kataras/neffos v0.0.14/go.mod h1:8lqADm8PnbeFfL7CLXh1WHw53dG27MC3pgi2R1rmoTE= github.com/kataras/pio v0.0.0-20190103105442-ea782b38602d/go.mod h1:NV88laa9UiiDuX9AhMbDPkGYSPugBOV6yTZB1l2K9Z0= +github.com/kataras/pio v0.0.2/go.mod h1:hAoW0t9UmXi4R5Oyq5Z4irTbaTsOemSrDGUtaTl7Dro= +github.com/kataras/sitemap v0.0.5/go.mod h1:KY2eugMKiPwsJgx7+U103YZehfvNGOXURubcGyk0Bz8= github.com/kevinburke/ssh_config v0.0.0-20190725054713-01f96b0aa0cd h1:Coekwdh0v2wtGp9Gmz1Ze3eVRAWJMLokvN3QjdzCHLY= github.com/kevinburke/ssh_config v0.0.0-20190725054713-01f96b0aa0cd/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= @@ -572,15 +601,16 @@ github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6 github.com/klauspost/compress v1.8.2/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= github.com/klauspost/compress v1.9.0/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= github.com/klauspost/compress v1.9.5/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= +github.com/klauspost/compress v1.9.7/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= github.com/klauspost/compress v1.11.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= -github.com/klauspost/compress v1.12.3 h1:G5AfA94pHPysR56qqrkO2pxEexdDzrpFJ6yt/VqWxVU= -github.com/klauspost/compress v1.12.3/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= +github.com/klauspost/compress v1.15.9 h1:wKRjX6JRtDdrE9qwa4b/Cip7ACOshUI4smpCQanqjSY= +github.com/klauspost/compress v1.15.9/go.mod h1:PhcZ0MbTNciWF3rruxRgKxI5NkcHHrHUDtV4Yw2GlzU= github.com/klauspost/cpuid v1.2.1/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= github.com/klauspost/cpuid/v2 v2.0.4/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= github.com/klauspost/cpuid/v2 v2.0.9 h1:lgaqFMSdTdQYdZ04uHyN2d/eKdOMyi2YLSvlQIBFYa4= github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= -github.com/knadh/koanf v1.4.0 h1:/k0Bh49SqLyLNfte9r6cvuZWrApOQhglOmhIU3L/zDw= -github.com/knadh/koanf v1.4.0/go.mod h1:1cfH5223ZeZUOs8FU2UdTmaNfHpqgtjV0+NHjRO43gs= +github.com/knadh/koanf v1.4.2 h1:2itp+cdC6miId4pO4Jw7c/3eiYD26Z/Sz3ATJMwHxIs= +github.com/knadh/koanf v1.4.2/go.mod h1:4NCo0q4pmU398vF9vq2jStF9MWQZ8JEDcDMHlDCr4h0= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= @@ -590,8 +620,9 @@ github.com/koron/go-ssdp v0.0.2/go.mod h1:XoLfkAiA2KeZsYh4DbHxD7h3nR2AZNqVQOa+LJ github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= +github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/pty v1.1.3/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/pty v1.1.8/go.mod h1:O1sed60cT9XZ5uDucP5qwvh+TE3NnUj51EiZO/lmSfw= @@ -601,6 +632,7 @@ github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/labstack/echo v3.3.10+incompatible h1:pGRcYk231ExFAyoAjAfD85kQzRJCRI8bbnE7CX5OEgg= github.com/labstack/echo v3.3.10+incompatible/go.mod h1:0INS7j/VjnFxD4E2wkz67b8cVwCLbBmJyDaka6Cmk1s= github.com/labstack/echo/v4 v4.1.11/go.mod h1:i541M3Fj6f76NZtHSj7TXnyM8n2gaodfvfxNnFqi74g= +github.com/labstack/echo/v4 v4.5.0/go.mod h1:czIriw4a0C1dFun+ObrXp7ok03xON0N1awStJ6ArI7Y= github.com/labstack/gommon v0.3.0 h1:JEeO0bvc78PKdyHxloTKiF8BD5iGrH8T6MSeGvSgob0= github.com/labstack/gommon v0.3.0/go.mod h1:MULnywXg0yavhxWKc+lOruYdAhDwPK9wf0OL7NoOu+k= github.com/leodido/go-urn v1.2.0 h1:hpXL4XnriNwQ/ABnpepYM/1vCLWNDfUNts8dX3xTG6Y= @@ -805,7 +837,7 @@ github.com/lucas-clemente/quic-go v0.21.2/go.mod h1:vF5M1XqhBAHgbjKcJOXY3JZz3GP0 github.com/lunixbochs/vtclean v1.0.0/go.mod h1:pHhQNgMf3btfWnGBVipUOjRYhoOsdGqdm/+2c2E2WMI= github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= -github.com/magiconair/properties v1.8.1 h1:ZC2Vc7/ZFkGmsVC9KvOjumD+G5lXy2RtTKyzRKO2BQ4= +github.com/magiconair/properties v1.8.6 h1:5ibWZ6iY0NctNGWo87LalDlEZ6R41TqbbDamhfG/Qzo= github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190312143242-1de009706dbe/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/markbates/oncer v0.0.0-20181203154359-bf2de49a0be2/go.mod h1:Ld9puTsIW75CHf65OeIOkyKbteujpZVXDpWK6YGZbxE= @@ -825,8 +857,10 @@ github.com/marten-seemann/tcp v0.0.0-20210406111302-dfbc87cc63fd/go.mod h1:QuCEs github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ= github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= -github.com/mattn/go-colorable v0.1.8 h1:c1ghPdyEDarC70ftn0y+A/Ee++9zz8ljHG1b13eJ0s8= github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-colorable v0.1.11/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= +github.com/mattn/go-colorable v0.1.12 h1:jF+Du6AlPIjs2BiUiQlKOX0rt3SujHxPnksPKZbaA40= +github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= @@ -834,14 +868,16 @@ github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hd github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= -github.com/mattn/go-isatty v0.0.13 h1:qdl+GuBjcsKKDco5BsxPJlId98mSWNKqYA+Co0SC1yA= github.com/mattn/go-isatty v0.0.13/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= +github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y= +github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/goveralls v0.0.2/go.mod h1:8d1ZMHsd7fW6IRPKQh46F2WRpyib5/X4FOpevwGNQEw= github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/mediocregopher/mediocre-go-lib v0.0.0-20181029021733-cb65787f37ed/go.mod h1:dSsfyI2zABAdhcbvkXqgxOxrCsbYeHCPgrZkku60dSg= github.com/mediocregopher/radix/v3 v3.3.0/go.mod h1:EmfVyvspXz1uZEyPBMyGK+kjWiKQGvsUt6O3Pj+LDCQ= +github.com/mediocregopher/radix/v3 v3.4.2/go.mod h1:8FL3F6UQRXHXIBSPUs5h0RybMF8i4n7wVopoX3x7Bv8= github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE= github.com/microcosm-cc/bluemonday v1.0.1/go.mod h1:hsXNsILzKxV+sX77C5b8FSuKF00vh2OMYv+xgHpAMF4= github.com/microcosm-cc/bluemonday v1.0.2/go.mod h1:iVP4YcDBq+n/5fb23BhYFvIMq/leAFZyRl6bYmGDlGc= @@ -880,8 +916,9 @@ github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS4 github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/mitchellh/mapstructure v1.4.1 h1:CpVNEelQCZBooIPDn+AR3NpivK/TIKU8bDxdASFVQag= github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= +github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= @@ -889,8 +926,9 @@ github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= +github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc= github.com/moul/http2curl v1.0.0/go.mod h1:8UbvGypXm98wA/IqH45anm5Y2Z6ep6O31QGOAZ3H0fQ= github.com/mr-tron/base58 v1.1.0/go.mod h1:xcD2VGqlgYjBdcBLw+TuYLr8afG+Hj8g2eTVqeSzSU8= @@ -979,6 +1017,7 @@ github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:v 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= github.com/onsi/ginkgo v1.8.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.0/go.mod h1:oUhWkIvk5aDxtKvDDuw8gItl8pKl42LzjC9KZE0HfGg= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.13.0/go.mod h1:+REjRxOmWfHCjfv9TTWB1jD1Frx4XydAD3zm1lskyM0= @@ -1009,8 +1048,8 @@ github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJ github.com/openzipkin/zipkin-go v0.2.1/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIwwtUjcrb0b5/5kLM= -github.com/panjf2000/ants/v2 v2.4.8 h1:JgTbolX6K6RreZ4+bfctI0Ifs+3mrE5BIHudQxUDQ9k= -github.com/panjf2000/ants/v2 v2.4.8/go.mod h1:f6F0NZVFsGCp5A7QW/Zj/m92atWwOkY0OIhFxRNFr4A= +github.com/panjf2000/ants/v2 v2.5.0 h1:1rWGWSnxCsQBga+nQbA4/iY6VMeNoOIAM0ZWh9u3q2Q= +github.com/panjf2000/ants/v2 v2.5.0/go.mod h1:cU93usDlihJZ5CfRGNDYsiBYvoilLvBF5Qp/BT2GNRE= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/paulbellamy/ratecounter v0.2.0 h1:2L/RhJq+HA8gBQImDXtLPrDXK5qAj6ozWVK/zFXVJGs= @@ -1018,15 +1057,19 @@ github.com/paulbellamy/ratecounter v0.2.0/go.mod h1:Hfx1hDpSGoqxkVVpBi/IlYD7kChl github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-buffruneio v0.2.0/go.mod h1:JkE26KsDizTr40EUHkXVtNPvgGtbSNq5BcowyYOWdKo= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/pelletier/go-toml v1.7.0 h1:7utD74fnzVc/cpcyy8sjrlFr5vYpypUixARcHIMIGuI= github.com/pelletier/go-toml v1.7.0/go.mod h1:vwGMzjaWMwyfHwgIBhI2YUM4fB6nL6lVAvS1LBMMhTE= +github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8= +github.com/pelletier/go-toml/v2 v2.0.2 h1:+jQXlF3scKIcSEKkdHzXhCTDLPFi5r1wnK6yPS+49Gw= +github.com/pelletier/go-toml/v2 v2.0.2/go.mod h1:MovirKjgVRESsAvNZlAjtFwV867yGuwRkXbG66OzopI= github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= -github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5 h1:q2e307iGHPdTGp0hoxKjt1H5pDo6utceo3dQVK3I5XQ= github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o= +github.com/petermattis/goid v0.0.0-20220712135657-ac599d9cba15 h1:4lW1DeHHRUzImL9Uz2Fa4j7IIJr+7FNfzjSJxGSZz/k= +github.com/petermattis/goid v0.0.0-20220712135657-ac599d9cba15/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4= github.com/pingcap/errors v0.11.4/go.mod h1:Oi8TUi2kEtXXLMJk9l1cGmz20kV3TaQ0usTwv5KuLY8= +github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= @@ -1043,8 +1086,9 @@ github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeD github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= github.com/prometheus/client_golang v1.9.0/go.mod h1:FqZLKOZnGdFAhOK4nqGHa7D66IdsO+O441Eve7ptJDU= github.com/prometheus/client_golang v1.10.0/go.mod h1:WJM3cc3yu7XKBKa/I8WeZm+V3eltZnBwfENSU7mdogU= -github.com/prometheus/client_golang v1.11.0 h1:HNkLOAEQMIDv/K+04rukrLx6ch7msSRwf3/SASFAGtQ= github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= +github.com/prometheus/client_golang v1.11.1 h1:+4eQaD7vAZ6DsfsxB15hbE0odUjGI5ARs9yskGu1v4s= +github.com/prometheus/client_golang v1.11.1/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= @@ -1079,6 +1123,9 @@ github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6L github.com/rogpeppe/go-internal v1.1.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.2.2/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= +github.com/rogpeppe/go-internal v1.8.1 h1:geMPLpDpQOgVyCg5z5GoRwLHepNdb71NXb67XFkP+Eg= +github.com/rogpeppe/go-internal v1.8.1/go.mod h1:JeRgkft04UBgHMgCIwADu4Pn6Mtm5d4nPKWu0nJ5d+o= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= @@ -1087,6 +1134,7 @@ github.com/ryanuber/go-glob v1.0.0/go.mod h1:807d1WSdnB0XRJzKNil9Om6lcp/3a0v4qIH github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= github.com/sasha-s/go-deadlock v0.3.1 h1:sqv7fDNShgjcaxkO0JNcOAlr8B9+cV5Ey/OB71efZx0= github.com/sasha-s/go-deadlock v0.3.1/go.mod h1:F73l+cr82YSh10GxyRI6qZiCgK64VaZjwesgfQ1/iLM= +github.com/schollz/closestmatch v2.1.0+incompatible/go.mod h1:RtP1ddjLong6gTkbtmuhtR2uUrrJOpYzYRvbcPAid+g= github.com/sclevine/agouti v3.0.0+incompatible/go.mod h1:b4WX9W9L1sfQKXeJf1mUTLZKJ48R1S7H23Ji7oFO5Bw= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= @@ -1136,8 +1184,8 @@ github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasO github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cast v1.4.1 h1:s0hze+J0196ZfEMTs80N7UlFt0BDuQ7Q+JDnHiMWKdA= -github.com/spf13/cast v1.4.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= +github.com/spf13/cast v1.5.0 h1:rj3WzYc11XZaIZMPKmwP96zkFEnnAmV8s6XbB2aY32w= +github.com/spf13/cast v1.5.0/go.mod h1:SpXXQ5YoyJw6s3/6cMTQuxvgRl3PCJiyaX9p6b155UU= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= @@ -1155,16 +1203,18 @@ github.com/streadway/handy v0.0.0-20190108123426-d5acb3125c2a/go.mod h1:qNTQ5P5J github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= -github.com/stretchr/objx v0.3.0 h1:NGXK3lHquSN08v5vWalVI/L8XU9hdzE/G6xsrze47As= -github.com/stretchr/objx v0.3.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= +github.com/stretchr/objx v0.4.0 h1:M2gUjqZET1qApGOWNSnZ49BAIMX4F/1plDv3+l31EJ4= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.1 h1:5TQK59W5E3v0r2duFAb7P95B6hEeOyEnHRa8MjYSMTY= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= +github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/syndtr/goleveldb v1.0.0/go.mod h1:ZVVdQEZoIme9iO1Ch2Jdy24qqXrMMOU6lpPAyBWyWuQ= github.com/tarm/serial v0.0.0-20180830185346-98f6abe2eb07/go.mod h1:kDXzergiv9cbyO7IOYJZWg1U88JhDg3PB6klq9Hg2pA= github.com/tidwall/pretty v1.0.0 h1:HsD+QiTn7sK6flMKIvNmpqz1qrpP3Ps6jOKIKMooyg4= @@ -1261,8 +1311,8 @@ go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/atomic v1.9.0 h1:ECmE8Bn/WFTYwEW/bpKD3M8VtR/zQVbavAoalC1PYyE= go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= -go.uber.org/dig v1.14.1 h1:fyakRgZDdi2F8FgwJJoRGangMSPTIxPSLGzR3Oh0/54= -go.uber.org/dig v1.14.1/go.mod h1:52EKx/Vjdpz9EzeNcweC4YMsTrDdFn9mS/+Uw5ZnVTI= +go.uber.org/dig v1.15.0 h1:vq3YWr8zRj1eFGC7Gvf907hE0eRjPTZ1d3xHadD6liE= +go.uber.org/dig v1.15.0/go.mod h1:pKHs0wMynzL6brANhB2hLMro+zalv1osARTviTcqHLM= go.uber.org/goleak v1.0.0/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= go.uber.org/goleak v1.1.11 h1:wy28qYRKZgnJTxGxvye5/wgWr1EKjmUDGYox5mGlRlI= @@ -1271,8 +1321,9 @@ go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/ go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= -go.uber.org/multierr v1.7.0 h1:zaiO/rmgFjbmCXdSYJWQcdvOCsthmdaHfr3Gm2Kx4Ec= go.uber.org/multierr v1.7.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95ak= +go.uber.org/multierr v1.8.0 h1:dg6GjLku4EH+249NNmoIciG9N/jURbDG+pFlTkhzIC8= +go.uber.org/multierr v1.8.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95ak= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= @@ -1305,6 +1356,7 @@ golang.org/x/crypto v0.0.0-20190618222545-ea8f1a30c443/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191119213627-4f8c1d86b1ba/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20191227163750-53104e6ec876/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200109152110-61a87790db17/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200115085410-6d4e4cb37c7d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200221231518-2aa609cf4a9d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= @@ -1316,8 +1368,9 @@ golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83/go.mod h1:jdWPYTVW3xRLrWP golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210506145944-38f3c27a63bf/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8= golang.org/x/crypto v0.0.0-20210813211128-0a44fdfbc16e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20220214200702-86341886e292 h1:f+lwQ+GtmgoY+A2YaQxlSOnDjXcQ7ZRLWOHbC6HtRqE= -golang.org/x/crypto v0.0.0-20220214200702-86341886e292/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa h1:zuSxTR4o9y82ebqCUJYNGJbGPo6sKVl54f/TVDObg1c= +golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -1342,6 +1395,7 @@ golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRu golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= @@ -1406,8 +1460,9 @@ golang.org/x/net v0.0.0-20210423184538-5f58ad60dda6/go.mod h1:OJAsFXCWl8Ukc7SiCT golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2 h1:CIJ76btIcR3eFI5EgSo6k1qKw9KJexJuRLI9G7Hp5wE= -golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20211008194852-3b03d305991f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20220802222814-0bcc04d9c69b h1:3ogNYyK4oIQdIKzTu68hQrr4iuVxF3AxKl9Aj/eDrw0= +golang.org/x/net v0.0.0-20220802222814-0bcc04d9c69b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181017192945-9dcd33a902f4/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181203162652-d668ce993890/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -1428,8 +1483,9 @@ golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4 h1:uVc8UZUe6tr40fFVnUP5Oj+veunVezqYl9z7DYw9xzw= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1504,18 +1560,24 @@ golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210316164454-77fc1eacc6aa/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210317225723-c4fcb01b228e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210426080607-c94f62235c83/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210511113859-b0526f3d8744/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210816183151-1e6c022a8912/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210909193231-528a39cd75f3 h1:3Ad41xy2WCESpufXwgs7NpDSu+vjxqLt2UFqUV+20bI= -golang.org/x/sys v0.0.0-20210909193231-528a39cd75f3/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220803195053-6e608f9ce704 h1:Y7NOhdqIOU8kYI7BxsgL38d0ot0raxvcW+EMQU2QrT4= +golang.org/x/sys v0.0.0-20220803195053-6e608f9ce704/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.0.0-20210503060354-a79de5458b56 h1:b8jxX3zqjpqb2LklXPzKSGJhzyxCOZSz8ncv8Nv+y7w= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 h1:JGgROgKl9N8DuW20oFS5gxc+lE67/N3FcwmBPMe7ArY= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1530,6 +1592,7 @@ golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxb golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20201208040808-7e3f01d25324/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -1593,13 +1656,15 @@ golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210112230658-8b4aab62c064/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5 h1:ouewzE6p+/VEB31YYnTbEJdi8pFqKp4P4n85vwo3DHA= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f h1:uF6paiQQebLeSXkrTqHqz0MXhXXS1KgF41eUdBNvxK0= +golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= google.golang.org/api v0.0.0-20180910000450-7ca32eb868bf/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= google.golang.org/api v0.0.0-20181030000543-1d582fd0359e/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= google.golang.org/api v0.1.0/go.mod h1:UGEZY7KEX120AnNLIHFMKIo4obdJhkp2tPbaPlQx13Y= @@ -1665,6 +1730,7 @@ google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7Fc google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= google.golang.org/grpc v1.12.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.16.0/go.mod h1:0JHn/cJsOMiMfNA9+DeHDlAU7KAAB5GDlYFpa9MZMio= @@ -1690,8 +1756,9 @@ google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.40.0 h1:AGJ0Ih4mHjSeibYkFGh1dD9KJ/eOtZ93I6hoHhukQ5Q= +google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= +google.golang.org/grpc v1.46.2 h1:u+MLGgVf7vRdjEYZ8wDFhAVNmhkbJ5hmrA1LMWK1CAQ= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -1704,8 +1771,9 @@ google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGj google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w= +google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d/go.mod h1:cuepJuh7vyXfUyUwEgHQXw849cJrilpS5NeIjOWESAw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -1720,6 +1788,7 @@ gopkg.in/gcfg.v1 v1.2.3/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE= gopkg.in/go-playground/validator.v8 v8.18.2/go.mod h1:RX2a/7Ha8BgOhfk7j780h4/u/RRjR0eouCJSH80/M2Y= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= +gopkg.in/ini.v1 v1.51.1/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/mgo.v2 v2.0.0-20180705113604-9856a29383ce/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/square/go-jose.v2 v2.3.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= @@ -1746,9 +1815,12 @@ gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= +gopkg.in/yaml.v3 v3.0.0-20191120175047-4206685974f2/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= grpc.go4.org v0.0.0-20170609214715-11d0a25b4919/go.mod h1:77eQGdRu53HpSqPFJFmuJdjuHRquDANNeA4x7B8WQ9o= honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/tools/integration-tests/tester/tests/consensus/consensus_conflict_spam_test.go b/tools/integration-tests/tester/tests/consensus/consensus_conflict_spam_test.go index c0ad6c0231..3636a3b325 100644 --- a/tools/integration-tests/tester/tests/consensus/consensus_conflict_spam_test.go +++ b/tools/integration-tests/tester/tests/consensus/consensus_conflict_spam_test.go @@ -6,13 +6,13 @@ import ( "testing" "time" - "github.com/iotaledger/hive.go/crypto/ed25519" - "github.com/iotaledger/hive.go/generics/lo" - "github.com/iotaledger/hive.go/types/confirmation" + "github.com/iotaledger/hive.go/core/crypto/ed25519" + "github.com/iotaledger/hive.go/core/generics/lo" + "github.com/iotaledger/hive.go/core/types/confirmation" "github.com/stretchr/testify/require" - "github.com/iotaledger/goshimmer/packages/jsonmodels" - "github.com/iotaledger/goshimmer/packages/ledger/vm/devnetvm" + "github.com/iotaledger/goshimmer/packages/app/jsonmodels" + "github.com/iotaledger/goshimmer/packages/core/ledger/vm/devnetvm" "github.com/iotaledger/goshimmer/tools/integration-tests/tester/framework" "github.com/iotaledger/goshimmer/tools/integration-tests/tester/tests" ) diff --git a/tools/integration-tests/tester/tests/consensus/consensus_test.go b/tools/integration-tests/tester/tests/consensus/consensus_test.go index 10d0a582ee..127d8c05c4 100644 --- a/tools/integration-tests/tester/tests/consensus/consensus_test.go +++ b/tools/integration-tests/tester/tests/consensus/consensus_test.go @@ -5,8 +5,8 @@ import ( "testing" "time" - "github.com/iotaledger/hive.go/bitmask" - "github.com/iotaledger/hive.go/types/confirmation" + "github.com/iotaledger/hive.go/core/bitmask" + "github.com/iotaledger/hive.go/core/types/confirmation" "github.com/mr-tron/base58" "github.com/stretchr/testify/require" @@ -14,7 +14,7 @@ import ( "github.com/iotaledger/goshimmer/client/wallet/packages/address" walletseed "github.com/iotaledger/goshimmer/client/wallet/packages/seed" "github.com/iotaledger/goshimmer/client/wallet/packages/sendoptions" - "github.com/iotaledger/goshimmer/packages/ledger/vm/devnetvm" + "github.com/iotaledger/goshimmer/packages/core/ledger/vm/devnetvm" "github.com/iotaledger/goshimmer/tools/integration-tests/tester/framework" "github.com/iotaledger/goshimmer/tools/integration-tests/tester/framework/config" "github.com/iotaledger/goshimmer/tools/integration-tests/tester/tests" diff --git a/tools/integration-tests/tester/tests/faucet/faucet_prepare_test.go b/tools/integration-tests/tester/tests/faucet/faucet_prepare_test.go index 74c046a42a..d909def5fa 100644 --- a/tools/integration-tests/tester/tests/faucet/faucet_prepare_test.go +++ b/tools/integration-tests/tester/tests/faucet/faucet_prepare_test.go @@ -6,7 +6,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/iotaledger/goshimmer/packages/ledger/vm/devnetvm" + "github.com/iotaledger/goshimmer/packages/core/ledger/vm/devnetvm" "github.com/iotaledger/goshimmer/tools/integration-tests/tester/framework" "github.com/iotaledger/goshimmer/tools/integration-tests/tester/tests" ) diff --git a/tools/integration-tests/tester/tests/faucet/faucet_request_test.go b/tools/integration-tests/tester/tests/faucet/faucet_request_test.go index 6a79ad6df4..db5def1db6 100644 --- a/tools/integration-tests/tester/tests/faucet/faucet_request_test.go +++ b/tools/integration-tests/tester/tests/faucet/faucet_request_test.go @@ -6,7 +6,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/iotaledger/goshimmer/packages/ledger/vm/devnetvm" + "github.com/iotaledger/goshimmer/packages/core/ledger/vm/devnetvm" "github.com/iotaledger/goshimmer/tools/integration-tests/tester/framework" "github.com/iotaledger/goshimmer/tools/integration-tests/tester/tests" ) diff --git a/tools/integration-tests/tester/tests/mana/mana_test.go b/tools/integration-tests/tester/tests/mana/mana_test.go index 4e8cbee19f..806b521167 100644 --- a/tools/integration-tests/tester/tests/mana/mana_test.go +++ b/tools/integration-tests/tester/tests/mana/mana_test.go @@ -6,25 +6,25 @@ import ( "math" "testing" - "github.com/iotaledger/hive.go/identity" + "github.com/iotaledger/hive.go/core/identity" "github.com/mr-tron/base58" "github.com/stretchr/testify/require" - "github.com/iotaledger/goshimmer/packages/tangle" + "github.com/iotaledger/goshimmer/packages/core/tangleold" "github.com/iotaledger/goshimmer/tools/integration-tests/tester/framework" "github.com/iotaledger/goshimmer/tools/integration-tests/tester/tests" ) var ( // minAccessMana is minimal amout of mana required to access the network - minAccessMana = tangle.MinMana + minAccessMana = tangleold.MinMana startAccessMana = 2_500_000_000_000_000. faucetPledgeAmount = 1_000_000. minConsensusMana = 0.0 ) // -//func TestManaPersistence(t *testing.T) { +// func TestManaPersistence(t *testing.T) { // ctx, cancel := tests.Context(context.Background(), t) // defer cancel() // snapshotInfo := tests.EqualSnapshotDetails @@ -58,9 +58,9 @@ var ( // // require.Greater(t, tests.Mana(t, peer).Access, minAccessMana) // require.Greater(t, tests.Mana(t, peer).Consensus, minConsensusMana) -//} +// } // -//func TestManaPledgeFilter(t *testing.T) { +// func TestManaPledgeFilter(t *testing.T) { // const ( // numPeers = 3 // tokensPerRequest = 100 @@ -135,7 +135,7 @@ var ( // }) // require.ErrorIs(t, err, client.ErrBadRequest) // require.Contains(t, err.Error(), webapiledgerstate.ErrNotAllowedToPledgeManaToNode.Error()) -//} +// } func TestManaApis(t *testing.T) { ctx, cancel := tests.Context(context.Background(), t) diff --git a/tools/integration-tests/tester/tests/testutil.go b/tools/integration-tests/tester/tests/testutil.go index 4869cdb8e6..1d468be69f 100644 --- a/tools/integration-tests/tester/tests/testutil.go +++ b/tools/integration-tests/tester/tests/testutil.go @@ -8,19 +8,19 @@ import ( "time" "github.com/cockroachdb/errors" - "github.com/iotaledger/hive.go/crypto/ed25519" - "github.com/iotaledger/hive.go/generics/lo" - "github.com/iotaledger/hive.go/identity" - "github.com/iotaledger/hive.go/types" - "github.com/iotaledger/hive.go/types/confirmation" + "github.com/iotaledger/hive.go/core/crypto/ed25519" + "github.com/iotaledger/hive.go/core/generics/lo" + "github.com/iotaledger/hive.go/core/identity" + "github.com/iotaledger/hive.go/core/types" + "github.com/iotaledger/hive.go/core/types/confirmation" "github.com/mr-tron/base58" "github.com/stretchr/testify/require" "golang.org/x/crypto/blake2b" "github.com/iotaledger/goshimmer/client" - "github.com/iotaledger/goshimmer/packages/jsonmodels" - "github.com/iotaledger/goshimmer/packages/ledger/vm/devnetvm" - "github.com/iotaledger/goshimmer/packages/tangle/payload" + "github.com/iotaledger/goshimmer/packages/app/jsonmodels" + "github.com/iotaledger/goshimmer/packages/core/ledger/vm/devnetvm" + "github.com/iotaledger/goshimmer/packages/core/tangleold/payload" "github.com/iotaledger/goshimmer/tools/integration-tests/tester/framework" "github.com/iotaledger/goshimmer/tools/integration-tests/tester/framework/config" ) diff --git a/tools/integration-tests/tester/tests/value/value_test.go b/tools/integration-tests/tester/tests/value/value_test.go index 22ccc384ad..31455b8cab 100644 --- a/tools/integration-tests/tester/tests/value/value_test.go +++ b/tools/integration-tests/tester/tests/value/value_test.go @@ -5,18 +5,18 @@ import ( "log" "testing" - "github.com/iotaledger/hive.go/bitmask" - "github.com/iotaledger/hive.go/crypto/ed25519" - "github.com/iotaledger/hive.go/generics/lo" - "github.com/iotaledger/hive.go/types/confirmation" + "github.com/iotaledger/hive.go/core/bitmask" + "github.com/iotaledger/hive.go/core/crypto/ed25519" + "github.com/iotaledger/hive.go/core/generics/lo" + "github.com/iotaledger/hive.go/core/types/confirmation" "github.com/stretchr/testify/require" "github.com/iotaledger/goshimmer/client/wallet" "github.com/iotaledger/goshimmer/client/wallet/packages/createnftoptions" "github.com/iotaledger/goshimmer/client/wallet/packages/destroynftoptions" walletseed "github.com/iotaledger/goshimmer/client/wallet/packages/seed" - "github.com/iotaledger/goshimmer/packages/ledger/utxo" - "github.com/iotaledger/goshimmer/packages/ledger/vm/devnetvm" + "github.com/iotaledger/goshimmer/packages/core/ledger/utxo" + "github.com/iotaledger/goshimmer/packages/core/ledger/vm/devnetvm" "github.com/iotaledger/goshimmer/tools/integration-tests/tester/framework" "github.com/iotaledger/goshimmer/tools/integration-tests/tester/tests" ) diff --git a/tools/rand-seed/main.go b/tools/rand-seed/main.go index 919d2a0e6c..a24a0d84fe 100644 --- a/tools/rand-seed/main.go +++ b/tools/rand-seed/main.go @@ -6,8 +6,8 @@ import ( "fmt" "os" - "github.com/iotaledger/hive.go/crypto/ed25519" - "github.com/iotaledger/hive.go/identity" + "github.com/iotaledger/hive.go/core/crypto/ed25519" + "github.com/iotaledger/hive.go/core/identity" "github.com/mr-tron/base58" ) diff --git a/tools/relay-checker/parameters.go b/tools/relay-checker/parameters.go index 2b697d20f1..127cf52489 100644 --- a/tools/relay-checker/parameters.go +++ b/tools/relay-checker/parameters.go @@ -3,7 +3,7 @@ package main import ( "time" - "github.com/iotaledger/hive.go/configuration" + "github.com/iotaledger/goshimmer/plugins/config" ) // ParametersDefinition contains the definition of configuration parameters used by the relaychecker. @@ -24,5 +24,5 @@ type ParametersDefinition struct { var Parameters = &ParametersDefinition{} func init() { - configuration.BindParameters(Parameters, "relayChecker") + config.BindParameters(Parameters, "relayChecker") }