solana-labs / solana

Web-Scale Blockchain for fast, secure, scalable, decentralized apps and marketplaces.
https://solanalabs.com
Apache License 2.0
13.21k stars 4.29k forks source link

Make solana-test-validator go forward in time #19822

Closed AuroraLantean closed 1 year ago

AuroraLantean commented 3 years ago

Problem

I cannot make solana-test-validator go forward in time so I cannot test how the deployed programs can react in different time. For example, different reward token amounts are given for different staked token amounts and different staked time period

Proposed Solution

1) make it available to set solana-test-validator's time to a different time in the future 2) make it available to allow Anchor testing environment to integrate above feature into testing

jon-chuang commented 3 years ago

There is a method to do this. I think it's warp_to_slot or something.

Not sure if you can interact with a solana-test-validator via command line. I think anchor may use command line for the JS-based tests. So you could write rust tests, maybe

beautyfree commented 10 months ago

why it's closed?

buffalojoec commented 10 months ago

@AuroraLantean @beautyfree The solana-test-validator CLI command has a flag --warp-slot which allows the validator to fast-forward to the provided slot on startup.

Is the proposed issue here regarding fast-forwarding an already running test validator? Or is --warp-slot sufficient?

beautyfree commented 7 months ago

should I create another issue if I need fast-forwarding for an already running test validator?

buffalojoec commented 7 months ago

should I create another issue if I need fast-forwarding for an already running test validator?

Sure, on https://github.com/anza-xyz/agave.

anthonyra commented 5 months ago

should I create another issue if I need fast-forwarding for an already running test validator?

Sure, on https://github.com/anza-xyz/agave.

Since it's been awhile, I opened up an issue for this feature. https://github.com/anza-xyz/agave/issues/1709