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

Implement ADR 033 #157

Merged
merged 19 commits into from
Dec 4, 2020
Merged

Implement ADR 033 #157

merged 19 commits into from
Dec 4, 2020

Conversation

aaronc
Copy link
Member

@aaronc aaronc commented Nov 10, 2020

@blushi blushi mentioned this pull request Nov 18, 2020
13 tasks
types/module/server/router.go Outdated Show resolved Hide resolved
}

rtr.antiReentryMap[moduleName] = true
defer delete(rtr.antiReentryMap, moduleName)
Copy link
Collaborator

Choose a reason for hiding this comment

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

This only works when we won't have async calls in hander (if handler is able to make a async call for other module , then this protection breaks apart.

As an alternative, we never delete from the map. Instead we create a new one once the app will start processing a new transaction.

Copy link
Member Author

@aaronc aaronc Dec 3, 2020

Choose a reason for hiding this comment

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

Yeah async currently isn't allowed because there is no consensus way to do ordering.

@aaronc aaronc requested a review from clevinson December 3, 2020 01:06
@aaronc aaronc marked this pull request as ready for review December 3, 2020 01:30
@codecov
Copy link

codecov bot commented Dec 3, 2020

Codecov Report

Merging #157 (7624417) into master (7f9fd48) will decrease coverage by 0.12%.
The diff coverage is 63.63%.

@@            Coverage Diff             @@
##           master     #157      +/-   ##
==========================================
- Coverage   67.36%   67.23%   -0.13%     
==========================================
  Files          30       30              
  Lines        1575     1581       +6     
==========================================
+ Hits         1061     1063       +2     
- Misses        404      406       +2     
- Partials      110      112       +2     

@aaronc
Copy link
Member Author

aaronc commented Dec 3, 2020

Any comments? @robert-zaremba @clevinson ?

Does this maybe look good enough to merge?

I know there are glaring omissions in terms of docs and unit tests (although most methods are tested by the x/data and x/ecocredit tests).

Copy link
Member

@clevinson clevinson left a comment

Choose a reason for hiding this comment

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

Great work on this @aaronc. I think i've got my head 90% wrapped around all the authorization logic (in Invoker, InvokerFactory, etc.)... but otherwise everything seems clear & makes sense.

Adding a bit more docs/comments would definitely help with some of the readability.

Few small other questions below, but approving as looks good to merge IMO.

Comment on lines +110 to +119
func (mm *Manager) CompleteInitialization() error {
for typ := range mm.requiredServices {
if _, found := mm.router.providedServices[typ]; !found {
return fmt.Errorf("initialization error, service %s was required, but not provided", typ)
}

}

return nil
}
Copy link
Member

Choose a reason for hiding this comment

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

The name CompleteInitialization() makes me think that this function performs some action (completing an initialization process). Looking at what it does, I think calling it something like VerifyInitialization() or ValidateInitialization() would be more clear.

Copy link
Member Author

Choose a reason for hiding this comment

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

I have in mind this might do some more things later that are more like completion. Maybe we can address later

types/module/server/router.go Outdated Show resolved Hide resolved
types/module/server/manager.go Outdated Show resolved Hide resolved
x/data/server/testsuite/suite.go Show resolved Hide resolved
@aaronc aaronc changed the title ADR 033 module refactor spike Implement ADR 033 Dec 4, 2020
@aaronc aaronc merged commit e81ef35 into master Dec 4, 2020
@ryanchristo ryanchristo deleted the aaronc/module-refactor branch July 2, 2022 22:03
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