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

Update proto depends to v1.19.0-rc2 #522

Merged
merged 7 commits into from
Jul 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -33,16 +33,22 @@ Ref: https://keepachangelog.com/en/1.0.0/

## Unreleased

* Updated Prov Protos to 1.19.0-rc2 [#522](https://github.com/provenance-io/explorer-service/pull/522)

## [v5.10.0](https://github.com/provenance-io/explorer-service/releases/tag/v5.10.0) - 2024-06-11
### Release Name: Fridtjof Nansen

* Update historical price data integration by removing figure's dlob and adding osmosis datasource [#519](https://github.com/provenance-io/explorer-service/issues/519)
* Dynamic loading of proto descriptors [#520](https://github.com/provenance-io/explorer-service/issues/520)

## [v5.8.0](https://github.com/provenance-io/explorer-service/releases/tag/v5.8.0) - 2024-03-05
## [v5.9.0](https://github.com/provenance-io/explorer-service/releases/tag/v5.9.0) - 2024-03-05
### Release Name: Alfred Harrison

### Improvements

* Updated Prov Protos to 1.18.0 [#515](https://github.com/provenance-io/explorer-service/pull/515)


## [v5.8.0](https://github.com/provenance-io/explorer-service/releases/tag/v5.8.0) - 2024-03-05
### Release Name: Romolo Gessi

Original file line number Diff line number Diff line change
@@ -21,8 +21,7 @@ enum class ProposalType(val example: BaseProposal) {
StoreCodeData(
"run as address",
StoreCodeAccessConfig(
Types.AccessType.ACCESS_TYPE_EVERYBODY,
"Only set to an address if ${Types.AccessType.ACCESS_TYPE_ONLY_ADDRESS.name}, else null"
Types.AccessType.ACCESS_TYPE_EVERYBODY
)
)
),
2 changes: 1 addition & 1 deletion buildSrc/src/main/kotlin/Dependencies.kt
Original file line number Diff line number Diff line change
@@ -51,7 +51,7 @@ object Versions {
const val SpringBoot = PluginVersions.SpringBoot
const val Swagger = "3.0.0"
const val Grpc = "1.50.2"
const val ProvProto = "1.18.0"
const val ProvProto = "1.19.0-rc2"
const val Postgres = "42.2.23"
const val Protobuf = "3.21.9"
const val Reflections = "0.9.12"
Original file line number Diff line number Diff line change
@@ -14,7 +14,6 @@ import io.provenance.explorer.domain.extensions.toDbHash
import io.provenance.explorer.domain.models.explorer.LedgerBySliceRes
import io.provenance.explorer.domain.models.explorer.LedgerInfo
import io.provenance.explorer.domain.models.explorer.TxData
import io.provenance.explorer.grpc.extensions.toLocalhostClientState
import io.provenance.explorer.grpc.extensions.toTendermintClientState
import io.provenance.explorer.model.IbcRelayer
import org.jetbrains.exposed.dao.IntEntity
@@ -55,8 +54,6 @@ fun Any.getChainName() =
when {
typeUrl.contains("ibc.lightclients.tendermint.v1.ClientState") ->
this.toTendermintClientState().chainId
typeUrl.contains("ibc.lightclients.localhost.v1.ClientState") ->
this.toLocalhostClientState().chainId
typeUrl.contains("ibc.lightclients.solomachine.v1.ClientState") -> "Unknown"
else -> throw ResourceNotFoundException("The Client State type is unknown: '$typeUrl'")
}
Original file line number Diff line number Diff line change
@@ -812,8 +812,8 @@ class TxFeeRecord(id: EntityID<Int>) : IntEntity(id) {
// find tx level msg event
val definedMsgFeeList = tx.txResponse.eventsList
.firstOrNull { it.type == getEventMsgFeesType().removeFirstSlash() }
?.attributesList?.first { it.key.toStringUtf8() == "msg_fees" }
?.value?.let { VANILLA_MAPPER.readValue<List<EventFee>>(it.toStringUtf8()) }
?.attributesList?.first { it.key == "msg_fees" }
?.value?.let { VANILLA_MAPPER.readValue<List<EventFee>>(it) }

// Adds any defined fees to fee map
definedMsgFeeList?.forEach { fee ->
Original file line number Diff line number Diff line change
@@ -43,14 +43,14 @@ fun Abci.TxResponse.getSuccessTotalBaseFee(msgFeeClient: MsgFeeGrpcClient, heigh
this.defaultBaseFees(msgFeeClient, height)
} else {
this.eventsList
.firstOrNull { it.type == "tx" && it.attributesList.map { attr -> attr.key.toStringUtf8() }.contains("basefee") }
?.attributesList?.first { it.key.toStringUtf8() == "basefee" }
?.value?.toStringUtf8()?.denomAmountToPair()?.first?.toBigDecimal()
.firstOrNull { it.type == "tx" && it.attributesList.map { attr -> attr.key }.contains("basefee") }
?.attributesList?.first { it.key == "basefee" }
?.value?.denomAmountToPair()?.first?.toBigDecimal()
?: (
this.eventsList
.firstOrNull { it.type == "tx" && it.attributesList.map { attr -> attr.key.toStringUtf8() }.contains("fee") }
?.attributesList?.first { it.key.toStringUtf8() == "fee" }
?.value?.toStringUtf8()?.denomAmountToPair()?.first?.toBigDecimal()
.firstOrNull { it.type == "tx" && it.attributesList.map { attr -> attr.key }.contains("fee") }
?.attributesList?.first { it.key == "fee" }
?.value?.denomAmountToPair()?.first?.toBigDecimal()
?: this.getFeeTotalPaid()
)
}
@@ -62,14 +62,14 @@ fun Abci.TxResponse.getSuccessTotalBaseFee(msgFeeClient: MsgFeeGrpcClient, heigh
// If no msg fee set, use the total fee paid (usually used for older txs)
fun Abci.TxResponse.getFailureTotalBaseFee(msgFeeClient: MsgFeeGrpcClient, height: Int) =
this.eventsList
.firstOrNull { it.type == "tx" && it.attributesList.map { attr -> attr.key.toStringUtf8() }.contains("min_fee_charged") }
?.attributesList?.first { it.key.toStringUtf8() == "min_fee_charged" }
?.value?.toStringUtf8()?.denomAmountToPair()?.first?.toBigDecimal()
.firstOrNull { it.type == "tx" && it.attributesList.map { attr -> attr.key }.contains("min_fee_charged") }
?.attributesList?.first { it.key == "min_fee_charged" }
?.value?.denomAmountToPair()?.first?.toBigDecimal()
?: (
this.eventsList
.firstOrNull { it.type == "coin_spent" && it.attributesList.map { attr -> attr.key.toStringUtf8() }.contains("amount") }
?.attributesList?.first { it.key.toStringUtf8() == "amount" }
?.value?.toStringUtf8()?.denomAmountToPair()?.first?.toBigDecimal()
.firstOrNull { it.type == "coin_spent" && it.attributesList.map { attr -> attr.key }.contains("amount") }
?.attributesList?.first { it.key == "amount" }
?.value?.denomAmountToPair()?.first?.toBigDecimal()
?: (
sigErrorComboList.firstOrNull { it == Pair(this.codespace, this.code) }?.let { BigDecimal.ZERO }
?: (
@@ -108,7 +108,7 @@ fun ServiceOuterClass.GetTxResponse.identifyMsgBasedFeesOld(msgFeeClient: MsgFee
// for each event obj, count the unique field, multiply by fee, and add to map (type to full amount)
val match = definedEvents[event.type]!!
val msgFee = msgFees[match.msg]!!
val count = event.attributesList.count { it.key.toStringUtf8() == match.uniqueField }
val count = event.attributesList.count { it.key == match.uniqueField }
val amount = msgFee.amount.toLong() * count
msgToFee[match.msg]?.add(amount) ?: msgToFee.put(match.msg, mutableListOf(amount))
}
Original file line number Diff line number Diff line change
@@ -18,7 +18,7 @@ fun String.removeFirstSlash() = this.split("/")[1]
fun ServiceOuterClass.GetTxResponse.mapTxEventAttrValues(eventType: String, attrKey: String) =
this.txResponse.eventsList
.filterIndexed { _, event ->
event.type == eventType && event.attributesList.map { it.key.toStringUtf8() }.contains(attrKey)
event.type == eventType && event.attributesList.map { it.key }.contains(attrKey)
}.mapIndexed { idx, event ->
idx to event.attributesList.first { it.key.toStringUtf8() == attrKey }.value.toStringUtf8()
idx to event.attributesList.first { it.key == attrKey }.value
}.toMap()
Original file line number Diff line number Diff line change
@@ -44,8 +44,8 @@ import ibc.core.connection.v1.Tx.MsgConnectionOpenAck
import ibc.core.connection.v1.Tx.MsgConnectionOpenConfirm
import ibc.core.connection.v1.Tx.MsgConnectionOpenInit
import ibc.core.connection.v1.Tx.MsgConnectionOpenTry
import ibc.lightclients.localhost.v1.Localhost
import ibc.lightclients.solomachine.v1.Solomachine
import ibc.lightclients.localhost.v2.Localhost
import ibc.lightclients.solomachine.v2.Solomachine
import ibc.lightclients.tendermint.v1.Tendermint
import io.provenance.attribute.v1.MsgAddAttributeRequest
import io.provenance.attribute.v1.MsgDeleteAttributeRequest
Original file line number Diff line number Diff line change
@@ -78,7 +78,7 @@ import org.joda.time.DateTime
import org.json.JSONArray
import org.json.JSONObject
import org.springframework.stereotype.Service
import tendermint.types.Types
import tendermint.types.ValidatorOuterClass
import java.math.BigDecimal

@Service
@@ -135,7 +135,7 @@ class ExplorerService(
) = let {
val proposer = transaction { BlockProposerRecord.findById(blockResponse.block.height())!! }
val stakingValidator = validatorService.getStakingValidator(proposer.proposerOperatorAddress)
val votingVals = nextBlock?.getVotingSet(Types.BlockIDFlag.BLOCK_ID_FLAG_ABSENT_VALUE)?.keys
val votingVals = nextBlock?.getVotingSet(ValidatorOuterClass.BlockIDFlag.BLOCK_ID_FLAG_ABSENT_VALUE)?.keys
BlockSummary(
height = blockResponse.block.height(),
hash = blockResponse.blockId.hash.toHash(),
@@ -382,7 +382,7 @@ class ExplorerService(
val valFilter = validatorSet.map { it.address }
val stakingValidators = validatorService.getStakingValidators(status, valFilter, page.toOffset(count), count)
val votingSet = asyncV2.getBlock(height + 1)!!
.getVotingSet(Types.BlockIDFlag.BLOCK_ID_FLAG_ABSENT_VALUE).keys
.getVotingSet(ValidatorOuterClass.BlockIDFlag.BLOCK_ID_FLAG_ABSENT_VALUE).keys
val proposer = transaction { BlockProposerRecord.findById(height)!! }
val results =
validatorService.hydrateValidators(validatorSet, listOf(), stakingValidators, height.toLong()).map {
Original file line number Diff line number Diff line change
@@ -218,7 +218,7 @@ class GovService(
content.typeUrl.endsWith("v1.StoreCodeProposal") ->
MonitorProposalType.STORE_CODE to
// base64(sha256(gzipUncompress(wasmByteCode))) == base64(storedCode.data_hash)
content.unpack(cosmwasm.wasm.v1.Proposal.StoreCodeProposal::class.java)
content.unpack(cosmwasm.wasm.v1.ProposalLegacy.StoreCodeProposal::class.java)
.wasmByteCode.gzipUncompress().to256Hash()
content.typeUrl.endsWith("v1.MsgStoreCode") ->
MonitorProposalType.STORE_CODE to content.toMsgStoreCode().wasmByteCode.gzipUncompress().to256Hash()
@@ -651,7 +651,9 @@ class GovService(
wasmByteCode = wasmFile.bytes.gzipCompress().toByteString()
content.accessConfig?.let { config ->
instantiatePermission = accessConfig {
config.address?.let { this.address = it }
config.address?.let {
this.addresses.addAll(listOf(it))
}
permission = config.type
}
}
Original file line number Diff line number Diff line change
@@ -161,16 +161,16 @@ class RestConfigTest {
cosmos.upgrade.v1beta1.Upgrade.SoftwareUpgradeProposal.getDescriptor(),
cosmos.upgrade.v1beta1.Upgrade.CancelSoftwareUpgradeProposal.getDescriptor(),
cosmos.distribution.v1beta1.Distribution.CommunityPoolSpendProposal.getDescriptor(),
cosmwasm.wasm.v1.Proposal.StoreCodeProposal.getDescriptor(),
cosmwasm.wasm.v1.Proposal.InstantiateContractProposal.getDescriptor(),
cosmwasm.wasm.v1.Proposal.MigrateContractProposal.getDescriptor(),
cosmwasm.wasm.v1.Proposal.SudoContractProposal.getDescriptor(),
cosmwasm.wasm.v1.Proposal.ExecuteContractProposal.getDescriptor(),
cosmwasm.wasm.v1.Proposal.UpdateAdminProposal.getDescriptor(),
cosmwasm.wasm.v1.Proposal.ClearAdminProposal.getDescriptor(),
cosmwasm.wasm.v1.Proposal.PinCodesProposal.getDescriptor(),
cosmwasm.wasm.v1.Proposal.UnpinCodesProposal.getDescriptor(),
cosmwasm.wasm.v1.Proposal.UpdateInstantiateConfigProposal.getDescriptor(),
cosmwasm.wasm.v1.ProposalLegacy.StoreCodeProposal.getDescriptor(),
cosmwasm.wasm.v1.ProposalLegacy.InstantiateContractProposal.getDescriptor(),
cosmwasm.wasm.v1.ProposalLegacy.MigrateContractProposal.getDescriptor(),
cosmwasm.wasm.v1.ProposalLegacy.SudoContractProposal.getDescriptor(),
cosmwasm.wasm.v1.ProposalLegacy.ExecuteContractProposal.getDescriptor(),
cosmwasm.wasm.v1.ProposalLegacy.UpdateAdminProposal.getDescriptor(),
cosmwasm.wasm.v1.ProposalLegacy.ClearAdminProposal.getDescriptor(),
cosmwasm.wasm.v1.ProposalLegacy.PinCodesProposal.getDescriptor(),
cosmwasm.wasm.v1.ProposalLegacy.UnpinCodesProposal.getDescriptor(),
cosmwasm.wasm.v1.ProposalLegacy.UpdateInstantiateConfigProposal.getDescriptor(),
cosmwasm.wasm.v1beta1.Proposal.StoreCodeProposal.getDescriptor(),
cosmwasm.wasm.v1beta1.Proposal.InstantiateContractProposal.getDescriptor(),
cosmwasm.wasm.v1beta1.Proposal.MigrateContractProposal.getDescriptor(),
Loading