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

Feat/sync dev with v1.53.1 #257

Merged
merged 9 commits into from
Nov 13, 2024
Merged

Feat/sync dev with v1.53.1 #257

merged 9 commits into from
Nov 13, 2024

Conversation

aarmoa
Copy link
Collaborator

@aarmoa aarmoa commented Nov 13, 2024

  • PR to sync the dev branch with the changes introduced in master for the v1.53.1 release

Summary by CodeRabbit

  • New Features
    • Updated the source URL for retrieving the OFAC list, enhancing data structure and accessibility.
    • Added 69 new Ethereum addresses to the OFAC list, improving compliance and monitoring capabilities.
    • Removed 6 outdated or duplicated addresses from the OFAC list to maintain accuracy.

aarmoa and others added 9 commits October 2, 2024 23:10
…the TX in the mainpool if it has been rejected by the node during broadcast
…c_broadcast_before_await

fix/check_tx_result_in_sync_broadcast_before_await
…th_relative

Fix/make OFAC list file path relative
Copy link

coderabbitai bot commented Nov 13, 2024

Walkthrough

The changes in this pull request involve updates to the DefaultOfacListURL constant in the client/chain/ofac.go file, changing the URL structure for retrieving the OFAC list. Additionally, the injective_data/ofac.json file has been modified to include 69 new Ethereum addresses and remove 6 existing ones. The overall functionality of the OfacChecker class remains unchanged, focusing solely on the updates to the URL and the address list.

Changes

File Change Summary
client/chain/ofac.go Updated DefaultOfacListURL from "https://raw.githubusercontent.com/InjectiveLabs/injective-lists/master/wallets/ofac.json" to "https://raw.githubusercontent.com/InjectiveLabs/injective-lists/refs/heads/master/json/wallets/ofac.json".
injective_data/ofac.json Added 69 new Ethereum addresses and removed 6 existing addresses from the JSON array.

Possibly related PRs

Suggested reviewers

  • PavelInjective

🐇 In the code where I hop and play,
New addresses join the fray today!
The URL's path has changed its way,
Fetching lists, come what may!
With hops and jumps, we check with glee,
A safer world for you and me! 🌟

Warning

There were issues while running some tools. Please review the errors and either fix the tool’s configuration or disable the tool if it’s a critical failure.

🔧 golangci-lint

level=warning msg="[lintersdb] The name "gas" is deprecated. The linter has been renamed to: gosec."
level=warning msg="[lintersdb] The linter named "megacheck" is deprecated. It has been split into: gosimple, staticcheck, unused."


🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Outside diff range and nitpick comments (1)
client/chain/ofac.go (1)

13-13: Consider version pinning for better stability.

The URL currently points to the master branch, which could lead to unexpected changes if the OFAC list is updated. Consider pinning to a specific commit hash or tag for better stability and control over updates.

You might want to:

  1. Pin to a specific commit hash
  2. Implement version checking before updates
  3. Add a mechanism to verify the integrity of downloaded data

Example approach:

-DefaultOfacListURL = "https://raw.githubusercontent.com/InjectiveLabs/injective-lists/refs/heads/master/json/wallets/ofac.json"
+// Pin to specific version for stability
+DefaultOfacListURL = "https://raw.githubusercontent.com/InjectiveLabs/injective-lists/<commit-hash>/json/wallets/ofac.json"
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between bc027f7 and c13db14.

📒 Files selected for processing (2)
  • client/chain/ofac.go (1 hunks)
  • injective_data/ofac.json (1 hunks)
🔇 Additional comments (4)
client/chain/ofac.go (1)

13-13: Verify the new OFAC list URL accessibility and data format.

The URL structure has been updated to include the refs/heads/master/json path segment. Let's verify the endpoint's accessibility and data format.

Consider adding a comment explaining the URL structure and its significance:

+// DefaultOfacListURL points to the OFAC blacklist maintained in the injective-lists repository.
+// The list contains Ethereum addresses that are blocked due to OFAC compliance requirements.
 DefaultOfacListURL = "https://raw.githubusercontent.com/InjectiveLabs/injective-lists/refs/heads/master/json/wallets/ofac.json"
✅ Verification successful

URL change verified - endpoint is accessible and returns valid data format

The new OFAC list URL is working as expected:

  • Returns HTTP 200 status code, confirming accessibility
  • Returns a valid JSON array of strings, matching the expected format for Ethereum addresses
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the new OFAC list URL accessibility and JSON format

# Test 1: Check if the URL is accessible and returns 200
echo "Testing URL accessibility..."
response_code=$(curl -s -o /dev/null -w "%{http_code}" "https://raw.githubusercontent.com/InjectiveLabs/injective-lists/refs/heads/master/json/wallets/ofac.json")
if [ "$response_code" != "200" ]; then
    echo "Error: URL returned status code $response_code"
    exit 1
fi

# Test 2: Verify JSON format and structure
echo "Verifying JSON format..."
curl -s "https://raw.githubusercontent.com/InjectiveLabs/injective-lists/refs/heads/master/json/wallets/ofac.json" | jq 'if type == "array" and (.[0] | type == "string") then "Valid JSON array of strings" else "Invalid format" end'

Length of output: 577

injective_data/ofac.json (3)

1-157: JSON structure looks good

The file maintains a valid JSON array structure with proper formatting.


2-157: All Ethereum addresses are properly formatted

Each address follows the standard Ethereum address format (0x prefix followed by 40 hexadecimal characters).


1-157: Verify OFAC compliance updates

The changes to the sanctioned addresses list should be properly documented and verified against official OFAC updates.

Let's verify these changes:

Consider adding a comment in the file or updating documentation to reference:

  1. The OFAC announcement/bulletin number
  2. The date of the update
  3. A brief description of the changes

@PavelInjective PavelInjective self-requested a review November 13, 2024 16:00
@aarmoa aarmoa merged commit d427297 into dev Nov 13, 2024
4 checks passed
@aarmoa aarmoa deleted the feat/sync_dev_with_v1_53_1 branch November 13, 2024 17:45
@coderabbitai coderabbitai bot mentioned this pull request Dec 3, 2024
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.

2 participants