Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat #372 & #373 #370

Open
wants to merge 16 commits into
base: main
Choose a base branch
from

Conversation

sourabhxyz
Copy link
Member

@sourabhxyz sourabhxyz commented Dec 13, 2024

Closes #372, closes #373.

Now era histories are cached through entire run of the program whereas protocol parameters are cached per epoch.

Inside mkMethod of makeGetParameters I had added print statements here to track values of the associated MVar to verify update is correctly occurring, see below logs:

Serving cached parameters, currentTime: 2024-12-18 10:02:46.504257 UTC and nextEpochBeginTime: 2024-12-18 10:03:28 UTC
Serving cached parameters, currentTime: 2024-12-18 10:02:55.519935 UTC and nextEpochBeginTime: 2024-12-18 10:03:28 UTC
Serving cached parameters, currentTime: 2024-12-18 10:03:04.54132 UTC and nextEpochBeginTime: 2024-12-18 10:03:28 UTC
Serving cached parameters, currentTime: 2024-12-18 10:03:07.552586 UTC and nextEpochBeginTime: 2024-12-18 10:03:28 UTC
Serving cached parameters, currentTime: 2024-12-18 10:03:10.560332 UTC and nextEpochBeginTime: 2024-12-18 10:03:28 UTC
Serving cached parameters, currentTime: 2024-12-18 10:03:16.579995 UTC and nextEpochBeginTime: 2024-12-18 10:03:28 UTC
Serving cached parameters, currentTime: 2024-12-18 10:03:19.596804 UTC and nextEpochBeginTime: 2024-12-18 10:03:28 UTC
Serving cached parameters, currentTime: 2024-12-18 10:03:22.631832 UTC and nextEpochBeginTime: 2024-12-18 10:03:28 UTC
Serving cached parameters, currentTime: 2024-12-18 10:03:25.660371 UTC and nextEpochBeginTime: 2024-12-18 10:03:28 UTC
Refreshing parameters, currentTime: 2024-12-18 10:03:31.672819 UTC and nextEpochBeginTime: 2024-12-18 10:03:28 UTC and timeDelta: 50s
newNextEpochBeginTime: 2024-12-18 10:04:18 UTC
Serving cached parameters, currentTime: 2024-12-18 10:03:37.714951 UTC and nextEpochBeginTime: 2024-12-18 10:04:18 UTC
Serving cached parameters, currentTime: 2024-12-18 10:03:46.755501 UTC and nextEpochBeginTime: 2024-12-18 10:04:18 UTC
Serving cached parameters, currentTime: 2024-12-18 10:03:52.773923 UTC and nextEpochBeginTime: 2024-12-18 10:04:18 UTC
Serving cached parameters, currentTime: 2024-12-18 10:03:58.797953 UTC and nextEpochBeginTime: 2024-12-18 10:04:18 UTC
Serving cached parameters, currentTime: 2024-12-18 10:04:01.817292 UTC and nextEpochBeginTime: 2024-12-18 10:04:18 UTC
Serving cached parameters, currentTime: 2024-12-18 10:04:04.829536 UTC and nextEpochBeginTime: 2024-12-18 10:04:18 UTC

This however is removed from final PR as we don't want to perform such IO action inside MVar update.

I had also written a privnet test file to verify that new fetch is occurring in next epoch here however this is removed from final PR as it's not automated.

While working on this task, I had noticed a nasty bug where our caching mechanism was essentially broken since when we call methods like getProtParams' we are actually generating fresh MVar instead of utilising an old one.

@sourabhxyz sourabhxyz requested a review from a team as a code owner December 13, 2024 12:46
@sourabhxyz sourabhxyz changed the title feat: allow addRefScript to work with higher plutus versions feat #372 & #373 Dec 16, 2024
@sourabhxyz sourabhxyz marked this pull request as draft December 18, 2024 12:31
@4TT1L4 4TT1L4 marked this pull request as ready for review December 18, 2024 13:07
4TT1L4
4TT1L4 previously approved these changes Dec 18, 2024
Copy link
Contributor

@4TT1L4 4TT1L4 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

…onsidering the short epoch size of privnet so as to not encounter past horizon error
4TT1L4
4TT1L4 previously approved these changes Dec 18, 2024
Copy link
Contributor

@4TT1L4 4TT1L4 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing the CI build

Re-approved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants