algorand / algorand/go-algorand

AVM: Reassess ECDSA opcode cost with secp256r1 curve

Ouverte
#3,776 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
new-feature-request Team Scytale
Langage dominant
Go
Étoiles
1.4k
Forks
537
Merge moyen
1 j 6 h
PR mergées (30 j)
17

Description

## 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

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.