Draft
Conversation
gballet
commented
Jul 19, 2024
core/state/statedb.go
Outdated
| // The error needs to be checked because we want to be future-proof | ||
| // and not rely on the length of the encoding, in case 0-values are | ||
| // somehow compressed later. | ||
| return errors.Is(pebble.ErrNotFound, err) |
Owner
Author
There was a problem hiding this comment.
this only works with pebble, which is a problem because we don't know how much of the network still uses legacy dbs.
gballet
commented
Jul 19, 2024
core/state/access_witness.go
Outdated
| return &AccessWitness{ | ||
| branches: make(map[branchAccessKey]mode), | ||
| chunks: make(map[chunkAccessKey]mode), | ||
| fills: make(map[chunkAccessKey]struct{}), |
Owner
Author
There was a problem hiding this comment.
note to self: this is a bug because it is reinitialized for each tx
gballet
commented
Jul 19, 2024
gballet
commented
Jul 19, 2024
Comment on lines
+662
to
+667
| // check the proof for the last block | ||
| // err = trie.DeserializeAndVerifyVerkleProof(proofs[0], genesis.Root().Bytes(), chain[0].Root().Bytes(), keyvals[0]) | ||
| // if err != nil { | ||
| // t.Fatal(err) | ||
| // } | ||
| // t.Log("verfied verkle proof") |
Owner
Author
There was a problem hiding this comment.
TODO: figure out why this is broken and fix it
gballet
commented
Jul 19, 2024
| // is now independent of the blockchain database. | ||
| gspec.MustCommit(gendb) | ||
|
|
||
| blockGasUsagesExpected := params.TxGas + 216 /* intrinsic gas */ + 3*vm.GasFastestStep + params.WitnessChunkReadCost + params.WitnessChunkWriteCost |
Owner
Author
There was a problem hiding this comment.
TODO: get intrinsic gas from the function
e5d5e09 to
4a2f6fb
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Directly bypass the
StateDBlayer into the disk DB, in order to find out if a value exists. This will avoid a lot of caching bugs.The obvious problem with this approach, is that reading a slot will require hashing. One workaround for this problem would be to have a DB with (key, values). All the insertions/tree updates are moved to the prefetcher/background threads. This would mean that the tree and values are stored at different locations - and that we need to rewrite the disk access layer in geth :| Let's see how bad the performance hit is, before we go for that one.
One thing to note is that there are really two things that cause this read:
SELFDESTRUCTis the use case for which the most checks need to happen. Note that this isn't implemented at the current state of this PR.SSTOREis the other use case, and unfortunately it will come at a significant slowdown.