perf(cmpp): process inbound submits within client window

This commit is contained in:
hectorzhao
2026-08-20 11:45:16 +08:00
parent b9a71fe0b9
commit 0757a699ff
20 changed files with 389 additions and 47 deletions
+22
View File
@@ -11,6 +11,7 @@ import (
"go/token"
"os"
"path/filepath"
"sort"
"strings"
)
@@ -41,6 +42,8 @@ var requiredFiles = []string{
var requiredTests = []string{
"TestInboundServerAuthenticatesAndSubmits",
"TestInboundServerProcessesSubmitWithinAuthenticatedConnectionWindow",
"TestBoundedSubmitWindowAndAggregateSlotSnapshot",
"TestInboundServerForwardsLongMessageFragmentsWithoutUDHAndAcknowledgesEachSubmit",
"TestSubmitResponsePrecedesQueuedFailureReceipt",
"TestDailyLimitRejectsSubmitSynchronouslyWithoutPendingReceipt",
@@ -83,6 +86,25 @@ func main() {
actual[key] = item
}
}
if os.Getenv("UPDATE_INBOUND_R6_CONTRACT") == "1" {
contract.Declarations = contract.Declarations[:0]
for _, item := range actual {
contract.Declarations = append(contract.Declarations, item)
}
sort.Slice(contract.Declarations, func(i, j int) bool {
if contract.Declarations[i].File != contract.Declarations[j].File {
return contract.Declarations[i].File < contract.Declarations[j].File
}
if contract.Declarations[i].Name == contract.Declarations[j].Name {
return contract.Declarations[i].Kind < contract.Declarations[j].Kind
}
return contract.Declarations[i].Name < contract.Declarations[j].Name
})
updated, err := json.MarshalIndent(contract, "", " ")
must(err)
must(os.WriteFile(manifestPath, append(updated, '\n'), 0o644))
fmt.Printf("R6 inbound contract updated with %d declarations.\n", len(contract.Declarations))
}
for _, expected := range contract.Declarations {
key := expected.Kind + ":" + expected.Name