Evaluators price scripts at a fixed protocol version

未关闭
#697 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
48/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
typescript

调研方向

Start at packages/evolution/src/sdk/builders/TransactionBuilder.ts:146 and trace how provider protocol parameters reach EvaluationContext; the issue says the major version is currently dropped. Check the Ogmios, Koios, and Blockfrost version fields, then inspect the uplc and Scalus evaluator entry points named in the issue. Done when both evaluators use the network's protocol version and their costs match the node for versions 10 and 11.

由索引模型根据 Issue 内容生成。

描述

bug

The local evaluators price scripts with the rules of one fixed protocol version, whatever version the network runs. The ledger picks the builtin cost rules by protocol version. From version 11, divideInteger and modInteger cost more when the dividend is narrower than the divisor. In Plutus V1 and V2 the memory of modInteger and remainderInteger changes too (plutus-ledger-api/src/PlutusLedgerApi/V2/EvaluationContext.hs:58-63 and V3/EvaluationContext.hs:51-57 at Plutus 1.72.0.0).

  • aiken-uplc builds on uplc 1.1.21 (packages/aiken-uplc/rust/Cargo.toml:10), which has only the rules from before version 11. Mainnet, preprod and preview are at 11, so a script that divides by an operand wider than 64 bits is under-declared. Compared with the mainnet node, V2 divideInteger(7, 10^300) costs 309,948 steps in aiken-uplc and 454,517 on the node.
  • scalus-uplc after #615 always uses version 11. That is right for the public networks, but the default devnet starts at 10. There, V2 modInteger with a wide dividend comes out at 1,501 memory against the node's 1,515.

In both cases the node rejects the transaction at submission with "Invalid transaction submitted as valid" (Ogmios code 3136). The transaction never enters the mempool, so no collateral is taken.

The fix is to carry the protocol major version in EvaluationContext (packages/evolution/src/sdk/builders/TransactionBuilder.ts:146), filled from the provider's protocol parameters. Ogmios returns it as version.major, Koios as protocol_major and Blockfrost as protocol_major_ver, but ProtocolParameters drops it today. Both evaluators can take it: uplc 1.1.23 and later through eval_phase_two_raw_with_protocol, and Scalus through evaluateTx. Bumping uplc to 1.1.24 without passing the version would move the mismatch to version 10 networks, as it did for Scalus.

主要语言
TypeScript
星标
22
派生
33
平均合并
21 小时 38 分钟
30 天内合并 PR
55

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

IntersectMBO/evolution-sdk 的其他 Issue

查看 IntersectMBO/evolution-sdk 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。