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

Enhancement/2004 add patch timestamp debug api #2077

Open
wants to merge 12 commits into
base: v4.0.0
Choose a base branch
from

Conversation

PropzSaladaz
Copy link

@PropzSaladaz PropzSaladaz commented Jan 15, 2025

Description

  • Added new RPC debug function that returns all patchTimestamps
  • Only callable when debug API is enabled

Example call:

curl -X POST --data '{"jsonrpc":"2.0","method":"debug_getPatchTimestamps","params":null,"id":1205}' <http_endpoint>

Example response:

{"id":1205,"jsonrpc":"2.0","result":{"contractStoragePatchTimestamp":1681732800,"contractStorageZeroValuePatchTimestamp":1681128000,"correctForkInPowPatchTimestamp":1710331200,"eIP1559TransactionsPatchTimestamp":1721818800,"externalGasPatchTimestamp":1727712000,"fastConsensusPatchTimestamp":1721822400,"flexibleDeploymentPatchTimestamp":1721826000,"powCheckPatchTimestamp":1702296000,"precompiledConfigPatchTimestamp":1710331200,"pushZeroPatchTimestamp":1710331200,"revertableFSPatchTimestamp":1681473600,"selfdestructStorageLimitPatchTimestamp":0,"skipInvalidTransactionsPatchTimestamp":1702382400,"storageDestructionPatchTimestamp":1702393200,"verifyBlsSyncPatchTimestamp":1721829600,"verifyDaSigsPatchTimestamp":1681300800}}

Tests

  • debugGetPatchTimestamps
    • Compares the output of RPC call to the timestamps defined in the config file.

Fixes #2004

Note

There was an error regarding SSL certificates - the fix was applied from this pull request: https://github.com/skalenetwork/skaled/pull/2083/files#diff-38359420a0372293cb7b671c618cfa76df6e2ae4db0197ce671aa07a57322b6bR1248 - namely lines 1248 & 1249 from file deps/build.sh

@DmytroNazarenko DmytroNazarenko added this to the SKALE 4.0 milestone Jan 16, 2025
@olehnikolaiev olehnikolaiev linked an issue Jan 22, 2025 that may be closed by this pull request
Comment on lines +29 to +30
else if ( _patchName == "SelfdestructStorageLimitPatch" )
return SchainPatchEnum::SelfdestructStorageLimitPatch;
Copy link
Collaborator

Choose a reason for hiding this comment

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

What is the purpose of this patch?

Copy link
Author

Choose a reason for hiding this comment

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

This line was missing in the original code. We had the SchainPatchEnum::SelfdestructStorageLimitPatch enum variant defined, but not the convertion from its string value to the enum variant in this function (which converts a string to the corresponding SchainPatchEnum variant. So I added the missing conversion.

test/unittests/libweb3jsonrpc/jsonrpc.cpp Outdated Show resolved Hide resolved
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.

Add debug API to check PatchTimestamp activation
3 participants