-
Notifications
You must be signed in to change notification settings - Fork 3
Description
In #35 we received the following feedback regarding our Plutus code:
The biggest performance gain will come from using a newer version of
plutus-tx
andplutus-tx-plugin
. You are on 1.0.0.0 which was published in Oct 2022, and a ton of performance improvements have been made since then. If you are able to bump GHC to 9.6, I'd strongly recommend doing so, as that will allow you to use the latest version ofplutus-tx-plugin
, which supports GHC 9.6 only.
We need to bump those dependencies, i.e. move to GHC 9.6 and the latest version of plutus-tx. As of the moment of this writing the latest version is 1.12.0.0. This probably has to be done in two steps:
- Bump dependencies in Nix, such that all the project dependencies compile. This needs to be done by someone who is familiar with Nix.
- Fix all compilation errors in our project, since not all code is necessarily compatible with GHC 9.6. This needs to be done by devs familiar with Plutus.
See also input-output-hk/trustless-sidechain#65, which this ticket in fact duplicates.
IOG Jira: https://input-output.atlassian.net/browse/ETCM-6654
Activity
kayvank commentedon Feb 21, 2024
I'll start working on this.
My suggestions is":
1- try to solve the issue is outlined above.
2- once the issue is resolved, consider updating the flake to follow iogx framework
tgunnoe commentedon Feb 22, 2024
I would suggest using https://github.com/hercules-ci/flake-parts in place of iogx unless there's something specific here that iogx would allow for.
kayvank commentedon Feb 23, 2024
@jstolarek
I am proceeding with step 1 above. I'd like to 1st simplify the
cabal.project
by removingsource-repository-package
where possible and rely on CHaPkayvank commentedon Feb 23, 2024
Thank you @tgunnoe , I am not familiar with the link you provided, but will take a look.
I like iogx for it has excellent documentation and support. Our devop team has been a supper star helping us in past projects to implement iogx. Additionally several of our projects have already adapted iogx,
Thoser were my primary reason
jstolarek commentedon Feb 26, 2024
@kayvank unfortunately, I can't provide any meaningful feedback in this discussion. I am not familiar with Nix in the slightest, so can't really say which way of organizing Nix code is better.
kayvank commentedon Feb 26, 2024
thanks @jstolarek, it is not an issue at this time as I think the first order of business should be upgrading to ghc9.x
Upgrading the nix framework could be addressed on a different ticket
kayvank commentedon Feb 26, 2024
@jstolarek nix and
ghci
for the entire stack has proven very difficult. The libraries and dependence are very old and has proven difficult to keep the dependency thread among them clean. The difficulty is compounded by the fact that thenix flake
has inputs to our vendor relate code,cardano-transaction-lib/plutip
At this stage, I'd like to propose to break this big problem into smaller ones:
nix develop
for theonchain
code with a newerghc
and plutus-tx-plugin as outlined in the ticketoffchain
code to the new environmentSo in summary, I'd like to break this issue to two:
onchain
project toghc9.6
and the latest plutus-tx-pluginoffchain
projectjstolarek commentedon Feb 26, 2024
That sounds reasonable, but note that:
make format-staged
in repo root). This needs to work after the refactoring.make update-scripts
in the offchain (sic!) directory, which builds the on-chain code from there. This would have to be fixed so that scripts are updated from the on-chain directory and the resultingRawScripts.purs
file is then moved to off-chain.tgunnoe commentedon Feb 26, 2024
I also think the onchain/offchain separate upgrade paths and dependency tracking will help keep the bill of materials more legible, even if it increases the size of the lockfile in the meantime.
jstolarek commentedon Feb 27, 2024
@kayvank A quick question regarding your second bullet point. Can you elaborate what you mean by migrating offchain project? Do you want to bring it up-to-date as its own separate project, which is potentially related to input-output-hk/trustless-sidechain#707? Or do you want to integrate everything back into one monolithic project?
kayvank commentedon Feb 28, 2024
@jstolarek I chose my words poorly, as
migrate
is not the correct word to use here, my apologies.My intentions is to do enough
nix
andflake
changes to upgrade theonchain
to the proper ghc 9.x per ticket so that we may use the recommendedplutus-tx-plugin
.Once that is completed, start building the
offchain
code in this newlynix
environment, and add runtime dependencies of theoncnain
code as required.I think tackling anything beyond the above points is out of scope for this ticket.
kayvank commentedon Feb 28, 2024
made a request to release
cardano-address
to CHaP, this should simplify the cabal.project a bit and help with managing the offchain build dependencies + build cachesee slack conv: https://input-output-rnd.slack.com/archives/CG1FBSDMM/p1709107638018839
jstolarek commentedon Feb 28, 2024
I agree with this, and your proposed solution sounds good. (I should have more to say on this by the end of the day - please give me a few hours).
I'm afraid I don't have access here. Could you give a quick summary of what this is about?
jstolarek commentedon Feb 28, 2024
Separating on-chain Nix bits from off-chain also lays groundwork for #710.
kayvank commentedon Feb 29, 2024
@jstolarek the slack conversation summary is:
"I initiated a request to publish
cardano-address
to CHaP. This way, we don't have to guess what git tag we need to point to in our cabal.project and will also reduce the build time since we can just pull it from cardano cache".I am afraid, in all likely hood, this will take a while, in the mean time, I'll just add
cardano-address
to the cabal.project, as we have beenkayvank commentedon Mar 11, 2024
I upgraded the plutus-tx and cother plutus-* modules to 1.21, see cabal.project
kayvank commentedon Jun 3, 2024
putting this ticket on hold for:
midnight
team- cardano-transaction-lib is not updated to newer version plutusTx, hence breaking the offchain CTL code
For additional detail see the corresponding slack-conversion