Skip to content

fix: reset_network to correctly reset time info#513

Merged
MicaiahReid merged 2 commits intotxtx:mainfrom
bonlime:fix-reset-network-time
Feb 5, 2026
Merged

fix: reset_network to correctly reset time info#513
MicaiahReid merged 2 commits intotxtx:mainfrom
bonlime:fix-reset-network-time

Conversation

@bonlime
Copy link
Contributor

@bonlime bonlime commented Jan 29, 2026

Fixes #511

Tests were vibed so if you think it's a little verbose, can shorten them

@MicaiahReid
Copy link
Member

Hmmm, I'm not sure about this.

When you first start a surfnet, the epoch info will come from the mainnet datasource. Now, we're clearing it out to zero.

I'm not sure what the expected behavior should be, one of these:

  1. Clear it out to zero like you have it
  2. When we first set the Epoch info after fetching from mainnet, cache "genesis info", and reset to that
  3. On reset, refetch from mainnet and have that new value be our epoch info

I'm of the opinion that we should go with option 2. Thoughts, @bonlime, @lgalabru?

@bonlime
Copy link
Contributor Author

bonlime commented Jan 30, 2026

that's a good point, I personally would go with option 3, since it would be closer to "full reset", I'll see if it's easy enough to do

@lgalabru
Copy link
Member

I'd go with option 3 when the surfnet has a datasource, and keep option 1 when the surfnet is offline

@MicaiahReid
Copy link
Member

Okay, sounds good. Let's go with option 3, @bonlime. Thanks!

@MicaiahReid
Copy link
Member

Hey, @bonlime, just checking in - do you think you'll have time to get this over the finish line?

@bonlime
Copy link
Contributor Author

bonlime commented Feb 3, 2026

Hey, i've tried to implement this, but struggled with rust async, since i'm not very proficient with it... if you could implement it, it probably would be faster

@lgalabru
Copy link
Member

lgalabru commented Feb 5, 2026

hey @bonlime, thanks for your contribution!
As long as your additions are tested, it's fine by us if you get a bit of help from Claude!

@bonlime
Copy link
Contributor Author

bonlime commented Feb 5, 2026

@lgalabru I've tried. The problem is that it requires changing previously sync functions to async to allow for rpc requests, in multiple attempts I did it resulted in pretty significant functions signatures changed, so I threw it away. it definitely needs some guided input from a person much better in both rust and this code base

@MicaiahReid MicaiahReid merged commit febbba2 into txtx:main Feb 5, 2026
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

surfnet_resetNetwork doesn't reset time

3 participants