Releases: geniusyield/atlas
v0.9.0
What's Changed
See CHANGELOG
.
All involved pull requests
- feat(#391 & #306): make datum as optional when spending an input in c… by @sourabhxyz in #395
Full Changelog: v0.8.1...v0.9.0
v0.8.1
What's Changed
See CHANGELOG
.
All involved pull requests
- feat: add combined stake address registration and delegation certificate by @sourabhxyz in #393
Full Changelog: v0.8.0...v0.8.1
v0.8.0
What's Changed
See CHANGELOG
.
All involved pull requests
- feat(#277): add keyrole, key hash & credential family by @sourabhxyz in #378
- feat(#379): create generalise signing key & verification key type by @sourabhxyz in #380
- feat(#383, #384): add more certificates and node update to v10.1.3 by @sourabhxyz in #382
- feat(#385): stake pool related certificates by @sourabhxyz in #386
- feat(#387): add committee related certificates by @sourabhxyz in #388
- feat: governance voting & proposal procedures, refactor transaction build sc… by @sourabhxyz in #392
Full Changelog: v0.7.0...v0.8.0
v0.7.0
What's Changed
0.7.0
- Era histories are now cached through entire run of the program whereas protocol parameters are fetched once per epoch. In case you were utilising era summary given by Atlas, note that era end of last era is now set to being unbounded.
- Bug fix for our caching mechanism, see PR #370 for more details.
- We no longer fetch registered stake pools as it is not required.
- Added utility functions to do slot to epoch related conversations.
addRefScript
now accepts for scripts that has version greater than or equal toPlutusV2
.
Full Changelog: v0.6.3...v0.7.0
v0.6.3
What's Changed
- feat(#368): avoid dependency upon
cardano-balance-tx:internal
by @sourabhxyz in #369
Full Changelog: v0.6.2...v0.6.3
v0.6.2
What's Changed
- feat(#365): add
valueAlter
and some typeclass instances for `GYTxWi… by @sourabhxyz in #367
Full Changelog: v0.6.1...v0.6.2
v0.6.1
What's Changed
- Add ability to create users within
GYTxGameMonad
by @TotallyNotChase in #335 - chore: clean up unified tests by @euonymos in #337
- fix: update Nix setup by @euonymos in #347
- Make feetracker track unexpected gains from inputs by @TotallyNotChase in #344
- feat(#350): remove hardcoded protocol parameters for Maestro & Blockfrost provider by @sourabhxyz in #351
- feat(#355): add support of CIP-57 by @sourabhxyz in #356
New Contributors
- @dependabot made their first contribution in #346
- @euonymos made their first contribution in #337
Full Changelog: v0.6.0...v0.6.1
v0.6.0
Migration guide
The changes introduced by v0.6.0 are huge and we attempt our best to describe a migration guide in this section, which should also introduce some of the new features that have been added.
General changes
- Atlas'
GYTxMonad
has been revamped, with details in this PR (please visit the linked PR as it describes the design of new monads! Same is also provided in the appendix of this release document). In particular, to handle these changes, you might need to do following changes in your codebase:-
Use
runGYTxQueryMonadIO
in place ofrunGYTxQueryMonadNode
. I'll userunGYTxQueryMonadNode
->runGYTxQueryMonadIO
to denote such a change. -
GYTxQueryMonadNode
->GYTxQueryMonadIO
. -
GYTxMonadNode
->GYTxBuilderMonadIO
. -
GYTxBuildResult Identity
->GYTxBuildResult
. -
GYTxMonad
can likely be replaced withGYTxUserQueryMonad
in your code. -
Some of the old functions such as
runGYTxMonadNode
are removed but these can be defined like so:runGYTxMonadNode :: GYNetworkId -> GYProviders -> [GYAddress] -> GYAddress -> Maybe (GYTxOutRef, Bool) -> GYTxBuilderMonadIO (GYTxSkeleton v) -> IO GYTxBody runGYTxMonadNode nid providers addrs change collateral act = runGYTxBuilderMonadIO nid providers addrs change collateral $ act >>= buildTxBody runGYTxMonadNodeF :: forall t v. Traversable t => GYCoinSelectionStrategy -> GYNetworkId -> GYProviders -> [GYAddress] -> GYAddress -> Maybe (GYTxOutRef, Bool) -> GYTxBuilderMonadIO (t (GYTxSkeleton v)) -> IO (t GYTxBody) runGYTxMonadNodeF strat nid providers addrs change collateral act = runGYTxBuilderMonadIO nid providers addrs change collateral $ act >>= traverse (buildTxBodyWithStrategy strat) runGYTxMonadNodeParallel :: GYNetworkId -> GYProviders -> [GYAddress] -> GYAddress -> Maybe (GYTxOutRef, Bool) -> GYTxBuilderMonadIO [GYTxSkeleton v] -> IO GYTxBuildResult runGYTxMonadNodeParallel nid providers addrs change collateral act = runGYTxBuilderMonadIO nid providers addrs change collateral $ act >>= buildTxBodyParallel runGYTxMonadNodeParallelWithStrategy :: GYCoinSelectionStrategy -> GYNetworkId -> GYProviders -> [GYAddress] -> GYAddress -> Maybe (GYTxOutRef, Bool) -> GYTxBuilderMonadIO [GYTxSkeleton v] -> IO GYTxBuildResult runGYTxMonadNodeParallelWithStrategy strat nid providers addrs change collateral act = runGYTxBuilderMonadIO nid providers addrs change collateral $ act >>= buildTxBodyParallelWithStrategy strat
-
GYTxQueryMonadIO
andGYTxBuilderMonadIO
do not haveMonadIO
instance, but these can be defined as shown:import GeniusYield.Unsafe (unsafeIOToQueryMonad, unsafeIOToTxBuilderMonad) instance MonadIO GYTxQueryMonadIO where liftIO = unsafeIOToQueryMonad instance MonadIO GYTxBuilderMonadIO where liftIO = unsafeIOToTxBuilderMonad
-
utxoRefScript
field insideGYUTxO
is updated toMaybe GYAnyScript
whereGYAnyScript
encapsulates both simple (native) scripts and plutus scripts (Atlas now supports simple scripts, yay!).
-
As an example, you can see how we migrated our dex-contracts-api
codebase here.
Privnet
How to run?
To run the privnet tests, first one needs to install cardano-node & cardano-cli like so:
cabal install --package-env=$(pwd) --overwrite-policy=always cardano-cli cardano-node
Then the tests can be ran, like for Atlas: cabal run atlas-privnet-tests -- -j1 --hide-successes
How to structure?
- Due to redesign of monads related to transaction building & query, functions such as
ctxRunI
are no longer present, but they (and some of the related utilities) can be implemented like so:
ctxRunI :: Ctx -> User -> GYTxBuilderMonadIO (GYTxSkeleton v) -> IO GYTxBody
ctxRunI ctx user act = ctxRunBuilder ctx user $ act >>= buildTxBody
ctxRunC :: Ctx -> User -> GYTxBuilderMonadIO a -> IO a
ctxRunC = ctxRunBuilder
ctxRunF :: Traversable t => Ctx -> User -> GYTxBuilderMonadIO (t (GYTxSkeleton v)) -> IO (t GYTxBody)
ctxRunF ctx user act = ctxRunBuilder ctx user $ act >>= traverse buildTxBody
submitTxCtx :: Ctx -> User -> GYTxBody -> IO GYTxId
submitTxCtx ctx user txBody = ctxRun ctx user $ signAndSubmitConfirmed txBody
submitTxCtx' :: Ctx -> User -> GYTx -> IO GYTxId
submitTxCtx' ctx user tx = ctxRun ctx user $ submitTxConfirmed tx
addRefScriptCtx :: Ctx -> User -> GYScript PlutusV2 -> IO GYTxOutRef
addRefScriptCtx ctx user script = ctxRun ctx user $ addRefScriptToLimbo script
-
Earlier the tests might expect the argument
IO Setup
but now onlySetup
is required which can be generated with following continuation:withPrivnet cardanoDefaultTestnetOptionsConway $ \setup
. Please see privnet tests structured inside Atlas here for examples. -
Arguments of
withSetup
are flipped, so instead ofwithSetup setup info
, nowwithSetup info setup
is required but you can usewithSetupOld
instead. -
Use
userChangeAddress
(or first element ofuserAddresses
) instead ofuserAddr
. Note that there is pattern synonymUser'
defined to access old fields such asuserAddr
. -
submitTx
is removed, can use abovesubmitTxCtx
function. -
In case you were catching of
BuildTxException
(now renamed toGYBuildTxError
and it no longer has instance forException
), since now these are made part ofGYBuildTxException
constructor insideGYTxMonadException
type, catch for those instead. For example:- isTxBodyScriptExecutionError :: BuildTxException -> Bool - isTxBodyScriptExecutionError (BuildTxBodyErrorAutoBalance (Api.TxBodyScriptExecutionError _)) = True - isTxBodyScriptExecutionError _ = False + isTxBodyScriptExecutionError :: GYTxMonadException -> Bool + isTxBodyScriptExecutionError (GYBuildTxException (GYBuildTxBodyErrorAutoBalance (Api.TxBodyScriptExecutionError _))) = True + isTxBodyScriptExecutionError _ = False
-
GYPrivnet
now has an additional field to store of the network information used internally, you can largely ignore those. -
Note that these privnet run against Conway era and protocol parameters can be check like so:
pp <- ctxRunQuery ctx protocolParams info $ printf "Protocol parameters: %s" (show pp)
Let us know if you think some of these should be changed!
CLB (cardano-ledger-backend, replacement of plutus-simple-model employed earlier) & new testing mechanism
Note that we now have unified testing in place, i.e., same test file can be ran against multiple backend interpreters, i.e., either utilising CLB, private testnet machinery or any of cardano network (testnet/mainnet).
It is best to see tests-unified
directory to see how to structure these. In particular you don't need to write privnet tests separately!
-
There is no longer
Wallet
type, useUser
instead. -
If you earlier had
runWallet w1 $ withWalletBalancesCheckSimple walletDiffList $ do ...
You should instead do
withWalletBalancesCheckSimple walletDiffList $ asUser w1 $ do ...
-
Note that since the testing mechanism is unified, you should no longer require to import types such as
GYTxMonadClb
in your backend code. I.e., if you hadmyTrace :: SomeParameters -> Wallets -> GYTxMonadClb ()
You should instead do
myTrace :: GYTxGameMonad m => SomeParameters -> Wallets -> m ()
Note that
GYTxGameMonad
constraint should be added if you are employingasUser
in your trace, otherwise make use ofGYTxMonad
etc. -
Use
ownChangeAddress
instead ofownAddress
. -
Instead of
fail ...
usethrowAppError $ someBackendError $ ...
. -
sendSkeleton
andsendSkeleton'
can be defined like so:-- | This is simply defined as @buildTxBody skeleton >>= signAndSubmitConfirmed@. sendSkeleton :: GYTxMonad m => GYTxSkeleton v -> m GYTxId sendSkeleton skeleton = snd <$> sendSkeleton' skeleton sendSkeleton' :: GYTxMonad m => GYTxSkeleton v -> m (GYTxBody, GYTxId) sendSkeleton' skeleton = buildTxBody skeleton >>= \tx -> signAndSubmitConfirmed tx >>= \txId -> pure (tx, txId)
Appendix
Monad redesign summary
This is a long overdue redesign of GYTxMonad
. It adds the ability to submit transactions to the monad and splits it into a more lawful hierarchy. In particular:
-
GYTxQueryMonad
- For common utxo and similar queriesInstance:
GYTxQueryMonadIO
-
GYTxQueryMonad => GYTxSpecialQueryMonad
- For uncommon queries such as protocol parameters, era history etc. (this could potentially be removed, see note below)Instance:
GYTxQueryMonadIO
-
GYTxQueryMonad => GYTxUserQueryMonad
- For queries while acting as a user (having access to own wallet for querying purposes not signing purposes)Instance:
GYTxBuilderMonadIO
- see below. -
(GYTxSpecialQueryMonad, GYTxUserQueryMonad, Default (TxBuilderStrategy)) => GYTxBuilderMonad
- For building transactions while acting as a user. This allows different instances to choose their own transaction building method. IfTxBuilderStrategy
is set toGYCoinSelectionStrategy
(default), the implementation defaults to the pre-existing transaction building methods. Therefore, simplyanyclass
deriving this class will be enough to use the transaction bu...
v0.5.0
What's Changed
- Handle all balancing errors failure in parallel tx build logic by @sourabhxyz in #269.
Earlier onlyBalancingErrorInsufficientFunds
was returned for inBuildTxBalancingError
but now all ofBalancingError
are accounted for in it. - Support for
GYStakeAddressBech32
+ upstreamed few types, instances & utilities by @sourabhxyz in #273. - Ability to use Maestro's turbo tx submission by @sourabhxyz in #274.
Now an optionalturboSubmit
field can be included when specifying Maestro provider configuration as explained in this section of the documentation. - Add support for stake signing keys by @sourabhxyz in #280.
This adds support in Atlas for stake keys. In particular, support is provided to load private stake signing keys from file and ability to require stake key hash in transaction skeleton. Attempt has been made to keep breaking changes at minimal, in particular two changes are breaking:newTempUserCtx
now accepts a configuration instead of a boolean.- Fields of
User
type have been updated. GYPaymentCredentialByKey
now requiresGYPaymentKeyHash
instead ofGYPubKeyHash
.
- Adds functions into
Wallet
module, improves api interface... by @sourabhxyz in #284. - Improve swagger instances, provide helper utilities... by @sourabhxyz in #288.
- Add improvements to tx metadata api by @sourabhxyz in #293.
- Add provider support to query utxos at multiple payment credent… by @sourabhxyz in #291.
- Add a way to add transaction metadata by @ajuggler in #285.
- Add support of stake validators by @sourabhxyz in #295.
This also added support of stake key related certificates, such as it's registration, delegation and deregistration. Support of withdrawal is also added. Head over to this section of the documentation for more information on it.
New Contributors
Full Changelog: v0.4.0...v0.5.0
v0.4.0
What's Changed
- Feat #239: Support to query for UTxOs at payment credential along with datum by @sourabhxyz in #240
- Feat #215: Optimisation - Merge multiple
utxosAtTxOutRefs
calls in transaction building, Feat #236: Pure variant ofutxoDatum
, Feat #211: Compute maximum possible fee using protocol params instead of having it hardcoded by @sourabhxyz in #234 - Feat #196: No separate change output for fee over approximation algorithm by @Micrograx & @sourabhxyz in #235 and #242
- Incorporating Maestro's Haskell SDK update by @sourabhxyz in #245
- Feat #243: Get payment credential of an address by @sourabhxyz in #244
- [Breaking Change] Feat #246 - Provider function to query for UTxOs at an address with an asset by @sourabhxyz in #247
- Feat #250: Bump on openapi3 dependency in sync with cardano-wallet by @sourabhxyz in #251
- Feat #253 & #255: Added GYNatural + Using updated Maestro Haskell SDK by @sourabhxyz in #254
- Feat #256: Support for stake addresses by @sourabhxyz in #257
Dependencies Bump: Please note the commit of dependencies used in cabal.project
file as some of them have been updated b/w v0.3.0 & v0.4.0.
Full Changelog: v0.3.0...v0.4.0