-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Stop logging requests in the Vault DON #20406
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
base: develop
Are you sure you want to change the base?
Conversation
|
👋 cedric-cordenier, thanks for creating this pull request! To help reviewers, please consider creating future PRs as drafts first. This allows you to self-review and make any final changes before notifying the team. Once you're ready, you can mark it as "Ready for review" to request feedback. Thanks! |
|
I see you updated files related to
|
| } | ||
| r.lggr.Infow("AuthorizeRequest success in auth", "method", req.Method, "requestID", req.ID, "authorizedRequestStr", authorizedRequestStr) | ||
| r.alreadyAuthorizedRequests[authorizedRequestStr] = int64(allowlistedRequest.ExpiryTimestamp) | ||
| return true, allowlistedRequest.Owner.Hex(), nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔴 Test Results: Unrelated Failure
Affected failures:
- Workflow Run: Run CCIP integration In Memory Tests For PR / smoke/ccip/ccip_cs_rmn_curse_uncurse_test.go:TestRMNUncurseForceOption
- Workflow Run: Run CCIP integration In Memory Tests For PR / smoke/ccip/ccip_cs_rmn_curse_uncurse_test.go:TestRMNUncurse
- Workflow Run: Run CCIP integration In Memory Tests For PR / smoke/ccip/ccip_cs_rmn_curse_uncurse_test.go:TestRMNCurseConfigValidate
- Workflow Run: Run CCIP integration In Memory Tests For PR / smoke/ccip/ccip_cs_rmn_curse_uncurse_test.go:TestRMNCurseOneConnectedLanesSolana
- Workflow Run: Run CCIP integration In Memory Tests For PR / smoke/ccip/ccip_messaging_test.go:Test_CCIPMessaging_Solana2EVM
- Workflow Run: Run CCIP integration In Memory Tests For PR / smoke/ccip/ccip_sui_upgrade_test.go:Test_CCIP_Upgrade_EVM2Sui
What Broke
These failures appear to be unrelated to the changes in this PR. The CI jobs consistently failed due to an external dependency issue: an inability to download necessary program artifacts (such as Solana or suiup) from GitHub releases. This was caused by a 503 server error, indicating a problem with the external GitHub service or network connectivity. These download failures prevented critical components from starting, leading to the observed job failures. The changes introduced in the PR are confined to internal logging and request authorization logic, which have no direct impact on external artifact downloads or environment setup.
Autofix Options
You can use our MCP server to get AI assistance with debugging and fixing these failures.
- Use MCP in your IDE to debug the issue. Try
Help me fix CI failures from q8FMfnrlto get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔴 Test Results: Bypassed Authorization Logic
Affected failures:
- Workflow Run: Run CCIP integration In Memory Tests For PR / smoke/ccip/ccip_sui_upgrade_test.go:Test_CCIP_Upgrade_NoBlock_EVM2Sui
- Workflow Run: Run CCIP integration In Memory Tests For PR / smoke/ccip/ccip_cs_rmn_curse_uncurse_test.go:TestRMNUncurseMCMS
What Broke
The PR's modifications bypassed crucial authorization logic within the vault capability, which is essential for the CCIP protocol's commitment process. This bypass also prevented the Solana container from starting correctly during integration tests.
Proposed Fixes
Revert the changes made to the AuthorizeRequest function in core/capabilities/vault/request_authorizer.go, restoring the original authorization logic and re-adding necessary imports.
+ "encoding/hex"
"encoding/json"
+ "errors"
+ "fmt"- return true, "owner1", nil
+ defer r.clearExpiredAuthorizedRequests()
+ r.lggr.Infow("AuthorizeRequest", "method", req.Method, "requestID", req.ID)
+ requestDigest, err := req.Digest()
+ if err != nil {
+ r.lggr.Infow("AuthorizeRequest failed to create digest", "method", req.Method, "requestID", req.ID)
+ return false, "", err
+ }
+ requestDigestBytes, err := hex.DecodeString(requestDigest)
+ if err != nil {
+ r.lggr.Infow("AuthorizeRequest failed to decode digest", "method", req.Method, "requestID", req.ID)
+ return false, "", err
+ }
+ requestDigestBytes32 := [32]byte(requestDigestBytes)
+ if r.workflowRegistrySyncer == nil {
+ r.lggr.Errorw("AuthorizeRequest workflowRegistrySyncer is nil", "method", req.Method, "requestID", req.ID)
+ return false, "", errors.New("internal error: workflowRegistrySyncer is nil")
+ }
+ allowedRequests := r.workflowRegistrySyncer.GetAllowlistedRequests(ctx)
+ allowedRequestsStrs := make([]string, 0, len(allowedRequests))
+ for _, rr := range allowedRequests {
+ allowedReqStr := fmt.Sprintf("Owner: %s, RequestDigest: %s, ExpiryTimestamp: %d", rr.Owner.Hex(), hex.EncodeToString(rr.RequestDigest[:]), rr.ExpiryTimestamp)
+ allowedRequestsStrs = append(allowedRequestsStrs, allowedReqStr)
+ }
+ r.lggr.Infow("AuthorizeRequest GetAllowlistedRequests", "method", req.Method, "requestID", req.ID, "allowedRequests", allowedRequestsStrs)
+ allowlistedRequest := r.fetchAllowlistedItem(allowedRequests, requestDigestBytes32)
+ if allowlistedRequest == nil {
+ r.lggr.Infow("AuthorizeRequest fetchAllowlistedItem request not allowlisted",
+ "method", req.Method,
+ "requestID", req.ID,
+ "digestHexStr", requestDigest,
+ "allowedRequestsStrs", allowedRequestsStrs)
+ return false, "", errors.New("request not allowlisted")
+ }
+ authorizedRequestStr := string(allowlistedRequest.RequestDigest[:])
+
+ r.alreadyAuthorizedMutex.Lock()
+ defer r.alreadyAuthorizedMutex.Unlock()
+ if r.alreadyAuthorizedRequests[authorizedRequestStr] > 0 {
+ r.lggr.Infow("AuthorizeRequest already authorized previously", "method", req.Method, "requestID", req.ID, "authorizedRequestStr", authorizedRequestStr)
+ return false, "", errors.New("request already authorized previously")
+ }
+ if time.Now().UTC().Unix() > int64(allowlistedRequest.ExpiryTimestamp) {
+ r.lggr.Infow("AuthorizeRequest expired authorization", "method", req.Method, "requestID", req.ID, "authorizedRequestStr", authorizedRequestStr)
+ return false, "", errors.New("request authorization expired")
+ }
+ r.lggr.Infow("AuthorizeRequest success in auth", "method", req.Method, "requestID", req.ID, "authorizedRequestStr", authorizedRequestStr)
+ r.alreadyAuthorizedRequests[authorizedRequestStr] = int64(allowlistedRequest.ExpiryTimestamp)
+ return true, allowlistedRequest.Owner.Hex(), nilAutofix Options
You can apply the proposed fixes directly to your branch. Try the following:
- Comment
/trunk stack-fix KTG6LnkJto generate a stacked PR with the proposed fixes. - Use MCP in your IDE to fix the issue. Try
Help me fix CI failures from KTG6LnkJto get started.
Tip
Get Better Results: This CI job is not uploading test reports. Adding structured test reports enables more precise, test-level analysis with better root cause identification and more targeted fix recommendations.
👉🏻 Learn how to upload test results.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔴 Test Results: Authorization Logic Bypass
Affected failures:
- TestRequestAuthorizer_CreateSecrets (Workflow Run: Core Tests (go_core_tests))
- TestRequestAuthorizer_UpdateSecrets (Workflow Run: Core Tests (go_core_tests))
- TestRequestAuthorizer_DeleteSecrets (Workflow Run: Core Tests (go_core_tests))
- TestRequestAuthorizer_ListSecrets (Workflow Run: Core Tests (go_core_tests))
- Workflow Run: Integration Tests
- Workflow Run: Run CCIP integration In Memory Tests For PR / smoke/ccip/ccip_sui_token_transfer_test.go:Test_CCIPTokenTransfer_EVM2SUI_ManagedTokenPool
What Broke
These failures are caused by an alteration to the AuthorizeRequest function in core/capabilities/vault/request_authorizer.go. The function was changed to always return a hardcoded authorized state and owner, effectively bypassing the actual authorization logic. This led to integration tests failing because they expected dynamic authorization and a specific hexadecimal owner address, which was no longer being provided.
Proposed Fixes
Revert the changes to the AuthorizeRequest function in core/capabilities/vault/request_authorizer.go to restore the original authorization logic and re-add necessary imports.
+ "encoding/hex"
"encoding/json"
+ "errors"
+ "fmt"
"sync"
"time" func (r *requestAuthorizer) AuthorizeRequest(ctx context.Context, req jsonrpc.Request[json.RawMessage]) (isAuthorized bool, owner string, err error) {
- return true, "owner1", nil
+ defer r.clearExpiredAuthorizedRequests()
+ r.lggr.Infow("AuthorizeRequest", "method", req.Method, "requestID", req.ID)
+ requestDigest, err := req.Digest()
+ if err != nil {
+ r.lggr.Infow("AuthorizeRequest failed to create digest", "method", req.Method, "requestID", req.ID)
+ return false, "", err
+ }
+ requestDigestBytes, err := hex.DecodeString(requestDigest)
+ if err != nil {
+ r.lggr.Infow("AuthorizeRequest failed to decode digest", "method", req.Method, "requestID", req.ID)
+ return false, "", err
+ }
+ requestDigestBytes32 := [32]byte(requestDigestBytes)
+ if r.workflowRegistrySyncer == nil {
+ r.lggr.Errorw("AuthorizeRequest workflowRegistrySyncer is nil", "method", req.Method, "requestID", req.ID)
+ return false, "", errors.New("internal error: workflowRegistrySyncer is nil")
+ }
+ allowedRequests := r.workflowRegistrySyncer.GetAllowlistedRequests(ctx)
+ allowedRequestsStrs := make([]string, 0, len(allowedRequests))
+ for _, rr := range allowedRequests {
+ allowedReqStr := fmt.Sprintf("Owner: %s, RequestDigest: %s, ExpiryTimestamp: %d", rr.Owner.Hex(), hex.EncodeToString(rr.RequestDigest[:]), rr.ExpiryTimestamp)
+ allowedRequestsStrs = append(allowedRequestsStrs, allowedReqStr)
+ }
+ r.lggr.Infow("AuthorizeRequest GetAllowlistedRequests", "method", req.Method, "requestID", req.ID, "allowedRequests", allowedRequestsStrs)
+ allowlistedRequest := r.fetchAllowlistedItem(allowedRequests, requestDigestBytes32)
+ if allowlistedRequest == nil {
+ r.lggr.Infow("AuthorizeRequest fetchAllowlistedItem request not allowlisted",
+ "method", req.Method,
+ "requestID", req.ID,
+ "digestHexStr", requestDigest,
+ "allowedRequestsStrs", allowedRequestsStrs)
+ return false, "", errors.New("request not allowlisted")
+ }
+ authorizedRequestStr := string(allowlistedRequest.RequestDigest[:])
+
+ r.alreadyAuthorizedMutex.Lock()
+ defer r.alreadyAuthorizedMutex.Unlock()
+ if r.alreadyAuthorizedRequests[authorizedRequestStr] > 0 {
+ r.lggr.Infow("AuthorizeRequest already authorized previously", "method", req.Method, "requestID", req.ID, "authorizedRequestStr", authorizedRequestStr)
+ return false, "", errors.New("request already authorized previously")
+ }
+ if time.Now().UTC().Unix() > int64(allowlistedRequest.ExpiryTimestamp) {
+ r.lggr.Infow("AuthorizeRequest expired authorization", "method", req.Method, "requestID", req.ID, "authorizedRequestStr", authorizedRequestStr)
+ return false, "", errors.New("request authorization expired")
+ }
+ r.lggr.Infow("AuthorizeRequest success in auth", "method", req.Method, "requestID", req.ID, "authorizedRequestStr", authorizedRequestStr)
+ r.alreadyAuthorizedRequests[authorizedRequestStr] = int64(allowlistedRequest.ExpiryTimestamp)
+ return true, allowlistedRequest.Owner.Hex(), nil
}Autofix Options
You can apply the proposed fixes directly to your branch. Try the following:
- Comment
/trunk stack-fix sKV2xgx2to generate a stacked PR with the proposed fixes. - Use MCP in your IDE to fix the issue. Try
Help me fix CI failures from sKV2xgx2to get started.
|


Requires
Supports