Description
When calling the /protocol_state or /contract_state endpoint for the latest finalized block, it returns 404 Error: Not Found. However, the endpoint works as expected for the blocks immediately before and after the latest finalized block.
Example
Given current finalized block: 21392273
With this request:
curl -X 'POST' \
'http://0.0.0.0:4242/v1/contract_state' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"chain": "ethereum",
"pagination": {
"page": 0,
"page_size": 2
},
"protocol_system": "vm:balancer_v2",
"version": {
"block": {
"chain": "ethereum",
"number": 21392273
}
}
}'
- Behavior:
/contract_state for block 21392272 → ✅ Works
/contract_state for block 21392274 → ✅ Works
/contract_state for block 21392273 → ❌ 404 Error: Not Found
And same behavior for /protocol_state.
On the server side, this log appears:
ERROR get_contract_state: Error while getting contract states. error=Could not find Block with id `21392273`!
Expected Behavior
/protocol_state and /contract_state endpoints should return the state for the latest finalized block.
Actual Behavior
The endpoint return 404 Error: Not Found specifically for the latest finalized block.
Description
When calling the
/protocol_stateor/contract_stateendpoint for the latest finalized block, it returns404 Error: Not Found. However, the endpoint works as expected for the blocks immediately before and after the latest finalized block.Example
Given current finalized block:
21392273With this request:
/contract_statefor block21392272→ ✅ Works/contract_statefor block21392274→ ✅ Works/contract_statefor block21392273→ ❌404 Error: Not FoundAnd same behavior for
/protocol_state.On the server side, this log appears:
Expected Behavior
/protocol_stateand/contract_stateendpoints should return the state for the latest finalized block.Actual Behavior
The endpoint return
404 Error: Not Foundspecifically for the latest finalized block.