Skip to content
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

[R4R] DTL response null result with 404 http status #1391

Conversation

shidaxi
Copy link
Collaborator

@shidaxi shidaxi commented Dec 22, 2023

Goals of PR

Core changes:

  • handler support return http status code
  • return 404 http status code when result is null

Related Issues:

  • with this we can enable cache safely

@shidaxi
Copy link
Collaborator Author

shidaxi commented Dec 22, 2023

Test

curl "localhost:7878/transaction/index/87?backend=l2" -i

HTTP/1.1 404 Not Found
X-Powered-By: Express
Access-Control-Allow-Origin: *
Content-Type: application/json; charset=utf-8
Content-Length: 33
ETag: W/"21-CMqNFJ1GmGJsYiAIPHNf2iBKJ9E"
Date: Fri, 22 Dec 2023 12:51:18 GMT
Connection: keep-alive
Keep-Alive: timeout=5

{"transaction":null,"batch":null}

                                                                                                                                    
curl "localhost:7878/transaction/index/86?backend=l2" -i

HTTP/1.1 200 OK
X-Powered-By: Express
Access-Control-Allow-Origin: *
Content-Type: application/json; charset=utf-8
Content-Length: 1054
ETag: W/"41e-LAO9Ef7iD5peiLs9WMbN9FjpsHw"
Date: Fri, 22 Dec 2023 12:51:24 GMT
Connection: keep-alive
Keep-Alive: timeout=5

{"transaction":{"index":86,"value":"0x0","batchIndex":null,"blockNumber":16005,"timestamp":1703089712,"queueOrigin":"sequencer","confirmed":false,"gasLimit":"0","target":"0x0000000000000000000000000000000000000000","origin":null,"data":"0xf8a8808402faf08082864294deaddeaddeaddeaddeaddeaddeaddeaddead111180b844a9059cbb00000000000000000000000000000500e87ee83a1bfa233512af25a4003836c800000000000000000000000000000000000000000000000000005af3107a400045a045f220e8638eb5f5cdb2259efbdd36533597eae1776d9fdc81d2914d59f60203a03e5202f7743b809bebbe8b8a181ae4f55a472f6b9b5de1ff695c29a102c0037e","decoded":{"sig":{"v":0,"r":"0x45f220e8638eb5f5cdb2259efbdd36533597eae1776d9fdc81d2914d59f60203","s":"0x3e5202f7743b809bebbe8b8a181ae4f55a472f6b9b5de1ff695c29a102c0037e"},"value":"0x0","gasLimit":"34370","gasPrice":"50000000","nonce":"0","target":"0xdeaddeaddeaddeaddeaddeaddeaddeaddead1111","data":"0xa9059cbb00000000000000000000000000000500e87ee83a1bfa233512af25a4003836c800000000000000000000000000000000000000000000000000005af3107a4000"},"queueIndex":null},"batch":null}

@guoshijiang guoshijiang merged commit 95e003b into release/v0.4.3 Dec 22, 2023
1 of 6 checks passed
@guoshijiang guoshijiang deleted the response-null-result-with-404-http-status-demo-code branch December 22, 2023 14:36
shidaxi added a commit that referenced this pull request Dec 22, 2023
DTL response null result with 404 http status
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants