Skip to content

Commit

Permalink
merge main
Browse files Browse the repository at this point in the history
  • Loading branch information
nullpointer0x00 committed May 28, 2024
2 parents deb2da2 + 81cca66 commit 4fc9301
Show file tree
Hide file tree
Showing 60 changed files with 2,334 additions and 1,248 deletions.
24 changes: 12 additions & 12 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,22 +44,22 @@ jobs:
name: "${{ steps.def-vars.outputs.file-prefix }}-pkgs.txt"
path: ./pkgs.txt
- name: Split pkgs into parts
# The x/marker/simulation test-race takes around 6ish minutes and is by far the longest running one.
# The next longest running is x/metadata/client/cli at 2.5ish minutes.
# So take x/marker/simulation out of the list, split the list into 3 parts and create a 4th part
# with just the x/marker/simulation test.
# Temporarily, several tests are known to still fail, so we make them all part 3, and split the rest among 0-2.
# TODO[1760]: Re-analyze how long tests tests take and change the splitting back to be based on speed.
# With a standard split, test-race (03) takes the longest of all these at around 6m35s.
# and test-race (00) is the shortest (of the race tests) at around 4m00s.
# The x/sanction/simulation test-race is one of the longer ones (at almost 2 minutes), and ends up in part 03.
# By forcing that one into 00, it ends up reducing the overall run-time of this whole workflow by about a minute.
# The x/marker/client/cli tests take around 30s (35s for race), and would be in 01.
# Moving it to 00 ends up leveling out the times a bit more.
run: |
grep -vF \
-e 'github.com/provenance-io/provenance/x/ibcratelimit/simulation' \
-e 'github.com/provenance-io/provenance/x/oracle/simulation' \
-e 'github.com/provenance-io/provenance/x/sanction/simulation' \
-e 'github.com/provenance-io/provenance/x/marker/client/cli' \
pkgs.txt > pkgs.txt.tmp
split -d -n l/3 pkgs.txt.tmp pkgs.txt.part.
split -d -n l/4 pkgs.txt.tmp pkgs.txt.part.
printf '%s\n' \
'github.com/provenance-io/provenance/x/ibcratelimit/simulation' \
'github.com/provenance-io/provenance/x/oracle/simulation' \
> pkgs.txt.part.03
'github.com/provenance-io/provenance/x/sanction/simulation' \
'github.com/provenance-io/provenance/x/marker/client/cli' \
>> pkgs.txt.part.00
- uses: actions/upload-artifact@v4
with:
name: "${{ steps.def-vars.outputs.file-prefix }}-pkgs.txt.part.00"
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,9 @@ Ref: https://keepachangelog.com/en/1.0.0/
* `ibcratelimit` add `UpdateParams` endpoint and deprecate `GovUpdateParams` [#1984](https://github.com/provenance-io/provenance/pull/1984).
* `attribute` add `UpdateParams` endpoint and cli [#1987](https://github.com/provenance-io/provenance/pull/1987).
* `marker` add `UpdateParams` endpoint and cli [#1991](https://github.com/provenance-io/provenance/pull/1991).
* `name` add `UpdateParams` endpoint and cli [#2004](https://github.com/provenance-io/provenance/pull/2004).
* Update the exchange `commitment-settlement-fee-calc` cli query to utilize the keyring [#2001](https://github.com/provenance-io/provenance/pull/2001).
* Implement the ProposalMsgs module interface for the internal/provwasm, ibcratelimit, oracle, and sanction modules [#1993](https://github.com/provenance-io/provenance/pull/1993.)

### Client Breaking

Expand Down
4 changes: 2 additions & 2 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -770,7 +770,7 @@ func New(

// IBC
ibc.NewAppModule(app.IBCKeeper),
ibcratelimitmodule.NewAppModule(appCodec, *app.RateLimitingKeeper, app.AccountKeeper, app.BankKeeper),
ibcratelimitmodule.NewAppModule(appCodec, *app.RateLimitingKeeper),
ibchooks.NewAppModule(app.AccountKeeper, *app.IBCHooksKeeper),
ibctransfer.NewAppModule(*app.TransferKeeper),
icqModule,
Expand Down Expand Up @@ -1015,7 +1015,7 @@ func New(

// IBC
ibc.NewAppModule(app.IBCKeeper),
ibcratelimitmodule.NewAppModule(appCodec, *app.RateLimitingKeeper, app.AccountKeeper, app.BankKeeper),
ibcratelimitmodule.NewAppModule(appCodec, *app.RateLimitingKeeper),
ibchooks.NewAppModule(app.AccountKeeper, *app.IBCHooksKeeper),
ibctransfer.NewAppModule(*app.TransferKeeper),
icaModule,
Expand Down
15 changes: 1 addition & 14 deletions app/params/weights.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,32 +14,19 @@ const (
DefaultWeightMsgDeleteDistinctAttribute int = 5
DefaultWeightMsgSetAccountData int = 10
// Marker
DefaultWeightSupplyIncreaseProposalContent int = 5
DefaultWeightSupplyDecreaseProposalContent int = 5
DefaultWeightSetAdministratorProposalContent int = 5
DefaultWeightRemoveAdministratorProposalContent int = 5
DefaultWeightChangeStatusProposalContent int = 5
DefaultWeightSetDenomMetadataProposalContent int = 5
// Adjusted marker operations to a cumulative weight of 100
DefaultWeightMsgAddMarker int = 30
DefaultWeightMsgChangeStatus int = 10
DefaultWeightMsgFinalize int = 10
DefaultWeightMsgAddAccess int = 10
DefaultWeightMsgAddFinalizeActivateMarker int = 10
DefaultWeightMsgAddMarkerProposal int = 40
DefaultWeightMsgUpdateDenySendList int = 10
// MsgFees
DefaultWeightAddMsgFeeProposalContent int = 75
DefaultWeightRemoveMsgFeeProposalContent int = 25
// Rewards
DefaultWeightSubmitCreateRewards int = 95
DefaultWeightSubmitEndRewards int = 5
// Trigger
DefaultWeightSubmitCreateTrigger int = 95
DefaultWeightSubmitDestroyTrigger int = 5
// Oracle
DefaultWeightUpdateOracle int = 25
DefaultWeightSendOracleQuery int = 75
// Ibc Rate Limiter
DefaultWeightUpdateParams int = 100
DefaultWeightIBCRLUpdateParams int = 100
)
2 changes: 1 addition & 1 deletion client/docs/statik/statik.go

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions client/docs/swagger-ui/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -117054,6 +117054,11 @@ definitions:
provenance.name.v1.MsgModifyNameResponse:
type: object
description: MsgModifyNameResponse defines the Msg/ModifyName response type.
provenance.name.v1.MsgUpdateParamsResponse:
type: object
description: >-
MsgUpdateParamsResponse is a response message for the UpdateParams
endpoint.
provenance.name.v1.NameRecord:
type: object
properties:
Expand Down
43 changes: 43 additions & 0 deletions internal/helpers/rand.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
package helpers

import (
"fmt"
"math/rand"

simtypes "github.com/cosmos/cosmos-sdk/types/simulation"
)

// RandIntBetween generates a random number between min and max inclusive.
func RandIntBetween(r *rand.Rand, min, max int) int {
return r.Intn(max-min+1) + min
}

// SelectRandomEntries selects count entries from the ones provided.
// The entriesType string is used in the error message to describe the entries slice.
func SelectRandomEntries[E any](r *rand.Rand, entries []E, count int, entriesType string) ([]E, error) {
if count == 0 {
return nil, nil
}
if len(entries) < count {
return nil, fmt.Errorf("cannot choose %d %s because there are only %d", count, entriesType, len(entries))
}
if count == 1 {
if len(entries) == 1 {
return entries, nil
}
pivot := r.Intn(len(entries))
return entries[pivot : pivot+1], nil
}

randomized := make([]E, 0, len(entries))
randomized = append(randomized, entries...)
r.Shuffle(len(randomized), func(i, j int) {
randomized[i], randomized[j] = randomized[j], randomized[i]
})
return randomized[:count], nil
}

// SelectRandomAccounts selects count accounts from the ones provided.
func SelectRandomAccounts(r *rand.Rand, accs []simtypes.Account, count int) ([]simtypes.Account, error) {
return SelectRandomEntries(r, accs, count, "accounts")
}
Loading

0 comments on commit 4fc9301

Please sign in to comment.