-
Notifications
You must be signed in to change notification settings - Fork 126
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
Conway #636
Conway #636
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.
/check
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.
/check
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.
/check
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.
/check
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.
🎉
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.
/check
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.
/check
Update Summary
1. Address Types:
network_id
getter to Address types.Malformed
. Used when it's impossible to deserialize an address in structs where the address is a nested type.kind()
. Returns an enum with address type.payment_cred()
. Returns payment credential.is_malformed()
.2. PlutusV3 Support:
3. Token Handling:
4. New Certificates:
Added support for the following certificates (can be added via
CertificatesBuilder
):CommitteeColdResign
CommitteeHotAuth
DrepDeregistration
DrepRegistration
DrepUpdate
StakeAndVoteDelegation
StakeRegistrationAndDelegation
StakeVoteRegistrationAndDelegation
VoteDelegation
VoteRegistrationAndDelegation
5. Reference Script Fee:
TransactionBuilderConfigBuilder
: Addedref_script_coins_per_byte
setter to account for new fees for reference script inputs.PlutusScriptSource
: Now requires an additional mandatory parameter for script size for reference inputs.6. New Builder Types:
VotingBuilder
: For participation in voting for governance actions.VotingProposalBuilder
: For proposing voting actions.TransactionBuilder
: Now has setters for these new builders.7. Extended Coin Selection Functions:
TransactionBuilder
has two new coin selection functions to account for change output and collateral return during fee estimation:add_inputs_from_and_change
: Considers change calculation; no need to calladd_change_if_needed
after it.add_inputs_from_and_change_with_collateral_return
: Considers change calculation and collateral return; no need to calladd_change_if_needed
after it.add_inputs_from_and_change_with_collateral_return
doesn't perform coin selection for collateral inputs; you need to specify collateral inputs manually.8. New Protocol Types for Governance-related Actions:
VotingProcedure
: Vote for specific governance action proposal.VotingProcedures
: Collection of votes.VotingProposal
: Proposal of specific governance action.VotingProposals
: Collection of VotingProposal.DRep
: Abstraction of delegate representative; can be a credential or a predefined DRep type.Voter
: Abstraction of voter; can be DRep, SPO, or CC member.GovernanceActionId
: ID of governance action; tuple of (tx_hash, index_of_voting_proposal). Similar to tx input abstraction.Anchor
: Abstraction to specify off-chain data; tuple of URL and data hash.HardForkInitiationAction
InfoAction
NewConstitutionAction
NoConfidenceAction
ParameterChangeAction
TreasuryWithdrawalsAction
UpdateCommitteeAction
9. Serialization Improvement:
10. Set Behavior and Add Function:
The following types work as a set, and their
add
function returns a boolean. It returnstrue
if the element is added andfalse
if the element already exists in the collection. In the case offalse
, the size of the collection remains unchanged:Credentials
Ed25519KeyHashes
Vkeywitnesses
VotingProposals
TransactionInputs
Certificates
11. New Transaction Builder Functions:
TransactionBuilder
has a new functions to set donation to the treasury (TransactionBuilder.set_donation()
) and the current treasury value (TransactionBuilder.set_current_treasury_value()
). However, if you use these fields, the Cardano node will reject all non-Plutus V3 scripts. These transaction fields can help facilitate direct donations to the treasury and limit transaction execution based on the current treasury value.12. New Packages With GC Support (EXPERIMENTAL):
CSL now includes NPM packages with GC (Garbage Collection) support, which means you no longer need to manually call
.free
for every CSL object. This was achieved by enabling theWEAK_REF
flag onwasm_bindgen
, and it utilizesFinalizationRegistry
to automatically callfree
for each CSL struct when it is no longer needed. However, please use this feature with caution, as it may lead to unpredictable behavior. For package links, refer to the packages in the "Published" section.Breaking Changes:
StakeCredential Renaming:
StakeCredential
was renamed toCredential
.StakeCredKind
was renamed toCredKind
.StakeCredentials
was renamed toCredentials
.TransactionBody Struct Changes:
multiassets()
due to its confusing naming.mint()
to obtain information about minting in a transaction.Fee Calculation Functions Changes:
new_coins_per_byte
instead of the removednew_coins_per_word
inDataCost
.TransactionOutputAmountBuilder
, switch towith_asset_and_min_required_coin_by_utxo_cost
, aswith_asset_and_min_required_coin
is now removed.ADA Requirement Function Updates:
min_ada_required
due to its inability to account for full transaction output fields and reliance on the outdated coins per word parameter.min_ada_for_output
.TransactionBuilderConfigBuilder Adjustments:
coins_per_utxo_word
.coins_per_utxo_byte
.NetworkInfo Simplification:
testnet()
function, as the testnet has been replaced by testnet preprod and testnet preview.Script Transaction Inputs Overhaul:
add_script_input
,add_input
,count_missing_input_scripts
,add_required_script_input_witnesses
, andadd_required_plutus_input_scripts
, used for adding script transaction inputs without a script witness.add_regular_input
,add_key_input
, oradd_bootstrap_input
.add_native_script_input
oradd_plutus_script_input
.PlutusScriptSource Enhancement:
new_ref_input
inPlutusScriptSource
now includes a language version argument, replacing the oldnew_ref_input
.new_ref_input_with_lang_ver
becausenew_ref_input
has the same functionality and no need for a specific function with a language version.PlutusScriptSource.new_ref_input
now requiresscript_size
parameter to respectref_script_coins_per_byte
from protocol parameters and correct fee calculation from Conway era. You need also setref_script_coins_per_byte
viaTransactionBuilderConfig
to use it correctly.NativeScriptSource Enhancement:
NativeScriptSource.new_ref_input
now requiresscript_size
parameter to respectref_script_coins_per_byte
from protocol parameters and correct fee calculation from Conway era. You need also setref_script_coins_per_byte
viaTransactionBuilderConfig
to use it correctly.Script Source Unification:
NativeScriptSource
andPlutusScriptSource
now hasrequired_signers
option. To set it, useNativeScriptSource.set_required_signers
orPlutusScriptSource.set_required_signers
andTrsansactionBuilder
will allocate space for theserequired_signers
during fee calculation.Multiple Mints:
Mint.get()
now returnsMintsAssets
type to respect key duplication inMint
field.MintsAssets
instead ofMintAssets
.Referenced Native Script:
TxInputsBuilder.add_native_script_input
now requiresNativeScriptSource
to support referenced native script. UseNativeScriptSource::new
to useNativeScript
witness as before, and useNativeScriptSource::new_ref_input
to use referenced native script.NativeScriptSource::new(NativeScript::new())
instead ofNativeScript::new()
.Duplicated Keys Support in Plutus Datum Maps:
PlutusMap.get
returns an instance ofPlutusMapValues
,PlutusMap.insert
accepts an instance ofPlutusMapValues
to support duplicated keys in a datum map.PlutusMapValues.add
and thenPlutusMap.insert
or just usePlutusMap.add_value
.PlutusMapValues
has an accessor functionPlutusMapValues.get()
to get a specific value andPlutusMapValues.len()
to get the total number of values.Ref Script Fee Support:
TransitionBuilder
now can throw an error during the building process if you are using reference inputs with a Plutus script. To avoid it, you need to useTransactionBuilderConfigBuilder.ref_script_coins_per_byte
to specify ref script byte cost and have correct fee calculations.PlutusScriptSource.new_ref_input
requires script size to have correct fee calculation.ref_script_coins_per_byte
to zero.Transaction Inputs and Reference Inputs Deduplication:
TransactionBuilder
now automatically removes reference inputs that are also present in the transaction inputs field. The Cardano node will not accept a transaction that has the same transaction input in both the transaction inputs field and the reference inputs field. The deduplication logic applies to all reference inputs set via builders, except for those explicitly set usingTransactionBuilder.set_ref_inputs()
. If there is a duplicate between explicitly set reference inputs (viaTransactionBuilder.set_ref_inputs()
) and the transaction inputs field,TransactionBuilder
will throw an error during the building process. To avoid this and enforce deduplication for explicitly set reference inputs, useTransactionBuilderConfigBuilder.deduplicate_explicit_ref_inputs_with_regular_inputs
duringTransactionBuilder
configuration.