Skip to content

Change behavior of START_BLOCKHEIGHT when testing #417

@SebastienGllmt

Description

@SebastienGllmt

Thematically related to #414 and #413

Right now, when using Paima, resetting your database also resets the START_BLOCKHEIGHT. This makes sense in two ways:

  1. It avoids replaying any history from previous testing which might contain data you want to ignore
  2. You want to avoid spending time waiting for historical data to sync

However, this feature was built at a time before localhost testing was a thing. It makes both of these points mostly useless because

  1. You can just restart the chain entirely if you want to remove previous data
  2. You're just syncing locally, so it's really fast anyway

That is to say, this feature is not only unnecessary in the average case, it's also dangerous because of timers. By resetting your START_BLOCKHEIGHT, it will not affect standard transactions (which still trigger during the presync), but it will not trigger time-based actions (which don't run during the presync, and probably can't run then)

Ways we can solve this

  1. Remove the START_BLOCKHEIGHT reset (maybe make it optional behind a flag, since it is very situationally useful)
  2. Add a warn/error if a time-based action gets added to Paima while presync is happening

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions