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/skaled 1583 patch architecture #1842

Closed
wants to merge 52 commits into from

Conversation

dimalit
Copy link
Contributor

@dimalit dimalit commented Mar 4, 2024

fixes #1583

Description

  1. "Forks" are now activated by block timestamp, rather than number.
  2. There are DEFINE_XXX_PATCH macros for defining patches.
  3. Timestamps for patches are automatically read from config.
  4. Existing patches use these macros.

Tests

Tests for patches:

  • ContractStorageLimitPatch: storage_limit_reverted
  • ContractStorageZeroValuePatch: tested manually, used in test storage_limit_predeployed
  • RevertableFSPatch: FilestorageCacheSuite)
  • StorageDestructionPatch: tested manually with JsonRpcSuite/simple_contract
  • POWCheckPatch: powTxnGasLimit
  • PushZeroPatch: LegacyVMSuite/InstructionSuite
  • SkipInvalidTransactionsPatch: SkaleHostSuite
  • PrecompiledConfigPatch: PrecompiledTests/getConfigVariable
  • CorrectForkInPowPatch: simplePoWTransaction
  • VerifyDaSigsPatch - need to check manually!

Performance Impact

There can be significant performance impact, as patch activations are evaluated at each block or sometimes even every transaction. This is to be tested separately

Details about changes in code

  1. A lot of functions that needed only blockNumber parameter now need also committedBlockTimestamp.
  2. Removed 'Frontier' fork (it was never used), as well as 'SkaleNNNForkBlock`s for same reson.
  3. EVMSchedule can now be constructed from several patches, and not only taken from pre-defined list as before (ChainOperationParams::evmSchedule)
  4. Some functionality moved from SealEngine to ChainOperationParams, and SealEngine is now unneeded in some places, where ChainOperationParams suffice - for simplification of architecture. Also it's planned to cut out SealEngine completely.
  5. PushZeroPatch uses boolean field in EVMSchedule, and generates new EVMSchedule similar to 'fork blocks'
  6. In libethereum/SchainPatch.h there are new macros for creation of patches.
  7. Almost all old patches now use these macros (see SchainPatch.h)
  8. Latest block timestamp is updated every block for all patches at once - in SchainPatch class.

@dimalit dimalit changed the base branch from develop to v3.19.0 March 4, 2024 12:26
@kladkogex kladkogex marked this pull request as ready for review March 6, 2024 11:57
kladkogex
kladkogex previously approved these changes Mar 14, 2024
@kladkogex kladkogex self-requested a review April 10, 2024 11:26
@dimalit
Copy link
Contributor Author

dimalit commented Apr 10, 2024

Superseded by #1868

@dimalit dimalit closed this Apr 10, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Apr 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Patch timestamp architecture
2 participants