Skip to content

Hot fix for fixing bad genesis file on 2.1.5 install#1553

Merged
algojohnlee merged 3 commits intoalgorand:masterfrom
btoll:hot_fix
Sep 24, 2020
Merged

Hot fix for fixing bad genesis file on 2.1.5 install#1553
algojohnlee merged 3 commits intoalgorand:masterfrom
btoll:hot_fix

Conversation

@btoll
Copy link
Copy Markdown

@btoll btoll commented Sep 24, 2020

Summary

This tests the following scenarios:

  1. MainNet debian user who upgraded to 2.1.5, and was moved to TestNet accidentally
  2. TestNet debian user who upgraded to 2.1.5
  3. MainNet debian user who installed 2.1.5 between Monday 2:30pm and Wednesday 12:00pm, and changed their genesis.json to MainNet
  4. TestNet debian user who installed 2.1.5 between Monday 2:30pm and Wednesday 12:00pm

Test Plan

Build package locally and run through each of the tests outlined above.

@btoll btoll self-assigned this Sep 24, 2020
@btoll btoll changed the title Hot fix for fixing bad genesis file on install Hot fix for fixing bad genesis file on 2.1.5 install Sep 24, 2020
Copy link
Copy Markdown
Contributor

@onetechnical onetechnical left a comment

Choose a reason for hiding this comment

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

The logic looks okay, but can you verify the shebang change requirement?

Comment thread installer/debian/algorand/postinst Outdated
Comment thread installer/debian/algorand/postinst Outdated
onetechnical
onetechnical previously approved these changes Sep 24, 2020
Copy link
Copy Markdown
Contributor

@tsachiherman tsachiherman left a comment

Choose a reason for hiding this comment

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

Overall looks good. Few ideas for better error handling.

Comment thread installer/debian/algorand/postinst Outdated
if [ "$1" = "configure" ]; then
if [ -f /var/lib/algorand/genesis.json-2.1.5-patch ]; then
# 2.1.5 bug fix - restore user-modified genesis.json
mv /var/lib/algorand/genesis.json-2.1.5-patch /var/lib/algorand/genesis.json
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

maybe

mv -f /var/lib/algorand/genesis.json-2.1.5-patch /var/lib/algorand/genesis.json

to avoid files modes that won't permit writing ?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Will fix.

# Filter out `algorand-indexer` and `algorand-devtools` packages, they are allowed to be
# installed alongside other `algorand` packages.
INSTALLED_PKG=$(grep -v -e algorand-indexer -e algorand-devtools <<< "$PKG_INFO" | awk '{print $1}')
ALGO_MD5=$(md5sum /var/lib/algorand/genesis.json | awk '{print $1}')
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

since you're using pipes, consider using set -o pipefail

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

and then, use export BASHOPTS to export that to the subshell.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Will fix.

Copy link
Copy Markdown
Contributor

@onetechnical onetechnical left a comment

Choose a reason for hiding this comment

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

Still looks good to me!

@algojohnlee
Copy link
Copy Markdown
Contributor

Tests unrelated to changes here, and Tsachi's changes addressed, merging.

@algojohnlee algojohnlee merged commit ea2af12 into algorand:master Sep 24, 2020
@btoll btoll deleted the hot_fix branch September 24, 2020 20:07
algojohnlee added a commit that referenced this pull request Sep 24, 2020
Hot fix for fixing bad genesis file on 2.1.5 install (#1553)
tsachiherman pushed a commit to tsachiherman/go-algorand that referenced this pull request Jul 7, 2021
tsachiherman pushed a commit to tsachiherman/go-algorand that referenced this pull request Jul 7, 2021
tsachiherman pushed a commit to tsachiherman/go-algorand that referenced this pull request Jul 7, 2021
…ta2.1.6

Hot fix for fixing bad genesis file on 2.1.5 install (algorand#1553)
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