github PolymeshAssociation/Polymesh v3.3.0
Polymesh Testnet v3.3.0

latest releases: v7.0.0, v6.3.5, v6.3.4...
3 years ago

Polymesh 3.3.0 Release Notes

Fix Phragman Issue

#1100

Removes pruning of Phragman solution set to allow off-chain calculations to be submitted back on-chain.

Backports fix from:
#992
into 3.3

Authorization refactor; nix accept_authorization for explicit extrinsics

#1035

modified API

  • Removed Identity::accept_authorization in favor of ExternalAgents::accept_become_agent, Portfolio::accept_portfolio_custody,
  • Merge some error types into AuthorizationError::BadType.
  • Cleanup AuthorizationType, removing TransferPrimaryIssuanceAgent and TransferCorporateActionAgent variants.

NCBD-234 Fix cli integration tests

#1040

modified logic

  • in testnet chains, genesis accounts now get BOOTSTRAP_TREASURY POLYX instead of BOOTSTRAP_STASH the higher amount is needed for the integration tests.

Fix deserialization from jsonrpc for the RPC interface.

modified logic

Polkadot's RPC serializes rust enum variant type names to lowercase. This seems to only affect rust style enums like our Singatory enum.

This PR uses #[serde(alias = "identity")] variant attribute to allow deserialize from the lowercase variant name.

Misc refactors and bug fixes, mostly re current DIDs

#1039

modified logic

  • Some bug fixes around permissions in some extrinsics. Not particularly notable.
  • Fixed a bug in make_multisig_signer where you could call it several times for the same multisig.

MESH-1615/Relax CapitalDistribution::reclaim to only require portfolio custody

#1029

modified logic

  • Relaxed CapitalDistribution::reclaim to only require portfolio custody

MESH-1629/create simple relayer

#1028

new features

  • Added Relayer pallet. This pallet provides subsidising support, to allow a paying_key to pay transaction and protocol fees.
  • Added type Subsidy.
  • Added AccountKeyUsage storage map to identity pallet. Internal functions are provided manage a 'usage' counter for account keys to lock them to their identity. This is being used by relayer, but can be used by other pallets.

modified API

  • AuthorizationData::AddRelayerPayingKey(AccountID, AccountID, Balance) and AuthorizationType::AddRelayerPayingKey was added. The authorization is used to add a subsidy to a user_key.
  • Added error AccountKeyIsBeingUsed to the identity pallet. This error is returned if a paying/user key tries to leave their identity.

modified logic

  • Extrinsics accept_primary_key, leave_identity_as_key, leave_identity_as_identity, remove_secondary_keys can throw error AccountKeyIsUsed if the key is being used as a paying_key or user_key in the relayer pallet.

MESH-1651: Don't allow a portfolio with assets to be deleted

#1044

new features

  • A new storage item Portfolio.portfolio_asset_count(pid) => u64 keeps count of the number of distinct assets with non-zero balance stored in the portfolio.

modified logic

  • Portfolio.delete_portfolio(pid) will error with PortfolioNotEmpty when Portfolio.portfolio_asset_count(pid) == 0.

MESH-1652: T::Balance => polymesh_primitives::Balance

#1047

No external impact

MESH-1625: Constant time portfolio name uniqueness

#1048

new features

  • Adds Portfolio.name_to_number for fast PortfolioName => PortfolioNumber lookup.

MESH-1625: Move out AssetName from SecurityToken

#1049

modified API

  • SecurityToken.name is moved into storage item Asset.asset_names(ticker) => AssetName.

MESH-1631/redirect fees to subsidiser

new features

  • Add support to pay transaction & protocol fees using a subsidy in Relayer.
  • Add restriction on pallets that can be subsidised.

modified API

  • Added error InsufficientSubsidyBalance to protocol-fee pallet. This error is returned if the subsidy doesn't have enough remaining POLYX to pay for the protocol fee.
  • Added PalletNotSubsidised to TransactionError.

modified logic

  • If the caller's account key has a subsidy in Relayer, then the transaction and/or protocol fees will be paid by the subsidiser.

MESH-1625: Move out CADetails from CorporateAction

#1053

modified API

  • Moved field CorporateAction.details: CADetails into its own storage item Details: CAId => CADetails.

MESH-1625: Split Venue

#1055

modified API

  • Split Settlement.update_venue into update_venue_type & update_venue_details along with respective events.
  • Removed fields Venue.{details, instructions}. The former improves performance and the latter crucially removes an attack vector.
  • Added storage item Settlement.details(venue_id) -> VenueDetails.
  • Added storage item Settlement.venue_instructions(venue_id, instruction_id) -> ().

MESH-1625: Comment out smart extension code

#1052

modified API

  • Removes smart extension related storage items. These should have been unused on ITN.

MESH-1625: AssetType::Custom uses ID instead of string

#1051

new features

  • Extrinsic Asset.register_custom_asset_type(origin, ty: Vec<u8>) was added. It is used to register string contents for a custom asset type, getting back an CustomAssetTypeId which can be used in AssetType::Custom. The extrinsic uses the following new resources:
    • Storage items Asset.{CustomTypeIdSequence, CustomTypes, CustomTypesInverse}. These are used by register_custom_asset_type
    • Events Asset.{CustomAssetTypeExists, CustomAssetTypeRegistered}.
    • Error Asset.CustomAssetTypeIdOverflow.

modified API

  • AssetType::Custom has a field CustomAssetTypeId(u32) instead of Vec<u8>.

MESH-1656/bridge freezing permissions

#1059

new features

  • Add support for multiple freeze admin accounts to the bridge pallet.

modified API

  • New extrinsics add_freeze_admin and remove_freeze_admin to bridge pallet. These can only be called by the current bridge admin to add/remove freeze admins.
  • New events FreezeAdminAdded and FreezeAdminRemoved.

modified logic

  • Bridge extrinsic freeze can now be called by any of the freeze admin accounts.

MESH-1636/Relayer tests

#1050

Adds additional tests for simple relayer - no downstream impact.

MESH-1662/allow changing paying key

#1057

new features

  • Allow user key to change subsidiser in single transaction.
  • Fix issue with user key calling remove_paying_key.

modified API

  • Removed error AlreadyHasPayingKey.

modified logic

  • accept_paying_key now allows accepting a new paying key without having to first remove the old paying key. (MESH-1663)
  • Fixed issue with the user key calling remove_paying_key. (MESH-1662)

modified agent functionality

  • accept_paying_key can now emit event RemovePayingKey if the user key already had a subsidy.

MESH-1664: Allow different ss58 values

#1069

Allows us to specify correct SS58 values for different networks.

MESH-1661: Optional PUIS

#1065

modified API

  • Asset.create_asset now takes an additional parameter that decides whether the asset will enforce investor uniqueness (IU).
    This information is stored in Asset.disable_iu, which, if true, means that IU is not enforced.

ITN Rewards

new features

  • New pallet rewards and new extrsinc claim_itn_reward.

MESH-1658/audit bridge pallet

#1060

modified API

  • Added event BridgeTxScheduleFailed for when scheduling a transaction failed.

modified logic

  • Extrinsic change_bridge_limit will throw error DivisionByZero if duration == 0.
  • Errors NoValidCdd, DivisionByZero, Overflow, BridgeLimitReached are now reported correctly.

modified agent functionality

  • Event BridgeTxScheduleFailed can be emitted by extrinsics force_handle_bridge_tx, batch_propose_bridge_tx, propose_bridge_tx, handle_bridge_tx, unfreeze_txs, handle_scheduled_bridge_tx.

MESH-1665/ITN Rewards: CDD Check for recipients

#1070

modified logic

Check that the recipient of ITN rewards has a valid CDD claim.

MESH-1659/relayer increase decrease polyx limit

#1068

new features

  • Add extrinsics increase_polyx_limit and decrease_polyx_limit to increase/decrease the POLYX limit of a subsidy.
  • Add error Overflow that can be thrown by increase_polyx_limit or decrease_polyx_limit.

modified agent functionality

  • Added extrinsics increase_polyx_limit and decrease_polyx_limit that can emit event UpdatedPolyxLimit.

MultiSig: Subsidise rejecting proposal and consistent errors

#1071

new features

  • When a MultiSig signer rejects a proposal, the transaction is paid for by the primary key of the creator.
  • When approving a MultiSig proposal, throw an error if the proposal was already executed.

Don't miss a new Polymesh release

NewReleases is sending notifications on new releases.