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?

Copy link
Contributor

github-actions bot commented Oct 23, 2024

AER Report: CI Core

aer_workflow , commit , Detect Changes , Scheduled Run Frequency , Clean Go Tidy & Generate , Find New Flaky Tests In Chainlink Project / Get Tests To Run , lint , 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) , 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 result in an overflow if the `int` value exceeds the range of `uint8` (0 to 255).

Suggested fix: Ensure that the int value being converted to uint8 is within the valid range (0 to 255) before performing the conversion.

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),
	 ^
**Why**: This error occurs because converting an `int64` to `uint32` can result in an overflow if the `int64` value exceeds the range of `uint32` (0 to 4294967295).

Suggested fix: Ensure that the int64 value being converted to uint32 is within the valid range (0 to 4294967295) before performing the conversion.

3. Integer overflow conversion int -> uint32: [Golang Lint]

Source of Error:
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 `int` to `uint32` can result in an overflow if the `int` value exceeds the range of `uint32` (0 to 4294967295).

Suggested fix: Ensure that the int value being converted to uint32 is within the valid range (0 to 4294967295) before performing the conversion.

4. Receiver name inconsistency: [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 the `MockTriggerService` type, which can lead to confusion.

Suggested fix: Rename the receiver o to m to maintain consistency with the previous receiver name.

5. Unnecessary trailing newline: [Golang Lint]

Source of Error:
core/capabilities/streams/mock_trigger.go:211:3: unnecessary trailing newline (whitespace)
**Why**: There is an unnecessary trailing newline in the code, which is flagged by the linter.

Suggested fix: Remove the unnecessary trailing newline to adhere to code style guidelines.

6. 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**: The linter suggests using the increment operator `++` instead of `prices[i] = prices[i] + 1` for better readability and conciseness.

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

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
Copy link
Contributor

This PR is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the Stale label Feb 10, 2025
@github-actions github-actions bot closed this Feb 17, 2025
@github-actions github-actions bot deleted the aptos-init branch February 17, 2025 00:17
@cfal cfal restored the aptos-init branch February 17, 2025 12:46
@archseer archseer reopened this Feb 17, 2025
@github-actions github-actions bot removed the Stale label Feb 20, 2025
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