algorand / algorand/go-algorand

AVM: Reassess ECDSA opcode cost with secp256r1 curve

未关闭
#3,776 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
new-feature-request Team Scytale
主要语言
Go
星标
1.4k
派生
537
平均合并
1 天 7 小时
30 天内合并 PR
18

描述

## Problem

https://github.com/algorand/go-algorand/pull/3495 adds an ECDSA curve (secp256r1) that leaves related opcode costs unchanged although there's a performance overhead. Since the opcode costs underprice the runtime cost, there's AVM execution _may not_ match advertised throughput levels.

Context:
* #3495 is merged into https://github.com/algorand/go-algorand/pull/3514.
* #3514 deliberately gates secp256r1 behind a future version. So, the curve is _not_ available for general consumption.

## Solution

Unclear how best to proceed. Here's the loosely discussed ideas:
* Since the opcode cost is _not_ specific to each curve, a conservative option is to make opcode costs reflect the _most_ costly curve. Obviously, the solution penalizes less costly curves.
* Provide static opcode costs varied by immediate arguments (like different curves). The proposal offers a general-purpose way to customize opcost costs.
* Tangentially related: Provide dynamic opcode costs. For example, vary opcode cost by input size. The change may _not_ be needed solve the ticketed concern. Though it may be prudent to consider implications while making changes here.

## Dependencies

N/A

## Urgency

TBD

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

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