-
Notifications
You must be signed in to change notification settings - Fork 50
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
fix: last updated setting in x/marketmap
keeper [DO NOT MERGE]
#799
base: main
Are you sure you want to change the base?
Changes from all commits
596b64d
d240fb3
32b8c05
c99bcb4
b74b975
7da6a3c
534986e
db8b606
98b92b2
2d55818
bad3330
0da86d9
8054d9d
2d6dc3a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -85,7 +85,7 @@ func (ms msgServer) UpsertMarkets(goCtx context.Context, msg *types.MsgUpsertMar | |
return nil, err | ||
} | ||
|
||
return &types.MsgUpsertMarketsResponse{}, ms.k.SetLastUpdated(ctx, uint64(ctx.BlockHeight())) //nolint:gosec | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For these functions, SetLastUpdated will not get called many times per upsert potentially. Are there gas consequences of this? Is that a problem? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There are gas consequences because it is called many times yes. This isn't a problem per-se as these transactions are only executed by gov / the mmu auth, but it is another reason why this PR is state breaking |
||
return &types.MsgUpsertMarketsResponse{}, nil | ||
} | ||
|
||
// CreateMarkets updates the marketmap by creating markets from the given message. All updates are made to the market | ||
|
@@ -126,7 +126,7 @@ func (ms msgServer) CreateMarkets(goCtx context.Context, msg *types.MsgCreateMar | |
return nil, fmt.Errorf("invalid state resulting from update: %w", err) | ||
} | ||
|
||
return &types.MsgCreateMarketsResponse{}, ms.k.SetLastUpdated(ctx, uint64(ctx.BlockHeight())) //nolint:gosec | ||
return &types.MsgCreateMarketsResponse{}, nil | ||
} | ||
|
||
// UpdateMarkets updates the marketmap by updating markets from the given message. All updates are made to the market | ||
|
@@ -166,7 +166,7 @@ func (ms msgServer) UpdateMarkets(goCtx context.Context, msg *types.MsgUpdateMar | |
return nil, fmt.Errorf("invalid state resulting from update: %w", err) | ||
} | ||
|
||
return &types.MsgUpdateMarketsResponse{}, ms.k.SetLastUpdated(ctx, uint64(ctx.BlockHeight())) //nolint:gosec | ||
return &types.MsgUpdateMarketsResponse{}, nil | ||
} | ||
|
||
// verifyMarketAuthorities verifies that the msg-submitter is a market-authority | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just curious, what are the properties of this cosmos-sdk collections map? Does it handle stuff to ensure things are deterministic? Any idea of the specifics?