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

Migrate bedrock-devnet to go #6710

Closed
wants to merge 1 commit into from
Closed

Migrate bedrock-devnet to go #6710

wants to merge 1 commit into from

Conversation

refcell
Copy link
Contributor

@refcell refcell commented Aug 11, 2023

Description

Migrates and refactors the bedrock-devnet/ to golang
in a new ops-devnet package.

@changeset-bot
Copy link

changeset-bot bot commented Aug 11, 2023

⚠️ No Changeset found

Latest commit: 53e5c5a

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@refcell
Copy link
Contributor Author

refcell commented Aug 11, 2023

Current dependencies on/for this PR:

This comment was auto-generated by Graphite.

// WriteJson writes the [target] to [path] as JSON.
func WriteJson(path string, target interface{}) error {
file, _ := json.MarshalIndent(target, "", " ")
return ioutil.WriteFile(path, file, 0644)
Copy link
Contributor

Choose a reason for hiding this comment

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

ioutil.WriteFile is deprecated

Suggested change
return ioutil.WriteFile(path, file, 0644)
return os.WriteFile(path, file, 0644)
Ignore this finding from deprecated-ioutil-writefile.

if err != nil {
return err
}
err = ioutil.WriteFile(devnetConfigPath, data, 0644)
Copy link
Contributor

Choose a reason for hiding this comment

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

ioutil.WriteFile is deprecated

Suggested change
err = ioutil.WriteFile(devnetConfigPath, data, 0644)
err = os.WriteFile(devnetConfigPath, data, 0644)
Ignore this finding from deprecated-ioutil-writefile.

if err != nil {
return err
}
err = ioutil.WriteFile(devnetConfigBackup, data, 0644)
Copy link
Contributor

Choose a reason for hiding this comment

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

ioutil.WriteFile is deprecated

Suggested change
err = ioutil.WriteFile(devnetConfigBackup, data, 0644)
err = os.WriteFile(devnetConfigBackup, data, 0644)
Ignore this finding from deprecated-ioutil-writefile.

if err != nil {
return err
}
err = ioutil.WriteFile(utils.AddressesJsonPath(monorepo), data, 0644)
Copy link
Contributor

Choose a reason for hiding this comment

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

ioutil.WriteFile is deprecated

Suggested change
err = ioutil.WriteFile(utils.AddressesJsonPath(monorepo), data, 0644)
err = os.WriteFile(utils.AddressesJsonPath(monorepo), data, 0644)
Ignore this finding from deprecated-ioutil-writefile.

devnetConfigPath := utils.DevnetConfigPath(monorepo)
devnetConfigBackup := utils.DevnetConfigBackup(monorepo)

data, err := ioutil.ReadFile(devnetConfigBackup)
Copy link
Contributor

Choose a reason for hiding this comment

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

ioutil.ReadFile is deprecated

Suggested change
data, err := ioutil.ReadFile(devnetConfigBackup)
data, err := os.ReadFile(devnetConfigBackup)
Ignore this finding from deprecated-ioutil-readfile.

devnetConfigPath := utils.DevnetConfigPath(monorepo)
devnetConfigBackup := utils.DevnetConfigBackup(monorepo)

data, err := ioutil.ReadFile(devnetConfigPath)
Copy link
Contributor

Choose a reason for hiding this comment

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

ioutil.ReadFile is deprecated

Suggested change
data, err := ioutil.ReadFile(devnetConfigPath)
data, err := os.ReadFile(devnetConfigPath)
Ignore this finding from deprecated-ioutil-readfile.


// ReadeBatchInboxAddress reads the batch inbox address from the rollup.json file.
func ReadeBatchInboxAddress(monorepo string) (string, error) {
data, err := ioutil.ReadFile(utils.RollupPath(monorepo))
Copy link
Contributor

Choose a reason for hiding this comment

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

ioutil.ReadFile is deprecated

Suggested change
data, err := ioutil.ReadFile(utils.RollupPath(monorepo))
data, err := os.ReadFile(utils.RollupPath(monorepo))
Ignore this finding from deprecated-ioutil-readfile.


// ReadL2OutputOracleAddress reads the L2 output oracle address from the addresses.json file.
func ReadL2OutputOracleAddress(monorepo string) (string, error) {
data, err := ioutil.ReadFile(utils.AddressesJsonPath(monorepo))
Copy link
Contributor

Choose a reason for hiding this comment

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

ioutil.ReadFile is deprecated

Suggested change
data, err := ioutil.ReadFile(utils.AddressesJsonPath(monorepo))
data, err := os.ReadFile(utils.AddressesJsonPath(monorepo))
Ignore this finding from deprecated-ioutil-readfile.

return err
}

data, err := ioutil.ReadFile(utils.L1DeploymentsPath(monorepo))
Copy link
Contributor

Choose a reason for hiding this comment

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

ioutil.ReadFile is deprecated

Suggested change
data, err := ioutil.ReadFile(utils.L1DeploymentsPath(monorepo))
data, err := os.ReadFile(utils.L1DeploymentsPath(monorepo))
Ignore this finding from deprecated-ioutil-readfile.

Comment on lines +98 to +101
if err != nil {
return err
}
return nil
Copy link
Contributor

Choose a reason for hiding this comment

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

superfluous nil err check before return

Ignore this finding from err-nil-check.

@refcell refcell self-assigned this Aug 11, 2023
@refcell refcell added C-spike Category: Performs a spike H-bedrock-devnet Hardfork: bedrock-devnet labels Aug 16, 2023
@refcell refcell changed the title feat(ops-devnet): Migrate bedrock-devnet to go Migrate bedrock-devnet to go Aug 16, 2023
@tynes
Copy link
Contributor

tynes commented Aug 23, 2023

I am not opposed to this, its a bit easier to do async stuff in go compared to python, but it feels like a bit of thrashing because what we have already works

@refcell refcell force-pushed the refcell/ops-bedrock branch from 53e5c5a to e2b9855 Compare August 23, 2023 14:39
@codecov
Copy link

codecov bot commented Aug 23, 2023

Codecov Report

Merging #6710 (e2b9855) into develop (cfa5e24) will increase coverage by 2.99%.
The diff coverage is n/a.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #6710      +/-   ##
===========================================
+ Coverage    45.36%   48.35%   +2.99%     
===========================================
  Files          383      315      -68     
  Lines        29945    23734    -6211     
  Branches      1692        0    -1692     
===========================================
- Hits         13584    11477    -2107     
+ Misses       14904    11230    -3674     
+ Partials      1457     1027     -430     
Flag Coverage Δ
bedrock-go-tests 48.35% <ø> (-0.03%) ⬇️
cannon-go-tests ?
chain-mon-tests ?
common-ts-tests ?
contracts-bedrock-tests ?
contracts-ts-tests ?
core-utils-tests ?
sdk-next-tests ?
sdk-tests ?

Flags with carried forward coverage won't be shown. Click here to find out more.

see 77 files with indirect coverage changes

@github-actions
Copy link
Contributor

github-actions bot commented Sep 7, 2023

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

@github-actions github-actions bot added the Stale label Sep 7, 2023
@refcell refcell closed this Sep 7, 2023
@trajan0x trajan0x mentioned this pull request Sep 15, 2023
4 tasks
@refcell refcell deleted the refcell/ops-bedrock branch September 19, 2023 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-spike Category: Performs a spike H-bedrock-devnet Hardfork: bedrock-devnet Stale
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants