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

[BCI-887] Solana HeadTracker Integration #521

Draft
wants to merge 47 commits into
base: develop
Choose a base branch
from

Conversation

yongkangc
Copy link

@yongkangc yongkangc commented Jun 9, 2023

This PR attempts to integrate the chain specific headtracker on the EVM generalised platform based on the Epic ticket on chain specific headtracker.

This is a POC on how likely the generalised headtracker could be implemented in a chain specific context, will remain as a draft PR for now given all changes that are likely to happen with the Headtracker.

Changes:

  • common folder pkg/common is added to replicate imports on chainlink-relay
  • Config for Headtracker has been changed. The changes for core can be seen here [BCI-1422]Added Values for Solana Headtracker Config chainlink#9572
    • Note that the changes for core has to be implemented and bumped up for the integration of addition of config values.
  • Added Solana head
  • Added poller client for head

Note:

  • Core imports needs to be replaced with a relay import. This is because of the time constraint for the POC project, therefore I made the choice to directly import the necessary components from core. into the Solana repo instead of relying on chain-relay imports.

References:

@yongkangc yongkangc self-assigned this Jun 9, 2023
@yongkangc yongkangc temporarily deployed to integration June 9, 2023 21:46 — with GitHub Actions Inactive
@yongkangc yongkangc temporarily deployed to integration June 9, 2023 21:46 — with GitHub Actions Inactive
@yongkangc yongkangc temporarily deployed to integration June 9, 2023 21:46 — with GitHub Actions Inactive
@yongkangc yongkangc temporarily deployed to integration June 9, 2023 21:46 — with GitHub Actions Inactive
@yongkangc yongkangc changed the title Added HeadTracker in Solana [BCI-887] Added HeadTracker in Solana Jun 9, 2023
@yongkangc yongkangc added the poc Proof of concept label Jun 9, 2023
@yongkangc yongkangc temporarily deployed to integration June 9, 2023 21:55 — with GitHub Actions Inactive
@yongkangc yongkangc temporarily deployed to integration June 9, 2023 22:03 — with GitHub Actions Inactive
@yongkangc yongkangc temporarily deployed to integration June 10, 2023 00:06 — with GitHub Actions Inactive
@yongkangc yongkangc temporarily deployed to integration June 10, 2023 00:06 — with GitHub Actions Inactive
@yongkangc yongkangc temporarily deployed to integration June 10, 2023 00:06 — with GitHub Actions Inactive
@yongkangc yongkangc temporarily deployed to integration June 10, 2023 00:07 — with GitHub Actions Inactive
@yongkangc yongkangc temporarily deployed to integration June 10, 2023 00:13 — with GitHub Actions Inactive
@yongkangc yongkangc temporarily deployed to integration June 10, 2023 00:21 — with GitHub Actions Inactive
@yongkangc yongkangc temporarily deployed to integration June 12, 2023 18:32 — with GitHub Actions Inactive
@yongkangc yongkangc temporarily deployed to integration June 12, 2023 18:32 — with GitHub Actions Inactive
@yongkangc yongkangc temporarily deployed to integration June 12, 2023 18:32 — with GitHub Actions Inactive
@yongkangc yongkangc temporarily deployed to integration June 12, 2023 18:40 — with GitHub Actions Inactive
@yongkangc yongkangc temporarily deployed to integration July 12, 2023 22:01 — with GitHub Actions Inactive
@yongkangc yongkangc temporarily deployed to integration July 12, 2023 22:01 — with GitHub Actions Inactive
@yongkangc yongkangc temporarily deployed to integration July 12, 2023 22:01 — with GitHub Actions Inactive
@yongkangc yongkangc temporarily deployed to integration July 12, 2023 22:53 — with GitHub Actions Inactive
@yongkangc yongkangc temporarily deployed to integration July 12, 2023 22:53 — with GitHub Actions Inactive
@yongkangc yongkangc temporarily deployed to integration July 12, 2023 22:54 — with GitHub Actions Inactive
@yongkangc
Copy link
Author

Integration completed, All tests passing

image

cc @aalu1418 @prashantkumar1982

@yongkangc yongkangc temporarily deployed to integration July 13, 2023 16:32 — with GitHub Actions Inactive
@yongkangc yongkangc temporarily deployed to integration July 13, 2023 16:32 — with GitHub Actions Inactive
@yongkangc yongkangc temporarily deployed to integration July 13, 2023 16:33 — with GitHub Actions Inactive
@yongkangc yongkangc temporarily deployed to integration July 13, 2023 21:53 — with GitHub Actions Inactive
@yongkangc yongkangc temporarily deployed to integration July 13, 2023 21:53 — with GitHub Actions Inactive
@yongkangc yongkangc temporarily deployed to integration July 13, 2023 21:54 — with GitHub Actions Inactive
}

func (h *Head) earliestInChain() *Head {
for h.Parent != nil {

Choose a reason for hiding this comment

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

add this:

if h == nil {
	return nil
}


func (h *Head) HashAtHeight(slotNum int64) Hash {
for {
if h.Slot == slotNum {

Choose a reason for hiding this comment

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

Might be able to optimize logic here.
For example, if slotNum is higher than current slot, then return Hash{}. This way, you return quicker.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do not merge poc Proof of concept
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants