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

Fixes #380

Merged
merged 49 commits into from
Sep 19, 2022
Merged

Fixes #380

merged 49 commits into from
Sep 19, 2022

Conversation

archseer
Copy link
Collaborator

@archseer archseer commented Jul 27, 2022

Best reviewed commit-by-commit, I'm still cleaning up the branch.

@github-actions
Copy link
Contributor

github-actions bot commented Jul 27, 2022

Smoke Test Results

0 tests  ±0   0 ✔️ ±0   0s ⏱️ ±0s
0 suites ±0   0 💤 ±0 
0 files   ±0   0 ±0 

Results for commit 7108b0b. ± Comparison against base commit 8ca9270.

♻️ This comment has been updated with latest results.

tests/e2e/solclient/ocr2.go Outdated Show resolved Hide resolved
@archseer archseer temporarily deployed to integration July 27, 2022 05:23 Inactive
@archseer archseer temporarily deployed to integration July 27, 2022 05:28 Inactive
@archseer archseer temporarily deployed to integration July 27, 2022 05:29 Inactive
@archseer archseer temporarily deployed to integration July 27, 2022 05:47 Inactive
@archseer archseer temporarily deployed to integration July 27, 2022 05:58 Inactive
@archseer archseer temporarily deployed to integration July 28, 2022 08:04 Inactive
@archseer archseer temporarily deployed to integration July 29, 2022 03:43 Inactive
@archseer archseer temporarily deployed to integration July 29, 2022 03:46 Inactive
@archseer archseer temporarily deployed to integration July 29, 2022 03:50 Inactive
@archseer archseer temporarily deployed to integration July 29, 2022 05:34 Inactive
@archseer archseer temporarily deployed to integration July 29, 2022 06:41 Inactive
@tateexon tateexon temporarily deployed to integration September 13, 2022 22:19 Inactive
@tateexon tateexon temporarily deployed to integration September 13, 2022 22:19 Inactive
tests/e2e/solclient/ocr2.go Outdated Show resolved Hide resolved
@@ -343,20 +345,25 @@ func (m *OCRv2) proposeConfig(ocConfig contracts.OffChainAggregatorV2Config) err
}
// set one payee for all
instr := make([]solana.Instruction, 0)
// TODO: get associated addr
Copy link
Collaborator

Choose a reason for hiding this comment

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

?

@@ -86,7 +86,7 @@ pub mod ocr2 {
) -> Result<()> {
let mut proposal = ctx.accounts.proposal.load_init()?;

proposal.version = 1;
proposal.version = STATE_VERSION;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could these two versions diverge?
If yes, let's use a specific proposal version constant.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think they should be in sync, an older proposal shouldn't be applied to a newer state because the layout expectations might be different

contracts/programs/ocr2/src/lib.rs Show resolved Hide resolved
contracts/tests/ocr2.spec.ts Show resolved Hide resolved
payee.to_account_info()
} else {
// then the token account must be closed
token_receiver.to_account_info()
Copy link
Collaborator

Choose a reason for hiding this comment

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

Shouldn't this happen only on close?

In other situations it could be more efficient to skip the oracle and keep the funds in the contract (on pay_oracles, accept_proposal & set_billing).

The way it's currently designed this will require setting this additional token_receiver account when calling these non-close methods, which might be confusing for contract operators.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

You can't skip the oracle because then the oracles aren't fully paid out so accept_proposal/set_billing won't succeed. Are you proposing to just ignore the oracle and then have the operator manually withdraw funds to resolve? That could work, but it would be easy to miss if one of the nodes didn't get paid out.

I think I set the token_receiver to whoever executes the call currently so there's no extra parameter.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I was suggesting that the owner probably doesn't expect to collect some dust every time they set/accept_proposal or set_billing, so it might go unnoticed.

I think I'd prefer these operations to skip the invalid payee, keep the funds in the contract and then all the remaining funds are transferred out either on close (rare occasion) or potentially an owner can withdraw on behalf of an invalid oracle (new fn).

Feels cleaner to do it that way, but maybe it's just my preference. Wdyt?


const CHAINLINK_PROGRAM_ID = "HEvSKofvBgfaexv23kMabbYqxasxU3mQ4ibBMEmJWHny";

describe('hello-world', () => {
const provider = anchor.Provider.env();
describe("hello-world", () => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I've noticed many style changes in this PR but looks like we don't have prettier configured in this repository. I suggest we use the one from StarkNet integration and we reformat the codebase one more time: https://github.com/smartcontractkit/chainlink-starknet/blob/develop/.prettierrc.json

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Let's do that in a follow-up PR since the diff is already quite big

Copy link
Collaborator

Choose a reason for hiding this comment

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

contracts/examples/hello-world/tests/hello-world.ts Outdated Show resolved Hide resolved
contracts/programs/ocr2/src/context.rs Outdated Show resolved Hide resolved
contracts/programs/ocr2/src/context.rs Outdated Show resolved Hide resolved
contracts/programs/ocr2/src/lib.rs Show resolved Hide resolved
contracts/tests/ocr2.spec.ts Outdated Show resolved Hide resolved
contracts/tests/ocr2.spec.ts Outdated Show resolved Hide resolved
Comment on lines +627 to +628
// await store.account.transmissions.createInstruction(transmissions, 8+192+8096*24),
// createFeed,
Copy link
Collaborator

Choose a reason for hiding this comment

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

?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I hoped to create these in a single transaction but had some issues getting it to work.

@tateexon tateexon temporarily deployed to integration September 14, 2022 22:17 Inactive
@tateexon tateexon temporarily deployed to integration September 14, 2022 22:30 Inactive
@archseer archseer temporarily deployed to integration September 15, 2022 05:49 Inactive
Copy link
Collaborator

@krebernisak krebernisak left a comment

Choose a reason for hiding this comment

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

Huge effort and nice improvements. Great work, @archseer!

I've reviewed to the best of my ability and it looks solid.

Except the CI e2e test failing, there is this discussion on oracle payments we might still consider, otherwise looks good.

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.

None yet

4 participants