Skip to content

Feature update/cost models#827

Merged
twwu123 merged 9 commits into
mainfrom
feature-update/cost-models
May 21, 2026
Merged

Feature update/cost models#827
twwu123 merged 9 commits into
mainfrom
feature-update/cost-models

Conversation

@twwu123
Copy link
Copy Markdown
Collaborator

@twwu123 twwu123 commented May 21, 2026

Thank you for contributing to Mesh! We appreciate your effort and dedication to improving this project. To ensure that your contribution is in line with the project's guidelines and can be reviewed efficiently, please fill out the template below.

Remember to follow our Contributing Guide before submitting your pull request.

Summary

Previously the cost models were hardcoded, so every single hard fork required manual updates to the hardcoded cost models to calculate script data hash. Update the tx builder so that it can accept custom cost models, AND by default, pull cost models from fetcher.

Two things I've added

  1. .setCostModels endpoint (previously .setNetwork had an option for number[][] for cost models, but .setCostModels seems more obvious what it does).

  2. By default, it now pulls cost models from the fetcher if available, these are currently available for blockfrost and maestro.

Affect components

Please indicate which part of the Mesh Repo

  • @meshsdk/common
  • @meshsdk/contract
  • @meshsdk/core
  • @meshsdk/core-csl
  • @meshsdk/core-cst
  • @meshsdk/hydra
  • @meshsdk/provider
  • @meshsdk/react
  • @meshsdk/svelte
  • @meshsdk/transaction
  • @meshsdk/wallet
  • Mesh playground (i.e. https://meshjs.dev/)
  • Mesh CLI

Type of Change

Please mark the relevant option(s) for your pull request:

  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Bug fix (non-breaking change which fixes an issue)
  • Code refactoring (improving code quality without changing its behavior)
  • Documentation update (adding or updating documentation related to the project)

Related Issues

Please add the related issue here if any

Checklist

Please ensure that your pull request meets the following criteria:

  • My code is appropriately commented and includes relevant documentation, if necessary
  • I have added tests to cover my changes, if necessary
  • I have updated the documentation, if necessary
  • All new and existing tests pass (i.e. npm run test)
  • The build is pass (i.e. npm run build)

Additional Information

If you have any additional information or context to provide, such as screenshots, relevant issues, or other details, please include them here.

@twwu123 twwu123 merged commit f5cfccb into main May 21, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant