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

Aptos (combined branch) #13716

Draft
wants to merge 4 commits into
base: release/2.19.0-aptos
Choose a base branch
from
Draft

Aptos (combined branch) #13716

wants to merge 4 commits into from

Conversation

archseer
Copy link
Contributor

@archseer archseer commented Jun 28, 2024

Contains #14076, #14078 and staged changes

Comment on lines 313 to 314
plugin := env.NewPlugin("aptos")
loopKs := &keystore.AptosLooppSigner{Aptos: ks}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Perhaps all this can be moved into InitAptos?

return flat
}

const triggerID = "[email protected]"
Copy link
Contributor

Choose a reason for hiding this comment

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

I like having this merged as an example trigger. I only wish it could go to common but it can't because of EVM dep :( Maybe we should create a special sub-directory with example capabilities and move on-demand trigger there as well...? @cedric-cordenier thoughts?

core/scripts/keystone/main.go Outdated Show resolved Hide resolved
core/services/chainlink/application.go Show resolved Hide resolved
Copy link
Contributor

github-actions bot commented Oct 23, 2024

AER Report: CI Core

aer_workflow , commit , Detect Changes , Clean Go Tidy & Generate , Scheduled Run Frequency , Find New Flaky Tests In Chainlink Project / Get Tests To Run , Core Tests (go_core_tests) , Core Tests (go_core_tests_integration) , Core Tests (go_core_ccip_deployment_tests) , Core Tests (go_core_race_tests) , Core Tests (go_core_fuzz) , lint , Find New Flaky Tests In Deployment Project , Find New Flaky Tests In Chainlink Project / Run Tests , Find New Flaky Tests In Chainlink Project / Report , Flakey Test Detection , SonarQube Scan

1. Integer overflow conversion int -> uint8:[Golang Lint]

Source of Error:
core/capabilities/streams/mock_trigger.go:72:20: G115: integer overflow conversion int -> uint8 (gosec)
		bytes[31] = uint8(i + 1)
		 ^
**Why**: This error occurs because converting an `int` to `uint8` can cause an overflow if the `int` value exceeds the range of `uint8` (0-255).

Suggested fix: Ensure the int value is within the uint8 range before conversion or use a type that can handle larger values.

2. Integer overflow conversion int64 -> uint32:[Golang Lint]

Source of Error:
core/capabilities/streams/mock_trigger.go:138:29: G115: integer overflow conversion int64 -> uint32 (gosec)
	Timestamp: uint32(timestamp),
	 ^
core/capabilities/streams/mock_trigger.go:139:29: G115: integer overflow conversion int64 -> uint32 (gosec)
	ValidFromTimestamp: uint32(timestamp),
	 ^
core/capabilities/streams/mock_trigger.go:144:29: G115: integer overflow conversion int64 -> uint32 (gosec)
	ExpiresAt: uint32(timestamp + 1000000),
	 ^
core/capabilities/streams/mock_trigger.go:181:94: G115: integer overflow conversion int -> uint32 (gosec)
	reportCtx := ocrTypes.ReportContext{ReportTimestamp: ocrTypes.ReportTimestamp{Epoch: uint32(baseTimestamp + j)}}
	 ^
**Why**: This error occurs because converting an `int64` to `uint32` can cause an overflow if the `int64` value exceeds the range of `uint32` (0-4294967295).

Suggested fix: Ensure the int64 value is within the uint32 range before conversion or use a type that can handle larger values.

3. Replace prices[i] = prices[i] + 1 with prices[i]++:[Golang Lint]

Source of Error:
core/capabilities/streams/mock_trigger.go:173:4: assignOp: replace `prices[i] = prices[i] + 1` with `prices[i]++` (gocritic)
	prices[i] = prices[i] + 1
	^
**Why**: This error suggests a more concise and idiomatic way to increment a value in Go.

Suggested fix: Replace prices[i] = prices[i] + 1 with prices[i]++.

4. Receiver name should be consistent:[Golang Lint]

Source of Error:
core/capabilities/streams/mock_trigger.go:110:1: receiver-naming: receiver name o should be consistent with previous receiver name m for MockTriggerService (revive)
func (o *MockTriggerService) RegisterTrigger(ctx context.Context, req capabilities.TriggerRegistrationRequest) (<-chan capabilities.TriggerResponse, error) {
	ch, err := o.MercuryTriggerService.RegisterTrigger(ctx, req)
	if err != nil {
		return nil, err
	}

	config, _ := o.MercuryTriggerService.ValidateConfig(req.Config)
	o.subscribersMu.Lock()
	defer o.subscribersMu.Unlock()
	o.subscribers[req.Metadata.WorkflowID] = config.FeedIds
	return ch, nil
}
core/capabilities/streams/mock_trigger.go:123:1: receiver-naming: receiver name o should be consistent with previous receiver name m for MockTriggerService (revive)
func (o *MockTriggerService) UnregisterTrigger(ctx context.Context, req capabilities.TriggerRegistrationRequest) error {
	err := o.MercuryTriggerService.UnregisterTrigger(ctx, req)
	o.subscribersMu.Lock()
	defer o.subscribersMu.Unlock()
	delete(o.subscribers, req.Metadata.WorkflowID)
	return err
}
**Why**: The receiver name `o` is inconsistent with the previous receiver name `m` for `MockTriggerService`, which can lead to confusion.

Suggested fix: Use a consistent receiver name, such as m, for all methods of MockTriggerService.

5. Unnecessary trailing newline:[Golang Lint]

Source of Error:
core/capabilities/streams/mock_trigger.go:211:3: unnecessary trailing newline (whitespace)
 
^
**Why**: This error indicates an unnecessary trailing newline, which can affect code readability and style.

Suggested fix: Remove the unnecessary trailing newline.

AER Report: Operator UI CI ran successfully ✅

aer_workflow , commit

@cl-sonarqube-production
Copy link

Quality Gate failed Quality Gate failed

Failed conditions
11.67% Technical Debt Ratio on New Code (required ≤ 4%)
C Maintainability Rating on New Code (required ≥ A)

See analysis details on SonarQube

Catch issues before they fail your Quality Gate with our IDE extension SonarLint SonarLint

@krebernisak krebernisak force-pushed the aptos-init branch 2 times, most recently from 97831c9 to 7bf04f5 Compare November 22, 2024 15:31
Copy link
Contributor

I see you added a changeset file but it does not contain a tag. Please edit the text include at least one of the following tags:

  • #added For any new functionality added.
  • #breaking_change For any functionality that requires manual action for the node to boot.
  • #bugfix For bug fixes.
  • #changed For any change to the existing functionality.
  • #db_update For any feature that introduces updates to database schema.
  • #deprecation_notice For any upcoming deprecation functionality.
  • #internal For changesets that need to be excluded from the final changelog.
  • #nops For any feature that is NOP facing and needs to be in the official Release Notes for the release.
  • #removed For any functionality/config that is removed.
  • #updated For any functionality that is updated.
  • #wip For any change that is not ready yet and external communication about it should be held off till it is feature complete.

🎖️ No JIRA issue number found in: PR title, commit message, or branch name. Please include the issue ID in one of these.

Copy link
Contributor

github-actions bot commented Dec 4, 2024

I see you updated files related to core. Please run pnpm changeset in the root directory to add a changeset as well as in the text include at least one of the following tags:

  • #added For any new functionality added.
  • #breaking_change For any functionality that requires manual action for the node to boot.
  • #bugfix For bug fixes.
  • #changed For any change to the existing functionality.
  • #db_update For any feature that introduces updates to database schema.
  • #deprecation_notice For any upcoming deprecation functionality.
  • #internal For changesets that need to be excluded from the final changelog.
  • #nops For any feature that is NOP facing and needs to be in the official Release Notes for the release.
  • #removed For any functionality/config that is removed.
  • #updated For any functionality that is updated.
  • #wip For any change that is not ready yet and external communication about it should be held off till it is feature complete.

🎖️ No JIRA issue number found in: PR title, commit message, or branch name. Please include the issue ID in one of these.

@krebernisak krebernisak changed the base branch from develop to aptos-init-base December 5, 2024 15:56
@krebernisak krebernisak changed the base branch from aptos-init-base to develop December 6, 2024 19:05
@krebernisak krebernisak changed the base branch from develop to release/2.19.0-aptos December 6, 2024 19:06
@krebernisak krebernisak changed the base branch from release/2.19.0-aptos to aptos-init-base December 11, 2024 11:20
@krebernisak krebernisak changed the base branch from aptos-init-base to release/2.19.0-aptos December 11, 2024 11:21
@krebernisak krebernisak changed the base branch from release/2.19.0-aptos to develop December 11, 2024 11:23
@krebernisak krebernisak changed the base branch from develop to release/2.19.0-aptos December 11, 2024 11:23
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.

4 participants