diff --git a/main.go b/main.go index d2e0f90abeb480bf290995f9f3d1c9e81c6f1a7f..99011bd1867ba9b02b0972ccf340e94b7072c0f7 100644 --- a/main.go +++ b/main.go @@ -4,6 +4,7 @@ import ( "github.com/iotaledger/goshimmer/packages/node" "github.com/iotaledger/goshimmer/plugins/analysis" "github.com/iotaledger/goshimmer/plugins/autopeering" + "github.com/iotaledger/goshimmer/plugins/bundleprocessor" "github.com/iotaledger/goshimmer/plugins/cli" "github.com/iotaledger/goshimmer/plugins/gossip" "github.com/iotaledger/goshimmer/plugins/gracefulshutdown" @@ -25,7 +26,7 @@ func main() { gossip.PLUGIN, //gossip_on_solidification.PLUGIN, tangle.PLUGIN, - //bundleprocessor.PLUGIN, + bundleprocessor.PLUGIN, analysis.PLUGIN, gracefulshutdown.PLUGIN, tipselection.PLUGIN, diff --git a/packages/transactionspammer/transactionspammer.go b/packages/transactionspammer/transactionspammer.go index 8038727265a8c1e3d5514a5d3e5f9dbf533e7127..936519f968dc8a93adbfe06034d5e136a80df9c7 100644 --- a/packages/transactionspammer/transactionspammer.go +++ b/packages/transactionspammer/transactionspammer.go @@ -44,6 +44,8 @@ func Start(tps uint) { totalSentCounter++ tx := value_transaction.New() + tx.SetHead(true) + tx.SetTail(true) tx.SetValue(totalSentCounter) tx.SetBranchTransactionHash(tipselection.GetRandomTip()) tx.SetTrunkTransactionHash(tipselection.GetRandomTip()) diff --git a/plugins/bundleprocessor/bundleprocessor_test.go b/plugins/bundleprocessor/bundleprocessor_test.go index f8966e3d7d805fa4e805e0a1f9f36d97c16fc800..06539a0023293a5cb481ad04e07084b513867a16 100644 --- a/plugins/bundleprocessor/bundleprocessor_test.go +++ b/plugins/bundleprocessor/bundleprocessor_test.go @@ -21,6 +21,31 @@ import ( var seed = client.NewSeed("YFHQWAUPCXC9S9DSHP9NDF9RLNPMZVCMSJKUKQP9SWUSUCPRQXCMDVDVZ9SHHESHIQNCXWBJF9UJSWE9Z", consts.SecurityLevelMedium) +func Benchmark(b *testing.B) { + bundleFactory := client.NewBundleFactory() + bundleFactory.AddInput(seed.GetAddress(0), -400) + bundleFactory.AddOutput(seed.GetAddress(1), 400, "Testmessage") + bundleFactory.AddOutput(client.NewAddress("SJKUKQP9SWUSUCPRQXCMDVDVZ9SHHESHIQNCXWBJF9UJSWE9ZYFHQWAUPCXC9S9DSHP9NDF9RLNPMZVCM"), 400, "Testmessage") + + generatedBundle := bundleFactory.GenerateBundle(tipselection.GetRandomTip(), tipselection.GetRandomTip()) + + b.ResetTimer() + + var wg sync.WaitGroup + + for i := 0; i < b.N; i++ { + wg.Add(1) + + go func() { + ValidateSignatures(generatedBundle.GetEssenceHash(), generatedBundle.GetTransactions()) + + wg.Done() + }() + } + + wg.Wait() +} + func TestValidateSignatures(t *testing.T) { bundleFactory := client.NewBundleFactory() bundleFactory.AddInput(seed.GetAddress(0), -400)