Skip to content

Conversation

@Kbhat1
Copy link
Contributor

@Kbhat1 Kbhat1 commented Oct 8, 2025

Describe your changes and provide context

Testing performed to validate your change

}

func (b *Batch) Write() (err error) {
startTime := time.Now()

Check warning

Code scanning / CodeQL

Calling the system time Warning

Calling the system time may be a possible source of non-determinism
}

func (b *RawBatch) Write() (err error) {
startTime := time.Now()

Check warning

Code scanning / CodeQL

Calling the system time Warning

Calling the system time may be a possible source of non-determinism
}

// Start background metrics collection
go database.collectMetricsInBackground()

Check notice

Code scanning / CodeQL

Spawning a Go routine Note

Spawning a Go routine may be a possible source of non-determinism
}

func (db *Database) Get(storeKey string, targetVersion int64, key []byte) ([]byte, error) {
startTime := time.Now()

Check warning

Code scanning / CodeQL

Calling the system time Warning

Calling the system time may be a possible source of non-determinism
}

func (db *Database) ApplyChangeset(version int64, cs *proto.NamedChangeSet) error {
startTime := time.Now()

Check warning

Code scanning / CodeQL

Calling the system time Warning

Calling the system time may be a possible source of non-determinism
}

func (db *Database) computeHashForRange(beginBlock, endBlock int64) error {
startTime := time.Now()

Check warning

Code scanning / CodeQL

Calling the system time Warning

Calling the system time may be a possible source of non-determinism
// it has been updated. This occurs when that module's keys are updated in between pruning runs, the node after is restarted.
// This is not a large issue given the next time that module is updated, it will be properly pruned thereafter.
func (db *Database) Prune(version int64) error {
startTime := time.Now()

Check warning

Code scanning / CodeQL

Calling the system time Warning

Calling the system time may be a possible source of non-determinism
// Import loads the initial version of the state in parallel with numWorkers goroutines
// TODO: Potentially add retries instead of panics
func (db *Database) Import(version int64, ch <-chan types.SnapshotNode) error {
startTime := time.Now()

Check warning

Code scanning / CodeQL

Calling the system time Warning

Calling the system time may be a possible source of non-determinism

// Record compaction duration if available
if compactionCountDelta > 0 && m.Compact.Duration > 0 {
avgDurationSeconds := m.Compact.Duration.Seconds() / float64(compactionCountDelta)

Check notice

Code scanning / CodeQL

Floating point arithmetic Note

Floating point arithmetic operations are not associative and a possible source of non-determinism

// Record flush duration if available
if flushCountDelta > 0 && m.Flush.WriteThroughput.WorkDuration > 0 {
avgDurationSeconds := m.Flush.WriteThroughput.WorkDuration.Seconds() / float64(flushCountDelta)

Check notice

Code scanning / CodeQL

Floating point arithmetic Note

Floating point arithmetic operations are not associative and a possible source of non-determinism
@Kbhat1 Kbhat1 changed the title Kartik/add ss metrics Add State Store Metrics Oct 8, 2025
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.

3 participants