8000 Add homi flags to patch genesis AddressBook code by blukat29 · Pull Request #1512 · klaytn/klaytn · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
This repository was archived by the owner on Aug 19, 2024. It is now read-only.

Add homi flags to patch genesis AddressBook code #1512

Merged
merged 4 commits into from
Sep 22, 2022

Conversation

blukat29
Copy link
Contributor
@blukat29 blukat29 commented Jul 11, 2022

Proposed changes

Add homi setup flags to help test with functioning AddressBook.

NOTE: GitHub cannot show diffs of options.go because it's very big.
For meaningful diffs, see blukat29/klaytn@be56e1b...blukat29:klaytn:homi-patch-abook-bin.

Background

  • homi options like --cypress and --baobab-test allocates AddressBook contract at address 0x400.
  • But the AddressBook contract has an hardcoded address that guards constructContract() (AddressBook.sol)
  • homi uses the code with some hardcoded addresses (options.go)
  • Therefore we cannot configure AddressBook in a test network created by homi.

Changes

  • Factor out long strings from cmd/homi/genesis/options.go to cmd/homi/genesis/bins.go. For future developers.
  • --patch-address-book: Patch the hardcoded address in the genesis AddressBook contract.
  • --patch-address-book-addr: Specify the address to inject in place of the hardcoded address. If not specified, the first CN's address is used.
  • --funding-addr: Give initial funds to the given address. Not directly related to AddressBook, but helps testing. Note that currently homi only give funds to randomly generated addresses according to --cn-num and --test-num.

Types of changes

Please put an x in the boxes related to your change.

  • Bugfix
  • New feature or enhancement
  • Others

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

  • I have read the CONTRIBUTING GUIDELINES doc
  • I have signed the CLA
  • Lint and unit tests pass locally with my changes ($ make test)
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)
  • Any dependent changes have been merged and published in downstream modules

Related issues

Further comments

Test network setup example

homi setup --cn-num 4 --baobab-test \
    --patch-address-book \
    --patch-address-book-addr 0x000000000000000000000000000000000000abcd \
    --funding-addr 0x000000000000000000000000000000000000abcd \
    --docker-image-id klaytn/klaytn:test

@blukat29 blukat29 requested a review from JayChoi1736 July 11, 2022 10:32
@blukat29 blukat29 self-assigned this Jul 11, 2022
@blukat29 blukat29 requested a review from ian0371 July 11, 2022 10:32
@blukat29 blukat29 mentioned this pull request Jul 11, 2022
10 tasks
@aidan-kwon aidan-kwon added the do not merge don't merge this PR yet label Jul 12, 2022
@blukat29 blukat29 force-pushed the homi-patch-abook-bin branch from d089aff to 872af8c Compare July 13, 2022 10:07
@aidan-kwon aidan-kwon removed the do not merge don't merge this PR yet label Aug 18, 2022
@ian0371 ian0371 mentioned this pull request Sep 13, 2022
9 tasks
@ian0371 ian0371 added this to the v1.10.0 (Kore) milestone Sep 19, 2022
Copy link
Collaborator
@2dvorak 2dvorak left a comment

Choose a reason for hiding this comment

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

Great, LGTM

@blukat29 blukat29 merged commit c4ea400 into klaytn:dev Sep 22, 2022
@blukat29 blukat29 deleted the homi-patch-abook-bin branch September 22, 2022 01:09
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0