Skip to content

AVM: Reassess ECDSA opcode cost with secp256r1 curve #3776

@michaeldiamant

Description

@michaeldiamant

Problem

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

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions