Skip to content

PLEX-583: add cache config to write targeter#1286

Merged
augustbleeds merged 2 commits intoPLEX-347from
augustus.PLEX-1583.add-cache-config
Jul 10, 2025
Merged

PLEX-583: add cache config to write targeter#1286
augustbleeds merged 2 commits intoPLEX-347from
augustus.PLEX-1583.add-cache-config

Conversation

@augustbleeds
Copy link
Contributor

Description

Requires Dependencies

Resolves Dependencies

@augustbleeds augustbleeds requested review from a team as code owners July 2, 2025 18:55
@augustbleeds augustbleeds changed the base branch from develop to PLEX-347 July 2, 2025 18:55
}

var remainingAccounts []solana.AccountMeta
for _, acc := range t.Config.RemainingAccounts {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if len(t.Config.RemainingAccount) > 0 {
...
return
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you actually don't need the conditional since you already have the check at the top. if only cache details is provided, this loop is never used. if only the remaining account is provided, the cache details conditional is never used.

}

if t.Config.CacheDetails != nil {
// assume that the receiver is the cache program
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably put the whole if block under another func and return it

@cl-sonarqube-production
Copy link

Quality Gate failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 75%)

See analysis details on SonarQube

solana.AccountMeta{
PublicKey: cacheProgram, // legacy writer omitted
IsWritable: false,
},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's not clear to me, why do we add three exactly the same accounts to the remaining?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

solana-foundation/anchor#2101 , the Optioanl account will be None if the program id is passed in

solana.AccountMeta{
PublicKey: solana.SystemProgramID,
IsWritable: false,
},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SystemProgramID is already included in NewReportInstruction constructor

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://github.com/smartcontractkit/chainlink-solana/pull/1262/files#diff-5135d90ef0327bf1db52f2cd77107c50d4c2cebe15a020a62256b9aa8ba21497R1618

The system program was included in the account context originally. I think this is no longer needed so we'll need to update the contract later

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But generally, as is it right now we also have to pass it into the remaining accounts because it's used by the receiver program. You could technically pass the system program from the forwarder report to a receiver on report, but you'd have to know the index ahead of time and whatnot.

@augustbleeds augustbleeds merged commit f13f8ec into PLEX-347 Jul 10, 2025
24 of 32 checks passed
@augustbleeds augustbleeds deleted the augustus.PLEX-1583.add-cache-config branch July 10, 2025 13:12
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.

2 participants