trufnetwork / trufnetwork/node

Problem: bridge config is hardcoded

Open
#1,161 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
7
Forks
3
Avg merge
3h 2m
Merged PRs (30d)
13

Description

hey @williamrusdyputra, since you are owning more of the code of erc20 implementation, can you analyze some suggestions?

My aim here is to make sure we have tests available to cover the implementation.

I see that some actions hardcode configurations of each network. I propose we make this configurable by adding a table network_bridge_config with columns

  • fee
  • treasure_address
  • chain_name

this should only be updated by the db_owner, and would make it more testable in ci tests and test nodes, etc.

It would be better if even the action could accept the alias as a parameter so we could call things like {chain_name}.bridge dynamically. But doesn't seem possible, in the worst case, we would still need to add a bunch of if ... else to have a statement for each chain. The idea is just to have less surface of code for fewer tests.

What do you think about this? Then we can start covering more critical parts with tests

I can take this issue if it aligns with the goal

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the ERC20 bridge actions and the network configurations that are currently hardcoded. Review how database-owned configuration and CI or test-node setup are handled, then define the table and update path before adding coverage for the configurable behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
backend, blockchain, databases
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.