Skip to content

Block timestamp not reliable for AMM #4483

@dobertRowneySr

Description

@dobertRowneySr

Problem

Currently the buy/sell_on_amm extrinsics rely on the pallet_timestamp::get() function for checking the order deadline. However block timestamp is:

  1. Not Deterministic
  2. Easily manipulated by the validator
  3. Doesn' really prevent execution if the order gets executed at the end of the block despite the transaction being the first time-wise.

Solution

Don't use the timestamp logic provided by the pallet_timestamp.
Drop the deadline check or use a offline source for the timestamp value

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions