-
Notifications
You must be signed in to change notification settings - Fork 13
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
[wip] FILL_COST take 2 #462
base: kaustinen-with-shapella
Are you sure you want to change the base?
Conversation
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) |
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.
this only works with pebble, which is a problem because we don't know how much of the network still uses legacy dbs.
core/state/access_witness.go
Outdated
@@ -50,6 +51,7 @@ func NewAccessWitness(pointCache *utils.PointCache) *AccessWitness { | |||
return &AccessWitness{ | |||
branches: make(map[branchAccessKey]mode), | |||
chunks: make(map[chunkAccessKey]mode), | |||
fills: make(map[chunkAccessKey]struct{}), |
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.
note to self: this is a bug because it is reinitialized for each tx
// 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") |
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.
TODO: figure out why this is broken and fix it
// is now independent of the blockchain database. | ||
gspec.MustCommit(gendb) | ||
|
||
blockGasUsagesExpected := params.TxGas + 216 /* intrinsic gas */ + 3*vm.GasFastestStep + params.WitnessChunkReadCost + params.WitnessChunkWriteCost |
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.
TODO: get intrinsic gas from the function
Directly bypass the
StateDB
layer 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:
SELFDESTRUCT
is the use case for which the most checks need to happen. Note that this isn't implemented at the current state of this PR.SSTORE
is the other use case, and unfortunately it will come at a significant slowdown.