diff --git a/go.mod b/go.mod index edf60a5f9..e368eaf8f 100644 --- a/go.mod +++ b/go.mod @@ -26,7 +26,7 @@ require ( github.com/iotaledger/inx-app v1.0.0-rc.3.0.20240123171338-c9f82bbb8ad6 github.com/iotaledger/inx/go v1.0.0-rc.2.0.20240123170953-fc68d7c1303b github.com/iotaledger/iota-crypto-demo v0.0.0-20231208171603-786bb32fdb00 - github.com/iotaledger/iota.go/v4 v4.0.0-20240123170900-42c1479d3f30 + github.com/iotaledger/iota.go/v4 v4.0.0-20240125083751-2a637ee97ebb github.com/labstack/echo/v4 v4.11.4 github.com/labstack/gommon v0.4.2 github.com/libp2p/go-libp2p v0.32.2 diff --git a/go.sum b/go.sum index ae7b44b6c..960ef3f09 100644 --- a/go.sum +++ b/go.sum @@ -309,8 +309,8 @@ github.com/iotaledger/inx/go v1.0.0-rc.2.0.20240123170953-fc68d7c1303b h1:KzsDGz github.com/iotaledger/inx/go v1.0.0-rc.2.0.20240123170953-fc68d7c1303b/go.mod h1:M4DqLsDD23/MkvmBEXJrEikqNIB/lL9vbGuIBRfjTY4= github.com/iotaledger/iota-crypto-demo v0.0.0-20231208171603-786bb32fdb00 h1:j5udgLtSN6wQgFI9vnhkdJsqsVdJmwtoc0yOmT/Ila4= github.com/iotaledger/iota-crypto-demo v0.0.0-20231208171603-786bb32fdb00/go.mod h1:gt+URx7DZu414nZME7jtGgxR4DVTSnNa1jF2trTUTZ0= -github.com/iotaledger/iota.go/v4 v4.0.0-20240123170900-42c1479d3f30 h1:W+a1Ne7Be+woCuzoueO5NAcDR+v/E5jdEKriv9XyFpQ= -github.com/iotaledger/iota.go/v4 v4.0.0-20240123170900-42c1479d3f30/go.mod h1:ZsbAtAhfjPO88C4k6gOJQUHHlulAMhNCW1MVzMqEfA4= +github.com/iotaledger/iota.go/v4 v4.0.0-20240125083751-2a637ee97ebb h1:toyYlq90YaKr13ScdJFdBN/yzfG02DGchL+Fp+X00Nk= +github.com/iotaledger/iota.go/v4 v4.0.0-20240125083751-2a637ee97ebb/go.mod h1:ZsbAtAhfjPO88C4k6gOJQUHHlulAMhNCW1MVzMqEfA4= github.com/ipfs/boxo v0.13.1 h1:nQ5oQzcMZR3oL41REJDcTbrvDvuZh3J9ckc9+ILeRQI= github.com/ipfs/boxo v0.13.1/go.mod h1:btrtHy0lmO1ODMECbbEY1pxNtrLilvKSYLoGQt1yYCk= github.com/ipfs/go-cid v0.4.1 h1:A/T3qGvxi4kpKWWcPC/PgbvDA2bjVLO7n4UeVwnbs/s= diff --git a/pkg/protocol/commitment_verifier.go b/pkg/protocol/commitment_verifier.go index 4a830215b..d7a6ce5fa 100644 --- a/pkg/protocol/commitment_verifier.go +++ b/pkg/protocol/commitment_verifier.go @@ -160,7 +160,7 @@ func (c *CommitmentVerifier) verifyAttestations(attestations []*iotago.Attestati switch signature := att.Signature.(type) { case *iotago.Ed25519Signature: // We found the accountData, but we don't know the public key used to sign this block/attestation. Ignore. - if !accountData.BlockIssuerKeys.Has(iotago.Ed25519PublicKeyBlockIssuerKeyFromPublicKey(signature.PublicKey)) { + if !accountData.BlockIssuerKeys.Has(iotago.Ed25519PublicKeyHashBlockIssuerKeyFromPublicKey(signature.PublicKey)) { continue } diff --git a/pkg/protocol/engine/filter/postsolidfilter/postsolidblockfilter/post_solid_block_filter.go b/pkg/protocol/engine/filter/postsolidfilter/postsolidblockfilter/post_solid_block_filter.go index 6436cd5ea..37463cb81 100644 --- a/pkg/protocol/engine/filter/postsolidfilter/postsolidblockfilter/post_solid_block_filter.go +++ b/pkg/protocol/engine/filter/postsolidfilter/postsolidblockfilter/post_solid_block_filter.go @@ -158,24 +158,17 @@ func (c *PostSolidBlockFilter) ProcessSolidBlock(block *blocks.Block) { { switch signature := block.ProtocolBlock().Signature.(type) { case *iotago.Ed25519Signature: - if !accountData.BlockIssuerKeys.Has(iotago.Ed25519PublicKeyBlockIssuerKeyFromPublicKey(signature.PublicKey)) { - // If the block issuer does not have the public key in the slot commitment, check if it is an implicit account with the corresponding address. - // There must be at least one block issuer key on any account, so extracting index 0 is fine. - // For implicit accounts there is exactly one key, so we do not have to check any other indices. - blockIssuerKey := accountData.BlockIssuerKeys[0] - // Implicit Accounts can only have Block Issuer Keys of type Ed25519PublicKeyHashBlockIssuerKey. - bikPubKeyHash, isBikPubKeyHash := blockIssuerKey.(*iotago.Ed25519PublicKeyHashBlockIssuerKey) - - // PreSolidFilter the block if it's not a Block Issuer Key from an Implicit Account or if the Pub Key Hashes do not match. - if !isBikPubKeyHash || bikPubKeyHash.PublicKeyHash != iotago.Ed25519PublicKeyHashBlockIssuerKeyFromPublicKey(signature.PublicKey[:]).PublicKeyHash { - c.events.BlockFiltered.Trigger(&postsolidfilter.BlockFilteredEvent{ - Block: block, - Reason: ierrors.Wrapf(iotago.ErrInvalidSignature, "block issuer account %s does not have block issuer key corresponding to public key %s in slot %d", block.ProtocolBlock().Header.IssuerID, signature.PublicKey, block.ProtocolBlock().Header.SlotCommitmentID.Index()), - }) - - return - } + expectedBlockIssuerKey := iotago.Ed25519PublicKeyHashBlockIssuerKeyFromPublicKey(signature.PublicKey) + + if !accountData.BlockIssuerKeys.Has(expectedBlockIssuerKey) { + c.events.BlockFiltered.Trigger(&postsolidfilter.BlockFilteredEvent{ + Block: block, + Reason: ierrors.Wrapf(iotago.ErrInvalidSignature, "block issuer account %s does not have block issuer key corresponding to public key %s in slot %d", block.ProtocolBlock().Header.IssuerID, signature.PublicKey, block.ProtocolBlock().Header.SlotCommitmentID.Index()), + }) + + return } + signingMessage, err := block.ProtocolBlock().SigningMessage() if err != nil { c.events.BlockFiltered.Trigger(&postsolidfilter.BlockFilteredEvent{ diff --git a/pkg/protocol/engine/filter/postsolidfilter/postsolidblockfilter/post_solid_block_filter_test.go b/pkg/protocol/engine/filter/postsolidfilter/postsolidblockfilter/post_solid_block_filter_test.go index 10fff4fc3..403eeb89e 100644 --- a/pkg/protocol/engine/filter/postsolidfilter/postsolidblockfilter/post_solid_block_filter_test.go +++ b/pkg/protocol/engine/filter/postsolidfilter/postsolidblockfilter/post_solid_block_filter_test.go @@ -152,7 +152,7 @@ func TestPostSolidFilter_NoAccount(t *testing.T) { accounts.NewAccountData( accountID, accounts.WithExpirySlot(iotago.MaxSlotIndex), - accounts.WithBlockIssuerKeys(iotago.Ed25519PublicKeyBlockIssuerKeyFromPublicKey(keyPairAccount.PublicKey)), + accounts.WithBlockIssuerKeys(iotago.Ed25519PublicKeyHashBlockIssuerKeyFromPublicKey(keyPairAccount.PublicKey)), ), ) keyPairImplicitAccount := ed25519.GenerateKeyPair() @@ -213,7 +213,7 @@ func TestPostSolidFilter_BurnedMana(t *testing.T) { accounts.NewAccountData( accountID, accounts.WithExpirySlot(iotago.MaxSlotIndex), - accounts.WithBlockIssuerKeys(iotago.Ed25519PublicKeyBlockIssuerKeyFromPublicKey(keyPair.PublicKey)), + accounts.WithBlockIssuerKeys(iotago.Ed25519PublicKeyHashBlockIssuerKeyFromPublicKey(keyPair.PublicKey)), ), ) @@ -251,7 +251,7 @@ func TestPostSolidFilter_Expiry(t *testing.T) { accounts.NewAccountData( accountID, accounts.WithExpirySlot(100), - accounts.WithBlockIssuerKeys(iotago.Ed25519PublicKeyBlockIssuerKeyFromPublicKey(keyPair.PublicKey)), + accounts.WithBlockIssuerKeys(iotago.Ed25519PublicKeyHashBlockIssuerKeyFromPublicKey(keyPair.PublicKey)), ), ) diff --git a/pkg/tests/upgrade_signaling_test.go b/pkg/tests/upgrade_signaling_test.go index edf7d5a04..6d41f9eb0 100644 --- a/pkg/tests/upgrade_signaling_test.go +++ b/pkg/tests/upgrade_signaling_test.go @@ -137,7 +137,7 @@ func Test_Upgrade_Signaling(t *testing.T) { Credits: &accounts.BlockIssuanceCredits{Value: iotago.MaxBlockIssuanceCredits / 2, UpdateSlot: 0}, ExpirySlot: iotago.MaxSlotIndex, OutputID: ts.AccountOutput("Genesis:1").OutputID(), - BlockIssuerKeys: iotago.NewBlockIssuerKeys(iotago.Ed25519PublicKeyBlockIssuerKeyFromPublicKey(ed25519.PublicKey(ts.Node("nodeA").Validator.PublicKey))), + BlockIssuerKeys: iotago.NewBlockIssuerKeys(iotago.Ed25519PublicKeyHashBlockIssuerKeyFromPublicKey(ed25519.PublicKey(ts.Node("nodeA").Validator.PublicKey))), ValidatorStake: mock.MinValidatorAccountAmount(ts.API.ProtocolParameters()), DelegationStake: 0, FixedCost: 0, @@ -150,7 +150,7 @@ func Test_Upgrade_Signaling(t *testing.T) { Credits: &accounts.BlockIssuanceCredits{Value: iotago.MaxBlockIssuanceCredits / 2, UpdateSlot: 0}, ExpirySlot: iotago.MaxSlotIndex, OutputID: ts.AccountOutput("Genesis:5").OutputID(), - BlockIssuerKeys: iotago.NewBlockIssuerKeys(iotago.Ed25519PublicKeyBlockIssuerKeyFromPublicKey(ed25519.PublicKey(wallet.BlockIssuer.PublicKey))), + BlockIssuerKeys: iotago.NewBlockIssuerKeys(iotago.Ed25519PublicKeyHashBlockIssuerKeyFromPublicKey(ed25519.PublicKey(wallet.BlockIssuer.PublicKey))), ValidatorStake: 0, DelegationStake: 0, FixedCost: 0, @@ -171,7 +171,7 @@ func Test_Upgrade_Signaling(t *testing.T) { Credits: &accounts.BlockIssuanceCredits{Value: iotago.MaxBlockIssuanceCredits / 2, UpdateSlot: 0}, ExpirySlot: iotago.MaxSlotIndex, OutputID: ts.AccountOutput("Genesis:1").OutputID(), - BlockIssuerKeys: iotago.NewBlockIssuerKeys(iotago.Ed25519PublicKeyBlockIssuerKeyFromPublicKey(ed25519.PublicKey(ts.Node("nodeA").Validator.PublicKey))), + BlockIssuerKeys: iotago.NewBlockIssuerKeys(iotago.Ed25519PublicKeyHashBlockIssuerKeyFromPublicKey(ed25519.PublicKey(ts.Node("nodeA").Validator.PublicKey))), ValidatorStake: mock.MinValidatorAccountAmount(ts.API.ProtocolParameters()), DelegationStake: 0, FixedCost: 0, @@ -184,7 +184,7 @@ func Test_Upgrade_Signaling(t *testing.T) { Credits: &accounts.BlockIssuanceCredits{Value: iotago.MaxBlockIssuanceCredits / 2, UpdateSlot: 0}, ExpirySlot: iotago.MaxSlotIndex, OutputID: ts.AccountOutput("Genesis:4").OutputID(), - BlockIssuerKeys: iotago.NewBlockIssuerKeys(iotago.Ed25519PublicKeyBlockIssuerKeyFromPublicKey(ed25519.PublicKey(ts.Node("nodeD").Validator.PublicKey))), + BlockIssuerKeys: iotago.NewBlockIssuerKeys(iotago.Ed25519PublicKeyHashBlockIssuerKeyFromPublicKey(ed25519.PublicKey(ts.Node("nodeD").Validator.PublicKey))), ValidatorStake: mock.MinValidatorAccountAmount(ts.API.ProtocolParameters()), DelegationStake: 0, FixedCost: 0, @@ -205,7 +205,7 @@ func Test_Upgrade_Signaling(t *testing.T) { Credits: &accounts.BlockIssuanceCredits{Value: iotago.MaxBlockIssuanceCredits / 2, UpdateSlot: 0}, ExpirySlot: iotago.MaxSlotIndex, OutputID: ts.AccountOutput("Genesis:1").OutputID(), - BlockIssuerKeys: iotago.NewBlockIssuerKeys(iotago.Ed25519PublicKeyBlockIssuerKeyFromPublicKey(ed25519.PublicKey(ts.Node("nodeA").Validator.PublicKey))), + BlockIssuerKeys: iotago.NewBlockIssuerKeys(iotago.Ed25519PublicKeyHashBlockIssuerKeyFromPublicKey(ed25519.PublicKey(ts.Node("nodeA").Validator.PublicKey))), ValidatorStake: mock.MinValidatorAccountAmount(ts.API.ProtocolParameters()), DelegationStake: 0, FixedCost: 0, @@ -370,7 +370,7 @@ func Test_Upgrade_Signaling(t *testing.T) { Credits: &accounts.BlockIssuanceCredits{Value: iotago.MaxBlockIssuanceCredits / 2, UpdateSlot: 0}, ExpirySlot: iotago.MaxSlotIndex, OutputID: ts.AccountOutput("Genesis:1").OutputID(), - BlockIssuerKeys: iotago.NewBlockIssuerKeys(iotago.Ed25519PublicKeyBlockIssuerKeyFromPublicKey(ed25519.PublicKey(ts.Node("nodeA").Validator.PublicKey))), + BlockIssuerKeys: iotago.NewBlockIssuerKeys(iotago.Ed25519PublicKeyHashBlockIssuerKeyFromPublicKey(ed25519.PublicKey(ts.Node("nodeA").Validator.PublicKey))), ValidatorStake: mock.MinValidatorAccountAmount(ts.API.ProtocolParameters()), DelegationStake: 0, FixedCost: 0, @@ -383,7 +383,7 @@ func Test_Upgrade_Signaling(t *testing.T) { Credits: &accounts.BlockIssuanceCredits{Value: iotago.MaxBlockIssuanceCredits / 2, UpdateSlot: 0}, ExpirySlot: iotago.MaxSlotIndex, OutputID: ts.AccountOutput("Genesis:4").OutputID(), - BlockIssuerKeys: iotago.NewBlockIssuerKeys(iotago.Ed25519PublicKeyBlockIssuerKeyFromPublicKey(ed25519.PublicKey(ts.Node("nodeD").Validator.PublicKey))), + BlockIssuerKeys: iotago.NewBlockIssuerKeys(iotago.Ed25519PublicKeyHashBlockIssuerKeyFromPublicKey(ed25519.PublicKey(ts.Node("nodeD").Validator.PublicKey))), ValidatorStake: mock.MinValidatorAccountAmount(ts.API.ProtocolParameters()), DelegationStake: 0, FixedCost: 0, diff --git a/pkg/testsuite/depositcalculator/depositcalculator.go b/pkg/testsuite/depositcalculator/depositcalculator.go index 307b5f5a4..e475cec30 100644 --- a/pkg/testsuite/depositcalculator/depositcalculator.go +++ b/pkg/testsuite/depositcalculator/depositcalculator.go @@ -219,7 +219,7 @@ func getFeatures[T iotago.Feature](opts *Options) iotago.Features[T] { if opts.BlockIssuerKeys > 0 { blockIssuerKeys := make([]iotago.BlockIssuerKey, 0, opts.BlockIssuerKeys) for i := 0; i < opts.BlockIssuerKeys; i++ { - blockIssuerKeys = append(blockIssuerKeys, &iotago.Ed25519PublicKeyBlockIssuerKey{}) + blockIssuerKeys = append(blockIssuerKeys, &iotago.Ed25519PublicKeyHashBlockIssuerKey{}) } features = append(features, &iotago.BlockIssuerFeature{BlockIssuerKeys: blockIssuerKeys}) diff --git a/pkg/testsuite/depositcalculator/depositcalculator_test.go b/pkg/testsuite/depositcalculator/depositcalculator_test.go index b93271fe3..d7c36b5b1 100644 --- a/pkg/testsuite/depositcalculator/depositcalculator_test.go +++ b/pkg/testsuite/depositcalculator/depositcalculator_test.go @@ -65,8 +65,8 @@ func TestCalculate(t *testing.T) { Features: iotago.AccountOutputFeatures{ &iotago.BlockIssuerFeature{ BlockIssuerKeys: iotago.BlockIssuerKeys{ - &iotago.Ed25519PublicKeyBlockIssuerKey{}, - &iotago.Ed25519PublicKeyBlockIssuerKey{}, + &iotago.Ed25519PublicKeyHashBlockIssuerKey{}, + &iotago.Ed25519PublicKeyHashBlockIssuerKey{}, }, ExpirySlot: 0, }, diff --git a/pkg/testsuite/mock/blockissuer.go b/pkg/testsuite/mock/blockissuer.go index 20969ad14..368213fb9 100644 --- a/pkg/testsuite/mock/blockissuer.go +++ b/pkg/testsuite/mock/blockissuer.go @@ -88,7 +88,7 @@ func NewBlockIssuer(t *testing.T, name string, keyManager *wallet.KeyManager, ac } func (i *BlockIssuer) BlockIssuerKey() iotago.BlockIssuerKey { - return iotago.Ed25519PublicKeyBlockIssuerKeyFromPublicKey(hiveEd25519.PublicKey(i.PublicKey)) + return iotago.Ed25519PublicKeyHashBlockIssuerKeyFromPublicKey(hiveEd25519.PublicKey(i.PublicKey)) } func (i *BlockIssuer) BlockIssuerKeys() iotago.BlockIssuerKeys { diff --git a/pkg/testsuite/mock/wallet.go b/pkg/testsuite/mock/wallet.go index bc44e166b..219a21f0f 100644 --- a/pkg/testsuite/mock/wallet.go +++ b/pkg/testsuite/mock/wallet.go @@ -62,7 +62,7 @@ func (w *Wallet) BlockIssuerKey() iotago.BlockIssuerKey { } _, pub := w.keyManager.KeyPair() - return iotago.Ed25519PublicKeyBlockIssuerKeyFromPublicKey(hiveEd25519.PublicKey(pub)) + return iotago.Ed25519PublicKeyHashBlockIssuerKeyFromPublicKey(hiveEd25519.PublicKey(pub)) } func (w *Wallet) SetDefaultNode(node *Node) { diff --git a/pkg/testsuite/snapshotcreator/snapshotcreator.go b/pkg/testsuite/snapshotcreator/snapshotcreator.go index 0d57b10ef..aa219c11d 100644 --- a/pkg/testsuite/snapshotcreator/snapshotcreator.go +++ b/pkg/testsuite/snapshotcreator/snapshotcreator.go @@ -3,8 +3,6 @@ package snapshotcreator import ( "os" - "golang.org/x/crypto/blake2b" - "github.com/iotaledger/hive.go/ierrors" "github.com/iotaledger/hive.go/lo" "github.com/iotaledger/hive.go/log" @@ -72,12 +70,11 @@ func CreateSnapshot(opts ...options.Option[Options]) error { for _, snapshotAccountDetails := range opt.Accounts { // Only add genesis validators if an account has both - StakedAmount and StakingEndEpoch - specified. if snapshotAccountDetails.StakedAmount > 0 && snapshotAccountDetails.StakingEndEpoch > 0 { - blockIssuerKeyEd25519, ok := snapshotAccountDetails.IssuerKey.(*iotago.Ed25519PublicKeyBlockIssuerKey) + blockIssuerKeyEd25519, ok := snapshotAccountDetails.IssuerKey.(*iotago.Ed25519PublicKeyHashBlockIssuerKey) if !ok { panic("block issuer key must be of type ed25519") } - ed25519PubKey := blockIssuerKeyEd25519.ToEd25519PublicKey() - accountID := blake2b.Sum256(ed25519PubKey[:]) + accountID := blockIssuerKeyEd25519.PublicKeyHash committeeAccountsData = append(committeeAccountsData, &accounts.AccountData{ ID: accountID, Credits: &accounts.BlockIssuanceCredits{Value: snapshotAccountDetails.BlockIssuanceCredits, UpdateSlot: 0}, diff --git a/pkg/testsuite/testsuite.go b/pkg/testsuite/testsuite.go index 1cb0029d7..7b9af070d 100644 --- a/pkg/testsuite/testsuite.go +++ b/pkg/testsuite/testsuite.go @@ -8,7 +8,6 @@ import ( "time" "github.com/stretchr/testify/require" - "golang.org/x/crypto/blake2b" "github.com/iotaledger/hive.go/crypto/ed25519" "github.com/iotaledger/hive.go/ds/orderedmap" @@ -350,7 +349,7 @@ func (t *TestSuite) addNodeToPartition(name string, partition string, validator Address: iotago.Ed25519AddressFromPubKey(node.Validator.PublicKey), Amount: walletOptions.Amount, Mana: iotago.Mana(walletOptions.Amount), - IssuerKey: iotago.Ed25519PublicKeyBlockIssuerKeyFromPublicKey(ed25519.PublicKey(node.Validator.PublicKey)), + IssuerKey: iotago.Ed25519PublicKeyHashBlockIssuerKeyFromPublicKey(ed25519.PublicKey(node.Validator.PublicKey)), ExpirySlot: iotago.MaxSlotIndex, BlockIssuanceCredits: iotago.MaxBlockIssuanceCredits / 2, StakedAmount: walletOptions.Amount, @@ -410,7 +409,7 @@ func (t *TestSuite) AddGenesisWallet(name string, node *mock.Node, walletOpts .. Address: iotago.Ed25519AddressFromPubKey(newWallet.BlockIssuer.PublicKey), Amount: walletOptions.Amount, Mana: iotago.Mana(mock.MinIssuerAccountAmount(t.API.ProtocolParameters())), - IssuerKey: iotago.Ed25519PublicKeyBlockIssuerKeyFromPublicKey(ed25519.PublicKey(newWallet.BlockIssuer.PublicKey)), + IssuerKey: iotago.Ed25519PublicKeyHashBlockIssuerKeyFromPublicKey(ed25519.PublicKey(newWallet.BlockIssuer.PublicKey)), ExpirySlot: iotago.MaxSlotIndex, BlockIssuanceCredits: walletOptions.BlockIssuanceCredits, } @@ -486,12 +485,11 @@ func (t *TestSuite) Run(failOnBlockFiltered bool, nodesOptions ...map[string][]o } if accountDetails.AccountID.Empty() { - blockIssuerKeyEd25519, ok := accountDetails.IssuerKey.(*iotago.Ed25519PublicKeyBlockIssuerKey) + blockIssuerKeyEd25519, ok := accountDetails.IssuerKey.(*iotago.Ed25519PublicKeyHashBlockIssuerKey) if !ok { panic("block issuer key must be of type ed25519") } - ed25519PubKey := blockIssuerKeyEd25519.ToEd25519PublicKey() - accountID := blake2b.Sum256(ed25519PubKey[:]) + accountID := blockIssuerKeyEd25519.PublicKeyHash accountDetails.AccountID = accountID } diff --git a/tools/gendoc/go.mod b/tools/gendoc/go.mod index 5ed67a64a..0e956c010 100644 --- a/tools/gendoc/go.mod +++ b/tools/gendoc/go.mod @@ -71,7 +71,7 @@ require ( github.com/iotaledger/inx-app v1.0.0-rc.3.0.20240123171338-c9f82bbb8ad6 // indirect github.com/iotaledger/inx/go v1.0.0-rc.2.0.20240123170953-fc68d7c1303b // indirect github.com/iotaledger/iota-crypto-demo v0.0.0-20231208171603-786bb32fdb00 // indirect - github.com/iotaledger/iota.go/v4 v4.0.0-20240123170900-42c1479d3f30 // indirect + github.com/iotaledger/iota.go/v4 v4.0.0-20240125083751-2a637ee97ebb // indirect github.com/ipfs/boxo v0.13.1 // indirect github.com/ipfs/go-cid v0.4.1 // indirect github.com/ipfs/go-datastore v0.6.0 // indirect diff --git a/tools/gendoc/go.sum b/tools/gendoc/go.sum index 627def3d5..ad305408e 100644 --- a/tools/gendoc/go.sum +++ b/tools/gendoc/go.sum @@ -313,8 +313,8 @@ github.com/iotaledger/inx/go v1.0.0-rc.2.0.20240123170953-fc68d7c1303b h1:KzsDGz github.com/iotaledger/inx/go v1.0.0-rc.2.0.20240123170953-fc68d7c1303b/go.mod h1:M4DqLsDD23/MkvmBEXJrEikqNIB/lL9vbGuIBRfjTY4= github.com/iotaledger/iota-crypto-demo v0.0.0-20231208171603-786bb32fdb00 h1:j5udgLtSN6wQgFI9vnhkdJsqsVdJmwtoc0yOmT/Ila4= github.com/iotaledger/iota-crypto-demo v0.0.0-20231208171603-786bb32fdb00/go.mod h1:gt+URx7DZu414nZME7jtGgxR4DVTSnNa1jF2trTUTZ0= -github.com/iotaledger/iota.go/v4 v4.0.0-20240123170900-42c1479d3f30 h1:W+a1Ne7Be+woCuzoueO5NAcDR+v/E5jdEKriv9XyFpQ= -github.com/iotaledger/iota.go/v4 v4.0.0-20240123170900-42c1479d3f30/go.mod h1:ZsbAtAhfjPO88C4k6gOJQUHHlulAMhNCW1MVzMqEfA4= +github.com/iotaledger/iota.go/v4 v4.0.0-20240125083751-2a637ee97ebb h1:toyYlq90YaKr13ScdJFdBN/yzfG02DGchL+Fp+X00Nk= +github.com/iotaledger/iota.go/v4 v4.0.0-20240125083751-2a637ee97ebb/go.mod h1:ZsbAtAhfjPO88C4k6gOJQUHHlulAMhNCW1MVzMqEfA4= github.com/ipfs/boxo v0.13.1 h1:nQ5oQzcMZR3oL41REJDcTbrvDvuZh3J9ckc9+ILeRQI= github.com/ipfs/boxo v0.13.1/go.mod h1:btrtHy0lmO1ODMECbbEY1pxNtrLilvKSYLoGQt1yYCk= github.com/ipfs/go-cid v0.4.1 h1:A/T3qGvxi4kpKWWcPC/PgbvDA2bjVLO7n4UeVwnbs/s= diff --git a/tools/genesis-snapshot/go.mod b/tools/genesis-snapshot/go.mod index 0a90ee5a2..c00c3cecd 100644 --- a/tools/genesis-snapshot/go.mod +++ b/tools/genesis-snapshot/go.mod @@ -10,7 +10,7 @@ require ( github.com/iotaledger/hive.go/lo v0.0.0-20240123132714-180e65c33a1d github.com/iotaledger/hive.go/runtime v0.0.0-20240123132714-180e65c33a1d github.com/iotaledger/iota-core v0.0.0-00010101000000-000000000000 - github.com/iotaledger/iota.go/v4 v4.0.0-20240123170900-42c1479d3f30 + github.com/iotaledger/iota.go/v4 v4.0.0-20240125083751-2a637ee97ebb github.com/mr-tron/base58 v1.2.0 github.com/spf13/pflag v1.0.5 golang.org/x/crypto v0.18.0 diff --git a/tools/genesis-snapshot/go.sum b/tools/genesis-snapshot/go.sum index 1f12ed4e9..45e893d09 100644 --- a/tools/genesis-snapshot/go.sum +++ b/tools/genesis-snapshot/go.sum @@ -54,8 +54,8 @@ github.com/iotaledger/hive.go/stringify v0.0.0-20240123132714-180e65c33a1d h1:pw github.com/iotaledger/hive.go/stringify v0.0.0-20240123132714-180e65c33a1d/go.mod h1:FTo/UWzNYgnQ082GI9QVM9HFDERqf9rw9RivNpqrnTs= github.com/iotaledger/iota-crypto-demo v0.0.0-20231208171603-786bb32fdb00 h1:j5udgLtSN6wQgFI9vnhkdJsqsVdJmwtoc0yOmT/Ila4= github.com/iotaledger/iota-crypto-demo v0.0.0-20231208171603-786bb32fdb00/go.mod h1:gt+URx7DZu414nZME7jtGgxR4DVTSnNa1jF2trTUTZ0= -github.com/iotaledger/iota.go/v4 v4.0.0-20240123170900-42c1479d3f30 h1:W+a1Ne7Be+woCuzoueO5NAcDR+v/E5jdEKriv9XyFpQ= -github.com/iotaledger/iota.go/v4 v4.0.0-20240123170900-42c1479d3f30/go.mod h1:ZsbAtAhfjPO88C4k6gOJQUHHlulAMhNCW1MVzMqEfA4= +github.com/iotaledger/iota.go/v4 v4.0.0-20240125083751-2a637ee97ebb h1:toyYlq90YaKr13ScdJFdBN/yzfG02DGchL+Fp+X00Nk= +github.com/iotaledger/iota.go/v4 v4.0.0-20240125083751-2a637ee97ebb/go.mod h1:ZsbAtAhfjPO88C4k6gOJQUHHlulAMhNCW1MVzMqEfA4= github.com/ipfs/go-cid v0.4.1 h1:A/T3qGvxi4kpKWWcPC/PgbvDA2bjVLO7n4UeVwnbs/s= github.com/ipfs/go-cid v0.4.1/go.mod h1:uQHwDeX4c6CtyrFwdqyhpNcxVewur1M7l7fNU7LKwZk= github.com/klauspost/cpuid/v2 v2.2.6 h1:ndNyv040zDGIDh8thGkXYjnFtiN02M1PVVF+JE/48xc= diff --git a/tools/genesis-snapshot/presets/presets.go b/tools/genesis-snapshot/presets/presets.go index 583b49ae5..75e9a8ffc 100644 --- a/tools/genesis-snapshot/presets/presets.go +++ b/tools/genesis-snapshot/presets/presets.go @@ -58,7 +58,7 @@ var ( AccountID: blake2b.Sum256(lo.PanicOnErr(hexutil.DecodeHex("0x293dc170d9a59474e6d81cfba7f7d924c09b25d7166bcfba606e53114d0a758b"))), Address: iotago.Ed25519AddressFromPubKey(lo.PanicOnErr(hexutil.DecodeHex("0x293dc170d9a59474e6d81cfba7f7d924c09b25d7166bcfba606e53114d0a758b"))), Amount: mock.MinValidatorAccountAmount(protocolParamsDocker), - IssuerKey: iotago.Ed25519PublicKeyBlockIssuerKeyFromPublicKey(ed25519.PublicKey(lo.PanicOnErr(hexutil.DecodeHex("0x293dc170d9a59474e6d81cfba7f7d924c09b25d7166bcfba606e53114d0a758b")))), + IssuerKey: iotago.Ed25519PublicKeyHashBlockIssuerKeyFromPublicKey(ed25519.PublicKey(lo.PanicOnErr(hexutil.DecodeHex("0x293dc170d9a59474e6d81cfba7f7d924c09b25d7166bcfba606e53114d0a758b")))), ExpirySlot: iotago.MaxSlotIndex, BlockIssuanceCredits: iotago.MaxBlockIssuanceCredits / 5, StakingEndEpoch: iotago.MaxEpochIndex, @@ -78,7 +78,7 @@ var ( AccountID: blake2b.Sum256(lo.PanicOnErr(hexutil.DecodeHex("0x05c1de274451db8de8182d64c6ee0dca3ae0c9077e0b4330c976976171d79064"))), Address: iotago.Ed25519AddressFromPubKey(lo.PanicOnErr(hexutil.DecodeHex("0x05c1de274451db8de8182d64c6ee0dca3ae0c9077e0b4330c976976171d79064"))), Amount: mock.MinValidatorAccountAmount(protocolParamsDocker), - IssuerKey: iotago.Ed25519PublicKeyBlockIssuerKeyFromPublicKey(ed25519.PublicKey(lo.PanicOnErr(hexutil.DecodeHex("0x05c1de274451db8de8182d64c6ee0dca3ae0c9077e0b4330c976976171d79064")))), + IssuerKey: iotago.Ed25519PublicKeyHashBlockIssuerKeyFromPublicKey(ed25519.PublicKey(lo.PanicOnErr(hexutil.DecodeHex("0x05c1de274451db8de8182d64c6ee0dca3ae0c9077e0b4330c976976171d79064")))), ExpirySlot: iotago.MaxSlotIndex, BlockIssuanceCredits: iotago.MaxBlockIssuanceCredits / 5, StakingEndEpoch: iotago.MaxEpochIndex, @@ -98,7 +98,7 @@ var ( AccountID: blake2b.Sum256(lo.PanicOnErr(hexutil.DecodeHex("0x1e4b21eb51dcddf65c20db1065e1f1514658b23a3ddbf48d30c0efc926a9a648"))), Address: iotago.Ed25519AddressFromPubKey(lo.PanicOnErr(hexutil.DecodeHex("0x1e4b21eb51dcddf65c20db1065e1f1514658b23a3ddbf48d30c0efc926a9a648"))), Amount: mock.MinValidatorAccountAmount(protocolParamsDocker), - IssuerKey: iotago.Ed25519PublicKeyBlockIssuerKeyFromPublicKey(ed25519.PublicKey(lo.PanicOnErr(hexutil.DecodeHex("0x1e4b21eb51dcddf65c20db1065e1f1514658b23a3ddbf48d30c0efc926a9a648")))), + IssuerKey: iotago.Ed25519PublicKeyHashBlockIssuerKeyFromPublicKey(ed25519.PublicKey(lo.PanicOnErr(hexutil.DecodeHex("0x1e4b21eb51dcddf65c20db1065e1f1514658b23a3ddbf48d30c0efc926a9a648")))), ExpirySlot: iotago.MaxSlotIndex, BlockIssuanceCredits: iotago.MaxBlockIssuanceCredits / 5, StakingEndEpoch: iotago.MaxEpochIndex, @@ -119,7 +119,7 @@ var ( AccountID: blake2b.Sum256(lo.PanicOnErr(hexutil.DecodeHex("0xc9ceac37d293155a578381aa313ee74edfa3ac73ee930d045564aae7771e8ffe"))), Address: iotago.Ed25519AddressFromPubKey(lo.PanicOnErr(hexutil.DecodeHex("0xc9ceac37d293155a578381aa313ee74edfa3ac73ee930d045564aae7771e8ffe"))), Amount: mock.MinValidatorAccountAmount(protocolParamsDocker), - IssuerKey: iotago.Ed25519PublicKeyBlockIssuerKeyFromPublicKey(ed25519.PublicKey(lo.PanicOnErr(hexutil.DecodeHex("0xc9ceac37d293155a578381aa313ee74edfa3ac73ee930d045564aae7771e8ffe")))), + IssuerKey: iotago.Ed25519PublicKeyHashBlockIssuerKeyFromPublicKey(ed25519.PublicKey(lo.PanicOnErr(hexutil.DecodeHex("0xc9ceac37d293155a578381aa313ee74edfa3ac73ee930d045564aae7771e8ffe")))), ExpirySlot: iotago.MaxSlotIndex, BlockIssuanceCredits: iotago.MaxBlockIssuanceCredits / 5, StakingEndEpoch: iotago.MaxEpochIndex, @@ -140,7 +140,7 @@ var ( AccountID: blake2b.Sum256(lo.PanicOnErr(hexutil.DecodeHex("0x997be92a22b1933f36e26fba5f721756f95811d6b4ae21564197c2bfa4f28270"))), Address: iotago.Ed25519AddressFromPubKey(lo.PanicOnErr(hexutil.DecodeHex("0x997be92a22b1933f36e26fba5f721756f95811d6b4ae21564197c2bfa4f28270"))), Amount: mock.MinIssuerAccountAmount(protocolParamsDocker), - IssuerKey: iotago.Ed25519PublicKeyBlockIssuerKeyFromPublicKey(ed25519.PublicKey(lo.PanicOnErr(hexutil.DecodeHex("0x997be92a22b1933f36e26fba5f721756f95811d6b4ae21564197c2bfa4f28270")))), + IssuerKey: iotago.Ed25519PublicKeyHashBlockIssuerKeyFromPublicKey(ed25519.PublicKey(lo.PanicOnErr(hexutil.DecodeHex("0x997be92a22b1933f36e26fba5f721756f95811d6b4ae21564197c2bfa4f28270")))), ExpirySlot: iotago.MaxSlotIndex, BlockIssuanceCredits: iotago.MaxBlockIssuanceCredits / 5, Mana: iotago.Mana(mock.MinIssuerAccountAmount(protocolParamsDocker)), @@ -180,7 +180,7 @@ var ( AccountID: blake2b.Sum256(lo.PanicOnErr(hexutil.DecodeHex("0x01fb6b9db5d96240aef00bc950d1c67a6494513f6d7cf784e57b4972b96ab2fe"))), Address: iotago.Ed25519AddressFromPubKey(lo.PanicOnErr(hexutil.DecodeHex("0x01fb6b9db5d96240aef00bc950d1c67a6494513f6d7cf784e57b4972b96ab2fe"))), Amount: mock.MinValidatorAccountAmount(protocolParamsFeature), - IssuerKey: iotago.Ed25519PublicKeyBlockIssuerKeyFromPublicKey(ed25519.PublicKey(lo.PanicOnErr(hexutil.DecodeHex("0x01fb6b9db5d96240aef00bc950d1c67a6494513f6d7cf784e57b4972b96ab2fe")))), + IssuerKey: iotago.Ed25519PublicKeyHashBlockIssuerKeyFromPublicKey(ed25519.PublicKey(lo.PanicOnErr(hexutil.DecodeHex("0x01fb6b9db5d96240aef00bc950d1c67a6494513f6d7cf784e57b4972b96ab2fe")))), ExpirySlot: iotago.MaxSlotIndex, BlockIssuanceCredits: iotago.MaxBlockIssuanceCredits / 5, StakingEndEpoch: iotago.MaxEpochIndex, @@ -200,7 +200,7 @@ var ( AccountID: blake2b.Sum256(lo.PanicOnErr(hexutil.DecodeHex("0x83e7f71a440afd48981a8b4684ddae24434b7182ce5c47cfb56ac528525fd4b6"))), Address: iotago.Ed25519AddressFromPubKey(lo.PanicOnErr(hexutil.DecodeHex("0x83e7f71a440afd48981a8b4684ddae24434b7182ce5c47cfb56ac528525fd4b6"))), Amount: mock.MinValidatorAccountAmount(protocolParamsFeature), - IssuerKey: iotago.Ed25519PublicKeyBlockIssuerKeyFromPublicKey(ed25519.PublicKey(lo.PanicOnErr(hexutil.DecodeHex("0x83e7f71a440afd48981a8b4684ddae24434b7182ce5c47cfb56ac528525fd4b6")))), + IssuerKey: iotago.Ed25519PublicKeyHashBlockIssuerKeyFromPublicKey(ed25519.PublicKey(lo.PanicOnErr(hexutil.DecodeHex("0x83e7f71a440afd48981a8b4684ddae24434b7182ce5c47cfb56ac528525fd4b6")))), ExpirySlot: iotago.MaxSlotIndex, BlockIssuanceCredits: iotago.MaxBlockIssuanceCredits / 5, StakingEndEpoch: iotago.MaxEpochIndex, @@ -220,7 +220,7 @@ var ( AccountID: blake2b.Sum256(lo.PanicOnErr(hexutil.DecodeHex("0xac628986b2ef52a1679f2289fcd7b4198476976dea4c30ae34ff04ae52e14805"))), Address: iotago.Ed25519AddressFromPubKey(lo.PanicOnErr(hexutil.DecodeHex("0xac628986b2ef52a1679f2289fcd7b4198476976dea4c30ae34ff04ae52e14805"))), Amount: mock.MinValidatorAccountAmount(protocolParamsFeature), - IssuerKey: iotago.Ed25519PublicKeyBlockIssuerKeyFromPublicKey(ed25519.PublicKey(lo.PanicOnErr(hexutil.DecodeHex("0xac628986b2ef52a1679f2289fcd7b4198476976dea4c30ae34ff04ae52e14805")))), + IssuerKey: iotago.Ed25519PublicKeyHashBlockIssuerKeyFromPublicKey(ed25519.PublicKey(lo.PanicOnErr(hexutil.DecodeHex("0xac628986b2ef52a1679f2289fcd7b4198476976dea4c30ae34ff04ae52e14805")))), ExpirySlot: iotago.MaxSlotIndex, BlockIssuanceCredits: iotago.MaxBlockIssuanceCredits / 5, StakingEndEpoch: iotago.MaxEpochIndex, @@ -241,7 +241,7 @@ var ( AccountID: blake2b.Sum256(lo.PanicOnErr(hexutil.DecodeHex("0xc9ceac37d293155a578381aa313ee74edfa3ac73ee930d045564aae7771e8ffe"))), Address: iotago.Ed25519AddressFromPubKey(lo.PanicOnErr(hexutil.DecodeHex("0xc9ceac37d293155a578381aa313ee74edfa3ac73ee930d045564aae7771e8ffe"))), Amount: mock.MinValidatorAccountAmount(protocolParamsFeature), - IssuerKey: iotago.Ed25519PublicKeyBlockIssuerKeyFromPublicKey(ed25519.PublicKey(lo.PanicOnErr(hexutil.DecodeHex("0xc9ceac37d293155a578381aa313ee74edfa3ac73ee930d045564aae7771e8ffe")))), + IssuerKey: iotago.Ed25519PublicKeyHashBlockIssuerKeyFromPublicKey(ed25519.PublicKey(lo.PanicOnErr(hexutil.DecodeHex("0xc9ceac37d293155a578381aa313ee74edfa3ac73ee930d045564aae7771e8ffe")))), ExpirySlot: iotago.MaxSlotIndex, BlockIssuanceCredits: iotago.MaxBlockIssuanceCredits / 5, StakingEndEpoch: iotago.MaxEpochIndex, @@ -261,7 +261,7 @@ var ( AccountID: blake2b.Sum256(lo.PanicOnErr(hexutil.DecodeHex("0x670a1a20ddb02a6cec53ec3196bc7d5bd26df2f5a6ca90b5fffd71364f104b25"))), Address: iotago.Ed25519AddressFromPubKey(lo.PanicOnErr(hexutil.DecodeHex("0x670a1a20ddb02a6cec53ec3196bc7d5bd26df2f5a6ca90b5fffd71364f104b25"))), Amount: mock.MinIssuerAccountAmount(protocolParamsFeature), - IssuerKey: iotago.Ed25519PublicKeyBlockIssuerKeyFromPublicKey(ed25519.PublicKey(lo.PanicOnErr(hexutil.DecodeHex("0x670a1a20ddb02a6cec53ec3196bc7d5bd26df2f5a6ca90b5fffd71364f104b25")))), + IssuerKey: iotago.Ed25519PublicKeyHashBlockIssuerKeyFromPublicKey(ed25519.PublicKey(lo.PanicOnErr(hexutil.DecodeHex("0x670a1a20ddb02a6cec53ec3196bc7d5bd26df2f5a6ca90b5fffd71364f104b25")))), ExpirySlot: iotago.MaxSlotIndex, BlockIssuanceCredits: iotago.MaxBlockIssuanceCredits / 5, Mana: iotago.Mana(mock.MinIssuerAccountAmount(protocolParamsFeature)), diff --git a/tools/genesis-snapshot/presets/presets_yaml.go b/tools/genesis-snapshot/presets/presets_yaml.go index 1bd1f2035..b61f2d515 100644 --- a/tools/genesis-snapshot/presets/presets_yaml.go +++ b/tools/genesis-snapshot/presets/presets_yaml.go @@ -60,7 +60,7 @@ func GenerateFromYaml(hostsFile string) ([]options.Option[snapshotcreator.Option AccountID: blake2b.Sum256(lo.PanicOnErr(hexutil.DecodeHex(pubkey))), Address: iotago.Ed25519AddressFromPubKey(lo.PanicOnErr(hexutil.DecodeHex(pubkey))), Amount: mock.MinValidatorAccountAmount(protocolParamsDocker), - IssuerKey: iotago.Ed25519PublicKeyBlockIssuerKeyFromPublicKey(ed25519.PublicKey(lo.PanicOnErr(hexutil.DecodeHex(pubkey)))), + IssuerKey: iotago.Ed25519PublicKeyHashBlockIssuerKeyFromPublicKey(ed25519.PublicKey(lo.PanicOnErr(hexutil.DecodeHex(pubkey)))), ExpirySlot: iotago.MaxSlotIndex, BlockIssuanceCredits: iotago.MaxBlockIssuanceCredits / 4, StakingEndEpoch: iotago.MaxEpochIndex, @@ -78,7 +78,7 @@ func GenerateFromYaml(hostsFile string) ([]options.Option[snapshotcreator.Option AccountID: blake2b.Sum256(lo.PanicOnErr(hexutil.DecodeHex(pubkey))), Address: iotago.Ed25519AddressFromPubKey(lo.PanicOnErr(hexutil.DecodeHex(pubkey))), Amount: mock.MinValidatorAccountAmount(protocolParamsDocker), - IssuerKey: iotago.Ed25519PublicKeyBlockIssuerKeyFromPublicKey(ed25519.PublicKey(lo.PanicOnErr(hexutil.DecodeHex(pubkey)))), + IssuerKey: iotago.Ed25519PublicKeyHashBlockIssuerKeyFromPublicKey(ed25519.PublicKey(lo.PanicOnErr(hexutil.DecodeHex(pubkey)))), ExpirySlot: iotago.MaxSlotIndex, BlockIssuanceCredits: iotago.MaxBlockIssuanceCredits / 4, Mana: iotago.Mana(mock.MinValidatorAccountAmount(protocolParamsDocker)),