Skip to content

Commit

Permalink
docs: pimp out readme with blob lifecycle diagrams (#233)
Browse files Browse the repository at this point in the history
* chore: move pull_request_template.md under .github/ dir

* docs: reorder README sections to feel more natural (move flags to bottom)

* docs (wip): add blob lifecycle diagrams to README

* docs: remove Sidecar from README title (proxy is not necessarily a side)

* docs: add blob lifecycle section to README

* docs: add TOC to README

* style(routing): rename raw_commitment -> payload

We changed the name in README so should be consistent in the code

* docs: update README sections to use Payload instead of Blob

Posting Blobs -> Posting Payloads
Retrieving Blobs -> Retrieving Payloads

* docs: remove "obviously" word
  • Loading branch information
samlaf authored Jan 23, 2025
1 parent deac7be commit ad8ad21
Show file tree
Hide file tree
Showing 6 changed files with 192 additions and 131 deletions.
File renamed without changes.
305 changes: 183 additions & 122 deletions README.md

Large diffs are not rendered by default.

Binary file added resources/payload-blob-poly-lifecycle.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/sequence-diagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions server/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func (svr *Server) handleGetStdCommitment(w http.ResponseWriter, r *http.Request
CertVersion: versionByte,
}

rawCommitmentHex, ok := mux.Vars(r)[routingVarNameRawCommitmentHex]
rawCommitmentHex, ok := mux.Vars(r)[routingVarNamePayloadHex]
if !ok {
return fmt.Errorf("commitment not found in path: %s", r.URL.Path)
}
Expand All @@ -63,7 +63,7 @@ func (svr *Server) handleGetOPKeccakCommitment(w http.ResponseWriter, r *http.Re
CertVersion: byte(commitments.CertV0),
}

rawCommitmentHex, ok := mux.Vars(r)[routingVarNameRawCommitmentHex]
rawCommitmentHex, ok := mux.Vars(r)[routingVarNamePayloadHex]
if !ok {
return fmt.Errorf("commitment not found in path: %s", r.URL.Path)
}
Expand All @@ -86,7 +86,7 @@ func (svr *Server) handleGetOPGenericCommitment(w http.ResponseWriter, r *http.R
CertVersion: versionByte,
}

rawCommitmentHex, ok := mux.Vars(r)[routingVarNameRawCommitmentHex]
rawCommitmentHex, ok := mux.Vars(r)[routingVarNamePayloadHex]
if !ok {
return fmt.Errorf("commitment not found in path: %s", r.URL.Path)
}
Expand Down Expand Up @@ -146,7 +146,7 @@ func (svr *Server) handlePostOPKeccakCommitment(w http.ResponseWriter, r *http.R
CertVersion: byte(commitments.CertV0),
}

rawCommitmentHex, ok := mux.Vars(r)[routingVarNameRawCommitmentHex]
rawCommitmentHex, ok := mux.Vars(r)[routingVarNamePayloadHex]
if !ok {
return fmt.Errorf("commitment not found in path: %s", r.URL.Path)
}
Expand Down
10 changes: 5 additions & 5 deletions server/routing.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
)

const (
routingVarNameRawCommitmentHex = "raw_commitment_hex"
routingVarNamePayloadHex = "payload_hex"
routingVarNameVersionByteHex = "version_byte_hex"
routingVarNameCommitTypeByteHex = "commit_type_byte_hex"
)
Expand All @@ -20,7 +20,7 @@ func (svr *Server) registerRoutes(r *mux.Router) {
subrouterGET.HandleFunc("/"+
"{optional_prefix:(?:0x)?}"+ // commitments can be prefixed with 0x
"{"+routingVarNameVersionByteHex+":[0-9a-fA-F]{2}}"+ // should always be 0x00 for now but we let others through to return a 404
"{"+routingVarNameRawCommitmentHex+":[0-9a-fA-F]*}",
"{"+routingVarNamePayloadHex+":[0-9a-fA-F]*}",
withLogging(withMetrics(svr.handleGetStdCommitment, svr.m, commitments.Standard), svr.log),
).Queries("commitment_mode", "standard")
// op keccak256 commitments (write to S3)
Expand All @@ -30,7 +30,7 @@ func (svr *Server) registerRoutes(r *mux.Router) {
// we don't use version_byte for keccak commitments, because not expecting keccak commitments to change,
// but perhaps we should (in case we want a v2 to use another hash for eg?)
// "{version_byte_hex:[0-9a-fA-F]{2}}"+ // should always be 0x00 for now but we let others through to return a 404
"{"+routingVarNameRawCommitmentHex+"}",
"{"+routingVarNamePayloadHex+"}",
withLogging(withMetrics(svr.handleGetOPKeccakCommitment, svr.m, commitments.OptimismKeccak), svr.log),
)
// op generic commitments (write to EigenDA)
Expand All @@ -39,7 +39,7 @@ func (svr *Server) registerRoutes(r *mux.Router) {
"{"+routingVarNameCommitTypeByteHex+":01}"+ // 01 for generic commitments
"{da_layer_byte:[0-9a-fA-F]{2}}"+ // should always be 0x00 for eigenDA but we let others through to return a 404
"{"+routingVarNameVersionByteHex+":[0-9a-fA-F]{2}}"+ // should always be 0x00 for now but we let others through to return a 404
"{"+routingVarNameRawCommitmentHex+"}",
"{"+routingVarNamePayloadHex+"}",
withLogging(withMetrics(svr.handleGetOPGenericCommitment, svr.m, commitments.OptimismGeneric), svr.log),
)
// unrecognized op commitment type (not 00 or 01)
Expand All @@ -66,7 +66,7 @@ func (svr *Server) registerRoutes(r *mux.Router) {
// we don't use version_byte for keccak commitments, because not expecting keccak commitments to change,
// but perhaps we should (in case we want a v2 to use another hash for eg?)
// "{version_byte_hex:[0-9a-fA-F]{2}}"+ // should always be 0x00 for now but we let others through to return a 404
"{"+routingVarNameRawCommitmentHex+"}",
"{"+routingVarNamePayloadHex+"}",
withLogging(withMetrics(svr.handlePostOPKeccakCommitment, svr.m, commitments.OptimismKeccak), svr.log),
)
// op generic commitments (write to EigenDA)
Expand Down

0 comments on commit ad8ad21

Please sign in to comment.