Update eth_writeStateDiffAt
#296
Labels
No Label
bug
critical
duplicate
enhancement
epic
help wanted
in progress
invalid
low priority
question
rebase
v1
v5
wontfix
Copied from Github
Kind/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: cerc-io/go-ethereum#296
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
eth_writeStateDiffAt
allows an external service to tell geth to write a statediff at a specific block(hash). This process can be long running, especially if the geth node is busy writing statediffs as it tracks the head of the chain.This is problematic for two reasons:
Quick fixes:
In each of the above cases we also need to add constraints on the number of concurrent requests being served.
It is quite easy to trigger associated problems by making calls to
eth_getStorageAt
throughipld-eth-server
. In the standard production configuration, if the data cannot be loaded byipld-eth-server
it will proxy the call togeth
and also spin up a go routine which callseth_writeStateDiffAt
oreth_writeStateDiffFor
in the background.This will respond to the client quickly (usually on the order of 100ms or less) while the go routine goes about its work. It isn't uncommon to request several storage items related to the same contract (for example) in quick succession. The result is triggering more and more statediffs, usually for the same block, all attempting to run concurrently. In the worst case scenario, this will exhaust available resources, eg, https://github.com/cerc-io/go-ethereum/issues/293 . In that example, all it takes is making a single
eth_getStorageAt
call at a time in a loop.It is worth noting that until https://github.com/cerc-io/issue_tracking/issues/5 is fixed, there is no guarantee that the requested key exists in the DB even after the block has been statediffed "successfully". This means statediffing can be triggered on the same block again (and again) regardless of how many times it has already been processed (see the repeated
writing statediff for...
messages in this comment: https://github.com/cerc-io/ipld-eth-server/issues/209#issuecomment-1363314614)Thanks @telackey
On the ipld-eth-server side the behavior we would like have is:
But then if another query comes in that would trigger the same
writeStateDiffAt
query as in step 4 and step 4 still hasn't returned, it should not trigger that query.For endpoints such as
eth_call
andeth_getStorageAt
where we cannot attribute missing data to a statediff missing at a specific height, we have removed their ability to calleth_writeStateDiffAt
entirely and that missing data need to be detected and handled separately as discussed elsewhere (and including the https://github.com/cerc-io/issue_tracking/issues/5 fix).