-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
support procedural test style for VM-defined workloads #1667
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm unconvinced this testing pattern adds value to VM developers. Seems like this adds a lot of additional complexity, especially if the developer still needs to implement the workloadfactory
|
||
require.NoError(err) | ||
|
||
timeoutCtx, timeoutCtxFnc := context.WithDeadline(context.Background(), time.Now().Add(2*time.Second)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we have a const txCheckInterval
. I think it makes sense to either pass the const in here or remove the const completely and pass in a value from the test.
ginkgo "github.com/onsi/ginkgo/v2" | ||
) | ||
|
||
var _ = he2e.RegisterTest("Transfer Transaction", func(t ginkgo.FullGinkgoTInterface, tn workload.TestNetwork) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i'm concerned this test doesn't add any real value to a hypersdk VM developer. If anything, it adds less value than the current workload tests because the user doesn't have fine grained controls of what a "confirmed" transaction is. In the workload tests, at least devs can define their custom confirmation logic. In these e2e tests all a user gets back is whether or not the transaction was found in the block.
) | ||
|
||
const ( | ||
txCheckInterval = 100 * time.Millisecond |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is the const i mentioned earlier
parser, err := lcli.Parser(context.Background()) | ||
require.NoError(err) | ||
|
||
spendingKey, err := tn.WorkloadFactory().GetSpendingKey() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in these custom e2e tests, we only use the workloadfactory
for this one method. This means if the user wants to only create custom e2e tests they need to also define the workloadfactory
interface which is quite confusing 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe its worth adding some of the further work you mentioned to this PR. If the GenesisKeys
are added to the test network then we wouldn't need to couple the WorkloadFactory
here
var _ = registry.RegisterTest("Transfer Transaction", func(t ginkgo.FullGinkgoTInterface, tn tworkload.TestNetwork) error { | ||
require := require.New(t) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(future PR) - it would be nice to enable tests to declare their funding dependency ie. request that you pass in N keys with balance of at least 1K
tests/workload/network.go
Outdated
SubmitTxs(context.Context, []*chain.Transaction) error | ||
ConfirmTxs(context.Context, []*chain.Transaction) error | ||
GenerateTx(context.Context, []chain.Action, chain.AuthFactory) (*chain.Transaction, error) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we remove TestNode
and support a single ConfirmTxs
call on TestNetwork
instead of the node?
We should leave it to each environment (integration/e2e) to handle this since submitting a tx to a single node in integration will result in a different outcome than submitting a tx to a single node in the e2e environment.
Each environment should enforce that marking a tx as confirmed indicates all nodes have marked it as confirmed, so that we can check the state by making API calls directly to the URIs reported by the TestNetwork
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
var _ = ginkgo.Describe("[Custom VM Tests]", func() { | ||
require := require.New(ginkgo.GinkgoT()) | ||
|
||
for testRegistry := range registry.GetTestsRegistries() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we pass the test registry into the integration/e2e tests rather than using a global registry this way?
Otherwise, I think this is just adding an extra step to the same pattern as #1667 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately, that won't work with ginkgo. we need the tests to be available in the GetTestRegistries
( or another global variable ) by the time this method is being invoked.
What I can do is to set this to be a function placeholder that would later on invoke the various tests. However, that would not be a ginkgo
node and any failure on these tests would not be reported correctly.
func (i *instance) confirmTx(ctx context.Context, txid ids.ID) error { | ||
lastAcceptedHeight, err := i.vm.GetLastAcceptedHeight() | ||
if err != nil { | ||
return err | ||
} | ||
lastAcceptedBlockID, err := i.vm.GetBlockHeightID(lastAcceptedHeight) | ||
if err != nil { | ||
return err | ||
} | ||
blk, err := i.vm.GetBlock(ctx, lastAcceptedBlockID) | ||
if err != nil { | ||
return err | ||
} | ||
for { | ||
stflBlk, ok := blk.(*chain.StatefulBlock) | ||
if !ok { | ||
return ErrTxNotFound | ||
} | ||
for _, tx := range stflBlk.StatelessBlock.Txs { | ||
if tx.ID() == txid { | ||
// found. | ||
return nil | ||
} | ||
} | ||
// keep iterating backward. | ||
lastAcceptedBlockID = blk.Parent() | ||
blk, err = i.vm.GetBlock(ctx, lastAcceptedBlockID) | ||
if err != nil { | ||
return ErrTxNotFound | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we switch to using the indexer API here instead so we don't need a manual search?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wasn't the intent of having the integration
tests was to bypass the indexer and all other rpc endpoints ?
( in contrast to the e2e tests )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think there's any need to explicitly avoid rpc endpoints. The integration tests should enable us to test the same logic much faster than starting a full e2e network by running all the VMs in a single process and skipping the overhead of running a full e2e network.
Co-authored-by: aaronbuchwald <aaron.buchwald56@gmail.com> Signed-off-by: Tsachi Herman <24438559+tsachiherman@users.noreply.github.com>
…to tsachi/proc-testing
// TestsRegistry is global tests registry instance where all the tests are to be registered. Each VM would typically have only | ||
// a single instance of such a registry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// TestsRegistry is global tests registry instance where all the tests are to be registered. Each VM would typically have only | |
// a single instance of such a registry. | |
// Global test registry initialized during init to ensure tests are identical during ginkgo | |
// tree construction and test execution | |
// ref https://onsi.github.io/ginkgo/#mental-model-how-ginkgo-traverses-the-spec-hierarchy |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
// a single instance of such a registry. | ||
var TestsRegistry = ®istry.Registry{} | ||
|
||
var _ = registry.Register(TestsRegistry, "Transfer Transaction", func(t ginkgo.FullGinkgoTInterface, tn tworkload.TestNetwork) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we are using require
internally can we remove the returned error?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
tests/e2e/e2e.go
Outdated
var _ = ginkgo.Describe("[Custom VM Tests]", ginkgo.Serial, func() { | ||
tc := e2e.NewTestContext() | ||
require := require.New(tc) | ||
|
||
for testRegistry := range registry.GetTestsRegistries() { | ||
for _, test := range testRegistry.List() { | ||
ginkgo.It(test.Name, func() { | ||
testNetwork := NewNetwork(tc) | ||
require.NoError(test.Fnc(ginkgo.GinkgoT(), testNetwork), "Test %s failed with an error", test.Name) | ||
}) | ||
} | ||
} | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm so I think the only requirement is that we populate it via a global/init function rather than in BeforeSuite
or SynchronizedBeforeSuite
as we do now.
Could we get rid of the nested for loop here in favor of a single registry of tests and remove the map[*Registry]bool
type? This should satisfy registering tests as globals for ginkgo and remove the extra loop.
tests/e2e/network.go
Outdated
) | ||
|
||
type Network struct { | ||
nodes []*Node |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we remove the node type completely? It seems that it just uses the URI and the reference to the network's parser to generate a tx, which is not specific to the node. I think we could just get rid of this construct completely and only have the network type.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
func (i *instance) confirmTx(ctx context.Context, txid ids.ID) error { | ||
lastAcceptedHeight, err := i.vm.GetLastAcceptedHeight() | ||
if err != nil { | ||
return err | ||
} | ||
lastAcceptedBlockID, err := i.vm.GetBlockHeightID(lastAcceptedHeight) | ||
if err != nil { | ||
return err | ||
} | ||
blk, err := i.vm.GetBlock(ctx, lastAcceptedBlockID) | ||
if err != nil { | ||
return err | ||
} | ||
for { | ||
stflBlk, ok := blk.(*chain.StatefulBlock) | ||
if !ok { | ||
return ErrTxNotFound | ||
} | ||
for _, tx := range stflBlk.StatelessBlock.Txs { | ||
if tx.ID() == txid { | ||
// found. | ||
return nil | ||
} | ||
} | ||
// keep iterating backward. | ||
lastAcceptedBlockID = blk.Parent() | ||
blk, err = i.vm.GetBlock(ctx, lastAcceptedBlockID) | ||
if err != nil { | ||
return ErrTxNotFound | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think there's any need to explicitly avoid rpc endpoints. The integration tests should enable us to test the same logic much faster than starting a full e2e network by running all the VMs in a single process and skipping the overhead of running a full e2e network.
tests/e2e/network.go
Outdated
testNetwork.nodes = append(testNetwork.nodes, n) | ||
} | ||
testNetwork.parser = &parser{ | ||
Parser: networkConfig.Parser(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add a comment on the parser
type explaining why we need to wrap the chain.Parser
type that is already passed in? As I understand it, this is because we cannot currently know the blockchainID in advance since it's the hash of the transaction on the P-Chain that will create the chain.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes. I'll add some comments around that.
tests/e2e/network.go
Outdated
return networkConfig | ||
} | ||
|
||
type Node struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we remove the Node
type? This seems to only be used to keep a list of uris and then a pass through back to the network, so I think we can just keep the URIs on the network and move GenerateTx
to be a function directly on the network.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
tests/e2e/network.go
Outdated
func (n *Network) ConfirmTxs(ctx context.Context, txs []*chain.Transaction) error { | ||
err := n.nodes[0].confirmTxs(ctx, txs) | ||
if err != nil { | ||
return err | ||
} | ||
var targetHeight uint64 | ||
// check the accepted block height on all blocks. | ||
for nodeIdx := 0; nodeIdx < len(n.nodes); nodeIdx++ { | ||
_, nodeHeight, _, err := n.nodes[nodeIdx].accepted(ctx) | ||
if err != nil { | ||
return err | ||
} | ||
if nodeIdx == 0 { | ||
// since we've already confirmed the tx on this node, just use the height as the target. | ||
targetHeight = nodeHeight | ||
} else if nodeHeight < targetHeight { | ||
// take a short delay and try again. | ||
select { | ||
case <-ctx.Done(): | ||
return ctx.Err() | ||
case <-time.After(txCheckInterval): | ||
} | ||
nodeIdx-- // try again the same node. | ||
continue | ||
} | ||
} | ||
return nil | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
func (n *Network) ConfirmTxs(ctx context.Context, txs []*chain.Transaction) error { | |
err := n.nodes[0].confirmTxs(ctx, txs) | |
if err != nil { | |
return err | |
} | |
var targetHeight uint64 | |
// check the accepted block height on all blocks. | |
for nodeIdx := 0; nodeIdx < len(n.nodes); nodeIdx++ { | |
_, nodeHeight, _, err := n.nodes[nodeIdx].accepted(ctx) | |
if err != nil { | |
return err | |
} | |
if nodeIdx == 0 { | |
// since we've already confirmed the tx on this node, just use the height as the target. | |
targetHeight = nodeHeight | |
} else if nodeHeight < targetHeight { | |
// take a short delay and try again. | |
select { | |
case <-ctx.Done(): | |
return ctx.Err() | |
case <-time.After(txCheckInterval): | |
} | |
nodeIdx-- // try again the same node. | |
continue | |
} | |
} | |
return nil | |
} | |
func (n *Network) ConfirmTxs(ctx context.Context, txs []*chain.Transaction) error { | |
c := jsonrpc.NewJSONRPCClient(n.uris[0]) | |
for _, tx := range txs { | |
_, err := c.SubmitTx(ctx, tx.Bytes()) | |
if err != nil { | |
return err | |
} | |
} | |
indexerCli := indexer.NewClient(n.uris[0]) | |
for _, tx := range txs { | |
success, _, err := indexerCli.WaitForTransaction(ctx, txCheckInterval, tx.ID()) | |
if err != nil { | |
return err | |
} | |
if !success { | |
return ErrUnableToConfirmTx | |
} | |
} | |
_, targetHeight, _, err := c.Accepted(ctx) | |
if err != nil { | |
return err | |
} | |
for _, uri := range n.uris[1:] { | |
if err := jsonrpc.Wait(ctx, txCheckInterval, func(ctx context.Context) (bool, error) { | |
c := jsonrpc.NewJSONRPCClient(uri) | |
_, nodeHeight, _, err := c.Accepted(ctx) | |
if err != nil { | |
return false, err | |
} | |
return nodeHeight >= targetHeight, nil | |
}); err != nil { | |
return err | |
} | |
} | |
return nil | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
// we need to pre-register all the test registries that are created externally in order to comply with the ginko execution order. | ||
// i.e. the global `var _ = ginkgo.Describe` used in the integration/e2e tests need to have this field populated before the iteration | ||
// over the top level nodes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we avoid this by setting this in a global variable / setting via init
function so that it's identical during test construction and execution?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that it is identical during test construction and execution.
Not sure how to implement that so that it would work ginkgo
otherwise, as ginkgo
is managing these in globals as well ( but keep them internal )
tests/integration/network.go
Outdated
for i := 0; i < len(instances); i++ { | ||
if i == biggestHeightInstanceIndex { | ||
continue | ||
} | ||
vm := instances[i].vm | ||
for { | ||
height, err := vm.GetLastAcceptedHeight() | ||
if err != nil { | ||
return err | ||
} | ||
if height == biggestHeight { | ||
break | ||
} | ||
statefulBlock, err := instances[biggestHeightInstanceIndex].vm.GetDiskBlock(ctx, height+1) | ||
if err != nil { | ||
return err | ||
} | ||
err = vm.SetPreference(ctx, statefulBlock.ID()) | ||
if err != nil { | ||
return err | ||
} | ||
blk, err := vm.ParseBlock(ctx, statefulBlock.Bytes()) | ||
if err != nil { | ||
return err | ||
} | ||
err = blk.Verify(ctx) | ||
if err != nil { | ||
return err | ||
} | ||
err = blk.Accept(ctx) | ||
if err != nil { | ||
return err | ||
} | ||
if instances[i].onAccept != nil { | ||
instances[i].onAccept(blk) | ||
} | ||
} | ||
} | ||
return nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for i := 0; i < len(instances); i++ { | |
if i == biggestHeightInstanceIndex { | |
continue | |
} | |
vm := instances[i].vm | |
for { | |
height, err := vm.GetLastAcceptedHeight() | |
if err != nil { | |
return err | |
} | |
if height == biggestHeight { | |
break | |
} | |
statefulBlock, err := instances[biggestHeightInstanceIndex].vm.GetDiskBlock(ctx, height+1) | |
if err != nil { | |
return err | |
} | |
err = vm.SetPreference(ctx, statefulBlock.ID()) | |
if err != nil { | |
return err | |
} | |
blk, err := vm.ParseBlock(ctx, statefulBlock.Bytes()) | |
if err != nil { | |
return err | |
} | |
err = blk.Verify(ctx) | |
if err != nil { | |
return err | |
} | |
err = blk.Accept(ctx) | |
if err != nil { | |
return err | |
} | |
if instances[i].onAccept != nil { | |
instances[i].onAccept(blk) | |
} | |
} | |
} | |
return nil | |
for i := 0; i < len(instances); i++ { | |
if i == biggestHeightInstanceIndex { | |
continue | |
} | |
instance := instances[i] | |
for { | |
height, err := instance.vm.GetLastAcceptedHeight() | |
if err != nil { | |
return err | |
} | |
if height == biggestHeight { | |
break | |
} | |
statefulBlock, err := instances[biggestHeightInstanceIndex].vm.GetDiskBlock(ctx, height+1) | |
if err != nil { | |
return err | |
} | |
if err := instance.applyBlk(ctx, statefulBlock); err != nil { | |
return err | |
} | |
} | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
…to tsachi/proc-testing
commit b2ad4d3 Author: Tsachi Herman <24438559+tsachiherman@users.noreply.github.com> Date: Sun Nov 3 16:01:37 2024 -0500 support procedural test style for VM-defined workloads (#1667) Signed-off-by: Tsachi Herman <24438559+tsachiherman@users.noreply.github.com> commit dbcc6c9 Author: Richard Pringle <richard.pringle@avalabs.org> Date: Thu Oct 31 16:42:44 2024 -0400 Update wasmtime-go (#1705) commit 1015ae1 Author: Sam Liokumovich <65994425+samliok@users.noreply.github.com> Date: Thu Oct 31 12:47:45 2024 -0400 Remove HRP + Decimals dead code (#1703) commit 24bacf8 Author: Sam Liokumovich <65994425+samliok@users.noreply.github.com> Date: Wed Oct 30 10:31:38 2024 -0400 Action Test Reusing Store (#1700) commit 1ce6ad8 Author: Richard Pringle <richard.pringle@avalabs.org> Date: Tue Oct 29 13:23:56 2024 -0400 Don't benchmark serializing parameters (#1697) commit 1c43f7e Author: Sam Liokumovich <65994425+samliok@users.noreply.github.com> Date: Tue Oct 29 13:16:34 2024 -0400 Call Contract Benchmarks (#1696) commit 7bd1a49 Author: nathan haim <haim.nathan@icloud.com> Date: Sat Oct 26 20:41:26 2024 +0200 state: Make state.Keys JSON human readable (#1661) Signed-off-by: nathan haim <nathan.haim@free.fr> commit c592a1d Author: rodrigo <77309055+RodrigoVillar@users.noreply.github.com> Date: Fri Oct 25 14:02:08 2024 -0400 Add `balance` cmd to CLI (#1691) commit 7fac7fa Author: Sam Liokumovich <65994425+samliok@users.noreply.github.com> Date: Fri Oct 25 13:28:52 2024 -0400 Default Contract Manager Implementation (#1687) commit 0459bd4 Author: rodrigo <77309055+RodrigoVillar@users.noreply.github.com> Date: Fri Oct 25 12:23:04 2024 -0400 Add Getter to `BalanceHandler` (#1685) commit 960b790 Author: containerman17 <8990432+containerman17@users.noreply.github.com> Date: Sat Oct 26 00:14:29 2024 +0900 Universal CLI (#1662) Creates a single binary that can be used with any HyperSDK VM, as long as the VM uses standard functionality. Signed-off-by: containerman17 <8990432+containerman17@users.noreply.github.com> Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> Co-authored-by: Aaron Buchwald <aaron.buchwald56@gmail.com> commit ef66271 Author: Richard Pringle <richard.pringle@avalabs.org> Date: Thu Oct 24 15:45:17 2024 -0400 Move vmwithcontracts out of examples (#1676) commit 3895ff5 Author: Richard Pringle <richard.pringle@avalabs.org> Date: Thu Oct 24 14:59:57 2024 -0400 Implement NFT example (#1684) commit 82dc621 Author: rodrigo <77309055+RodrigoVillar@users.noreply.github.com> Date: Thu Oct 24 09:54:31 2024 -0400 Add back `actionID` to `StateKeys()` (#1683) commit cf6d48a Author: Richard Pringle <richard.pringle@avalabs.org> Date: Wed Oct 23 15:11:25 2024 -0400 Force test-context to be initialized with an actor (#1682) commit 1a3c670 Author: Sam Liokumovich <65994425+samliok@users.noreply.github.com> Date: Wed Oct 23 14:26:09 2024 -0400 Refactor Workload (#1668) Signed-off-by: Sam Liokumovich <65994425+samliok@users.noreply.github.com> Co-authored-by: aaronbuchwald <aaron.buchwald56@gmail.com> commit 403bfb3 Author: rodrigo <77309055+RodrigoVillar@users.noreply.github.com> Date: Tue Oct 22 21:56:25 2024 -0400 Decouple State Manager (#1658) commit 61993f8 Author: Richard Pringle <richard.pringle@avalabs.org> Date: Mon Oct 21 14:25:25 2024 -0400 Revert "Make Morpheus build script take optional path (#1671)" (#1673) commit 87cf88a Author: aaronbuchwald <aaron.buchwald56@gmail.com> Date: Mon Oct 21 12:39:13 2024 -0400 Update min go version to go1.22.8 (#1672) commit 22241f5 Author: Richard Pringle <richard.pringle@avalabs.org> Date: Fri Oct 18 14:18:53 2024 -0400 Make Morpheus build script take optional path (#1671) commit 0658976 Author: Richard Pringle <richard.pringle@avalabs.org> Date: Wed Oct 16 18:37:50 2024 -0400 Move runtime tests into contracts-ci (#1666) commit e3d911a Author: Sam Liokumovich <65994425+samliok@users.noreply.github.com> Date: Sun Oct 13 17:45:32 2024 -0400 Remove global variables from spam script (#1659) commit bca7739 Author: Tsachi Herman <24438559+tsachiherman@users.noreply.github.com> Date: Fri Oct 11 11:41:27 2024 -0400 Create SignedTransaction out of the existing Transaction (#1640) commit 6f15b2f Author: Sam Liokumovich <65994425+samliok@users.noreply.github.com> Date: Thu Oct 10 20:47:49 2024 -0400 Include Spam Config Defaults (#1657) commit b3713a1 Author: Sam Liokumovich <65994425+samliok@users.noreply.github.com> Date: Thu Oct 10 20:16:23 2024 -0400 Separate Spam Broadcast Functionality (#1653) commit 182e023 Author: Sam Liokumovich <65994425+samliok@users.noreply.github.com> Date: Thu Oct 10 18:19:44 2024 -0400 Decouple Spam Functionality from CLI into Throughput Package (#1636) commit b8104ac Author: aaronbuchwald <aaron.buchwald56@gmail.com> Date: Thu Oct 10 14:44:08 2024 -0400 Fix incorrect naming of stateless block (#1652) commit 725a589 Author: aaronbuchwald <aaron.buchwald56@gmail.com> Date: Thu Oct 10 10:12:59 2024 -0400 Use CreateActionID to give simulated actions unique actionID (#1644) commit 0a2d991 Author: aaronbuchwald <aaron.buchwald56@gmail.com> Date: Thu Oct 10 09:57:25 2024 -0400 Update ActionRegistry to ActionCodec (#1650) commit 829b991 Author: containerman17 <8990432+containerman17@users.noreply.github.com> Date: Thu Oct 10 22:42:19 2024 +0900 Reflect Marshaler (#1592) Signed-off-by: containerman17 <8990432+containerman17@users.noreply.github.com> commit b3c991f Author: Tsachi Herman <24438559+tsachiherman@users.noreply.github.com> Date: Thu Oct 10 09:36:21 2024 -0400 add simulateTransaction endpoint (#1610) Signed-off-by: Tsachi Herman <24438559+tsachiherman@users.noreply.github.com> commit cbb6a33 Author: containerman17 <8990432+containerman17@users.noreply.github.com> Date: Thu Oct 10 22:24:22 2024 +0900 Add boolean support to the ABI spec (#1648) Signed-off-by: containerman17 <8990432+containerman17@users.noreply.github.com> commit 5d8c590 Author: Sam Liokumovich <65994425+samliok@users.noreply.github.com> Date: Thu Oct 10 09:21:46 2024 -0400 Remove marshaling from transfer action (#1647) commit b934dbd Author: Joshua Kim <20001595+joshua-kim@users.noreply.github.com> Date: Wed Oct 9 16:52:29 2024 -0400 Remove type alias for Action + Auth + Output Registry (#1547) Signed-off-by: Joshua Kim <20001595+joshua-kim@users.noreply.github.com> commit b5407c9 Author: containerman17 <8990432+containerman17@users.noreply.github.com> Date: Thu Oct 10 00:45:38 2024 +0900 Simulate a chain of actions (#1635) commit fee360f Author: Tsachi Herman <24438559+tsachiherman@users.noreply.github.com> Date: Fri Oct 4 11:23:58 2024 -0400 refactor marshalActions implementation (#1631) commit 2cb5530 Author: aaronbuchwald <aaron.buchwald56@gmail.com> Date: Thu Oct 3 18:49:12 2024 -0400 Add block indexing to Indexer API (#1606) commit f1bcc59 Author: aaronbuchwald <aaron.buchwald56@gmail.com> Date: Thu Oct 3 18:31:39 2024 -0400 Add JSON marshalling to Result (#1627) commit 2ea784a Author: Richard Pringle <richard.pringle@avalabs.org> Date: Thu Oct 3 12:54:10 2024 -0400 Implement multisig example (#1581) commit 6bbf236 Author: Richard Pringle <richard.pringle@avalabs.org> Date: Thu Oct 3 12:43:41 2024 -0400 Update codeowners (#1629) commit 47849d8 Author: aaronbuchwald <aaron.buchwald56@gmail.com> Date: Thu Oct 3 08:34:51 2024 -0400 Re-mark pubsub tests as flaky (#1625) commit d847132 Author: aaronbuchwald <aaron.buchwald56@gmail.com> Date: Wed Oct 2 14:23:24 2024 -0400 Reduce tests.unit.sh timeout value less than CI job (#1623) commit 404e74f Author: aaronbuchwald <aaron.buchwald56@gmail.com> Date: Wed Oct 2 14:07:04 2024 -0400 Add JSON marshalling for fee dimensions (#1622) commit 7e53003 Author: Joshua Kim <20001595+joshua-kim@users.noreply.github.com> Date: Wed Oct 2 12:38:34 2024 -0400 Replace usage of `internal/network` with `p2p` (#1613) Signed-off-by: Joshua Kim <20001595+joshua-kim@users.noreply.github.com> commit 79f363e Author: containerman17 <8990432+containerman17@users.noreply.github.com> Date: Wed Oct 2 11:53:59 2024 +0900 Standardize decimals (#1620) commit e191c88 Author: Joshua Kim <20001595+joshua-kim@users.noreply.github.com> Date: Tue Oct 1 20:02:30 2024 -0400 Update to avalanchego@v1.11.12-rc.2 (#1614) Signed-off-by: Joshua Kim <20001595+joshua-kim@users.noreply.github.com> commit 59c84d7 Author: aaronbuchwald <aaron.buchwald56@gmail.com> Date: Tue Oct 1 17:19:17 2024 -0400 Add ExecutedBlock type (#1601) commit 165a455 Author: Tsachi Herman <24438559+tsachiherman@users.noreply.github.com> Date: Tue Oct 1 09:26:32 2024 -0400 validate buffer length prior to calling Uint64 (#1588) commit c24f0d8 Author: rodrigo <77309055+RodrigoVillar@users.noreply.github.com> Date: Tue Oct 1 09:25:18 2024 -0400 Fix VM-With-Contracts Unit Tests (#1602) commit 8ab9d83 Author: aaronbuchwald <aaron.buchwald56@gmail.com> Date: Mon Sep 30 16:57:29 2024 -0400 Minor nits on pubsub implementation (#1593) commit 592cd7a Author: rodrigo <77309055+RodrigoVillar@users.noreply.github.com> Date: Mon Sep 30 12:46:35 2024 -0400 Remove `StateKeysMaxChunks()` (#1607) commit 3e358c1 Author: aaronbuchwald <aaron.buchwald56@gmail.com> Date: Mon Sep 30 12:46:20 2024 -0400 Update ActionBenchmark to use single ExpectedOutput (#1608) commit e78841e Author: Franfran <51274081+iFrostizz@users.noreply.github.com> Date: Mon Sep 30 16:42:00 2024 +0200 Write FIFO cache unit tests (#1201) * write FIFO cache unit tests * invert expected / actual * add limit parameter and cache fail on 0 size * simplify test table and create new test for empty cache * simpler tests by having a limit of 2 * fix test cases * typos * backout uselesss change * add a "not an LRU" test case * use switch in fifo unit tests commit f1150a1 Author: aaronbuchwald <aaron.buchwald56@gmail.com> Date: Fri Sep 27 17:46:28 2024 -0400 Update tx indexer to include tx action outputs (#1597) commit 6a3fd63 Author: Joshua Kim <20001595+joshua-kim@users.noreply.github.com> Date: Thu Sep 26 15:44:56 2024 -0400 Remove usage of mockgen (#1591) Signed-off-by: Joshua Kim <20001595+joshua-kim@users.noreply.github.com> commit 49376bd Author: rodrigo <77309055+RodrigoVillar@users.noreply.github.com> Date: Thu Sep 26 14:39:59 2024 -0400 Fix benchmarks (#1590) commit 77a73ba Author: Richard Pringle <richard.pringle@avalabs.org> Date: Tue Sep 24 12:38:27 2024 -0400 Ignore gas on mock-function-call (#1585) commit 1bbab7b Author: containerman17 <8990432+containerman17@users.noreply.github.com> Date: Tue Sep 24 23:19:18 2024 +0900 Remove special cases for Bytes, add arrays support (#1587) commit 3410599 Author: aaronbuchwald <aaron.buchwald56@gmail.com> Date: Mon Sep 23 12:34:55 2024 -0400 Add spam cmd to morpheus readme (#1577) commit dfefd27 Author: aaronbuchwald <aaron.buchwald56@gmail.com> Date: Mon Sep 23 12:34:32 2024 -0400 Improve chain comments (#1579) commit 6c15244 Author: Richard Pringle <richard.pringle@avalabs.org> Date: Fri Sep 20 16:10:21 2024 -0400 Series of changes that improve development (#1583) commit e0a3324 Author: Richard Pringle <richard.pringle@avalabs.org> Date: Fri Sep 20 13:12:58 2024 -0400 Use repr(packed) with state-keys (#1580) commit 75c6cfd Author: aaronbuchwald <aaron.buchwald56@gmail.com> Date: Thu Sep 19 07:58:39 2024 -0400 Separate proposer monitor from vm into internal package (#1574) Signed-off-by: Joshua Kim <20001595+joshua-kim@users.noreply.github.com>
commit b2ad4d3 Author: Tsachi Herman <24438559+tsachiherman@users.noreply.github.com> Date: Sun Nov 3 16:01:37 2024 -0500 support procedural test style for VM-defined workloads (#1667) Signed-off-by: Tsachi Herman <24438559+tsachiherman@users.noreply.github.com> commit dbcc6c9 Author: Richard Pringle <richard.pringle@avalabs.org> Date: Thu Oct 31 16:42:44 2024 -0400 Update wasmtime-go (#1705) commit 1015ae1 Author: Sam Liokumovich <65994425+samliok@users.noreply.github.com> Date: Thu Oct 31 12:47:45 2024 -0400 Remove HRP + Decimals dead code (#1703) commit 24bacf8 Author: Sam Liokumovich <65994425+samliok@users.noreply.github.com> Date: Wed Oct 30 10:31:38 2024 -0400 Action Test Reusing Store (#1700) commit 1ce6ad8 Author: Richard Pringle <richard.pringle@avalabs.org> Date: Tue Oct 29 13:23:56 2024 -0400 Don't benchmark serializing parameters (#1697) commit 1c43f7e Author: Sam Liokumovich <65994425+samliok@users.noreply.github.com> Date: Tue Oct 29 13:16:34 2024 -0400 Call Contract Benchmarks (#1696) commit 7bd1a49 Author: nathan haim <haim.nathan@icloud.com> Date: Sat Oct 26 20:41:26 2024 +0200 state: Make state.Keys JSON human readable (#1661) Signed-off-by: nathan haim <nathan.haim@free.fr> commit c592a1d Author: rodrigo <77309055+RodrigoVillar@users.noreply.github.com> Date: Fri Oct 25 14:02:08 2024 -0400 Add `balance` cmd to CLI (#1691) commit 7fac7fa Author: Sam Liokumovich <65994425+samliok@users.noreply.github.com> Date: Fri Oct 25 13:28:52 2024 -0400 Default Contract Manager Implementation (#1687) commit 0459bd4 Author: rodrigo <77309055+RodrigoVillar@users.noreply.github.com> Date: Fri Oct 25 12:23:04 2024 -0400 Add Getter to `BalanceHandler` (#1685) commit 960b790 Author: containerman17 <8990432+containerman17@users.noreply.github.com> Date: Sat Oct 26 00:14:29 2024 +0900 Universal CLI (#1662) Creates a single binary that can be used with any HyperSDK VM, as long as the VM uses standard functionality. Signed-off-by: containerman17 <8990432+containerman17@users.noreply.github.com> Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> Co-authored-by: Aaron Buchwald <aaron.buchwald56@gmail.com> commit ef66271 Author: Richard Pringle <richard.pringle@avalabs.org> Date: Thu Oct 24 15:45:17 2024 -0400 Move vmwithcontracts out of examples (#1676) commit 3895ff5 Author: Richard Pringle <richard.pringle@avalabs.org> Date: Thu Oct 24 14:59:57 2024 -0400 Implement NFT example (#1684) commit 82dc621 Author: rodrigo <77309055+RodrigoVillar@users.noreply.github.com> Date: Thu Oct 24 09:54:31 2024 -0400 Add back `actionID` to `StateKeys()` (#1683) commit cf6d48a Author: Richard Pringle <richard.pringle@avalabs.org> Date: Wed Oct 23 15:11:25 2024 -0400 Force test-context to be initialized with an actor (#1682) commit 1a3c670 Author: Sam Liokumovich <65994425+samliok@users.noreply.github.com> Date: Wed Oct 23 14:26:09 2024 -0400 Refactor Workload (#1668) Signed-off-by: Sam Liokumovich <65994425+samliok@users.noreply.github.com> Co-authored-by: aaronbuchwald <aaron.buchwald56@gmail.com> commit 403bfb3 Author: rodrigo <77309055+RodrigoVillar@users.noreply.github.com> Date: Tue Oct 22 21:56:25 2024 -0400 Decouple State Manager (#1658) commit 61993f8 Author: Richard Pringle <richard.pringle@avalabs.org> Date: Mon Oct 21 14:25:25 2024 -0400 Revert "Make Morpheus build script take optional path (#1671)" (#1673) commit 87cf88a Author: aaronbuchwald <aaron.buchwald56@gmail.com> Date: Mon Oct 21 12:39:13 2024 -0400 Update min go version to go1.22.8 (#1672) commit 22241f5 Author: Richard Pringle <richard.pringle@avalabs.org> Date: Fri Oct 18 14:18:53 2024 -0400 Make Morpheus build script take optional path (#1671) commit 0658976 Author: Richard Pringle <richard.pringle@avalabs.org> Date: Wed Oct 16 18:37:50 2024 -0400 Move runtime tests into contracts-ci (#1666) commit e3d911a Author: Sam Liokumovich <65994425+samliok@users.noreply.github.com> Date: Sun Oct 13 17:45:32 2024 -0400 Remove global variables from spam script (#1659) commit bca7739 Author: Tsachi Herman <24438559+tsachiherman@users.noreply.github.com> Date: Fri Oct 11 11:41:27 2024 -0400 Create SignedTransaction out of the existing Transaction (#1640) commit 6f15b2f Author: Sam Liokumovich <65994425+samliok@users.noreply.github.com> Date: Thu Oct 10 20:47:49 2024 -0400 Include Spam Config Defaults (#1657) commit b3713a1 Author: Sam Liokumovich <65994425+samliok@users.noreply.github.com> Date: Thu Oct 10 20:16:23 2024 -0400 Separate Spam Broadcast Functionality (#1653) commit 182e023 Author: Sam Liokumovich <65994425+samliok@users.noreply.github.com> Date: Thu Oct 10 18:19:44 2024 -0400 Decouple Spam Functionality from CLI into Throughput Package (#1636) commit b8104ac Author: aaronbuchwald <aaron.buchwald56@gmail.com> Date: Thu Oct 10 14:44:08 2024 -0400 Fix incorrect naming of stateless block (#1652) commit 725a589 Author: aaronbuchwald <aaron.buchwald56@gmail.com> Date: Thu Oct 10 10:12:59 2024 -0400 Use CreateActionID to give simulated actions unique actionID (#1644) commit 0a2d991 Author: aaronbuchwald <aaron.buchwald56@gmail.com> Date: Thu Oct 10 09:57:25 2024 -0400 Update ActionRegistry to ActionCodec (#1650) commit 829b991 Author: containerman17 <8990432+containerman17@users.noreply.github.com> Date: Thu Oct 10 22:42:19 2024 +0900 Reflect Marshaler (#1592) Signed-off-by: containerman17 <8990432+containerman17@users.noreply.github.com> commit b3c991f Author: Tsachi Herman <24438559+tsachiherman@users.noreply.github.com> Date: Thu Oct 10 09:36:21 2024 -0400 add simulateTransaction endpoint (#1610) Signed-off-by: Tsachi Herman <24438559+tsachiherman@users.noreply.github.com> commit cbb6a33 Author: containerman17 <8990432+containerman17@users.noreply.github.com> Date: Thu Oct 10 22:24:22 2024 +0900 Add boolean support to the ABI spec (#1648) Signed-off-by: containerman17 <8990432+containerman17@users.noreply.github.com> commit 5d8c590 Author: Sam Liokumovich <65994425+samliok@users.noreply.github.com> Date: Thu Oct 10 09:21:46 2024 -0400 Remove marshaling from transfer action (#1647) commit b934dbd Author: Joshua Kim <20001595+joshua-kim@users.noreply.github.com> Date: Wed Oct 9 16:52:29 2024 -0400 Remove type alias for Action + Auth + Output Registry (#1547) Signed-off-by: Joshua Kim <20001595+joshua-kim@users.noreply.github.com> commit b5407c9 Author: containerman17 <8990432+containerman17@users.noreply.github.com> Date: Thu Oct 10 00:45:38 2024 +0900 Simulate a chain of actions (#1635) commit fee360f Author: Tsachi Herman <24438559+tsachiherman@users.noreply.github.com> Date: Fri Oct 4 11:23:58 2024 -0400 refactor marshalActions implementation (#1631) commit 2cb5530 Author: aaronbuchwald <aaron.buchwald56@gmail.com> Date: Thu Oct 3 18:49:12 2024 -0400 Add block indexing to Indexer API (#1606) commit f1bcc59 Author: aaronbuchwald <aaron.buchwald56@gmail.com> Date: Thu Oct 3 18:31:39 2024 -0400 Add JSON marshalling to Result (#1627) commit 2ea784a Author: Richard Pringle <richard.pringle@avalabs.org> Date: Thu Oct 3 12:54:10 2024 -0400 Implement multisig example (#1581) commit 6bbf236 Author: Richard Pringle <richard.pringle@avalabs.org> Date: Thu Oct 3 12:43:41 2024 -0400 Update codeowners (#1629) commit 47849d8 Author: aaronbuchwald <aaron.buchwald56@gmail.com> Date: Thu Oct 3 08:34:51 2024 -0400 Re-mark pubsub tests as flaky (#1625) commit d847132 Author: aaronbuchwald <aaron.buchwald56@gmail.com> Date: Wed Oct 2 14:23:24 2024 -0400 Reduce tests.unit.sh timeout value less than CI job (#1623) commit 404e74f Author: aaronbuchwald <aaron.buchwald56@gmail.com> Date: Wed Oct 2 14:07:04 2024 -0400 Add JSON marshalling for fee dimensions (#1622) commit 7e53003 Author: Joshua Kim <20001595+joshua-kim@users.noreply.github.com> Date: Wed Oct 2 12:38:34 2024 -0400 Replace usage of `internal/network` with `p2p` (#1613) Signed-off-by: Joshua Kim <20001595+joshua-kim@users.noreply.github.com> commit 79f363e Author: containerman17 <8990432+containerman17@users.noreply.github.com> Date: Wed Oct 2 11:53:59 2024 +0900 Standardize decimals (#1620) commit e191c88 Author: Joshua Kim <20001595+joshua-kim@users.noreply.github.com> Date: Tue Oct 1 20:02:30 2024 -0400 Update to avalanchego@v1.11.12-rc.2 (#1614) Signed-off-by: Joshua Kim <20001595+joshua-kim@users.noreply.github.com> commit 59c84d7 Author: aaronbuchwald <aaron.buchwald56@gmail.com> Date: Tue Oct 1 17:19:17 2024 -0400 Add ExecutedBlock type (#1601) commit 165a455 Author: Tsachi Herman <24438559+tsachiherman@users.noreply.github.com> Date: Tue Oct 1 09:26:32 2024 -0400 validate buffer length prior to calling Uint64 (#1588) commit c24f0d8 Author: rodrigo <77309055+RodrigoVillar@users.noreply.github.com> Date: Tue Oct 1 09:25:18 2024 -0400 Fix VM-With-Contracts Unit Tests (#1602) commit 8ab9d83 Author: aaronbuchwald <aaron.buchwald56@gmail.com> Date: Mon Sep 30 16:57:29 2024 -0400 Minor nits on pubsub implementation (#1593) commit 592cd7a Author: rodrigo <77309055+RodrigoVillar@users.noreply.github.com> Date: Mon Sep 30 12:46:35 2024 -0400 Remove `StateKeysMaxChunks()` (#1607) commit 3e358c1 Author: aaronbuchwald <aaron.buchwald56@gmail.com> Date: Mon Sep 30 12:46:20 2024 -0400 Update ActionBenchmark to use single ExpectedOutput (#1608) commit e78841e Author: Franfran <51274081+iFrostizz@users.noreply.github.com> Date: Mon Sep 30 16:42:00 2024 +0200 Write FIFO cache unit tests (#1201) * write FIFO cache unit tests * invert expected / actual * add limit parameter and cache fail on 0 size * simplify test table and create new test for empty cache * simpler tests by having a limit of 2 * fix test cases * typos * backout uselesss change * add a "not an LRU" test case * use switch in fifo unit tests commit f1150a1 Author: aaronbuchwald <aaron.buchwald56@gmail.com> Date: Fri Sep 27 17:46:28 2024 -0400 Update tx indexer to include tx action outputs (#1597) commit 6a3fd63 Author: Joshua Kim <20001595+joshua-kim@users.noreply.github.com> Date: Thu Sep 26 15:44:56 2024 -0400 Remove usage of mockgen (#1591) Signed-off-by: Joshua Kim <20001595+joshua-kim@users.noreply.github.com> commit 49376bd Author: rodrigo <77309055+RodrigoVillar@users.noreply.github.com> Date: Thu Sep 26 14:39:59 2024 -0400 Fix benchmarks (#1590) commit 77a73ba Author: Richard Pringle <richard.pringle@avalabs.org> Date: Tue Sep 24 12:38:27 2024 -0400 Ignore gas on mock-function-call (#1585) commit 1bbab7b Author: containerman17 <8990432+containerman17@users.noreply.github.com> Date: Tue Sep 24 23:19:18 2024 +0900 Remove special cases for Bytes, add arrays support (#1587) commit 3410599 Author: aaronbuchwald <aaron.buchwald56@gmail.com> Date: Mon Sep 23 12:34:55 2024 -0400 Add spam cmd to morpheus readme (#1577) commit dfefd27 Author: aaronbuchwald <aaron.buchwald56@gmail.com> Date: Mon Sep 23 12:34:32 2024 -0400 Improve chain comments (#1579) commit 6c15244 Author: Richard Pringle <richard.pringle@avalabs.org> Date: Fri Sep 20 16:10:21 2024 -0400 Series of changes that improve development (#1583) commit e0a3324 Author: Richard Pringle <richard.pringle@avalabs.org> Date: Fri Sep 20 13:12:58 2024 -0400 Use repr(packed) with state-keys (#1580) commit 75c6cfd Author: aaronbuchwald <aaron.buchwald56@gmail.com> Date: Thu Sep 19 07:58:39 2024 -0400 Separate proposer monitor from vm into internal package (#1574) Signed-off-by: Joshua Kim <20001595+joshua-kim@users.noreply.github.com>
What ?
Add the infrastructure that would allow custom-VM to implement their own integration and e2e testing, outside of the workload design pattern.
Why ?
Custom networks might try to achieve different goals that could not easily be tested using the
workload
patten being used. The workload patten is great when we want to ensure that the custom-VM perform the hyper-SDK functionalities correctly. However, when aiming to test custom network functionalities, this testing model comes short.How would we solve that problem ?
Each VM would defined the following:
as well as one or more tests:
Then, when the e2e and integration tests would get executed, a new test node would be added
[Custom VM Tests]
which would invoke these custom test. The network would be the same network created during the e2e/integration tests.In order to get access to that network, the
workload.TestNetwork
would be used :The implementation of the
TestNetwork
depends on whether we're running e2e or integration testing.On integration testings, the ConfirmTxs would be executed against the underlying VM directly.
On e2e testings, the the ConfirmTxs would be implemented via the JSON RPC and Indexer.