Skip to content

cryptosim bugfixes#3085

Merged
cody-littley merged 4 commits into
mainfrom
cjl/cryptosim-bugfixes
Mar 18, 2026
Merged

cryptosim bugfixes#3085
cody-littley merged 4 commits into
mainfrom
cjl/cryptosim-bugfixes

Conversation

@cody-littley

Copy link
Copy Markdown
Contributor

Describe your changes and provide context

Fixes two minor issues with the cryptosim benchmark:

  • logs are currently spamming the console
  • we are currently writing addresses to the storage DB instead of the address DB

Testing performed to validate your change

Ran cryptosim locally

@github-actions

github-actions Bot commented Mar 18, 2026

Copy link
Copy Markdown

The latest Buf updates on your PR. Results from workflow Buf / buf (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedMar 18, 2026, 4:01 PM

if found {
return fmt.Errorf("should not find source account in DB, account should be new")
}
srcAccountValue = txn.newSrcData

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

the transaction struct still defines newSrcData and newDstData fields, and BuildTransaction() still allocates random byte slices into them

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

removed unused fields

)

/*
This extra binary for setting up logging is a an unfortunate complexity, but we can't really avoid it

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

typo: is an

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

fixed

}()
}

func (m *CryptosimMetrics) startLogDirSizeSampling(logDir string, intervalSeconds int) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

startLogDirSizeSampling() duplicates many code in startDataDirSizeSampling(), consider a common helper func?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I've cleaned up the monitoring code setup.

@@ -141,20 +140,16 @@ func (txn *transaction) Execute(
phaseTimer.SetPhase("read_src_account")

// Read the sender's native balance / nonce / codehash.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

comments outdated after the key prefix change to EVMKeyCodeHash

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Updated comment:

	// Read the sender's native balance / nonce / codehash.
	// Technically, we are just requesting to read the codehash, but internally the codehash is bundled with
	// the nonce and balance, so all of this data will be read from low level storage, even if it isn't being
	// returned to the caller.
	_, found, err = database.Get(txn.srcAccount)

@cody-littley cody-littley added this pull request to the merge queue Mar 18, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Mar 18, 2026
@cody-littley cody-littley added this pull request to the merge queue Mar 18, 2026
Merged via the queue into main with commit 8a11ce5 Mar 18, 2026
38 checks passed
@cody-littley cody-littley deleted the cjl/cryptosim-bugfixes branch March 18, 2026 17:25
yzang2019 pushed a commit that referenced this pull request Mar 19, 2026
## Describe your changes and provide context

Fixes two minor issues with the cryptosim benchmark:

- logs are currently spamming the console
- we are currently writing addresses to the storage DB instead of the
address DB

## Testing performed to validate your change

Ran cryptosim locally

---------

Co-authored-by: Cody Littley <cody.littley@seinetwork.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants