wasp

command module
v1.0.2-legacy-migration Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 21, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

README

Wasp logo

Legacy-Migration Wasp

For the regular wasp node software go to https://github.com/iotaledger/wasp .

This version of the wasp software was made with the objective of allowing the migration of legacy funds from the pre-chysalis network.

Contains a simple contract that can be called to release funds given a valid signature of an unmigrated bundle.

This repo also contains a snapshot of the old network containing all the unmigrated bundles

Everytime a migration is successful, the funds are released on L1 to the target address and an event is published, making the entire process auditable.

At any point, the governance contract of the EVM Chain can vote and decide to burn the unmigrated tokens.

Instructions

All committee participants must use the node-docker-setup with the legacy-migration wasp software.

The deployer must use the wasp-cli compiled from this branch.

  • deploy the chain
wasp-cli chain deploy --chain=migration-chain --migration-admin=0x0000000000000000000000000000000000000000@IOTA_EVM_CHAIN_ID

then activate the chain on each committee node

  • funds must be deposited to the contract (substitute MIGRATION_CHAIN_ID and AMOUNT):
wasp-cli chain post-request -s accounts transferAllowanceTo string a agentid 05204969@MIGRATION_CHAIN_ID --transfer=base:AMOUNT --allowance=base:AMOUNT
  • call a view to confirm everything is as expected
wasp-cli chain call-view legacymigration getTotalBalance | tee >(wasp-cli decode string total uint64) >(wasp-cli decode string balance uint64)
  • (optional) relinquish control of the chain governance/UTXO
wasp-cli chain change-gov-controller <NEXT_OWNER_ADDRESS>

By setting the governance controller of the chain UTXO to the chain itself, it means only the chain itself can rotate the committee of validators. It's also possible to set the gov-controller to some unusable address, like the Zero address (0x000...), but that means the committee cannot ever be changed.

If the chain gov controller is set to the chain itself, committee changes and other administrative tasks can be made by the "chain admin" (including changing who the chain admin is), by interacting with the Governance Contract


Testing Instructions (Localhost)

(this assumes docker and docker compose are installed)

  • edit packages/legacymigration/migratable.csv to include the test cases
  • make install - this will make sure the software build, and will make wasp-cli available
  • cd tools/local-setup
  • create docker volumes for wasp / hornet:
docker volume create --name hornet-nest-db
docker volume create --name wasp-db
  • build and start the test node bash build_container.sh && docker compose up
  • on another directory of your choice, setup wasp-cli and deploy a chain:
wasp-cli init
wasp-cli set l1.apiaddress http://localhost:14265
wasp-cli set l1.faucetaddress http://localhost:8091
wasp-cli wasp add my-node http://localhost:9090
wasp-cli request-funds
wasp-cli chain deploy --chain=test-migration-chain --migration-admin=0x0000000000000000000000000000000000000000@tst1pq3e0awlpdsvk7uh2dcaz86mp63nflypu6fyprwxvfherr8lksktwhdwp9j

(migration-admin is just a dummy address, should be an entity of IotaEVM in the real network)

  • send funds to the migration contract (it must be at least the total amount specified in migratable.csv (sum of all migratable balances)). In the following command,CHAIN_ID must be substituted by the ChainID of the newly deployed chain, also 1000000 is just a placeholder value that should be substituted with the correct amount to deposit.
wasp-cli chain post-request -s accounts transferAllowanceTo string a agentid 05204969@CHAIN_ID --transfer=base:1000000 --allowance=base:1000000
  • ensure everything looks good by calling the view entrypoints of the legacy-migration contract:
wasp-cli chain call-view legacymigration getTotalBalance | tee >(wasp-cli decode string total uint64) >(wasp-cli decode string balance uint64)

balance must be >= total

optionally, you can check how many tokens are migratable for a given address with:

wasp-cli chain call-view legacymigration getMigratableBalance string a bytes 0x...

where 0x... is the binary format of the migratable address in t5b1 encoding (t5b1.EncodeTrytes)

  • off-ledger requests can be sent to http://localhost/wasp/api/v1/requests/offledger with the following body: {Request: "Hex string"}

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
clients
components
app
dkg
wasmtimevm
Wasp can have several VM types.
Wasp can have several VM types.
contracts
documentation
packages
chain
This runs single chain will all the committees, mempool, state mgr etc.
This runs single chain will all the committees, mempool, state mgr etc.
chain/chainmanager
This package implements a protocol for running a chain in a node.
This package implements a protocol for running a chain in a node.
chain/cmt_log
package cmtLog is responsible for producing a log of chain's block decisions for a particular committee.
package cmtLog is responsible for producing a log of chain's block decisions for a particular committee.
chain/cons
Consensus.
Consensus.
chain/cons/cons_gr
The purpose of this package is to run the consensus protocol as a goroutine and communicate with all the related components.
The purpose of this package is to run the consensus protocol as a goroutine and communicate with all the related components.
chain/dss
Run a NonceDKG and sign the supplied hash.
Run a NonceDKG and sign the supplied hash.
chain/mempool
A mempool basically does these functions:
A mempool basically does these functions:
chains/access_mgr/am_dist
The algorithm here follows the specification `WaspChainAccessNodesV4.tla`.
The algorithm here follows the specification `WaspChainAccessNodesV4.tla`.
dkg
Package dkg is responsible for performing a distributed key generation procedure.
Package dkg is responsible for performing a distributed key generation procedure.
evm/evmdoc
Package evmdoc contains internal documentation about EVM support in ISC.
Package evmdoc contains internal documentation about EVM support in ISC.
evm/jsonrpc
Package jsonrpc contains the implementation of the JSONRPC service which is called by Ethereum clients (e.g.
Package jsonrpc contains the implementation of the JSONRPC service which is called by Ethereum clients (e.g.
gpa
package gpa stands for generic pure (distributed) algorithm.
package gpa stands for generic pure (distributed) algorithm.
gpa/aba/craig
TODO: That's Craig's "Good-Case-Coin-Free" ABA consensus.
TODO: That's Craig's "Good-Case-Coin-Free" ABA consensus.
gpa/acs
Here we implement the Asynchronous Common Subset algorithm from the HBBFT paper:
Here we implement the Asynchronous Common Subset algorithm from the HBBFT paper:
gpa/acss
package acss implements "Asynchronous Complete Secret Sharing" as described in
package acss implements "Asynchronous Complete Secret Sharing" as described in
gpa/acss/crypto
This package is a copy of <https://github.com/Wollac/async.go/tree/main/pkg/acss/crypto>
This package is a copy of <https://github.com/Wollac/async.go/tree/main/pkg/acss/crypto>
gpa/adkg/nonce
nonce package implements NonceDKG as described in <https://github.com/iotaledger/crypto-tss/>.
nonce package implements NonceDKG as described in <https://github.com/iotaledger/crypto-tss/>.
gpa/cc/blssig
blssig package implements a Common Coin (CC) based on a BLS Threshold signatures as described in the Appendix C of
blssig package implements a Common Coin (CC) based on a BLS Threshold signatures as described in the Appendix C of
gpa/cc/semi
semi package implements a Common Coin (CC) that produces deterministic values only for some of the rounds.
semi package implements a Common Coin (CC) that produces deterministic values only for some of the rounds.
gpa/rbc/bracha
package bracha implements Bracha's Reliable Broadcast.
package bracha implements Bracha's Reliable Broadcast.
isc
Package 'isc' defines fundamental types that are used in Wasp.
Package 'isc' defines fundamental types that are used in Wasp.
isc/coreutil
package coreutil provides functions to describe interface of the core contract in a compact way
package coreutil provides functions to describe interface of the core contract in a compact way
kv
l1connection
to be used by utilities like: cluster-tool, wasp-cli, apilib, etc
to be used by utilities like: cluster-tool, wasp-cli, apilib, etc
nodeconn
nodeconn package provides an interface to the L1 node (Hornet).
nodeconn package provides an interface to the L1 node (Hornet).
peering
Package peering provides an overlay network for communicating between nodes in a peer-to-peer style with low overhead encoding and persistent connections.
Package peering provides an overlay network for communicating between nodes in a peer-to-peer style with low overhead encoding and persistent connections.
peering/group
Package group implements a generic peering.GroupProvider.
Package group implements a generic peering.GroupProvider.
peering/lpp
Package lpp implements a peering.NetworkProvider based on the libp2p.
Package lpp implements a peering.NetworkProvider based on the libp2p.
solo
Package 'solo' is a development tool to write unit tests for IOTA Smart Contracts (ISC).
Package 'solo' is a development tool to write unit tests for IOTA Smart Contracts (ISC).
solo/solobench
package solobench provides tools to benchmark contracts running under solo
package solobench provides tools to benchmark contracts running under solo
tcrypto
Package tcrypto stands for Threshold Cryptography.
Package tcrypto stands for Threshold Cryptography.
testutil
Package testutil provides mock implementations of various wasp components.
Package testutil provides mock implementations of various wasp components.
testutil/privtangle
privtangle is a cluster of HORNET nodes started for testing purposes.
privtangle is a cluster of HORNET nodes started for testing purposes.
testutil/utxodb
Package utxodb provides tools to simulate an in-memory synchronous ledger, for testing purposes.
Package utxodb provides tools to simulate an in-memory synchronous ledger, for testing purposes.
trie
package trie implements an immutable Merkle Patricia Trie, used by the state package to store the chain state.
package trie implements an immutable Merkle Patricia Trie, used by the state package to store the chain state.
vm
vm/core/blocklog
in the blocklog core contract the VM keeps indices of blocks and requests in an optimized way for fast checking and timestamp access.
in the blocklog core contract the VM keeps indices of blocks and requests in an optimized way for fast checking and timestamp access.
vm/core/evm
Package evm contains the declaration of the evm core contract's interface.
Package evm contains the declaration of the evm core contract's interface.
vm/core/evm/emulator
Package emulator contains the implementation of the EVMEmulator and subcomponents.
Package emulator contains the implementation of the EVMEmulator and subcomponents.
vm/core/evm/evmimpl
Package evmimpl contains the implementation of the `evm` core contract.
Package evmimpl contains the implementation of the `evm` core contract.
vm/core/evm/evmnames
package evmnames provides the names of EVM core contract functions and fields.
package evmnames provides the names of EVM core contract functions and fields.
vm/core/evm/evmtest
Package evmtest contains solo tests for the evm core contract.
Package evmtest contains solo tests for the evm core contract.
vm/core/governance
in the blocklog core contract the VM keeps indices of blocks and requests in an optimized way for fast checking and timestamp access.
in the blocklog core contract the VM keeps indices of blocks and requests in an optimized way for fast checking and timestamp access.
vm/core/governance/governanceimpl
This file provides implementation for the governance SC, the ChainNode management functions.
This file provides implementation for the governance SC, the ChainNode management functions.
vm/core/testcore/sbtests/sbtestsc
smart contract for testing
smart contract for testing
vm/vmtxbuilder
Package vmtxbuilder implements AnchorTransactionBuilder, a transaction builder used by the VM to construct anchor transaction.
Package vmtxbuilder implements AnchorTransactionBuilder, a transaction builder used by the VM to construct anchor transaction.
wasmvm Module
tools
gendoc Module
wasp-cli Module

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL