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

BCF-2654 chain reader get latest value evm poc WIP #11272

Closed
wants to merge 30 commits into from

Conversation

ilija42
Copy link
Contributor

@ilija42 ilija42 commented Nov 13, 2023

WIP

reductionista and others added 27 commits November 8, 2023 19:27
Also add some initialization and validation relay skeletons
This avoids us having to modify the signature of NewMedianFactory, which
would require further modifications to all non-evm repos and chainlink-relay
Co-authored-by: Jordan Krage <jmank88@gmail.com>
Logic was inverted here, causing ChainReader to be used if it's unimplemented rather
than if it's implemeneted. Also, clarify error message to avoid ambiguity
This was getting setting medianProvider.chainReader to *chainReader(nil) instead of nil
 - Parse abis in constructor
 - Unexport validation
 - Unexport constructor
Copy link
Contributor

I see that you haven't updated any CHANGELOG files. Would it make sense to do so?

@cl-sonarqube-production
Copy link

SonarQube Quality Gate

Quality Gate failed

Failed condition 36.1% 36.1% Coverage on New Code (is less than 75%)

See analysis details on SonarQube

@ilija42 ilija42 changed the title BCF-2654 chain reader get latest value evm poc BCF-2654 chain reader get latest value evm poc WIP Nov 14, 2023
@reductionista reductionista force-pushed the BCF-2612-ChainReader-EVM-POC branch 9 times, most recently from 2324382 to c4f0291 Compare November 22, 2023 04:01
@reductionista reductionista force-pushed the BCF-2612-ChainReader-EVM-POC branch from 4de881b to 109e0d9 Compare November 23, 2023 04:41
@ilija42 ilija42 force-pushed the BCF-2612-ChainReader-EVM-POC branch 2 times, most recently from 7673e0d to 4e70656 Compare November 26, 2023 11:47
@@ -111,6 +132,13 @@ func NewMedianServices(ctx context.Context,
CreatedAt: time.Now(),
}, lggr)

if medianProvider.ChainReader() != nil {
medianProvider = medianProviderWrapper{
Copy link
Contributor

Choose a reason for hiding this comment

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

@ilija42 Looking at the details of this now, I think this modification is happening too high up the call-stack. Have you considered adding a shim around median.NumericalMedianFactory that overrides the median contract with a ChainReader based implementation? This would behave almost like what @reductionista described as the ideal suggestion, which would be to modify median directly.

I think implementing it that way has a couple of advantages:

  • the shim provides a centralized, single abstraction point where we can modify median in a way that will affect all users of it.
  • easier migration -- IIRC we are going to take ownership over median in the near future, so this will make those changes easier to make.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@cedric-cordenier sry, completely missed this. This makes sense to me, I will change this in the final POC version

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh, I also missed this somehow till today, despite being tagged!

I don't see a problem with this, but curious to understand the motivation better.

the shim provides a centralized, single abstraction point where we can modify median in a way that will affect all users of it.

What other users of NumericalMedianFactory would there be aside from the Median plugin? Is the issue just that for migration you need a separate implementation of Median plugin to co-exist with the current one? Or is it more than that?

@reductionista reductionista force-pushed the BCF-2612-ChainReader-EVM-POC branch 7 times, most recently from ad7a6a1 to 1cd875f Compare December 5, 2023 04:38
Base automatically changed from BCF-2612-ChainReader-EVM-POC to develop December 6, 2023 17:37
contractAddr := common.HexToAddress(bc.Address)

// TODO overriding params with params from config
// TODO overriding returnVal with returnVal from config
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we add a JIRA # here?

@ilija42 ilija42 closed this Jan 22, 2024
@ilija42 ilija42 deleted the BCF-2654-ChainReader-GetLatestValue-EVM-POC branch January 22, 2024 10:36
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.

3 participants