cache eth_maxPriorityFeePerGas with the head block
This commit is contained in:
parent
a696fb92f6
commit
1185b2d0f9
@ -234,11 +234,13 @@ impl CacheMode {
|
|||||||
"eth_getBlockByHash" => {
|
"eth_getBlockByHash" => {
|
||||||
// TODO: double check that any node can serve this
|
// TODO: double check that any node can serve this
|
||||||
// TODO: can a block change? like what if it gets orphaned?
|
// TODO: can a block change? like what if it gets orphaned?
|
||||||
|
// TODO: make sure re-orgs work properly!
|
||||||
return Ok(CacheMode::CacheSuccessForever);
|
return Ok(CacheMode::CacheSuccessForever);
|
||||||
}
|
}
|
||||||
"eth_getBlockByNumber" => {
|
"eth_getBlockByNumber" => {
|
||||||
// TODO: double check that any node can serve this
|
// TODO: double check that any node can serve this
|
||||||
// TODO: CacheSuccessForever if the block is old enough
|
// TODO: CacheSuccessForever if the block is old enough
|
||||||
|
// TODO: make sure re-orgs work properly!
|
||||||
return Ok(CacheMode::Cache {
|
return Ok(CacheMode::Cache {
|
||||||
block: head_block.into(),
|
block: head_block.into(),
|
||||||
cache_errors: true,
|
cache_errors: true,
|
||||||
@ -351,6 +353,13 @@ impl CacheMode {
|
|||||||
return Ok(CacheMode::CacheSuccessForever);
|
return Ok(CacheMode::CacheSuccessForever);
|
||||||
}
|
}
|
||||||
"eth_getUncleCountByBlockNumber" => 0,
|
"eth_getUncleCountByBlockNumber" => 0,
|
||||||
|
"eth_maxPriorityFeePerGas" => {
|
||||||
|
// TODO: this might be too aggressive. i think it can change before a block is mined
|
||||||
|
return Ok(CacheMode::Cache {
|
||||||
|
block: head_block.into(),
|
||||||
|
cache_errors: false,
|
||||||
|
});
|
||||||
|
}
|
||||||
_ => {
|
_ => {
|
||||||
// some other command that doesn't take block numbers as an argument
|
// some other command that doesn't take block numbers as an argument
|
||||||
// since we are caching with the head block, it should be safe to cache_errors
|
// since we are caching with the head block, it should be safe to cache_errors
|
||||||
|
Loading…
Reference in New Issue
Block a user