Polymesh 3.3.0 Release Notes
Fix Phragman Issue
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
modified API
- Removed
Identity::accept_authorization
in favor ofExternalAgents::accept_become_agent
,Portfolio::accept_portfolio_custody
, - Merge some error types into
AuthorizationError::BadType
. - Cleanup
AuthorizationType
, removingTransferPrimaryIssuanceAgent
andTransferCorporateActionAgent
variants.
NCBD-234 Fix cli integration tests
modified logic
- in testnet chains, genesis accounts now get
BOOTSTRAP_TREASURY
POLYX instead ofBOOTSTRAP_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
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
modified logic
- Relaxed
CapitalDistribution::reclaim
to only require portfolio custody
MESH-1629/create simple relayer
new features
- Added
Relayer
pallet. This pallet provides subsidising support, to allow apaying_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)
andAuthorizationType::AddRelayerPayingKey
was added. The authorization is used to add a subsidy to auser_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 errorAccountKeyIsUsed
if the key is being used as apaying_key
oruser_key
in the relayer pallet.
MESH-1651: Don't allow a portfolio with assets to be deleted
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 withPortfolioNotEmpty
whenPortfolio.portfolio_asset_count(pid) == 0
.
MESH-1652: T::Balance => polymesh_primitives::Balance
No external impact
MESH-1625: Constant time portfolio name uniqueness
new features
- Adds
Portfolio.name_to_number
for fastPortfolioName
=>PortfolioNumber
lookup.
MESH-1625: Move out AssetName from SecurityToken
modified API
SecurityToken.name
is moved into storage itemAsset.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
toprotocol-fee
pallet. This error is returned if the subsidy doesn't have enough remaining POLYX to pay for the protocol fee. - Added
PalletNotSubsidised
toTransactionError
.
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
modified API
- Moved field
CorporateAction.details: CADetails
into its own storage itemDetails: CAId => CADetails
.
MESH-1625: Split Venue
modified API
- Split
Settlement.update_venue
intoupdate_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
modified API
- Removes smart extension related storage items. These should have been unused on ITN.
MESH-1625: AssetType::Custom uses ID instead of string
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 anCustomAssetTypeId
which can be used inAssetType::Custom
. The extrinsic uses the following new resources:- Storage items
Asset.{CustomTypeIdSequence, CustomTypes, CustomTypesInverse}
. These are used byregister_custom_asset_type
- Events
Asset.{CustomAssetTypeExists, CustomAssetTypeRegistered}
. - Error
Asset.CustomAssetTypeIdOverflow
.
- Storage items
modified API
AssetType::Custom
has a fieldCustomAssetTypeId(u32)
instead ofVec<u8>
.
MESH-1656/bridge freezing permissions
new features
- Add support for multiple freeze admin accounts to the bridge pallet.
modified API
- New extrinsics
add_freeze_admin
andremove_freeze_admin
tobridge
pallet. These can only be called by the current bridge admin to add/remove freeze admins. - New events
FreezeAdminAdded
andFreezeAdminRemoved
.
modified logic
- Bridge extrinsic
freeze
can now be called by any of the freeze admin accounts.
MESH-1636/Relayer tests
Adds additional tests for simple relayer - no downstream impact.
MESH-1662/allow changing paying key
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 eventRemovePayingKey
if the user key already had a subsidy.
MESH-1664: Allow different ss58 values
Allows us to specify correct SS58 values for different networks.
MESH-1661: Optional PUIS
modified API
Asset.create_asset
now takes an additional parameter that decides whether the asset will enforce investor uniqueness (IU).
This information is stored inAsset.disable_iu
, which, if true, means that IU is not enforced.
ITN Rewards
new features
- New pallet
rewards
and new extrsincclaim_itn_reward
.
MESH-1658/audit bridge pallet
modified API
- Added event
BridgeTxScheduleFailed
for when scheduling a transaction failed.
modified logic
- Extrinsic
change_bridge_limit
will throw errorDivisionByZero
ifduration == 0
. - Errors
NoValidCdd
,DivisionByZero
,Overflow
,BridgeLimitReached
are now reported correctly.
modified agent functionality
- Event
BridgeTxScheduleFailed
can be emitted by extrinsicsforce_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
modified logic
Check that the recipient of ITN rewards has a valid CDD claim.
MESH-1659/relayer increase decrease polyx limit
new features
- Add extrinsics
increase_polyx_limit
anddecrease_polyx_limit
to increase/decrease the POLYX limit of a subsidy. - Add error
Overflow
that can be thrown byincrease_polyx_limit
ordecrease_polyx_limit
.
modified agent functionality
- Added extrinsics
increase_polyx_limit
anddecrease_polyx_limit
that can emit eventUpdatedPolyxLimit
.
MultiSig: Subsidise rejecting proposal and consistent errors
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.