-
Notifications
You must be signed in to change notification settings - Fork 18
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
Add vertex store size limit; cleanup vertex store events #854
base: develop
Are you sure you want to change the base?
Changes from all commits
501a3bf
783d36f
a79c14b
b707db8
1ad56a4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -64,24 +64,18 @@ | |
|
||
package com.radixdlt.consensus.bft; | ||
|
||
import com.radixdlt.consensus.BFTHeader; | ||
import com.radixdlt.consensus.event.LocalEvent; | ||
import com.radixdlt.consensus.vertexstore.ExecutedVertex; | ||
import com.radixdlt.consensus.vertexstore.VertexStoreState; | ||
import com.radixdlt.utils.WrappedByteArray; | ||
|
||
/** An update emitted when the BFT has inserted a new vertex */ | ||
/** An event emitted after a vertex has been inserted into the vertex store. */ | ||
public record BFTInsertUpdate( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We've lost the nice There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Otherwise we could end up with a massive log of the serialized vertex state in hex. |
||
ExecutedVertex insertedVertex, int siblingsCount, VertexStoreState vertexStoreState) | ||
ExecutedVertex insertedVertex, WrappedByteArray serializedVertexStoreState) | ||
implements LocalEvent { | ||
|
||
public int getVertexStoreSize() { | ||
return vertexStoreState.getVertices().size(); | ||
} | ||
|
||
public BFTHeader getHeader() { | ||
return new BFTHeader( | ||
insertedVertex.getRound(), | ||
insertedVertex.getVertexHash(), | ||
insertedVertex.getLedgerHeader()); | ||
@Override | ||
public String toString() { | ||
return String.format( | ||
"%s[insertedVertex=%s serializedVertexStoreStateSize=%s]", | ||
getClass().getSimpleName(), insertedVertex(), serializedVertexStoreState.size()); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -66,6 +66,17 @@ | |
|
||
import com.radixdlt.consensus.event.LocalEvent; | ||
import com.radixdlt.consensus.vertexstore.VertexStoreState; | ||
import com.radixdlt.utils.WrappedByteArray; | ||
|
||
/** An update emitted when the BFT has been rebuilt */ | ||
public record BFTRebuildUpdate(VertexStoreState vertexStoreState) implements LocalEvent {} | ||
/** An even emitted when the vertex store has been rebuilt. */ | ||
public record BFTRebuildUpdate( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We've lost the nice There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Otherwise we could end up with a massive log of the serialized vertex state in hex. |
||
VertexStoreState vertexStoreState, WrappedByteArray serializedVertexStoreState) | ||
implements LocalEvent { | ||
|
||
@Override | ||
public String toString() { | ||
return String.format( | ||
"%s[serializedVertexStoreStateSize=%s]", | ||
getClass().getSimpleName(), serializedVertexStoreState.size()); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We've lost the nice
toString
here - perhaps we should override it?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Otherwise we could end up with a massive log of the serialized vertex state in hex.