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: 15154 Added createSnapshot method to State API #15543

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

Commits on Sep 18, 2024

  1. feat: 15154 Added createSnapshot method to State API

    Signed-off-by: Ivan Malygin <ivan@swirldslabs.com>
    imalygin committed Sep 18, 2024
    Configuration menu
    Copy the full SHA
    a07dcfa View commit details
    Browse the repository at this point in the history

Commits on Sep 19, 2024

  1. Addressed review comments:

    - Got rid of signed state creation just for the sake of creating a snapshot
    - Extracted serialization logic that is specific for `MerkleStateRoot` into `MerkleStateRoot`. Now it's responsible for serializing itself.
    - Extracted signature set into a separate file
    - Bumped serialization protocol version
    - removed SNAPSHOT_ON_DEMAND, as it's redundant
    
    Signed-off-by: Ivan Malygin <ivan@swirldslabs.com>
    imalygin committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    39dd5e2 View commit details
    Browse the repository at this point in the history
  2. Merge branch 'develop' into 15154-snapshot-api

    # Conflicts:
    #	platform-sdk/swirlds-common/src/main/java/com/swirlds/common/io/streams/SerializableDataInputStream.java
    imalygin committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    285a6b5 View commit details
    Browse the repository at this point in the history
  3. Fixed tests.

    Signed-off-by: Ivan Malygin <ivan@swirldslabs.com>
    imalygin committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    83be890 View commit details
    Browse the repository at this point in the history
  4. Made making copy conditional.

    Signed-off-by: Ivan Malygin <ivan@swirldslabs.com>
    imalygin committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    a20231c View commit details
    Browse the repository at this point in the history

Commits on Sep 20, 2024

  1. Addressed review comments.

    Signed-off-by: Ivan Malygin <ivan@swirldslabs.com>
    imalygin committed Sep 20, 2024
    Configuration menu
    Copy the full SHA
    c27c045 View commit details
    Browse the repository at this point in the history
  2. Added createSnapshot to com.swirlds.platform.state.MerkleRoot and…

    … implemented it in `com.swirlds.platform.state.State`
    
    Signed-off-by: Ivan Malygin <ivan@swirldslabs.com>
    imalygin committed Sep 20, 2024
    Configuration menu
    Copy the full SHA
    b468b8f View commit details
    Browse the repository at this point in the history
  3. Reused snapshot creation code in com.swirlds.platform.state.State. Ad…

    …ded missing ` setImmutable(true)` to `com.swirlds.platform.state.State#copy`
    
    Signed-off-by: Ivan Malygin <ivan@swirldslabs.com>
    imalygin committed Sep 20, 2024
    Configuration menu
    Copy the full SHA
    7b461ae View commit details
    Browse the repository at this point in the history
  4. Added a metric for the snapshot creation.

    Signed-off-by: Ivan Malygin <ivan@swirldslabs.com>
    imalygin committed Sep 20, 2024
    Configuration menu
    Copy the full SHA
    72eb164 View commit details
    Browse the repository at this point in the history
  5. Used Time object directly from the PlatformContext

    Signed-off-by: Ivan Malygin <ivan@swirldslabs.com>
    imalygin committed Sep 20, 2024
    Configuration menu
    Copy the full SHA
    3820588 View commit details
    Browse the repository at this point in the history
  6. Used System.nanoTime to calculate the time that snapshot creation t…

    …akes.
    
    Signed-off-by: Ivan Malygin <ivan@swirldslabs.com>
    imalygin committed Sep 20, 2024
    Configuration menu
    Copy the full SHA
    3b721f5 View commit details
    Browse the repository at this point in the history
  7. Addressed review comments:

    - added missing @nonnull and @nullable annotations
    - added missing final modifiers
    - extracted helper methods
    - added null check for `snapshotMetrics`
    
    Signed-off-by: Ivan Malygin <ivan@swirldslabs.com>
    imalygin committed Sep 20, 2024
    Configuration menu
    Copy the full SHA
    262119f View commit details
    Browse the repository at this point in the history
  8. Addressed review comments:

    - added missing @nonnull and @nullable annotations
    - added missing javadocs
    - added missing final modifier
    
    Signed-off-by: Ivan Malygin <ivan@swirldslabs.com>
    imalygin committed Sep 20, 2024
    Configuration menu
    Copy the full SHA
    93d3d73 View commit details
    Browse the repository at this point in the history
  9. Addressed review comments:

    - created a separate constant for sig set file version
    - added missing final modifier
    
    Signed-off-by: Ivan Malygin <ivan@swirldslabs.com>
    imalygin committed Sep 20, 2024
    Configuration menu
    Copy the full SHA
    e11ff16 View commit details
    Browse the repository at this point in the history
  10. Addressed review comments:

    - added missing final modifier
    - extracted snapshot creation logic into a separate class to reduce size of `MerkleStateRoot`
    
    Signed-off-by: Ivan Malygin <ivan@swirldslabs.com>
    imalygin committed Sep 20, 2024
    Configuration menu
    Copy the full SHA
    9f259f9 View commit details
    Browse the repository at this point in the history

Commits on Sep 21, 2024

  1. Fixed unit tests

    Signed-off-by: Ivan Malygin <ivan@swirldslabs.com>
    imalygin committed Sep 21, 2024
    Configuration menu
    Copy the full SHA
    43ae908 View commit details
    Browse the repository at this point in the history