Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
7b6df71
Progress on multi-chain cleanup
chriscandless Aug 6, 2025
65eea71
Progress on multi-chain cleanup
chriscandless Aug 8, 2025
333d272
Progress on multi-chain cleanup
chriscandless Aug 8, 2025
b38155e
Progress on multi-chain cleanup
chriscandless Aug 11, 2025
ecfb860
Progress on multi-chain cleanup
chriscandless Aug 11, 2025
f1ca9e0
Progress on multi-chain cleanup
chriscandless Aug 12, 2025
998382e
Merged with develop
chriscandless Aug 12, 2025
660ca79
Fixed build & lint
chriscandless Aug 12, 2025
be39c17
Fixed some of tests
chriscandless Aug 13, 2025
c1a6d08
Returned chain ID into off ledger request and call context
chriscandless Aug 18, 2025
5a2d030
Formatted with gufumpt
chriscandless Aug 18, 2025
ff73e98
Renamed chains into chainrunner; Returned chain ID into off ledger re…
chriscandless Aug 19, 2025
35295d0
Some renamings
chriscandless Aug 19, 2025
efa12b7
Removing some of unneeded changes
chriscandless Aug 19, 2025
f8eed0a
Removing some of unneeded changes
chriscandless Aug 20, 2025
f883b20
Removed chain provider; Renamed chains into chain runner or chain
chriscandless Aug 20, 2025
91d8986
More renamings; Removed some unneeded changes
chriscandless Aug 20, 2025
d98d907
Minor cleanup
chriscandless Aug 20, 2025
6a99957
Temporary reverted accessmanager dist folder
chriscandless Aug 20, 2025
c3e5738
Moving accessmgr dist folder
chriscandless Aug 20, 2025
4eb2df7
Changes to accessmgr dist files
chriscandless Aug 20, 2025
ebc929e
Removed unneeded changes
chriscandless Aug 20, 2025
f426251
Merged with develop
chriscandless Aug 22, 2025
d2899b6
Fixed test build
chriscandless Aug 22, 2025
69cef92
Fixed node startup
chriscandless Aug 22, 2025
dbc95b2
Fixed lint
chriscandless Aug 22, 2025
02ebe40
Fixed node startup with pre-deployed chain
chriscandless Aug 26, 2025
809552a
Fixed lint
chriscandless Sep 2, 2025
fdfc233
Merged with develop
chriscandless Sep 2, 2025
05c509d
Fixed some of the references to old "/chains/" routes
Sep 8, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion clients/apiclient/CorecontractsApi.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion clients/apiclient/api/openapi.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion clients/apiclient/api_corecontracts.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion clients/apiclient/apis/CorecontractsApi.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions clients/apiclient/types/ObjectParamAPI.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions clients/apiclient/types/ObservableAPI.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions clients/apiclient/types/PromiseAPI.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion clients/iota-go/hw_ledger/ledger-go/ledger_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ func Test_BasicExchange(t *testing.T) {

for i := 0; i < 10; i++ {
response, err := ledger.Exchange(message)

if err != nil {
fmt.Printf("iteration %d\n", i)
t.Fatalf("Error: %s", err.Error())
Expand Down
1 change: 0 additions & 1 deletion clients/iota-go/hw_ledger/ledger_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ func TestDeployChain(t *testing.T) {
require.NoError(t, err)

fmt.Println(result)

}

func TestSign(t *testing.T) {
Expand Down
12 changes: 7 additions & 5 deletions clients/iota-go/iotaclient/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,13 @@ type WaitParams struct {
DelayBetweenAttempts time.Duration
}

var WaitForEffectsDisabled *WaitParams = nil
var WaitForEffectsEnabled *WaitParams = &WaitParams{
Attempts: 5,
DelayBetweenAttempts: 2 * time.Second,
}
var (
WaitForEffectsDisabled *WaitParams = nil
WaitForEffectsEnabled *WaitParams = &WaitParams{
Attempts: 5,
DelayBetweenAttempts: 2 * time.Second,
}
)

type transport interface {
Call(ctx context.Context, v any, method iotaconn.JsonRPCMethod, args ...any) error
Expand Down
1 change: 0 additions & 1 deletion clients/iota-go/iotaconn/websocket.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ func NewWebsocketClient(
url string,
log log.Logger,
) (*WebsocketClient, error) {

c := &WebsocketClient{
url: url,
writeQueue: make(chan *jsonrpcMessage),
Expand Down
6 changes: 4 additions & 2 deletions clients/iota-go/iotago/iotatest/test_values.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,10 @@ func testTransactionData(packageAddr, senderAddr *iotago.Address) *iotago.Transa
return &tx
}

var TestAddress = iotago.AddressFromArray([iotago.AddressLen]byte(testval.TestBytes(iotago.AddressLen)))
var TestDigest = iotago.MustNewDigest(testval.TestHex(iotago.DigestSize))
var (
TestAddress = iotago.AddressFromArray([iotago.AddressLen]byte(testval.TestBytes(iotago.AddressLen)))
TestDigest = iotago.MustNewDigest(testval.TestHex(iotago.DigestSize))
)

var TestObjectRef = &iotago.ObjectRef{
ObjectID: TestAddress,
Expand Down
16 changes: 8 additions & 8 deletions clients/multiclient/reqstatus.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
)

// WaitUntilRequestProcessed blocks until the request has been processed by all nodes
func (m *MultiClient) WaitUntilRequestProcessed(ctx context.Context, chainID isc.ChainID, reqID isc.RequestID, waitForL1Confirmation bool, timeout time.Duration) (*apiclient.ReceiptResponse, error) {
func (m *MultiClient) WaitUntilRequestProcessed(ctx context.Context, reqID isc.RequestID, waitForL1Confirmation bool, timeout time.Duration) (*apiclient.ReceiptResponse, error) {
oldTimeout := m.Timeout
defer func() { m.Timeout = oldTimeout }()

Expand All @@ -37,8 +37,8 @@ func (m *MultiClient) WaitUntilRequestProcessed(ctx context.Context, chainID isc

// WaitUntilRequestProcessedSuccessfully is similar to WaitUntilRequestProcessed,
// but also checks the receipt and return an error if the request was processed with an error
func (m *MultiClient) WaitUntilRequestProcessedSuccessfully(ctx context.Context, chainID isc.ChainID, reqID isc.RequestID, waitForL1Confirmation bool, timeout time.Duration) (*apiclient.ReceiptResponse, error) {
receipt, err := m.WaitUntilRequestProcessed(ctx, chainID, reqID, waitForL1Confirmation, timeout)
func (m *MultiClient) WaitUntilRequestProcessedSuccessfully(ctx context.Context, reqID isc.RequestID, waitForL1Confirmation bool, timeout time.Duration) (*apiclient.ReceiptResponse, error) {
receipt, err := m.WaitUntilRequestProcessed(ctx, reqID, waitForL1Confirmation, timeout)
if err != nil {
return receipt, err
}
Expand All @@ -50,9 +50,9 @@ func (m *MultiClient) WaitUntilRequestProcessedSuccessfully(ctx context.Context,

// WaitUntilEVMRequestProcessedSuccessfully is similar to WaitUntilRequestProcessed,
// but also checks the receipt and return an error if the request was processed with an error
func (m *MultiClient) WaitUntilEVMRequestProcessedSuccessfully(ctx context.Context, chainID isc.ChainID, txHash common.Hash, waitForL1Confirmation bool, timeout time.Duration) (*apiclient.ReceiptResponse, error) {
func (m *MultiClient) WaitUntilEVMRequestProcessedSuccessfully(ctx context.Context, txHash common.Hash, waitForL1Confirmation bool, timeout time.Duration) (*apiclient.ReceiptResponse, error) {
requestID := isc.RequestIDFromEVMTxHash(txHash)
receipt, err := m.WaitUntilRequestProcessed(ctx, chainID, requestID, waitForL1Confirmation, timeout)
receipt, err := m.WaitUntilRequestProcessed(ctx, requestID, waitForL1Confirmation, timeout)
if err != nil {
return receipt, err
}
Expand All @@ -64,7 +64,7 @@ func (m *MultiClient) WaitUntilEVMRequestProcessedSuccessfully(ctx context.Conte

// WaitUntilAllRequestsProcessed blocks until all requests in the given transaction have been processed
// by all nodes
func (m *MultiClient) WaitUntilAllRequestsProcessed(ctx context.Context, chainID isc.ChainID, tx *iotajsonrpc.IotaTransactionBlockResponse, waitForL1Confirmation bool, timeout time.Duration) ([]*apiclient.ReceiptResponse, error) {
func (m *MultiClient) WaitUntilAllRequestsProcessed(ctx context.Context, tx *iotajsonrpc.IotaTransactionBlockResponse, waitForL1Confirmation bool, timeout time.Duration) ([]*apiclient.ReceiptResponse, error) {
oldTimeout := m.Timeout
defer func() { m.Timeout = oldTimeout }()

Expand All @@ -82,8 +82,8 @@ func (m *MultiClient) WaitUntilAllRequestsProcessed(ctx context.Context, chainID

// WaitUntilAllRequestsProcessedSuccessfully is similar to WaitUntilAllRequestsProcessed
// but also checks the receipts and return an error if any of the requests was processed with an error
func (m *MultiClient) WaitUntilAllRequestsProcessedSuccessfully(ctx context.Context, chainID isc.ChainID, tx *iotajsonrpc.IotaTransactionBlockResponse, waitForL1Confirmation bool, timeout time.Duration) ([]*apiclient.ReceiptResponse, error) {
receipts, err := m.WaitUntilAllRequestsProcessed(ctx, chainID, tx, waitForL1Confirmation, timeout)
func (m *MultiClient) WaitUntilAllRequestsProcessedSuccessfully(ctx context.Context, tx *iotajsonrpc.IotaTransactionBlockResponse, waitForL1Confirmation bool, timeout time.Duration) ([]*apiclient.ReceiptResponse, error) {
receipts, err := m.WaitUntilAllRequestsProcessed(ctx, tx, waitForL1Confirmation, timeout)
if err != nil {
return receipts, err
}
Expand Down
4 changes: 2 additions & 2 deletions components/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"github.com/iotaledger/hive.go/app/components/profiling"
"github.com/iotaledger/hive.go/app/components/shutdown"
"github.com/iotaledger/wasp/v2/components/cache"
"github.com/iotaledger/wasp/v2/components/chains"
"github.com/iotaledger/wasp/v2/components/chainrunner"
"github.com/iotaledger/wasp/v2/components/database"
"github.com/iotaledger/wasp/v2/components/dkg"
"github.com/iotaledger/wasp/v2/components/logger"
Expand Down Expand Up @@ -48,7 +48,7 @@ func App() *app.App {
peering.Component,
dkg.Component,
processors.Component,
chains.Component,
chainrunner.Component,
publisher.Component,
webapi.Component,
profiling.Component,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package chains
package chainrunner

import (
"context"
Expand All @@ -13,7 +13,7 @@ import (
"github.com/iotaledger/wasp/v2/packages/chain"
"github.com/iotaledger/wasp/v2/packages/chain/cmtlog"
"github.com/iotaledger/wasp/v2/packages/chain/mempool"
"github.com/iotaledger/wasp/v2/packages/chains"
chainrunner "github.com/iotaledger/wasp/v2/packages/chainrunner"
"github.com/iotaledger/wasp/v2/packages/daemon"
"github.com/iotaledger/wasp/v2/packages/database"
"github.com/iotaledger/wasp/v2/packages/metrics"
Expand Down Expand Up @@ -45,7 +45,7 @@ type dependencies struct {
dig.In

ShutdownHandler *hiveshutdown.ShutdownHandler
Chains *chains.Chains
Chains *chainrunner.ChainRunner
ReadOnlyDBPath string
}

Expand All @@ -57,16 +57,16 @@ func initConfigParams(c *dig.Container) error {

if err := c.Provide(func() cfgResult {
return cfgResult{
APICacheTTL: ParamsChains.APICacheTTL,
APICacheTTL: ParamsChainRunner.APICacheTTL,
}
}); err != nil {
Component.LogPanic(err.Error())
}

chain.RedeliveryPeriod = ParamsChains.RedeliveryPeriod
chain.PrintStatusPeriod = ParamsChains.PrintStatusPeriod
chain.ConsensusInstsInAdvance = ParamsChains.ConsensusInstsInAdvance
chain.AwaitReceiptCleanupEvery = ParamsChains.AwaitReceiptCleanupEvery
chain.RedeliveryPeriod = ParamsChainRunner.RedeliveryPeriod
chain.PrintStatusPeriod = ParamsChainRunner.PrintStatusPeriod
chain.ConsensusInstsInAdvance = ParamsChainRunner.ConsensusInstsInAdvance
chain.AwaitReceiptCleanupEvery = ParamsChainRunner.AwaitReceiptCleanupEvery

return nil
}
Expand All @@ -88,24 +88,24 @@ func provide(c *dig.Container) error {
ChainMetricsProvider *metrics.ChainMetricsProvider
}

type chainsResult struct {
type chainRunnerResult struct {
dig.Out

Chains *chains.Chains
Runner *chainrunner.ChainRunner
}

if err := c.Provide(func(deps chainsDeps) chainsResult {
return chainsResult{
Chains: chains.New(
if err := c.Provide(func(deps chainsDeps) chainRunnerResult {
return chainRunnerResult{
Runner: chainrunner.New(
Component.Logger,
deps.NodeConnection,
deps.ProcessorsConfig,
ParamsValidator.Address,
ParamsChains.DeriveAliasOutputByQuorum,
ParamsChains.PipeliningLimit,
ParamsChains.PostponeRecoveryMilestones,
ParamsChains.ConsensusDelay,
ParamsChains.RecoveryTimeout,
ParamsChainRunner.DeriveAliasOutputByQuorum,
ParamsChainRunner.PipeliningLimit,
ParamsChainRunner.PostponeRecoveryMilestones,
ParamsChainRunner.ConsensusDelay,
ParamsChainRunner.RecoveryTimeout,
deps.NetworkProvider,
deps.TrustedNetworkManager,
deps.ChainStateDatabaseManager.ChainStateKVStore,
Expand All @@ -122,7 +122,7 @@ func provide(c *dig.Container) error {
ParamsStateManager.StateManagerTimerTickPeriod,
ParamsStateManager.PruningMinStatesToKeep,
ParamsStateManager.PruningMaxStatesToDelete,
ParamsSnapshotManager.SnapshotsToLoad,
ParamsSnapshotManager.SnapshotToLoad,
ParamsSnapshotManager.Period,
ParamsSnapshotManager.Delay,
ParamsSnapshotManager.LocalPath,
Expand All @@ -133,16 +133,16 @@ func provide(c *dig.Container) error {
deps.ConsensusStateRegistry,
deps.ChainListener,
mempool.Settings{
TTL: ParamsChains.MempoolTTL,
OnLedgerRefreshMinInterval: ParamsChains.MempoolOnLedgerRefreshMinInterval,
MaxOffledgerInPool: ParamsChains.MempoolMaxOffledgerInPool,
MaxOnledgerInPool: ParamsChains.MempoolMaxOnledgerInPool,
MaxTimedInPool: ParamsChains.MempoolMaxTimedInPool,
MaxOnledgerToPropose: ParamsChains.MempoolMaxOnledgerToPropose,
MaxOffledgerToPropose: ParamsChains.MempoolMaxOffledgerToPropose,
MaxOffledgerPerAccount: ParamsChains.MempoolMaxOffledgerPerAccount,
TTL: ParamsChainRunner.MempoolTTL,
OnLedgerRefreshMinInterval: ParamsChainRunner.MempoolOnLedgerRefreshMinInterval,
MaxOffledgerInPool: ParamsChainRunner.MempoolMaxOffledgerInPool,
MaxOnledgerInPool: ParamsChainRunner.MempoolMaxOnledgerInPool,
MaxTimedInPool: ParamsChainRunner.MempoolMaxTimedInPool,
MaxOnledgerToPropose: ParamsChainRunner.MempoolMaxOnledgerToPropose,
MaxOffledgerToPropose: ParamsChainRunner.MempoolMaxOffledgerToPropose,
MaxOffledgerPerAccount: ParamsChainRunner.MempoolMaxOffledgerPerAccount,
},
ParamsChains.BroadcastInterval,
ParamsChainRunner.BroadcastInterval,
shutdown.NewCoordinator("chains", Component.NewChildLogger("Shutdown")),
deps.ChainMetricsProvider,
),
Expand Down
20 changes: 10 additions & 10 deletions components/chains/params.go → components/chainrunner/params.go
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
// Package chains provides functionality for managing IOTA Smart Contract chains,
// Package chainrunner provides functionality for managing IOTA Smart Contract chain runner,
// including chain configuration parameters, write-ahead logging, validator settings,
// state management, and snapshot capabilities.
package chains
package chainrunner

import (
"time"

"github.com/iotaledger/hive.go/app"
)

type ParametersChains struct {
type ParametersChainRunner struct {
BroadcastUpToNPeers int `default:"2" usage:"number of peers an offledger request is broadcasted to"`
BroadcastInterval time.Duration `default:"0s" usage:"time between re-broadcast of offledger requests; 0 value means that re-broadcasting is disabled"`
APICacheTTL time.Duration `default:"300s" usage:"time to keep processed offledger requests in api cache"`
Expand Down Expand Up @@ -57,15 +57,15 @@ type ParametersStateManager struct {
}

type ParametersSnapshotManager struct {
SnapshotsToLoad []string `default:"" usage:"list of snapshots to load; can be either single block hash of a snapshot (if a single chain has to be configured) or list of '<chainID>:<blockHash>' to configure many chains"`
Period uint32 `default:"0" usage:"how often state snapshots should be made: 1000 meaning \"every 1000th state\", 0 meaning \"making snapshots is disabled\""`
Delay uint32 `default:"20" usage:"how many states should pass before snapshot is produced"`
LocalPath string `default:"waspdb/snap" usage:"the path to the snapshots folder in this node's disk"`
NetworkPaths []string `default:"" usage:"the list of paths to the remote (http(s)) snapshot locations; each of listed locations must contain 'INDEX' file with list of snapshot files"`
SnapshotToLoad string `default:"" usage:"block hash of a snapshot to load"`

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Notice config.json structure has changed in this place. We would need to update all configs upon deployment.

Period uint32 `default:"0" usage:"how often state snapshots should be made: 1000 meaning \"every 1000th state\", 0 meaning \"making snapshots is disabled\""`
Delay uint32 `default:"20" usage:"how many states should pass before snapshot is produced"`
LocalPath string `default:"waspdb/snap" usage:"the path to the snapshots folder in this node's disk"`
NetworkPaths []string `default:"" usage:"the list of paths to the remote (http(s)) snapshot locations; each of listed locations must contain 'INDEX' file with list of snapshot files"`
}

var (
ParamsChains = &ParametersChains{}
ParamsChainRunner = &ParametersChainRunner{}
ParamsWAL = &ParametersWAL{}
ParamsValidator = &ParametersValidator{}
ParamsStateManager = &ParametersStateManager{}
Expand All @@ -74,7 +74,7 @@ var (

var params = &app.ComponentParams{
Params: map[string]any{
"chains": ParamsChains,
"chain": ParamsChainRunner,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Notice this key also changed in config.json.

"wal": ParamsWAL,
"validator": ParamsValidator,
"stateManager": ParamsStateManager,
Expand Down
4 changes: 2 additions & 2 deletions components/nodeconn/component.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"github.com/iotaledger/hive.go/app/shutdown"

"github.com/iotaledger/wasp/v2/clients/iota-go/iotago"
"github.com/iotaledger/wasp/v2/components/chains"
"github.com/iotaledger/wasp/v2/components/chainrunner"
"github.com/iotaledger/wasp/v2/packages/chain"
"github.com/iotaledger/wasp/v2/packages/daemon"
"github.com/iotaledger/wasp/v2/packages/nodeconn"
Expand Down Expand Up @@ -54,7 +54,7 @@ func provide(c *dig.Container) error {
nodeConnection, err := nodeconn.New(
Component.Daemon().ContextStopped(),
*address,
chains.ParamsChains.MempoolMaxOnledgerInPool,
chainrunner.ParamsChainRunner.MempoolMaxOnledgerInPool,
ParamsL1.WebsocketURL,
ParamsL1.HTTPURL,
Component.NewChildLogger("nc"),
Expand Down
Loading
Loading