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

Develop #401

Merged
merged 56 commits into from
Jan 6, 2022
Merged

Develop #401

merged 56 commits into from
Jan 6, 2022

Conversation

ashish10677
Copy link
Member

@ashish10677 ashish10677 commented Dec 7, 2021

Description

Changes in this PR

  • Increase test coverage.
  • Increment gasLimit while confirming block
  • Fixed GetNumberOfStakers() function
  • Fixed hashing issue in getElectedProposer() and added tests.
  • Added dispute of wrong biggest influencer id.
  • Integration of sentry.
  • Added new feature to increase gas limit returned by EstimateGas().
  • Introduced crash recovery after commit is done.
  • New retry mechanism added.
  • Bug fixes.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

  • Test A
  • Test B

Test Configuration:

  • Contracts version:
  • Hardware:

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

ashish10677 and others added 30 commits November 8, 2021 14:30
Co-authored-by: Skanda Bhat <bhat.skanda.m@gmail.com>
Signed-off-by: Ashish Kumar Mishra <ashish10677@gmail.com>
Signed-off-by: Ashish Kumar Mishra <ashish10677@gmail.com>
Signed-off-by: Ashish Kumar Mishra <ashish10677@gmail.com>
* Added GetSortedProposedBlockIds
* Support for tests
* Modified tests
* Corrected activeAssetIds in tests
* Added check for biggestInfluence

* Support for tests

* Additional tests

* only one dispute check
* StakerInfo command implemented.

Signed-off-by: Ashish Kumar Mishra <ashish10677@gmail.com>

* Update README files.

Signed-off-by: Ashish Kumar Mishra <ashish10677@gmail.com>

* Implement necessary mocks for tests.

Signed-off-by: Ashish Kumar Mishra <ashish10677@gmail.com>

* Fix typo.

Signed-off-by: Ashish Kumar Mishra <ashish10677@gmail.com>

* Add more tests.

Signed-off-by: Ashish Kumar Mishra <ashish10677@gmail.com>

* Remove address from stakerInfo command.

Signed-off-by: Ashish Kumar Mishra <ashish10677@gmail.com>

* Fix getEpoch method.

Signed-off-by: Ashish Kumar Mishra <ashish10677@gmail.com>

* Fix tests.

Signed-off-by: Ashish Kumar Mishra <ashish10677@gmail.com>

* Update README.

Signed-off-by: Ashish Kumar Mishra <ashish10677@gmail.com>
Signed-off-by: Ashish Kumar Mishra <ashish10677@gmail.com>
Signed-off-by: Ashish Kumar Mishra <ashish10677@gmail.com>
* Added getUpdatedEpoch()

* Fetched updated epoch in for loop
* Initialized sentry to the project.

Signed-off-by: Ashish Kumar Mishra <ashish10677@gmail.com>

* Run golangci-lint run.

Signed-off-by: Ashish Kumar Mishra <ashish10677@gmail.com>
* utilsStruct call methods
* consolidated interfaces into one
* compilation changes
* Modified functions with utilsStruct
* Update config.yml

* changed addresses to v0.1.76 (#318)

* Develop (#325)

* Update config.yml (#316)

* Additional tests (#317)

* Increment gasLimit while confirming block. (#320)

* Corrected GetNumberOfStakers() (#324)

Co-authored-by: Ashish Kumar Mishra <ashish10677@gmail.com>
Co-authored-by: Yashk767 <76935991+Yashk767@users.noreply.github.com>
Co-authored-by: Skanda Bhat <bhat.skanda.m@gmail.com>
Co-authored-by: OxHimanshu <61224737+OxHimanshu@users.noreply.github.com>
* Added gasLimit as a setConfig parameter.

Signed-off-by: Ashish Kumar Mishra <ashish10677@gmail.com>

* Add code to increase gas limit by dynamic value.

Signed-off-by: Ashish Kumar Mishra <ashish10677@gmail.com>

* Restrict gas limit to 21 million max.

Signed-off-by: Ashish Kumar Mishra <ashish10677@gmail.com>

* Add Gas limit in config.sh

Signed-off-by: Ashish Kumar Mishra <ashish10677@gmail.com>

* Add tests for set config.

Signed-off-by: Ashish Kumar Mishra <ashish10677@gmail.com>

* Update README

Signed-off-by: Ashish Kumar Mishra <ashish10677@gmail.com>

* Make default gas limit as 100%

Signed-off-by: Ashish Kumar Mishra <ashish10677@gmail.com>

* Apply gofmt.

Signed-off-by: Ashish Kumar Mishra <ashish10677@gmail.com>

* Modify gas limit multiplier to be used as 2x, 3x, 1.5x, etc.

Signed-off-by: Ashish Kumar Mishra <ashish10677@gmail.com>

* Update README.

Signed-off-by: Ashish Kumar Mishra <ashish10677@gmail.com>

* Fix tests.

Signed-off-by: Ashish Kumar Mishra <ashish10677@gmail.com>
* ConvertToNumber coverage

* Moved AssignAmountInWei() to cmd-utils.go

* Additional tests

Added a nil testcase

minor changes

* requested change
Co-authored-by: Shrikant Upadhyay <shrikant@thetreedots.com>
* Removed max gas limit from confirm block.

Signed-off-by: Ashish Kumar Mishra <ashish10677@gmail.com>

* Fix tests.

Signed-off-by: Ashish Kumar Mishra <ashish10677@gmail.com>
Signed-off-by: Ashish Kumar Mishra <ashish10677@gmail.com>
Signed-off-by: Ashish Kumar Mishra <ashish10677@gmail.com>
Signed-off-by: Ashish Kumar Mishra <ashish10677@gmail.com>
Signed-off-by: Ashish Kumar Mishra <ashish10677@gmail.com>
Signed-off-by: Ashish Kumar Mishra <ashish10677@gmail.com>
* Seperated InitialiseUnstake()

* modified functions with  utilsStruct

* seperate executeUnstake()

* Added support for tests

* Added tests for unstake

* Added a UnstakeInput struct

* requested changes

* Mocked Sleep function

* Modified AutoWithdraw function

* Added tests for AutoWithdraw
* feat: Adding docker-compose.yml

* feat: configured docker-compose and readme

* feat: updated readme for docker compose

* fix: updated readme and added support for silicon based MAC

* fix: Updated README for silicon based MAC

Signed-off-by: Shrikant Upadhyay <shrikant1997upadhyay@gmail.com>

Co-authored-by: Shrikant Upadhyay <shrikant@thetreedots.com>
* Timeout duration reduced from 120 to 30 secs.

Signed-off-by: Ashish Kumar Mishra <ashish10677@gmail.com>

* Block completion timeout made a constant value.

Signed-off-by: Ashish Kumar Mishra <ashish10677@gmail.com>
* Modified functions with utilsStruct

* Compilation fixes

* modified AssignAmountInWei

* Compilation fixes

* Added tests for cmd-ttils

* Added tests for different states
ashish10677 and others added 7 commits December 6, 2021 15:41
* Update contract addresses.

* Removed unneccessary usage of address.

* Removed address and fixed tests.

Signed-off-by: Ashish Kumar Mishra <ashish10677@gmail.com>
* removed Accounts interface from cmd

* New Accounts Interface in accounts pkg

* Compilation fixes

* Added tests for accounts
* Update contract addresses.

* Add function to handle XHTML data points.

* Add tests for TestGetDataFromHTML

* Add tests and updateJob changed.

* README updated.

Signed-off-by: Ashish Kumar Mishra <ashish10677@gmail.com>
* Added stakedToken contract

* Added RZR,sRZR conversion functions

* Converted RZR's to sRZR's before unstake call

* Added support for tests

* Added tests

* Seperate GetAmountInSRZRs function

* Modified tests

* displayed log to highest decimals

* Changed log format to debug

* Added test cases with higher values
* Modified config-utils with utilsStruct

* Added support in interfaces

* Compilation fixes due to modified GetConfigdata()

* Added mocks for config functions

* fixed tests

* Added flagSetUtils to utilsStruct

* Added tests for config-Utils
* Added support for tests

* Modified functions with RazorUtilsInterface

* compilation fixes

* changed parameter count

* Fixed tests

* Added tests for options.go
* Changed interface and struct names

* Compilation fixes

* Fix tests
@SkandaBhat
Copy link
Member

@ashish10677 can you please add a succinct summary of the changes that are included in this PR?

@ashish10677
Copy link
Member Author

@ashish10677 can you please add a succinct summary of the changes that are included in this PR?

Done

@SkandaBhat
Copy link
Member

There are conflicts @ashish10677

@ashish10677
Copy link
Member Author

There are conflicts @ashish10677

Yeah this is still not ready for merge.

Shrikant1212 and others added 11 commits December 20, 2021 14:23
* configure publish step

* fix indentation

* configure dind in job

* configure dind in job

* configure dind in job

* test image build job

* configure docker login

* configure docker login

* configure context in ci

* configure docker host address

* cleanup

* add env vars

* Configured tag based job for publishing docker image
* Add rogue mode for commit.
* rogueMode with commit tested.
* Only propose rogue if the rogue mode is mentioned as propose.
* Fix tests.
* Update README.
* Add tests for GetRogueRandomValue
* Removed comments.
* Change rogue to rogueData.
* Comment hotfix.

Signed-off-by: Ashish Kumar Mishra <ashish10677@gmail.com>
* Readme updated
* Update package.json

* Fix data type issue.

* No compilation or running error.

* Add new command for updateCommission.

* Fix tests.

* Rename razorUtils to packageUtils.

* Change parameters in tests.

* Update README and version.

* Add condition to check if a staker has been slashed before.

* Fix waitFor issue.

Signed-off-by: Ashish Kumar Mishra <ashish10677@gmail.com>
* Reduced maxIteration and removed address parameter from getIteraion()

* Added tests for 100% coverage
* generated mocks using mockery

* Added mockery support
* Separate initializeVote(), executeVote(), vote()

* Added autoVote feature

* modified ReadMe
* jobList command added

* Readme updated

* test fixes
* collectionList command added

* lint fix

* minor fix
* Added method caller UtilsStruct for block.go functions

* Added mocks

* Added tests for block.go

* Compilation fixes
@ashish10677 ashish10677 marked this pull request as draft January 5, 2022 05:27
@ashish10677 ashish10677 linked an issue Jan 5, 2022 that may be closed by this pull request
* Init overrideJob.

* Override job command implemented.

* Add deleteOverride.

* Delete Override job implemented.

* Add if condition while fetching job.

* Remove packageUtils.

* Fix bug in updateCommission.

* Update tests.

* README updated.

Signed-off-by: Ashish Kumar Mishra <ashish10677@gmail.com>
@ashish10677 ashish10677 marked this pull request as ready for review January 5, 2022 11:24
ashish10677 and others added 3 commits January 5, 2022 18:35
* Develop (#375)

* Update config.yml (#316)

Co-authored-by: Skanda Bhat <bhat.skanda.m@gmail.com>

* Additional tests (#317)

* Increment gasLimit while confirming block. (#320)

Signed-off-by: Ashish Kumar Mishra <ashish10677@gmail.com>

* Corrected GetNumberOfStakers() (#324)

* Fix issue of isElectedProposer. (#328)

Signed-off-by: Ashish Kumar Mishra <ashish10677@gmail.com>

* Exit the code if the stake is slashed to 0 (#334)

Signed-off-by: Ashish Kumar Mishra <ashish10677@gmail.com>

* Dispute blockId fix (#333)

* Added GetSortedProposedBlockIds
* Support for tests
* Modified tests
* Corrected activeAssetIds in tests

* Dispute influence id fix (#338)

* Added check for biggestInfluence

* Support for tests

* Additional tests

* only one dispute check

* Staker info (#314)

* StakerInfo command implemented.

Signed-off-by: Ashish Kumar Mishra <ashish10677@gmail.com>

* Update README files.

Signed-off-by: Ashish Kumar Mishra <ashish10677@gmail.com>

* Implement necessary mocks for tests.

Signed-off-by: Ashish Kumar Mishra <ashish10677@gmail.com>

* Fix typo.

Signed-off-by: Ashish Kumar Mishra <ashish10677@gmail.com>

* Add more tests.

Signed-off-by: Ashish Kumar Mishra <ashish10677@gmail.com>

* Remove address from stakerInfo command.

Signed-off-by: Ashish Kumar Mishra <ashish10677@gmail.com>

* Fix getEpoch method.

Signed-off-by: Ashish Kumar Mishra <ashish10677@gmail.com>

* Fix tests.

Signed-off-by: Ashish Kumar Mishra <ashish10677@gmail.com>

* Update README.

Signed-off-by: Ashish Kumar Mishra <ashish10677@gmail.com>

* Increase coverage on propose.go. (#340)

Signed-off-by: Ashish Kumar Mishra <ashish10677@gmail.com>

* Added maximum gas limit while confirming block. (#335)

Signed-off-by: Ashish Kumar Mishra <ashish10677@gmail.com>

* Fix withdraw (#344)

* Added getUpdatedEpoch()

* Fetched updated epoch in for loop

* Sentry integrated to razor-go (#347)

* Initialized sentry to the project.

Signed-off-by: Ashish Kumar Mishra <ashish10677@gmail.com>

* Run golangci-lint run.

Signed-off-by: Ashish Kumar Mishra <ashish10677@gmail.com>

* Consolidated interfaces into utilsStruct  (#341)

* utilsStruct call methods
* consolidated interfaces into one
* compilation changes
* Modified functions with utilsStruct

* Resolve conflicts (#349)

* Update config.yml

* changed addresses to v0.1.76 (#318)

* Develop (#325)

* Update config.yml (#316)

* Additional tests (#317)

* Increment gasLimit while confirming block. (#320)

* Corrected GetNumberOfStakers() (#324)

Co-authored-by: Ashish Kumar Mishra <ashish10677@gmail.com>
Co-authored-by: Yashk767 <76935991+Yashk767@users.noreply.github.com>
Co-authored-by: Skanda Bhat <bhat.skanda.m@gmail.com>
Co-authored-by: OxHimanshu <61224737+OxHimanshu@users.noreply.github.com>

* Gas limit config (#343)

* Added gasLimit as a setConfig parameter.

Signed-off-by: Ashish Kumar Mishra <ashish10677@gmail.com>

* Add code to increase gas limit by dynamic value.

Signed-off-by: Ashish Kumar Mishra <ashish10677@gmail.com>

* Restrict gas limit to 21 million max.

Signed-off-by: Ashish Kumar Mishra <ashish10677@gmail.com>

* Add Gas limit in config.sh

Signed-off-by: Ashish Kumar Mishra <ashish10677@gmail.com>

* Add tests for set config.

Signed-off-by: Ashish Kumar Mishra <ashish10677@gmail.com>

* Update README

Signed-off-by: Ashish Kumar Mishra <ashish10677@gmail.com>

* Make default gas limit as 100%

Signed-off-by: Ashish Kumar Mishra <ashish10677@gmail.com>

* Apply gofmt.

Signed-off-by: Ashish Kumar Mishra <ashish10677@gmail.com>

* Modify gas limit multiplier to be used as 2x, 3x, 1.5x, etc.

Signed-off-by: Ashish Kumar Mishra <ashish10677@gmail.com>

* Update README.

Signed-off-by: Ashish Kumar Mishra <ashish10677@gmail.com>

* Fix tests.

Signed-off-by: Ashish Kumar Mishra <ashish10677@gmail.com>

* modified tests with more realistic values (#351)

* Added tests for math.go (#353)

* ConvertToNumber coverage

* Moved AssignAmountInWei() to cmd-utils.go

* Additional tests

Added a nil testcase

minor changes

* requested change

* fix: added jq pkg and updated build script in dockerfile. (#362)

Co-authored-by: Shrikant Upadhyay <shrikant@thetreedots.com>

* Removed max gas limit from confirm block. (#359)

* Removed max gas limit from confirm block.

Signed-off-by: Ashish Kumar Mishra <ashish10677@gmail.com>

* Fix tests.

Signed-off-by: Ashish Kumar Mishra <ashish10677@gmail.com>

* Reduce calculations in handle dispute. (#364)

Signed-off-by: Ashish Kumar Mishra <ashish10677@gmail.com>

* Update contract addresses. (#374)

Signed-off-by: Ashish Kumar Mishra <ashish10677@gmail.com>

* Remove unnecessary import

Signed-off-by: Ashish Kumar Mishra <ashish10677@gmail.com>

* Fix tests.

Signed-off-by: Ashish Kumar Mishra <ashish10677@gmail.com>

* Test unstake (#350)

* Seperated InitialiseUnstake()

* modified functions with  utilsStruct

* seperate executeUnstake()

* Added support for tests

* Added tests for unstake

* Added a UnstakeInput struct

* requested changes

* Mocked Sleep function

* Modified AutoWithdraw function

* Added tests for AutoWithdraw

* feat: Adding docker-compose.yml (#365)

* feat: Adding docker-compose.yml

* feat: configured docker-compose and readme

* feat: updated readme for docker compose

* fix: updated readme and added support for silicon based MAC

* fix: Updated README for silicon based MAC

Signed-off-by: Shrikant Upadhyay <shrikant1997upadhyay@gmail.com>

Co-authored-by: Shrikant Upadhyay <shrikant@thetreedots.com>

* Timeout duration reduced from 120 to 30 secs. (#366)

* Timeout duration reduced from 120 to 30 secs.

Signed-off-by: Ashish Kumar Mishra <ashish10677@gmail.com>

* Block completion timeout made a constant value.

Signed-off-by: Ashish Kumar Mishra <ashish10677@gmail.com>

Co-authored-by: Skanda Bhat <bhat.skanda.m@gmail.com>
Co-authored-by: Yashk767 <76935991+Yashk767@users.noreply.github.com>
Co-authored-by: OxHimanshu <61224737+OxHimanshu@users.noreply.github.com>
Co-authored-by: Shrikant upadhyay <shrikant1997upadhyay@gmail.com>
Co-authored-by: Shrikant Upadhyay <shrikant@thetreedots.com>

* Added new address (#411)

* README updated (#416)

Co-authored-by: Skanda Bhat <bhat.skanda.m@gmail.com>
Co-authored-by: Yashk767 <76935991+Yashk767@users.noreply.github.com>
Co-authored-by: OxHimanshu <61224737+OxHimanshu@users.noreply.github.com>
Co-authored-by: Shrikant upadhyay <shrikant1997upadhyay@gmail.com>
Co-authored-by: Shrikant Upadhyay <shrikant@thetreedots.com>
Co-authored-by: Shekhar Gaur <65169767+shekhar2807@users.noreply.github.com>
Signed-off-by: Ashish Kumar Mishra <ashish10677@gmail.com>
@SkandaBhat SkandaBhat merged commit 5b10f41 into main Jan 6, 2022
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.

Release v0.1.8
5 participants